From ee3b4e3d211232726392c64672dfa4aef2d84945 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 18 May 2023 08:55:52 +0000 Subject: [PATCH 1/2] feat: add Oracle to PostgreSQL migration APIs PiperOrigin-RevId: 533037268 Source-Link: https://github.com/googleapis/googleapis/commit/d45c9a2409c9e362d163d899f8479cd92959f93e Source-Link: https://github.com/googleapis/googleapis-gen/commit/40c33043e3d79a0dd38ec29dabde66490dcce809 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNsb3VkZG1zLy5Pd2xCb3QueWFtbCIsImgiOiI0MGMzMzA0M2UzZDc5YTBkZDM4ZWMyOWRhYmRlNjY0OTBkY2NlODA5In0= --- .../google-cloud-clouddms/v1/.eslintignore | 7 + .../google-cloud-clouddms/v1/.eslintrc.json | 3 + .../google-cloud-clouddms/v1/.gitignore | 14 + .../google-cloud-clouddms/v1/.jsdoc.js | 55 + .../google-cloud-clouddms/v1/.mocharc.js | 33 + .../google-cloud-clouddms/v1/.prettierrc.js | 22 + .../google-cloud-clouddms/v1/README.md | 1 + .../v1/linkinator.config.json | 16 + .../google-cloud-clouddms/v1/package.json | 64 + .../google/cloud/clouddms/v1/clouddms.proto | 1412 ++++ .../clouddms/v1/clouddms_resources.proto | 1139 +++ .../v1/conversionworkspace_resources.proto | 606 ++ ...tion_service.apply_conversion_workspace.js | 73 + ...ion_service.commit_conversion_workspace.js | 66 + ...on_service.convert_conversion_workspace.js | 72 + ...ation_service.create_connection_profile.js | 92 + ...ion_service.create_conversion_workspace.js | 80 + ..._migration_service.create_migration_job.js | 82 + ...ation_service.create_private_connection.js | 84 + ...ation_service.delete_connection_profile.js | 75 + ...ion_service.delete_conversion_workspace.js | 70 + ..._migration_service.delete_migration_job.js | 76 + ...ation_service.delete_private_connection.js | 70 + ...describe_conversion_workspace_revisions.js | 67 + ...tion_service.describe_database_entities.js | 97 + ...data_migration_service.fetch_static_ips.js | 72 + ...a_migration_service.generate_ssh_script.js | 77 + ...igration_service.get_connection_profile.js | 61 + ...ration_service.get_conversion_workspace.js | 61 + ...ata_migration_service.get_migration_job.js | 61 + ...igration_service.get_private_connection.js | 61 + ..._migration_service.import_mapping_rules.js | 77 + ...ration_service.list_connection_profiles.js | 93 + ...tion_service.list_conversion_workspaces.js | 88 + ...a_migration_service.list_migration_jobs.js | 95 + ...ration_service.list_private_connections.js | 90 + ...migration_service.promote_migration_job.js | 61 + ...migration_service.restart_migration_job.js | 61 + ..._migration_service.resume_migration_job.js | 61 + ...n_service.rollback_conversion_workspace.js | 62 + ...igration_service.search_background_jobs.js | 79 + ...ation_service.seed_conversion_workspace.js | 76 + ...a_migration_service.start_migration_job.js | 61 + ...ta_migration_service.stop_migration_job.js | 61 + ...ation_service.update_connection_profile.js | 88 + ...ion_service.update_conversion_workspace.js | 76 + ..._migration_service.update_migration_job.js | 76 + ..._migration_service.verify_migration_job.js | 61 + ...pet_metadata.google.cloud.clouddms.v1.json | 1739 +++++ .../google-cloud-clouddms/v1/src/index.ts | 25 + .../src/v1/data_migration_service_client.ts | 5338 +++++++++++++ .../data_migration_service_client_config.json | 206 + .../v1/data_migration_service_proto_list.json | 5 + .../v1/src/v1/gapic_metadata.json | 407 + .../google-cloud-clouddms/v1/src/v1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1/system-test/install.ts | 49 + .../test/gapic_data_migration_service_v1.ts | 6929 +++++++++++++++++ .../google-cloud-clouddms/v1/tsconfig.json | 19 + .../v1/webpack.config.js | 64 + 61 files changed, 20894 insertions(+) create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/README.md create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/linkinator.config.json create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/package.json create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms.proto create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms_resources.proto create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.apply_conversion_workspace.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.commit_conversion_workspace.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.convert_conversion_workspace.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_connection_profile.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_conversion_workspace.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_migration_job.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_private_connection.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_connection_profile.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_conversion_workspace.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_migration_job.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_private_connection.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.describe_database_entities.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.fetch_static_ips.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.generate_ssh_script.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_connection_profile.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_conversion_workspace.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_migration_job.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_private_connection.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.import_mapping_rules.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_connection_profiles.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_conversion_workspaces.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_migration_jobs.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_private_connections.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.promote_migration_job.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.restart_migration_job.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.resume_migration_job.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.search_background_jobs.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.seed_conversion_workspace.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.start_migration_job.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.stop_migration_job.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_connection_profile.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_conversion_workspace.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_migration_job.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.verify_migration_job.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client.ts create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/test/gapic_data_migration_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-clouddms/v1/webpack.config.js diff --git a/owl-bot-staging/google-cloud-clouddms/v1/.eslintignore b/owl-bot-staging/google-cloud-clouddms/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-clouddms/v1/.eslintrc.json b/owl-bot-staging/google-cloud-clouddms/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/.gitignore b/owl-bot-staging/google-cloud-clouddms/v1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/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-clouddms/v1/.jsdoc.js b/owl-bot-staging/google-cloud-clouddms/v1/.jsdoc.js new file mode 100644 index 00000000000..c2acb4b4a1c --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/dms', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-clouddms/v1/.mocharc.js b/owl-bot-staging/google-cloud-clouddms/v1/.mocharc.js new file mode 100644 index 00000000000..1a38f257db7 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2023 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-clouddms/v1/.prettierrc.js b/owl-bot-staging/google-cloud-clouddms/v1/.prettierrc.js new file mode 100644 index 00000000000..55639e70f9e --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2023 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-clouddms/v1/README.md b/owl-bot-staging/google-cloud-clouddms/v1/README.md new file mode 100644 index 00000000000..55024e41595 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/README.md @@ -0,0 +1 @@ +Clouddms: Nodejs Client diff --git a/owl-bot-staging/google-cloud-clouddms/v1/linkinator.config.json b/owl-bot-staging/google-cloud-clouddms/v1/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/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-clouddms/v1/package.json b/owl-bot-staging/google-cloud-clouddms/v1/package.json new file mode 100644 index 00000000000..38af89d6f5f --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/dms", + "version": "0.1.0", + "description": "Clouddms client for Node.js", + "repository": "googleapis/nodejs-clouddms", + "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 clouddms", + "clouddms", + "data migration service" + ], + "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.7" + }, + "devDependencies": { + "@types/mocha": "^10.0.1", + "@types/node": "^18.11.18", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.1.2", + "mocha": "^10.2.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.1", + "ts-loader": "^8.4.0", + "typescript": "^4.8.4", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms.proto b/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms.proto new file mode 100644 index 00000000000..69d7d93d016 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms.proto @@ -0,0 +1,1412 @@ +// Copyright 2023 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.clouddms.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/clouddms/v1/clouddms_resources.proto"; +import "google/cloud/clouddms/v1/conversionworkspace_resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudDms.V1"; +option go_package = "cloud.google.com/go/clouddms/apiv1/clouddmspb;clouddmspb"; +option java_multiple_files = true; +option java_outer_classname = "ClouddmsProto"; +option java_package = "com.google.cloud.clouddms.v1"; +option php_namespace = "Google\\Cloud\\CloudDms\\V1"; +option ruby_package = "Google::Cloud::CloudDMS::V1"; + +// Database Migration service +service DataMigrationService { + option (google.api.default_host) = "datamigration.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists migration jobs in a given project and location. + rpc ListMigrationJobs(ListMigrationJobsRequest) + returns (ListMigrationJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/migrationJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single migration job. + rpc GetMigrationJob(GetMigrationJobRequest) returns (MigrationJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/migrationJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new migration job in a given project and location. + rpc CreateMigrationJob(CreateMigrationJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/migrationJobs" + body: "migration_job" + }; + option (google.api.method_signature) = + "parent,migration_job,migration_job_id"; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single migration job. + rpc UpdateMigrationJob(UpdateMigrationJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{migration_job.name=projects/*/locations/*/migrationJobs/*}" + body: "migration_job" + }; + option (google.api.method_signature) = "migration_job,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single migration job. + rpc DeleteMigrationJob(DeleteMigrationJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/migrationJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Start an already created migration job. + rpc StartMigrationJob(StartMigrationJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:start" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Stops a running migration job. + rpc StopMigrationJob(StopMigrationJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:stop" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Resume a migration job that is currently stopped and is resumable (was + // stopped during CDC phase). + rpc ResumeMigrationJob(ResumeMigrationJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:resume" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Promote a migration job, stopping replication to the destination and + // promoting the destination to be a standalone database. + rpc PromoteMigrationJob(PromoteMigrationJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:promote" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Verify a migration job, making sure the destination can reach the source + // and that all configuration and prerequisites are met. + rpc VerifyMigrationJob(VerifyMigrationJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:verify" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Restart a stopped or failed migration job, resetting the destination + // instance to its original state and starting the migration process from + // scratch. + rpc RestartMigrationJob(RestartMigrationJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:restart" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Generate a SSH configuration script to configure the reverse SSH + // connectivity. + rpc GenerateSshScript(GenerateSshScriptRequest) returns (SshScript) { + option (google.api.http) = { + post: "/v1/{migration_job=projects/*/locations/*/migrationJobs/*}:generateSshScript" + body: "*" + }; + } + + // Retrieves a list of all connection profiles in a given project and + // location. + rpc ListConnectionProfiles(ListConnectionProfilesRequest) + returns (ListConnectionProfilesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/connectionProfiles" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single connection profile. + rpc GetConnectionProfile(GetConnectionProfileRequest) + returns (ConnectionProfile) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/connectionProfiles/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new connection profile in a given project and location. + rpc CreateConnectionProfile(CreateConnectionProfileRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/connectionProfiles" + body: "connection_profile" + }; + option (google.api.method_signature) = + "parent,connection_profile,connection_profile_id"; + option (google.longrunning.operation_info) = { + response_type: "ConnectionProfile" + metadata_type: "OperationMetadata" + }; + } + + // Update the configuration of a single connection profile. + rpc UpdateConnectionProfile(UpdateConnectionProfileRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{connection_profile.name=projects/*/locations/*/connectionProfiles/*}" + body: "connection_profile" + }; + option (google.api.method_signature) = "connection_profile,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ConnectionProfile" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Database Migration Service connection profile. + // A connection profile can only be deleted if it is not in use by any + // active migration jobs. + rpc DeleteConnectionProfile(DeleteConnectionProfileRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/connectionProfiles/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new private connection in a given project and location. + rpc CreatePrivateConnection(CreatePrivateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/privateConnections" + body: "private_connection" + }; + option (google.api.method_signature) = + "parent,private_connection,private_connection_id"; + option (google.longrunning.operation_info) = { + response_type: "PrivateConnection" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single private connection. + rpc GetPrivateConnection(GetPrivateConnectionRequest) + returns (PrivateConnection) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/privateConnections/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves a list of private connections in a given project and location. + rpc ListPrivateConnections(ListPrivateConnectionsRequest) + returns (ListPrivateConnectionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/privateConnections" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a single Database Migration Service private connection. + rpc DeletePrivateConnection(DeletePrivateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/privateConnections/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single conversion workspace. + rpc GetConversionWorkspace(GetConversionWorkspaceRequest) + returns (ConversionWorkspace) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists conversion workspaces in a given project and location. + rpc ListConversionWorkspaces(ListConversionWorkspacesRequest) + returns (ListConversionWorkspacesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/conversionWorkspaces" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new conversion workspace in a given project and location. + rpc CreateConversionWorkspace(CreateConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/conversionWorkspaces" + body: "conversion_workspace" + }; + option (google.api.method_signature) = + "parent,conversion_workspace,conversion_workspace_id"; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single conversion workspace. + rpc UpdateConversionWorkspace(UpdateConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{conversion_workspace.name=projects/*/locations/*/conversionWorkspaces/*}" + body: "conversion_workspace" + }; + option (google.api.method_signature) = "conversion_workspace,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single conversion workspace. + rpc DeleteConversionWorkspace(DeleteConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Imports a snapshot of the source database into the + // conversion workspace. + rpc SeedConversionWorkspace(SeedConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:seed" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Imports the mapping rules for a given conversion workspace. + // Supports various formats of external rules files. + rpc ImportMappingRules(ImportMappingRulesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/conversionWorkspaces/*}/mappingRules:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Creates a draft tree schema for the destination database. + rpc ConvertConversionWorkspace(ConvertConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:convert" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Marks all the data in the conversion workspace as committed. + rpc CommitConversionWorkspace(CommitConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:commit" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Rolls back a conversion workspace to the last committed snapshot. + rpc RollbackConversionWorkspace(RollbackConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:rollback" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Applies draft tree onto a specific destination database. + rpc ApplyConversionWorkspace(ApplyConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:apply" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Describes the database entities tree for a specific conversion workspace + // and a specific tree type. + // + // Database entities are not resources like conversion workspaces or mapping + // rules, and they can't be created, updated or deleted. Instead, they are + // simple data objects describing the structure of the client database. + rpc DescribeDatabaseEntities(DescribeDatabaseEntitiesRequest) + returns (DescribeDatabaseEntitiesResponse) { + option (google.api.http) = { + get: "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:describeDatabaseEntities" + }; + } + + // Searches/lists the background jobs for a specific + // conversion workspace. + // + // The background jobs are not resources like conversion workspaces or + // mapping rules, and they can't be created, updated or deleted. + // Instead, they are a way to expose the data plane jobs log. + rpc SearchBackgroundJobs(SearchBackgroundJobsRequest) + returns (SearchBackgroundJobsResponse) { + option (google.api.http) = { + get: "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:searchBackgroundJobs" + }; + } + + // Retrieves a list of committed revisions of a specific conversion + // workspace. + rpc DescribeConversionWorkspaceRevisions( + DescribeConversionWorkspaceRevisionsRequest) + returns (DescribeConversionWorkspaceRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:describeConversionWorkspaceRevisions" + }; + } + + // Fetches a set of static IP addresses that need to be allowlisted by the + // customer when using the static-IP connectivity method. + rpc FetchStaticIps(FetchStaticIpsRequest) returns (FetchStaticIpsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*}:fetchStaticIps" + }; + option (google.api.method_signature) = "name"; + } +} + +// Retrieves a list of all migration jobs in a given project and location. +message ListMigrationJobsRequest { + // Required. The parent which owns this collection of migrationJobs. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/MigrationJob" + } + ]; + + // The maximum number of migration jobs to return. The service may return + // fewer than this value. If unspecified, at most 50 migration jobs will be + // returned. The maximum value is 1000; values above 1000 are coerced to + // 1000. + int32 page_size = 2; + + // The nextPageToken value received in the previous call to + // migrationJobs.list, used in the subsequent request to retrieve the next + // page of results. On first call this should be left blank. When paginating, + // all other parameters provided to migrationJobs.list must match the call + // that provided the page token. + string page_token = 3; + + // A filter expression that filters migration jobs listed in the response. + // The expression must specify the field name, a comparison operator, and the + // value that you want to use for filtering. The value must be a string, + // a number, or a boolean. The comparison operator must be + // either =, !=, >, or <. For example, list migration jobs created this year + // by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + // You can also filter nested fields. For example, you could specify + // **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + // jobs connecting through the specific SSH tunnel bastion. + string filter = 4; + + // Sort the results based on the migration job name. + // Valid values are: "name", "name asc", and "name desc". + string order_by = 5; +} + +// Response message for 'ListMigrationJobs' request. +message ListMigrationJobsResponse { + // The list of migration jobs objects. + repeated MigrationJob migration_jobs = 1; + + // A token which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for 'GetMigrationJob' request. +message GetMigrationJobRequest { + // Required. Name of the migration job resource to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + } + ]; +} + +// Request message to create a new Database Migration Service migration job +// in the specified project and region. +message CreateMigrationJobRequest { + // Required. The parent which owns this collection of migration jobs. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/MigrationJob" + } + ]; + + // Required. The ID of the instance to create. + string migration_job_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Represents a [migration + // job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) + // object. + MigrationJob migration_job = 3 [(google.api.field_behavior) = REQUIRED]; + + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 4; +} + +// Request message for 'UpdateMigrationJob' request. +message UpdateMigrationJobRequest { + // Required. Field mask is used to specify the fields to be overwritten by the + // update in the conversion workspace resource. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The migration job parameters to update. + MigrationJob migration_job = 2 [(google.api.field_behavior) = REQUIRED]; + + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 3; +} + +// Request message for 'DeleteMigrationJob' request. +message DeleteMigrationJobRequest { + // Required. Name of the migration job resource to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + } + ]; + + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 2; + + // The destination CloudSQL connection profile is always deleted with the + // migration job. In case of force delete, the destination CloudSQL replica + // database is also deleted. + bool force = 3; +} + +// Request message for 'StartMigrationJob' request. +message StartMigrationJobRequest { + // Name of the migration job resource to start. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; +} + +// Request message for 'StopMigrationJob' request. +message StopMigrationJobRequest { + // Name of the migration job resource to stop. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; +} + +// Request message for 'ResumeMigrationJob' request. +message ResumeMigrationJobRequest { + // Name of the migration job resource to resume. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; +} + +// Request message for 'PromoteMigrationJob' request. +message PromoteMigrationJobRequest { + // Name of the migration job resource to promote. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; +} + +// Request message for 'VerifyMigrationJob' request. +message VerifyMigrationJobRequest { + // Name of the migration job resource to verify. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; +} + +// Request message for 'RestartMigrationJob' request. +message RestartMigrationJobRequest { + // Name of the migration job resource to restart. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; +} + +// Request message for 'GenerateSshScript' request. +message GenerateSshScriptRequest { + // Name of the migration job resource to generate the SSH script. + string migration_job = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; + + // Required. Bastion VM Instance name to use or to create. + string vm = 2 [(google.api.field_behavior) = REQUIRED]; + + // The VM configuration + oneof vm_config { + // The VM creation configuration + VmCreationConfig vm_creation_config = 100; + + // The VM selection configuration + VmSelectionConfig vm_selection_config = 101; + } + + // The port that will be open on the bastion host. + int32 vm_port = 3; +} + +// VM creation configuration message +message VmCreationConfig { + // Required. VM instance machine type to create. + string vm_machine_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // The Google Cloud Platform zone to create the VM in. + string vm_zone = 2; + + // The subnet name the vm needs to be created in. + string subnet = 3; +} + +// VM selection configuration message +message VmSelectionConfig { + // Required. The Google Cloud Platform zone the VM is located. + string vm_zone = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for 'GenerateSshScript' request. +message SshScript { + // The ssh configuration script. + string script = 1; +} + +// Request message for 'ListConnectionProfiles' request. +message ListConnectionProfilesRequest { + // Required. The parent which owns this collection of connection profiles. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/ConnectionProfile" + } + ]; + + // The maximum number of connection profiles to return. The service may return + // fewer than this value. If unspecified, at most 50 connection profiles will + // be returned. The maximum value is 1000; values above 1000 are coerced + // to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListConnectionProfiles` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListConnectionProfiles` + // must match the call that provided the page token. + string page_token = 3; + + // A filter expression that filters connection profiles listed in the + // response. The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. The value must + // be a string, a number, or a boolean. The comparison operator must be either + // =, !=, >, or <. For example, list connection profiles created this year by + // specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + // also filter nested fields. For example, you could specify **mySql.username + // = %lt;my_username%gt;** to list all connection profiles configured to + // connect with a specific username. + string filter = 4; + + // A comma-separated list of fields to order results according to. + string order_by = 5; +} + +// Response message for 'ListConnectionProfiles' request. +message ListConnectionProfilesResponse { + // The response list of connection profiles. + repeated ConnectionProfile connection_profiles = 1; + + // A token which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for 'GetConnectionProfile' request. +message GetConnectionProfileRequest { + // Required. Name of the connection profile resource to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConnectionProfile" + } + ]; +} + +// Request message for 'CreateConnectionProfile' request. +message CreateConnectionProfileRequest { + // Required. The parent which owns this collection of connection profiles. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConnectionProfile" + } + ]; + + // Required. The connection profile identifier. + string connection_profile_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The create request body including the connection profile data + ConnectionProfile connection_profile = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique ID used to identify the request. If the server receives + // two requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only validate the connection profile, but don't create any + // resources. The default is false. Only supported for Oracle connection + // profiles. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Create the connection profile without validating it. + // The default is false. + // Only supported for Oracle connection profiles. + bool skip_validation = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for 'UpdateConnectionProfile' request. +message UpdateConnectionProfileRequest { + // Required. Field mask is used to specify the fields to be overwritten by the + // update in the conversion workspace resource. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The connection profile parameters to update. + ConnectionProfile connection_profile = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique ID used to identify the request. If the server receives + // two requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only validate the connection profile, but don't update any + // resources. The default is false. Only supported for Oracle connection + // profiles. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Update the connection profile without validating it. + // The default is false. + // Only supported for Oracle connection profiles. + bool skip_validation = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for 'DeleteConnectionProfile' request. +message DeleteConnectionProfileRequest { + // Required. Name of the connection profile resource to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConnectionProfile" + } + ]; + + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 2; + + // In case of force delete, the CloudSQL replica database is also deleted + // (only for CloudSQL connection profile). + bool force = 3; +} + +// Request message to create a new private connection in the specified project +// and region. +message CreatePrivateConnectionRequest { + // Required. The parent that owns the collection of PrivateConnections. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/PrivateConnection" + } + ]; + + // Required. The private connection identifier. + string private_connection_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The private connection resource to create. + PrivateConnection private_connection = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique ID used to identify the request. If the server receives + // two requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, will skip validations. + bool skip_validation = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message to retrieve a list of private connections in a given project +// and location. +message ListPrivateConnectionsRequest { + // Required. The parent that owns the collection of private connections. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/PrivateConnection" + } + ]; + + // Maximum number of private connections to return. + // If unspecified, at most 50 private connections that are returned. + // The maximum value is 1000; values above 1000 are coerced to 1000. + int32 page_size = 2; + + // Page token received from a previous `ListPrivateConnections` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListPrivateConnections` must match the call that provided the page + // token. + string page_token = 3; + + // A filter expression that filters private connections listed in the + // response. The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. The value must + // be a string, a number, or a boolean. The comparison operator must be either + // =, !=, >, or <. For example, list private connections created this year by + // specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. + string filter = 4; + + // Order by fields for the result. + string order_by = 5; +} + +// Response message for 'ListPrivateConnections' request. +message ListPrivateConnectionsResponse { + // List of private connections. + repeated PrivateConnection private_connections = 1; + + // A token which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message to delete a private connection. +message DeletePrivateConnectionRequest { + // Required. The name of the private connection to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/PrivateConnection" + } + ]; + + // Optional. A unique ID used to identify the request. If the server receives + // two requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message to get a private connection resource. +message GetPrivateConnectionRequest { + // Required. The name of the private connection to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/PrivateConnection" + } + ]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Retrieve a list of all conversion workspaces in a given project and location. +message ListConversionWorkspacesRequest { + // Required. The parent which owns this collection of conversion workspaces. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // The maximum number of conversion workspaces to return. The service may + // return fewer than this value. If unspecified, at most 50 sets are returned. + int32 page_size = 2; + + // The nextPageToken value received in the previous call to + // conversionWorkspaces.list, used in the subsequent request to retrieve the + // next page of results. On first call this should be left blank. When + // paginating, all other parameters provided to conversionWorkspaces.list must + // match the call that provided the page token. + string page_token = 3; + + // A filter expression that filters conversion workspaces listed in the + // response. The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. The value must + // be a string, a number, or a boolean. The comparison operator must be either + // =, !=, >, or <. For example, list conversion workspaces created this year + // by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can + // also filter nested fields. For example, you could specify + // **source.version = "12.c.1"** to select all conversion workspaces with + // source database version equal to 12.c.1. + string filter = 4; +} + +// Response message for 'ListConversionWorkspaces' request. +message ListConversionWorkspacesResponse { + // The list of conversion workspace objects. + repeated ConversionWorkspace conversion_workspaces = 1; + + // A token which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for 'GetConversionWorkspace' request. +message GetConversionWorkspaceRequest { + // Required. Name of the conversion workspace resource to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; +} + +// Request message to create a new Conversion Workspace +// in the specified project and region. +message CreateConversionWorkspaceRequest { + // Required. The parent which owns this collection of conversion workspaces. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // Required. The ID of the conversion workspace to create. + string conversion_workspace_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Represents a conversion workspace object. + ConversionWorkspace conversion_workspace = 3 + [(google.api.field_behavior) = REQUIRED]; + + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 4; +} + +// Request message for 'UpdateConversionWorkspace' request. +message UpdateConversionWorkspaceRequest { + // Required. Field mask is used to specify the fields to be overwritten by the + // update in the conversion workspace resource. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The conversion workspace parameters to update. + ConversionWorkspace conversion_workspace = 2 + [(google.api.field_behavior) = REQUIRED]; + + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 3; +} + +// Request message for 'DeleteConversionWorkspace' request. +message DeleteConversionWorkspaceRequest { + // Required. Name of the conversion workspace resource to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 2; +} + +// Request message for 'CommitConversionWorkspace' request. +message CommitConversionWorkspaceRequest { + // Required. Name of the conversion workspace resource to commit. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // Optional. Optional name of the commit. + string commit_name = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for 'RollbackConversionWorkspace' request. +message RollbackConversionWorkspaceRequest { + // Required. Name of the conversion workspace resource to roll back to. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; +} + +// Request message for 'ApplyConversionWorkspace' request. +message ApplyConversionWorkspaceRequest { + // Required. The name of the conversion workspace resource for which to apply + // the draft tree. Must be in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // Filter which entities to apply. Leaving this field empty will apply all of + // the entities. Supports Google AIP 160 based filtering. + string filter = 2; + + // Which destination to use when applying the conversion workspace. + oneof destination { + // Fully qualified (Uri) name of the destination connection profile. + string connection_profile = 100; + } +} + +// Request message for 'SeedConversionWorkspace' request. +message SeedConversionWorkspaceRequest { + // Name of the conversion workspace resource to seed with new database + // structure, in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + }]; + + // Should the conversion workspace be committed automatically after the + // seed operation. + bool auto_commit = 2; + + // The input to be used for seeding the conversion workspace. The input can + // either be from the source or destination databases and it can be provided + // through a connection profile or a DDL file. + oneof seed_from { + // Fully qualified (Uri) name of the source connection profile. + string source_connection_profile = 100; + + // Fully qualified (Uri) name of the destination connection profile. + string destination_connection_profile = 101; + } +} + +// Request message for 'ConvertConversionWorkspace' request. +message ConvertConversionWorkspaceRequest { + // Name of the conversion workspace resource to convert in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + }]; + + // Specifies whether the conversion workspace is to be committed automatically + // after the conversion. + bool auto_commit = 4; + + // Filter the entities to convert. Leaving this field empty will convert all + // of the entities. Supports Google AIP-160 style filtering. + string filter = 5; +} + +// Request message for 'ImportMappingRules' request. +message ImportMappingRulesRequest { + // Details of a single rules file. + message RulesFile { + // The filename of the rules that needs to be converted. The filename is + // used mainly so that future logs of the import rules job contain it, and + // can therefore be searched by it. + string rules_source_filename = 1; + + // The text content of the rules that needs to be converted. + string rules_content = 2; + } + + // Required. Name of the conversion workspace resource to import the rules to + // in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // The format of the rules content file. + ImportRulesFileFormat rules_format = 2; + + // One or more rules files. + repeated RulesFile rules_files = 3; + + // Should the conversion workspace be committed automatically after the + // import operation. + bool auto_commit = 6; +} + +// Request message for 'DescribeDatabaseEntities' request. +message DescribeDatabaseEntitiesRequest { + // The type of a tree to return + enum DBTreeType { + // Unspecified tree type. + DB_TREE_TYPE_UNSPECIFIED = 0; + + // The source database tree. + SOURCE_TREE = 1; + + // The draft database tree. + DRAFT_TREE = 2; + + // The destination database tree. + DESTINATION_TREE = 3; + } + + // Required. Name of the conversion workspace resource whose database entities + // are described. Must be in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string conversion_workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // The maximum number of entities to return. The service may return + // fewer entities than the value specifies. + int32 page_size = 3; + + // The nextPageToken value received in the previous call to + // conversionWorkspace.describeDatabaseEntities, used in the subsequent + // request to retrieve the next page of results. On first call this should be + // left blank. When paginating, all other parameters provided to + // conversionWorkspace.describeDatabaseEntities must match the call that + // provided the page token. + string page_token = 4; + + // The tree to fetch. + DBTreeType tree = 6; + + // Whether to retrieve the latest committed version of the entities or the + // latest version. This field is ignored if a specific commit_id is specified. + bool uncommitted = 11; + + // Request a specific commit ID. If not specified, the entities from the + // latest commit are returned. + string commit_id = 12; + + // Filter the returned entities based on AIP-160 standard. + string filter = 13; +} + +// Response message for 'DescribeDatabaseEntities' request. +message DescribeDatabaseEntitiesResponse { + // The list of database entities for the conversion workspace. + repeated DatabaseEntity database_entities = 1; + + // A token which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for 'SearchBackgroundJobs' request. +message SearchBackgroundJobsRequest { + // Required. Name of the conversion workspace resource whose jobs are listed, + // in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string conversion_workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // Optional. Whether or not to return just the most recent job per job type, + bool return_most_recent_per_job_type = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of jobs to return. The service may return + // fewer than this value. If unspecified, at most 100 jobs are + // returned. The maximum value is 100; values above 100 are coerced to + // 100. + int32 max_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If provided, only returns jobs that completed until (not + // including) the given timestamp. + google.protobuf.Timestamp completed_until_time = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for 'SearchBackgroundJobs' request. +message SearchBackgroundJobsResponse { + // The list of conversion workspace mapping rules. + repeated BackgroundJobLogEntry jobs = 1; +} + +// Request message for 'DescribeConversionWorkspaceRevisions' request. +message DescribeConversionWorkspaceRevisionsRequest { + // Required. Name of the conversion workspace resource whose revisions are + // listed. Must be in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string conversion_workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // Optional. Optional filter to request a specific commit ID. + string commit_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for 'DescribeConversionWorkspaceRevisions' request. +message DescribeConversionWorkspaceRevisionsResponse { + // The list of conversion workspace revisions. + repeated ConversionWorkspace revisions = 1; +} + +// Request message for 'FetchStaticIps' request. +message FetchStaticIpsRequest { + // Required. The resource name for the location for which static IPs should be + // returned. Must be in the format `projects/*/locations/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of IPs to return. + int32 page_size = 2; + + // A page token, received from a previous `FetchStaticIps` call. + string page_token = 3; +} + +// Response message for a 'FetchStaticIps' request. +message FetchStaticIpsResponse { + // List of static IPs. + repeated string static_ips = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms_resources.proto b/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms_resources.proto new file mode 100644 index 00000000000..0b66a82de58 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms_resources.proto @@ -0,0 +1,1139 @@ +// Copyright 2023 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.clouddms.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.CloudDms.V1"; +option go_package = "cloud.google.com/go/clouddms/apiv1/clouddmspb;clouddmspb"; +option java_multiple_files = true; +option java_outer_classname = "ClouddmsResourcesProto"; +option java_package = "com.google.cloud.clouddms.v1"; +option php_namespace = "Google\\Cloud\\CloudDms\\V1"; +option ruby_package = "Google::Cloud::CloudDMS::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Networks" + pattern: "projects/{project}/global/networks/{network}" +}; + +// SSL configuration information. +message SslConfig { + // Specifies The kind of ssl configuration used. + enum SslType { + // Unspecified. + SSL_TYPE_UNSPECIFIED = 0; + + // Only 'ca_certificate' specified. + SERVER_ONLY = 1; + + // Both server ('ca_certificate'), and client ('client_key', + // 'client_certificate') specified. + SERVER_CLIENT = 2; + } + + // Output only. The ssl config type according to 'client_key', + // 'client_certificate' and 'ca_certificate'. + SslType type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key + // associated with the Client Certificate. If this field is used then the + // 'client_certificate' field is mandatory. + string client_key = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. The x509 PEM-encoded certificate that will be used by the + // replica to authenticate against the source database server.If this field is + // used then the 'client_key' field is mandatory. + string client_certificate = 3 [(google.api.field_behavior) = INPUT_ONLY]; + + // Required. Input only. The x509 PEM-encoded certificate of the CA that + // signed the source database server's certificate. The replica will use this + // certificate to verify it's connecting to the right host. + string ca_certificate = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = REQUIRED + ]; +} + +// Specifies connection parameters required specifically for MySQL databases. +message MySqlConnectionProfile { + // Required. The IP or hostname of the source MySQL database. + string host = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The network port of the source MySQL database. + int32 port = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The username that Database Migration Service will use to connect + // to the database. The value is encrypted when stored in Database Migration + // Service. + string username = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The password for the user that Database Migration + // Service will be using to connect to the database. This field is not + // returned on request, and the value is encrypted when stored in Database + // Migration Service. + string password = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. Indicates If this connection profile password is stored. + bool password_set = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // SSL configuration for the destination to connect to the source database. + SslConfig ssl = 6; + + // If the source is a Cloud SQL database, use this field to + // provide the Cloud SQL instance ID of the source. + string cloud_sql_id = 7; +} + +enum NetworkArchitecture { + NETWORK_ARCHITECTURE_UNSPECIFIED = 0; + + // Instance is in Cloud SQL's old producer network architecture. + NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER = 1; + + // Instance is in Cloud SQL's new producer network architecture. + NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER = 2; +} + +// Specifies connection parameters required specifically for PostgreSQL +// databases. +message PostgreSqlConnectionProfile { + // Required. The IP or hostname of the source PostgreSQL database. + string host = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The network port of the source PostgreSQL database. + int32 port = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The username that Database Migration Service will use to connect + // to the database. The value is encrypted when stored in Database Migration + // Service. + string username = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The password for the user that Database Migration + // Service will be using to connect to the database. This field is not + // returned on request, and the value is encrypted when stored in Database + // Migration Service. + string password = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. Indicates If this connection profile password is stored. + bool password_set = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // SSL configuration for the destination to connect to the source database. + SslConfig ssl = 6; + + // If the source is a Cloud SQL database, use this field to + // provide the Cloud SQL instance ID of the source. + string cloud_sql_id = 7; + + // Output only. If the source is a Cloud SQL database, this field indicates + // the network architecture it's associated with. + NetworkArchitecture network_architecture = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Connectivity options used to establish a connection to the database server. + oneof connectivity { + // Static ip connectivity data (default, no additional details needed). + StaticIpConnectivity static_ip_connectivity = 100; + + // Private service connect connectivity. + PrivateServiceConnectConnectivity private_service_connect_connectivity = + 101; + } +} + +// Specifies connection parameters required specifically for Oracle +// databases. +message OracleConnectionProfile { + // Required. The IP or hostname of the source Oracle database. + string host = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The network port of the source Oracle database. + int32 port = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The username that Database Migration Service will use to connect + // to the database. The value is encrypted when stored in Database Migration + // Service. + string username = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The password for the user that Database Migration + // Service will be using to connect to the database. This field is not + // returned on request, and the value is encrypted when stored in Database + // Migration Service. + string password = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. Indicates whether a new password is included in the request. + bool password_set = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Database service for the Oracle connection. + string database_service = 6 [(google.api.field_behavior) = REQUIRED]; + + // Connectivity options used to establish a connection to the database server. + oneof connectivity { + // Static Service IP connectivity. + StaticServiceIpConnectivity static_service_ip_connectivity = 100; + + // Forward SSH tunnel connectivity. + ForwardSshTunnelConnectivity forward_ssh_connectivity = 101; + + // Private connectivity. + PrivateConnectivity private_connectivity = 102; + } +} + +// Specifies required connection parameters, and, optionally, the parameters +// required to create a Cloud SQL destination database instance. +message CloudSqlConnectionProfile { + // Output only. The Cloud SQL instance ID that this connection profile is + // associated with. + string cloud_sql_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Metadata used to create the destination Cloud SQL database. + CloudSqlSettings settings = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The Cloud SQL database instance's private IP. + string private_ip = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Cloud SQL database instance's public IP. + string public_ip = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Cloud SQL database instance's additional (outgoing) public + // IP. Used when the Cloud SQL database availability type is REGIONAL (i.e. + // multiple zones / highly available). + string additional_public_ip = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Specifies required connection parameters, and the parameters +// required to create an AlloyDB destination cluster. +message AlloyDbConnectionProfile { + // Required. The AlloyDB cluster ID that this connection profile is associated + // with. + string cluster_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Immutable. Metadata used to create the destination AlloyDB cluster. + AlloyDbSettings settings = 2 [(google.api.field_behavior) = IMMUTABLE]; +} + +// An entry for an Access Control list. +message SqlAclEntry { + // The allowlisted value for the access control list. + string value = 1; + + // The access control entry entry expiration. + oneof expiration { + // The time when this access control entry expires in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example: + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp expire_time = 10; + + // Input only. The time-to-leave of this access control entry. + google.protobuf.Duration ttl = 11 + [(google.api.field_behavior) = INPUT_ONLY]; + } + + // A label to identify this entry. + string label = 3; +} + +// IP Management configuration. +message SqlIpConfig { + // Whether the instance should be assigned an IPv4 address or not. + google.protobuf.BoolValue enable_ipv4 = 1; + + // The resource link for the VPC network from which the Cloud SQL instance is + // accessible for private IP. For example, + // `projects/myProject/global/networks/default`. This setting can + // be updated, but it cannot be removed after it is set. + string private_network = 2; + + // Optional. The name of the allocated IP address range for the private IP + // Cloud SQL instance. This name refers to an already allocated IP range + // address. If set, the instance IP address will be created in the allocated + // range. Note that this IP address range can't be modified after the instance + // is created. If you change the VPC when configuring connectivity settings + // for the migration job, this field is not relevant. + string allocated_ip_range = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Whether SSL connections over IP should be enforced or not. + google.protobuf.BoolValue require_ssl = 3; + + // The list of external networks that are allowed to connect to the instance + // using the IP. See + // https://en.wikipedia.org/wiki/CIDR_notation#CIDR_notation, also known as + // 'slash' notation (e.g. `192.168.100.0/24`). + repeated SqlAclEntry authorized_networks = 4; +} + +// Settings for creating a Cloud SQL database instance. +message CloudSqlSettings { + // Specifies when the instance should be activated. + enum SqlActivationPolicy { + // unspecified policy. + SQL_ACTIVATION_POLICY_UNSPECIFIED = 0; + + // The instance is always up and running. + ALWAYS = 1; + + // The instance should never spin up. + NEVER = 2; + } + + // The storage options for Cloud SQL databases. + enum SqlDataDiskType { + // Unspecified. + SQL_DATA_DISK_TYPE_UNSPECIFIED = 0; + + // SSD disk. + PD_SSD = 1; + + // HDD disk. + PD_HDD = 2; + } + + // The database engine type and version. + enum SqlDatabaseVersion { + // Unspecified version. + SQL_DATABASE_VERSION_UNSPECIFIED = 0; + + // MySQL 5.6. + MYSQL_5_6 = 1; + + // MySQL 5.7. + MYSQL_5_7 = 2; + + // PostgreSQL 9.6. + POSTGRES_9_6 = 3; + + // PostgreSQL 11. + POSTGRES_11 = 4; + + // PostgreSQL 10. + POSTGRES_10 = 5; + + // MySQL 8.0. + MYSQL_8_0 = 6; + + // PostgreSQL 12. + POSTGRES_12 = 7; + + // PostgreSQL 13. + POSTGRES_13 = 8; + + // PostgreSQL 14. + POSTGRES_14 = 17; + } + + // The availability type of the given Cloud SQL instance. + enum SqlAvailabilityType { + // This is an unknown Availability type. + SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0; + + // Zonal availablility instance. + ZONAL = 1; + + // Regional availability instance. + REGIONAL = 2; + } + + // The database engine type and version. + SqlDatabaseVersion database_version = 1; + + // The resource labels for a Cloud SQL instance to use to annotate any related + // underlying resources such as Compute Engine VMs. + // An object containing a list of "key": "value" pairs. + // + // Example: `{ "name": "wrench", "mass": "18kg", "count": "3" }`. + map user_labels = 2; + + // The tier (or machine type) for this instance, for example: + // `db-n1-standard-1` (MySQL instances) or + // `db-custom-1-3840` (PostgreSQL instances). + // For more information, see + // [Cloud SQL Instance + // Settings](https://cloud.google.com/sql/docs/mysql/instance-settings). + string tier = 3; + + // The maximum size to which storage capacity can be automatically increased. + // The default value is 0, which specifies that there is no limit. + google.protobuf.Int64Value storage_auto_resize_limit = 4; + + // The activation policy specifies when the instance is activated; it is + // applicable only when the instance state is 'RUNNABLE'. Valid values: + // + // 'ALWAYS': The instance is on, and remains so even in + // the absence of connection requests. + // + // `NEVER`: The instance is off; it is not activated, even if a + // connection request arrives. + SqlActivationPolicy activation_policy = 5; + + // The settings for IP Management. This allows to enable or disable the + // instance IP and manage which external networks can connect to the instance. + // The IPv4 address cannot be disabled. + SqlIpConfig ip_config = 6; + + // [default: ON] If you enable this setting, Cloud SQL checks your available + // storage every 30 seconds. If the available storage falls below a threshold + // size, Cloud SQL automatically adds additional storage capacity. If the + // available storage repeatedly falls below the threshold size, Cloud SQL + // continues to add storage until it reaches the maximum of 30 TB. + google.protobuf.BoolValue auto_storage_increase = 7; + + // The database flags passed to the Cloud SQL instance at startup. + // An object containing a list of "key": value pairs. + // Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. + map database_flags = 8; + + // The type of storage: `PD_SSD` (default) or `PD_HDD`. + SqlDataDiskType data_disk_type = 9; + + // The storage capacity available to the database, in GB. + // The minimum (and default) size is 10GB. + google.protobuf.Int64Value data_disk_size_gb = 10; + + // The Google Cloud Platform zone where your Cloud SQL database instance is + // located. + string zone = 11; + + // Optional. The Google Cloud Platform zone where the failover Cloud SQL + // database instance is located. Used when the Cloud SQL database availability + // type is REGIONAL (i.e. multiple zones / highly available). + string secondary_zone = 18 [(google.api.field_behavior) = OPTIONAL]; + + // The Database Migration Service source connection profile ID, + // in the format: + // `projects/my_project_name/locations/us-central1/connectionProfiles/connection_profile_ID` + string source_id = 12; + + // Input only. Initial root password. + string root_password = 13 [(google.api.field_behavior) = INPUT_ONLY]; + + // Output only. Indicates If this connection profile root password is stored. + bool root_password_set = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The Cloud SQL default instance level collation. + string collation = 15; + + // The KMS key name used for the csql instance. + string cmek_key_name = 16; + + // Optional. Availability type. Potential values: + // * `ZONAL`: The instance serves data from only one zone. Outages in that + // zone affect data availability. + // * `REGIONAL`: The instance can serve data from more than one zone in a + // region (it is highly available). + SqlAvailabilityType availability_type = 17 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Settings for creating an AlloyDB cluster. +message AlloyDbSettings { + // The username/password for a database user. Used for specifying initial + // users at cluster creation time. + message UserPassword { + // The database username. + string user = 1; + + // The initial password for the user. + string password = 2; + + // Output only. Indicates if the initial_user.password field has been set. + bool password_set = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Settings for the cluster's primary instance + message PrimaryInstanceSettings { + // MachineConfig describes the configuration of a machine. + message MachineConfig { + // The number of CPU's in the VM instance. + int32 cpu_count = 1; + } + + // Required. The ID of the AlloyDB primary instance. The ID must satisfy the + // regex expression "[a-z0-9-]+". + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Configuration for the machines that host the underlying + // database engine. + MachineConfig machine_config = 2; + + // Database flags to pass to AlloyDB when DMS is creating the AlloyDB + // cluster and instances. See the AlloyDB documentation for how these can be + // used. + map database_flags = 6; + + // Labels for the AlloyDB primary instance created by DMS. An object + // containing a list of 'key', 'value' pairs. + map labels = 7; + + // Output only. The private IP address for the Instance. + // This is the connection endpoint for an end-user application. + string private_ip = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // EncryptionConfig describes the encryption config of a cluster that is + // encrypted with a CMEK (customer-managed encryption key). + message EncryptionConfig { + // The fully-qualified resource name of the KMS key. + // Each Cloud KMS key is regionalized and has the following format: + // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + string kms_key_name = 1; + } + + // Required. Input only. Initial user to setup during cluster creation. + // Required. + UserPassword initial_user = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Required. The resource link for the VPC network in which cluster resources + // are created and from which they are accessible via Private IP. The network + // must belong to the same project as the cluster. It is specified in the + // form: "projects/{project_number}/global/networks/{network_id}". This is + // required to create a cluster. + string vpc_network = 2 [(google.api.field_behavior) = REQUIRED]; + + // Labels for the AlloyDB cluster created by DMS. An object containing a list + // of 'key', 'value' pairs. + map labels = 3; + + PrimaryInstanceSettings primary_instance_settings = 4; + + // Optional. The encryption config can be specified to encrypt the data disks + // and other persistent data resources of a cluster with a + // customer-managed encryption key (CMEK). When this field is not + // specified, the cluster will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The source database will allow incoming connections from the public IP of the +// destination database. You can retrieve the public IP of the Cloud SQL +// instance from the Cloud SQL console or using Cloud SQL APIs. No additional +// configuration is required. +message StaticIpConnectivity {} + +// Private Service Connect connectivity +// (https://cloud.google.com/vpc/docs/private-service-connect#service-attachments) +message PrivateServiceConnectConnectivity { + // Required. A service attachment that exposes a database, and has the + // following format: + // projects/{project}/regions/{region}/serviceAttachments/{service_attachment_name} + string service_attachment = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The details needed to configure a reverse SSH tunnel between the source and +// destination databases. These details will be used when calling the +// generateSshScript method (see +// https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs/generateSshScript) +// to produce the script that will help set up the reverse SSH tunnel, and to +// set up the VPC peering between the Cloud SQL private network and the VPC. +message ReverseSshConnectivity { + // Required. The IP of the virtual machine (Compute Engine) used as the + // bastion server for the SSH tunnel. + string vm_ip = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The forwarding port of the virtual machine (Compute Engine) used + // as the bastion server for the SSH tunnel. + int32 vm_port = 2 [(google.api.field_behavior) = REQUIRED]; + + // The name of the virtual machine (Compute Engine) used as the bastion server + // for the SSH tunnel. + string vm = 3; + + // The name of the VPC to peer with the Cloud SQL private network. + string vpc = 4; +} + +// The details of the VPC where the source database is located in Google Cloud. +// We will use this information to set up the VPC peering connection between +// Cloud SQL and this VPC. +message VpcPeeringConnectivity { + // The name of the VPC network to peer with the Cloud SQL private network. + string vpc = 1; +} + +// Forward SSH Tunnel connectivity. +message ForwardSshTunnelConnectivity { + // Required. Hostname for the SSH tunnel. + string hostname = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Username for the SSH tunnel. + string username = 2 [(google.api.field_behavior) = REQUIRED]; + + // Port for the SSH tunnel, default value is 22. + int32 port = 3; + + oneof authentication_method { + // Input only. SSH password. + string password = 100 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. SSH private key. + string private_key = 101 [(google.api.field_behavior) = INPUT_ONLY]; + } +} + +// Static IP address connectivity configured on service project. +message StaticServiceIpConnectivity {} + +// Private Connectivity. +message PrivateConnectivity { + // Required. The resource name (URI) of the private connection. + string private_connection = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A message defining the database engine and provider. +message DatabaseType { + // The database provider. + DatabaseProvider provider = 1; + + // The database engine. + DatabaseEngine engine = 2; +} + +// Represents a Database Migration Service migration job object. +message MigrationJob { + option (google.api.resource) = { + type: "datamigration.googleapis.com/MigrationJob" + pattern: "projects/{project}/locations/{location}/migrationJobs/{migration_job}" + }; + + // The current migration job states. + enum State { + // The state of the migration job is unknown. + STATE_UNSPECIFIED = 0; + + // The migration job is down for maintenance. + MAINTENANCE = 1; + + // The migration job is in draft mode and no resources are created. + DRAFT = 2; + + // The migration job is being created. + CREATING = 3; + + // The migration job is created and not started. + NOT_STARTED = 4; + + // The migration job is running. + RUNNING = 5; + + // The migration job failed. + FAILED = 6; + + // The migration job has been completed. + COMPLETED = 7; + + // The migration job is being deleted. + DELETING = 8; + + // The migration job is being stopped. + STOPPING = 9; + + // The migration job is currently stopped. + STOPPED = 10; + + // The migration job has been deleted. + DELETED = 11; + + // The migration job is being updated. + UPDATING = 12; + + // The migration job is starting. + STARTING = 13; + + // The migration job is restarting. + RESTARTING = 14; + + // The migration job is resuming. + RESUMING = 15; + } + + // The current migration job phase. + enum Phase { + // The phase of the migration job is unknown. + PHASE_UNSPECIFIED = 0; + + // The migration job is in the full dump phase. + FULL_DUMP = 1; + + // The migration job is CDC phase. + CDC = 2; + + // The migration job is running the promote phase. + PROMOTE_IN_PROGRESS = 3; + + // Only RDS flow - waiting for source writes to stop + WAITING_FOR_SOURCE_WRITES_TO_STOP = 4; + + // Only RDS flow - the sources writes stopped, waiting for dump to begin + PREPARING_THE_DUMP = 5; + } + + // The type of migration job (one-time or continuous). + enum Type { + // The type of the migration job is unknown. + TYPE_UNSPECIFIED = 0; + + // The migration job is a one time migration. + ONE_TIME = 1; + + // The migration job is a continuous migration. + CONTINUOUS = 2; + } + + // Dump flag definition. + message DumpFlag { + // The name of the flag + string name = 1; + + // The value of the flag. + string value = 2; + } + + // Dump flags definition. + message DumpFlags { + // The flags for the initial dump. + repeated DumpFlag dump_flags = 1; + } + + // The name (URI) of this migration job resource, in the form of: + // projects/{project}/locations/{location}/migrationJobs/{migrationJob}. + string name = 1; + + // Output only. The timestamp when the migration job resource was created. + // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + // Example: "2014-10-02T15:01:23.045123456Z". + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the migration job resource was last + // updated. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + // Example: "2014-10-02T15:01:23.045123456Z". + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The resource labels for migration job to use to annotate any related + // underlying resources such as Compute Engine VMs. An object containing a + // list of "key": "value" pairs. + // + // Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. + map labels = 4; + + // The migration job display name. + string display_name = 5; + + // The current migration job state. + State state = 6; + + // Output only. The current migration job phase. + Phase phase = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The migration job type. + Type type = 8 [(google.api.field_behavior) = REQUIRED]; + + // The path to the dump file in Google Cloud Storage, + // in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). + // This field and the "dump_flags" field are mutually exclusive. + string dump_path = 9; + + // The initial dump flags. + // This field and the "dump_path" field are mutually exclusive. + DumpFlags dump_flags = 17; + + // Required. The resource name (URI) of the source connection profile. + string source = 10 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource name (URI) of the destination connection profile. + string destination = 11 [(google.api.field_behavior) = REQUIRED]; + + // The connectivity method. + oneof connectivity { + // The details needed to communicate to the source over Reverse SSH + // tunnel connectivity. + ReverseSshConnectivity reverse_ssh_connectivity = 101; + + // The details of the VPC network that the source database is located in. + VpcPeeringConnectivity vpc_peering_connectivity = 102; + + // static ip connectivity data (default, no additional details needed). + StaticIpConnectivity static_ip_connectivity = 103; + } + + // Output only. The duration of the migration job (in seconds). A duration in + // seconds with up to nine fractional digits, terminated by 's'. Example: + // "3.5s". + google.protobuf.Duration duration = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error details in case of state FAILED. + google.rpc.Status error = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The database engine type and provider of the source. + DatabaseType source_database = 14; + + // The database engine type and provider of the destination. + DatabaseType destination_database = 15; + + // Output only. If the migration job is completed, the time when it was + // completed. + google.protobuf.Timestamp end_time = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The conversion workspace used by the migration. + ConversionWorkspaceInfo conversion_workspace = 18; + + // This field can be used to select the entities to migrate as part of + // the migration job. It uses AIP-160 notation to select a subset of the + // entities configured on the associated conversion-workspace. This field + // should not be set on migration-jobs that are not associated with a + // conversion workspace. + string filter = 20; + + // The CMEK (customer-managed encryption key) fully qualified key name used + // for the migration job. + // This field supports all migration jobs types except for: + // * Mysql to Mysql (use the cmek field in the cloudsql connection profile + // instead). + // * PostrgeSQL to PostgreSQL (use the cmek field in the cloudsql + // connection profile instead). + // * PostgreSQL to AlloyDB (use the kms_key_name field in the alloydb + // connection profile instead). + // Each Cloud CMEK key has the following format: + // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + string cmek_key_name = 21; +} + +// A conversion workspace's version. +message ConversionWorkspaceInfo { + // The resource name (URI) of the conversion workspace. + string name = 1; + + // The commit ID of the conversion workspace. + string commit_id = 2; +} + +// A connection profile definition. +message ConnectionProfile { + option (google.api.resource) = { + type: "datamigration.googleapis.com/ConnectionProfile" + pattern: "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}" + }; + + // The current connection profile state (e.g. DRAFT, READY, or FAILED). + enum State { + // The state of the connection profile is unknown. + STATE_UNSPECIFIED = 0; + + // The connection profile is in draft mode and fully editable. + DRAFT = 1; + + // The connection profile is being created. + CREATING = 2; + + // The connection profile is ready. + READY = 3; + + // The connection profile is being updated. + UPDATING = 4; + + // The connection profile is being deleted. + DELETING = 5; + + // The connection profile has been deleted. + DELETED = 6; + + // The last action on the connection profile failed. + FAILED = 7; + } + + // The name of this connection profile resource in the form of + // projects/{project}/locations/{location}/connectionProfiles/{connectionProfile}. + string name = 1; + + // Output only. The timestamp when the resource was created. + // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + // Example: "2014-10-02T15:01:23.045123456Z". + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was last updated. + // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + // Example: "2014-10-02T15:01:23.045123456Z". + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The resource labels for connection profile to use to annotate any related + // underlying resources such as Compute Engine VMs. An object containing a + // list of "key": "value" pairs. + // + // Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. + map labels = 4; + + // The current connection profile state (e.g. DRAFT, READY, or FAILED). + State state = 5; + + // The connection profile display name. + string display_name = 6; + + // The connection profile definition. + oneof connection_profile { + // A MySQL database connection profile. + MySqlConnectionProfile mysql = 100; + + // A PostgreSQL database connection profile. + PostgreSqlConnectionProfile postgresql = 101; + + // An Oracle database connection profile. + OracleConnectionProfile oracle = 104; + + // A CloudSQL database connection profile. + CloudSqlConnectionProfile cloudsql = 102; + + // An AlloyDB cluster connection profile. + AlloyDbConnectionProfile alloydb = 105; + } + + // Output only. The error details in case of state FAILED. + google.rpc.Status error = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The database provider. + DatabaseProvider provider = 8; +} + +// Error message of a verification Migration job. +message MigrationJobVerificationError { + // A general error code describing the type of error that occurred. + enum ErrorCode { + // An unknown error occurred + ERROR_CODE_UNSPECIFIED = 0; + + // We failed to connect to one of the connection profile. + CONNECTION_FAILURE = 1; + + // We failed to authenticate to one of the connection profile. + AUTHENTICATION_FAILURE = 2; + + // One of the involved connection profiles has an invalid configuration. + INVALID_CONNECTION_PROFILE_CONFIG = 3; + + // The versions of the source and the destination are incompatible. + VERSION_INCOMPATIBILITY = 4; + + // The types of the source and the destination are incompatible. + CONNECTION_PROFILE_TYPES_INCOMPATIBILITY = 5; + + // No pglogical extension installed on databases, applicable for postgres. + NO_PGLOGICAL_INSTALLED = 7; + + // pglogical node already exists on databases, applicable for postgres. + PGLOGICAL_NODE_ALREADY_EXISTS = 8; + + // The value of parameter wal_level is not set to logical. + INVALID_WAL_LEVEL = 9; + + // The value of parameter shared_preload_libraries does not include + // pglogical. + INVALID_SHARED_PRELOAD_LIBRARY = 10; + + // The value of parameter max_replication_slots is not sufficient. + INSUFFICIENT_MAX_REPLICATION_SLOTS = 11; + + // The value of parameter max_wal_senders is not sufficient. + INSUFFICIENT_MAX_WAL_SENDERS = 12; + + // The value of parameter max_worker_processes is not sufficient. + INSUFFICIENT_MAX_WORKER_PROCESSES = 13; + + // Extensions installed are either not supported or having unsupported + // versions. + UNSUPPORTED_EXTENSIONS = 14; + + // Unsupported migration type. + UNSUPPORTED_MIGRATION_TYPE = 15; + + // Invalid RDS logical replication. + INVALID_RDS_LOGICAL_REPLICATION = 16; + + // The gtid_mode is not supported, applicable for MySQL. + UNSUPPORTED_GTID_MODE = 17; + + // The table definition is not support due to missing primary key or replica + // identity. + UNSUPPORTED_TABLE_DEFINITION = 18; + + // The definer is not supported. + UNSUPPORTED_DEFINER = 19; + + // Migration is already running at the time of restart request. + CANT_RESTART_RUNNING_MIGRATION = 21; + + // The source has tables with limited support. + // E.g. PostgreSQL tables without primary keys. + TABLES_WITH_LIMITED_SUPPORT = 24; + + // The source uses an unsupported locale. + UNSUPPORTED_DATABASE_LOCALE = 25; + + // The source uses an unsupported Foreign Data Wrapper configuration. + UNSUPPORTED_DATABASE_FDW_CONFIG = 26; + + // There was an underlying RDBMS error. + ERROR_RDBMS = 27; + + // The source DB size in Bytes exceeds a certain threshold. The migration + // might require an increase of quota, or might not be supported. + SOURCE_SIZE_EXCEEDS_THRESHOLD = 28; + } + + // Output only. An instance of ErrorCode specifying the error that occurred. + ErrorCode error_code = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A formatted message with further details about the error and a + // CTA. + string error_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A specific detailed error message, if supplied by the engine. + string error_detail_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The database engine types. +enum DatabaseEngine { + // The source database engine of the migration job is unknown. + DATABASE_ENGINE_UNSPECIFIED = 0; + + // The source engine is MySQL. + MYSQL = 1; + + // The source engine is PostgreSQL. + POSTGRESQL = 2; + + // The source engine is Oracle. + ORACLE = 4; +} + +// The database providers. +enum DatabaseProvider { + // The database provider is unknown. + DATABASE_PROVIDER_UNSPECIFIED = 0; + + // CloudSQL runs the database. + CLOUDSQL = 1; + + // RDS runs the database. + RDS = 2; + + // Amazon Aurora. + AURORA = 3; + + // AlloyDB. + ALLOYDB = 4; +} + +// The PrivateConnection resource is used to establish private connectivity +// with the customer's network. +message PrivateConnection { + option (google.api.resource) = { + type: "datamigration.googleapis.com/PrivateConnection" + pattern: "projects/{project}/locations/{location}/privateConnections/{private_connection}" + }; + + // Private Connection state. + enum State { + STATE_UNSPECIFIED = 0; + + // The private connection is in creation state - creating resources. + CREATING = 1; + + // The private connection has been created with all of its resources. + CREATED = 2; + + // The private connection creation has failed. + FAILED = 3; + + // The private connection is being deleted. + DELETING = 4; + + // Delete request has failed, resource is in invalid state. + FAILED_TO_DELETE = 5; + + // The private connection has been deleted. + DELETED = 6; + } + + // The name of the resource. + string name = 1; + + // Output only. The create time of the resource. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update time of the resource. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The resource labels for private connections to use to annotate any related + // underlying resources such as Compute Engine VMs. An object containing a + // list of "key": "value" pairs. + // + // Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. + map labels = 4; + + // The private connection display name. + string display_name = 5; + + // Output only. The state of the private connection. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error details in case of state FAILED. + google.rpc.Status error = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + oneof connectivity { + // VPC peering configuration. + VpcPeeringConfig vpc_peering_config = 100; + } +} + +// The VPC peering configuration is used to create VPC peering with the +// consumer's VPC. +message VpcPeeringConfig { + // Required. Fully qualified name of the VPC that Database Migration Service + // will peer to. + string vpc_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Networks" + } + ]; + + // Required. A free subnet for peering. (CIDR of /29) + string subnet = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto b/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto new file mode 100644 index 00000000000..332fd2c6d31 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto @@ -0,0 +1,606 @@ +// Copyright 2023 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.clouddms.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/clouddms/v1/clouddms_resources.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudDms.V1"; +option go_package = "cloud.google.com/go/clouddms/apiv1/clouddmspb;clouddmspb"; +option java_multiple_files = true; +option java_outer_classname = "ConversionWorkspaceResourcesProto"; +option java_package = "com.google.cloud.clouddms.v1"; +option php_namespace = "Google\\Cloud\\CloudDms\\V1"; +option ruby_package = "Google::Cloud::CloudDMS::V1"; + +// The type and version of a source or destination database. +message DatabaseEngineInfo { + // Required. Engine type. + DatabaseEngine engine = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Engine named version, for example 12.c.1. + string version = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The main conversion workspace resource entity. +message ConversionWorkspace { + option (google.api.resource) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + pattern: "projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}" + }; + + // Full name of the workspace resource, in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string name = 1; + + // Required. The source engine details. + DatabaseEngineInfo source = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The destination engine details. + DatabaseEngineInfo destination = 3 [(google.api.field_behavior) = REQUIRED]; + + // A generic list of settings for the workspace. + // The settings are database pair dependant and can indicate default behavior + // for the mapping rules engine or turn on or off specific features. + // Such examples can be: convert_foreign_key_to_interleave=true, + // skip_triggers=false, ignore_non_table_synonyms=true + map global_settings = 4; + + // Output only. Whether the workspace has uncommitted changes (changes which + // were made after the workspace was committed). + bool has_uncommitted_changes = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The latest commit ID. + string latest_commit_id = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the workspace was committed. + google.protobuf.Timestamp latest_commit_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the workspace resource was created. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the workspace resource was last updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The display name for the workspace. + string display_name = 11; +} + +// Execution log of a background job. +message BackgroundJobLogEntry { + // Final state after a job completes. + enum JobCompletionState { + // The status is not specified. This state is used when job is not yet + // finished. + JOB_COMPLETION_STATE_UNSPECIFIED = 0; + + // Success. + SUCCEEDED = 1; + + // Error. + FAILED = 2; + } + + // Details regarding a Seed background job. + message SeedJobDetails { + // The connection profile which was used for the seed job. + string connection_profile = 1; + } + + // Details regarding an Import Rules background job. + message ImportRulesJobDetails { + // File names used for the import rules job. + repeated string files = 1; + + // The requested file format. + ImportRulesFileFormat file_format = 2; + } + + // Details regarding a Convert background job. + message ConvertJobDetails { + // AIP-160 based filter used to specify the entities to convert + string filter = 1; + } + + // Details regarding an Apply background job. + message ApplyJobDetails { + // The connection profile which was used for the apply job. + string connection_profile = 1; + + // AIP-160 based filter used to specify the entities to apply + string filter = 2; + } + + // The background job log entry ID. + string id = 1; + + // The type of job that was executed. + BackgroundJobType job_type = 2; + + // The timestamp when the background job was started. + google.protobuf.Timestamp start_time = 3; + + // The timestamp when the background job was finished. + google.protobuf.Timestamp finish_time = 4; + + // Job completion state, i.e. the final state after the job completed. + JobCompletionState completion_state = 5; + + // Job completion comment, such as how many entities were seeded, + // how many warnings were found during conversion, and similar information. + string completion_comment = 6; + + // Whether the client requested the conversion workspace to be committed after + // a successful completion of the job. + bool request_autocommit = 7; + + oneof job_details { + // Seed job details. + SeedJobDetails seed_job_details = 100; + + // Import rules job details. + ImportRulesJobDetails import_rules_job_details = 101; + + // Convert job details. + ConvertJobDetails convert_job_details = 102; + + // Apply job details. + ApplyJobDetails apply_job_details = 103; + } +} + +// The base entity type for all the database related entities. +// The message contains the entity name, the name of its parent, the entity +// type, and the specific details per entity type. +message DatabaseEntity { + // The type of database entities tree. + enum TreeType { + // Tree type unspecified. + TREE_TYPE_UNSPECIFIED = 0; + + // Tree of entities loaded from a source database. + SOURCE = 1; + + // Tree of entities converted from the source tree using the mapping rules. + DRAFT = 2; + + // Tree of entities observed on the destination database. + DESTINATION = 3; + } + + // The short name (e.g. table name) of the entity. + string short_name = 1; + + // The full name of the parent entity (e.g. schema name). + string parent_entity = 2; + + // The type of tree the entity belongs to. + TreeType tree = 3; + + // The type of the database entity (table, view, index, ...). + DatabaseEntityType entity_type = 4; + + // Details about entity mappings. + // For source tree entities, this holds the draft entities which were + // generated by the mapping rules. + // For draft tree entities, this holds the source entities which were + // converted to form the draft entity. + // Destination entities will have no mapping details. + repeated EntityMapping mappings = 5; + + // The specific body for each entity type. + oneof entity_body { + // Schema. + SchemaEntity schema = 102; + + // Table. + TableEntity table = 103; + + // View. + ViewEntity view = 104; + + // Sequence. + SequenceEntity sequence = 105; + + // Stored procedure. + StoredProcedureEntity stored_procedure = 106; + + // Function. + FunctionEntity database_function = 107; + + // Synonym. + SynonymEntity synonym = 108; + + // Package. + PackageEntity database_package = 109; + } +} + +// Schema typically has no parent entity, but can have a parent entity +// DatabaseInstance (for database engines which support it). For some database +// engines, the terms schema and user can be used interchangeably when they +// refer to a namespace or a collection of other database entities. Can store +// additional information which is schema specific. +message SchemaEntity { + // Custom engine specific features. + google.protobuf.Struct custom_features = 1; +} + +// Table's parent is a schema. +message TableEntity { + // Table columns. + repeated ColumnEntity columns = 1; + + // Table constraints. + repeated ConstraintEntity constraints = 2; + + // Table indices. + repeated IndexEntity indices = 3; + + // Table triggers. + repeated TriggerEntity triggers = 4; + + // Custom engine specific features. + google.protobuf.Struct custom_features = 5; + + // Comment associated with the table. + string comment = 6; +} + +// Column is not used as an independent entity, it is retrieved as part of a +// Table entity. +message ColumnEntity { + // Column name. + string name = 1; + + // Column data type. + string data_type = 2; + + // Charset override - instead of table level charset. + string charset = 3; + + // Collation override - instead of table level collation. + string collation = 4; + + // Column length - e.g. varchar (50). + int64 length = 5; + + // Column precision - when relevant. + int32 precision = 6; + + // Column scale - when relevant. + int32 scale = 7; + + // Column fractional second precision - used for timestamp based datatypes. + int32 fractional_seconds_precision = 8; + + // Is the column of array type. + bool array = 9; + + // If the column is array, of which length. + int32 array_length = 10; + + // Is the column nullable. + bool nullable = 11; + + // Is the column auto-generated/identity. + bool auto_generated = 12; + + // Is the column a UDT. + bool udt = 13; + + // Custom engine specific features. + google.protobuf.Struct custom_features = 14; + + // Specifies the list of values allowed in the column. + // Only used for set data type. + repeated string set_values = 15; + + // Comment associated with the column. + string comment = 16; + + // Column order in the table. + int32 ordinal_position = 17; + + // Default value of the column. + string default_value = 18; +} + +// Constraint is not used as an independent entity, it is retrieved +// as part of another entity such as Table or View. +message ConstraintEntity { + // The name of the table constraint. + string name = 1; + + // Type of constraint, for example unique, primary key, foreign key (currently + // only primary key is supported). + string type = 2; + + // Table columns used as part of the Constraint, for example primary key + // constraint should list the columns which constitutes the key. + repeated string table_columns = 3; + + // Custom engine specific features. + google.protobuf.Struct custom_features = 4; + + // Reference columns which may be associated with the constraint. For example, + // if the constraint is a FOREIGN_KEY, this represents the list of full names + // of referenced columns by the foreign key. + repeated string reference_columns = 5; + + // Reference table which may be associated with the constraint. For example, + // if the constraint is a FOREIGN_KEY, this represents the list of full name + // of the referenced table by the foreign key. + string reference_table = 6; + + // Table which is associated with the constraint. In case the constraint + // is defined on a table, this field is left empty as this information is + // stored in parent_name. However, if constraint is defined on a view, this + // field stores the table name on which the view is defined. + string table_name = 7; +} + +// Index is not used as an independent entity, it is retrieved as part of a +// Table entity. +message IndexEntity { + // The name of the index. + string name = 1; + + // Type of index, for example B-TREE. + string type = 2; + + // Table columns used as part of the Index, for example B-TREE index should + // list the columns which constitutes the index. + repeated string table_columns = 3; + + // Boolean value indicating whether the index is unique. + bool unique = 4; + + // Custom engine specific features. + google.protobuf.Struct custom_features = 5; +} + +// Trigger is not used as an independent entity, it is retrieved as part of a +// Table entity. +message TriggerEntity { + // The name of the trigger. + string name = 1; + + // The DML, DDL, or database events that fire the trigger, for example + // INSERT, UPDATE. + repeated string triggering_events = 2; + + // Indicates when the trigger fires, for example BEFORE STATEMENT, AFTER EACH + // ROW. + string trigger_type = 3; + + // The SQL code which creates the trigger. + string sql_code = 4; + + // Custom engine specific features. + google.protobuf.Struct custom_features = 5; +} + +// View's parent is a schema. +message ViewEntity { + // The SQL code which creates the view. + string sql_code = 1; + + // Custom engine specific features. + google.protobuf.Struct custom_features = 2; + + // View constraints. + repeated ConstraintEntity constraints = 3; +} + +// Sequence's parent is a schema. +message SequenceEntity { + // Increment value for the sequence. + int64 increment = 1; + + // Start number for the sequence represented as bytes to accommodate large. + // numbers + bytes start_value = 2; + + // Maximum number for the sequence represented as bytes to accommodate large. + // numbers + bytes max_value = 3; + + // Minimum number for the sequence represented as bytes to accommodate large. + // numbers + bytes min_value = 4; + + // Indicates whether the sequence value should cycle through. + bool cycle = 5; + + // Indicates number of entries to cache / precreate. + int64 cache = 6; + + // Custom engine specific features. + google.protobuf.Struct custom_features = 7; +} + +// Stored procedure's parent is a schema. +message StoredProcedureEntity { + // The SQL code which creates the stored procedure. + string sql_code = 1; + + // Custom engine specific features. + google.protobuf.Struct custom_features = 2; +} + +// Function's parent is a schema. +message FunctionEntity { + // The SQL code which creates the function. + string sql_code = 1; + + // Custom engine specific features. + google.protobuf.Struct custom_features = 2; +} + +// Synonym's parent is a schema. +message SynonymEntity { + // The name of the entity for which the synonym is being created (the source). + string source_entity = 1; + + // The type of the entity for which the synonym is being created + // (usually a table or a sequence). + DatabaseEntityType source_type = 2; + + // Custom engine specific features. + google.protobuf.Struct custom_features = 3; +} + +// Package's parent is a schema. +message PackageEntity { + // The SQL code which creates the package. + string package_sql_code = 1; + + // The SQL code which creates the package body. If the package specification + // has cursors or subprograms, then the package body is mandatory. + string package_body = 2; + + // Custom engine specific features. + google.protobuf.Struct custom_features = 3; +} + +// Details of the mappings of a database entity. +message EntityMapping { + // Source entity full name. + // The source entity can also be a column, index or constraint using the + // same naming notation schema.table.column. + string source_entity = 1; + + // Target entity full name. + // The draft entity can also include a column, index or constraint using the + // same naming notation schema.table.column. + string draft_entity = 2; + + // Type of source entity. + DatabaseEntityType source_type = 4; + + // Type of draft entity. + DatabaseEntityType draft_type = 5; + + // Entity mapping log entries. + // Multiple rules can be effective and contribute changes to a converted + // entity, such as a rule can handle the entity name, another rule can handle + // an entity type. In addition, rules which did not change the entity are also + // logged along with the reason preventing them to do so. + repeated EntityMappingLogEntry mapping_log = 3; +} + +// A single record of a rule which was used for a mapping. +message EntityMappingLogEntry { + // Which rule caused this log entry. + string rule_id = 1; + + // Rule revision ID. + string rule_revision_id = 2; + + // Comment. + string mapping_comment = 3; +} + +// The type of database entities supported, +enum DatabaseEntityType { + // Unspecified database entity type. + DATABASE_ENTITY_TYPE_UNSPECIFIED = 0; + + // Schema. + DATABASE_ENTITY_TYPE_SCHEMA = 1; + + // Table. + DATABASE_ENTITY_TYPE_TABLE = 2; + + // Column. + DATABASE_ENTITY_TYPE_COLUMN = 3; + + // Constraint. + DATABASE_ENTITY_TYPE_CONSTRAINT = 4; + + // Index. + DATABASE_ENTITY_TYPE_INDEX = 5; + + // Trigger. + DATABASE_ENTITY_TYPE_TRIGGER = 6; + + // View. + DATABASE_ENTITY_TYPE_VIEW = 7; + + // Sequence. + DATABASE_ENTITY_TYPE_SEQUENCE = 8; + + // Stored Procedure. + DATABASE_ENTITY_TYPE_STORED_PROCEDURE = 9; + + // Function. + DATABASE_ENTITY_TYPE_FUNCTION = 10; + + // Synonym. + DATABASE_ENTITY_TYPE_SYNONYM = 11; + + // Package. + DATABASE_ENTITY_TYPE_DATABASE_PACKAGE = 12; + + // UDT. + DATABASE_ENTITY_TYPE_UDT = 13; + + // Materialized View. + DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW = 14; + + // Database. + DATABASE_ENTITY_TYPE_DATABASE = 15; +} + +// The types of jobs that can be executed in the background. +enum BackgroundJobType { + // Unspecified background job type. + BACKGROUND_JOB_TYPE_UNSPECIFIED = 0; + + // Job to seed from the source database. + BACKGROUND_JOB_TYPE_SOURCE_SEED = 1; + + // Job to convert the source database into a draft of the destination + // database. + BACKGROUND_JOB_TYPE_CONVERT = 2; + + // Job to apply the draft tree onto the destination. + BACKGROUND_JOB_TYPE_APPLY_DESTINATION = 3; + + // Job to import and convert mapping rules from an external source such as an + // ora2pg config file. + BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE = 5; +} + +// The format for the import rules file. +enum ImportRulesFileFormat { + // Unspecified rules format. + IMPORT_RULES_FILE_FORMAT_UNSPECIFIED = 0; + + // HarbourBridge session file. + IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE = 1; + + // Ora2Pg configuration file. + IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE = 2; +} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.apply_conversion_workspace.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.apply_conversion_workspace.js new file mode 100644 index 00000000000..5db674a94e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.apply_conversion_workspace.js @@ -0,0 +1,73 @@ +// Copyright 2023 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(name) { + // [START datamigration_v1_generated_DataMigrationService_ApplyConversionWorkspace_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. + */ + /** + * Required. The name of the conversion workspace resource for which to apply + * the draft tree. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + */ + // const name = 'abc123' + /** + * Filter which entities to apply. Leaving this field empty will apply all of + * the entities. Supports Google AIP 160 based filtering. + */ + // const filter = 'abc123' + /** + * Fully qualified (Uri) name of the destination connection profile. + */ + // const connectionProfile = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callApplyConversionWorkspace() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await clouddmsClient.applyConversionWorkspace(request); + const [response] = await operation.promise(); + console.log(response); + } + + callApplyConversionWorkspace(); + // [END datamigration_v1_generated_DataMigrationService_ApplyConversionWorkspace_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-clouddms/v1/samples/generated/v1/data_migration_service.commit_conversion_workspace.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.commit_conversion_workspace.js new file mode 100644 index 00000000000..3713e685e6c --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.commit_conversion_workspace.js @@ -0,0 +1,66 @@ +// Copyright 2023 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(name) { + // [START datamigration_v1_generated_DataMigrationService_CommitConversionWorkspace_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. + */ + /** + * Required. Name of the conversion workspace resource to commit. + */ + // const name = 'abc123' + /** + * Optional. Optional name of the commit. + */ + // const commitName = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callCommitConversionWorkspace() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await clouddmsClient.commitConversionWorkspace(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCommitConversionWorkspace(); + // [END datamigration_v1_generated_DataMigrationService_CommitConversionWorkspace_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-clouddms/v1/samples/generated/v1/data_migration_service.convert_conversion_workspace.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.convert_conversion_workspace.js new file mode 100644 index 00000000000..6cfa23a9b62 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.convert_conversion_workspace.js @@ -0,0 +1,72 @@ +// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_ConvertConversionWorkspace_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. + */ + /** + * Name of the conversion workspace resource to convert in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + */ + // const name = 'abc123' + /** + * Specifies whether the conversion workspace is to be committed automatically + * after the conversion. + */ + // const autoCommit = true + /** + * Filter the entities to convert. Leaving this field empty will convert all + * of the entities. Supports Google AIP-160 style filtering. + */ + // const filter = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callConvertConversionWorkspace() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.convertConversionWorkspace(request); + const [response] = await operation.promise(); + console.log(response); + } + + callConvertConversionWorkspace(); + // [END datamigration_v1_generated_DataMigrationService_ConvertConversionWorkspace_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-clouddms/v1/samples/generated/v1/data_migration_service.create_connection_profile.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_connection_profile.js new file mode 100644 index 00000000000..8580dab4f6a --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_connection_profile.js @@ -0,0 +1,92 @@ +// Copyright 2023 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(parent, connectionProfileId, connectionProfile) { + // [START datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_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. + */ + /** + * Required. The parent which owns this collection of connection profiles. + */ + // const parent = 'abc123' + /** + * Required. The connection profile identifier. + */ + // const connectionProfileId = 'abc123' + /** + * Required. The create request body including the connection profile data + */ + // const connectionProfile = {} + /** + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. + * It is recommended to always set this value to a UUID. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + /** + * Optional. Only validate the connection profile, but don't create any + * resources. The default is false. Only supported for Oracle connection + * profiles. + */ + // const validateOnly = true + /** + * Optional. Create the connection profile without validating it. + * The default is false. + * Only supported for Oracle connection profiles. + */ + // const skipValidation = true + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callCreateConnectionProfile() { + // Construct request + const request = { + parent, + connectionProfileId, + connectionProfile, + }; + + // Run request + const [operation] = await clouddmsClient.createConnectionProfile(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateConnectionProfile(); + // [END datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_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-clouddms/v1/samples/generated/v1/data_migration_service.create_conversion_workspace.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_conversion_workspace.js new file mode 100644 index 00000000000..3d6acdcda7f --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_conversion_workspace.js @@ -0,0 +1,80 @@ +// Copyright 2023 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(parent, conversionWorkspaceId, conversionWorkspace) { + // [START datamigration_v1_generated_DataMigrationService_CreateConversionWorkspace_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. + */ + /** + * Required. The parent which owns this collection of conversion workspaces. + */ + // const parent = 'abc123' + /** + * Required. The ID of the conversion workspace to create. + */ + // const conversionWorkspaceId = 'abc123' + /** + * Required. Represents a conversion workspace object. + */ + // const conversionWorkspace = {} + /** + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * It is recommended to always set this value to a UUID. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callCreateConversionWorkspace() { + // Construct request + const request = { + parent, + conversionWorkspaceId, + conversionWorkspace, + }; + + // Run request + const [operation] = await clouddmsClient.createConversionWorkspace(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateConversionWorkspace(); + // [END datamigration_v1_generated_DataMigrationService_CreateConversionWorkspace_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-clouddms/v1/samples/generated/v1/data_migration_service.create_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_migration_job.js new file mode 100644 index 00000000000..58f2117f811 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_migration_job.js @@ -0,0 +1,82 @@ +// Copyright 2023 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(parent, migrationJobId, migrationJob) { + // [START datamigration_v1_generated_DataMigrationService_CreateMigrationJob_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. + */ + /** + * Required. The parent which owns this collection of migration jobs. + */ + // const parent = 'abc123' + /** + * Required. The ID of the instance to create. + */ + // const migrationJobId = 'abc123' + /** + * Required. Represents a migration + * job (https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) + * object. + */ + // const migrationJob = {} + /** + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * It is recommended to always set this value to a UUID. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callCreateMigrationJob() { + // Construct request + const request = { + parent, + migrationJobId, + migrationJob, + }; + + // Run request + const [operation] = await clouddmsClient.createMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_CreateMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.create_private_connection.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_private_connection.js new file mode 100644 index 00000000000..b4d4931f8b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_private_connection.js @@ -0,0 +1,84 @@ +// Copyright 2023 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(parent, privateConnectionId, privateConnection) { + // [START datamigration_v1_generated_DataMigrationService_CreatePrivateConnection_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. + */ + /** + * Required. The parent that owns the collection of PrivateConnections. + */ + // const parent = 'abc123' + /** + * Required. The private connection identifier. + */ + // const privateConnectionId = 'abc123' + /** + * Required. The private connection resource to create. + */ + // const privateConnection = {} + /** + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. + * It is recommended to always set this value to a UUID. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, will skip validations. + */ + // const skipValidation = true + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callCreatePrivateConnection() { + // Construct request + const request = { + parent, + privateConnectionId, + privateConnection, + }; + + // Run request + const [operation] = await clouddmsClient.createPrivateConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreatePrivateConnection(); + // [END datamigration_v1_generated_DataMigrationService_CreatePrivateConnection_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-clouddms/v1/samples/generated/v1/data_migration_service.delete_connection_profile.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_connection_profile.js new file mode 100644 index 00000000000..1cfb2661d82 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_connection_profile.js @@ -0,0 +1,75 @@ +// Copyright 2023 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(name) { + // [START datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_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. + */ + /** + * Required. Name of the connection profile resource to delete. + */ + // const name = 'abc123' + /** + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * It is recommended to always set this value to a UUID. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + /** + * In case of force delete, the CloudSQL replica database is also deleted + * (only for CloudSQL connection profile). + */ + // const force = true + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callDeleteConnectionProfile() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await clouddmsClient.deleteConnectionProfile(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteConnectionProfile(); + // [END datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_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-clouddms/v1/samples/generated/v1/data_migration_service.delete_conversion_workspace.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_conversion_workspace.js new file mode 100644 index 00000000000..eb820265914 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_conversion_workspace.js @@ -0,0 +1,70 @@ +// Copyright 2023 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(name) { + // [START datamigration_v1_generated_DataMigrationService_DeleteConversionWorkspace_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. + */ + /** + * Required. Name of the conversion workspace resource to delete. + */ + // const name = 'abc123' + /** + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * It is recommended to always set this value to a UUID. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callDeleteConversionWorkspace() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await clouddmsClient.deleteConversionWorkspace(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteConversionWorkspace(); + // [END datamigration_v1_generated_DataMigrationService_DeleteConversionWorkspace_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-clouddms/v1/samples/generated/v1/data_migration_service.delete_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_migration_job.js new file mode 100644 index 00000000000..1269bfb4e20 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_migration_job.js @@ -0,0 +1,76 @@ +// Copyright 2023 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(name) { + // [START datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_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. + */ + /** + * Required. Name of the migration job resource to delete. + */ + // const name = 'abc123' + /** + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * It is recommended to always set this value to a UUID. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + /** + * The destination CloudSQL connection profile is always deleted with the + * migration job. In case of force delete, the destination CloudSQL replica + * database is also deleted. + */ + // const force = true + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callDeleteMigrationJob() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await clouddmsClient.deleteMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.delete_private_connection.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_private_connection.js new file mode 100644 index 00000000000..ad09b321cd1 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_private_connection.js @@ -0,0 +1,70 @@ +// Copyright 2023 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(name) { + // [START datamigration_v1_generated_DataMigrationService_DeletePrivateConnection_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. + */ + /** + * Required. The name of the private connection to delete. + */ + // const name = 'abc123' + /** + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. + * It is recommended to always set this value to a UUID. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callDeletePrivateConnection() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await clouddmsClient.deletePrivateConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeletePrivateConnection(); + // [END datamigration_v1_generated_DataMigrationService_DeletePrivateConnection_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-clouddms/v1/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js new file mode 100644 index 00000000000..cccca2fbcef --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js @@ -0,0 +1,67 @@ +// Copyright 2023 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(conversionWorkspace) { + // [START datamigration_v1_generated_DataMigrationService_DescribeConversionWorkspaceRevisions_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. + */ + /** + * Required. Name of the conversion workspace resource whose revisions are + * listed. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + */ + // const conversionWorkspace = 'abc123' + /** + * Optional. Optional filter to request a specific commit ID. + */ + // const commitId = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callDescribeConversionWorkspaceRevisions() { + // Construct request + const request = { + conversionWorkspace, + }; + + // Run request + const response = await clouddmsClient.describeConversionWorkspaceRevisions(request); + console.log(response); + } + + callDescribeConversionWorkspaceRevisions(); + // [END datamigration_v1_generated_DataMigrationService_DescribeConversionWorkspaceRevisions_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-clouddms/v1/samples/generated/v1/data_migration_service.describe_database_entities.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.describe_database_entities.js new file mode 100644 index 00000000000..16f8a7ca305 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.describe_database_entities.js @@ -0,0 +1,97 @@ +// Copyright 2023 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(conversionWorkspace) { + // [START datamigration_v1_generated_DataMigrationService_DescribeDatabaseEntities_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. + */ + /** + * Required. Name of the conversion workspace resource whose database entities + * are described. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + */ + // const conversionWorkspace = 'abc123' + /** + * The maximum number of entities to return. The service may return + * fewer entities than the value specifies. + */ + // const pageSize = 1234 + /** + * The nextPageToken value received in the previous call to + * conversionWorkspace.describeDatabaseEntities, used in the subsequent + * request to retrieve the next page of results. On first call this should be + * left blank. When paginating, all other parameters provided to + * conversionWorkspace.describeDatabaseEntities must match the call that + * provided the page token. + */ + // const pageToken = 'abc123' + /** + * The tree to fetch. + */ + // const tree = {} + /** + * Whether to retrieve the latest committed version of the entities or the + * latest version. This field is ignored if a specific commit_id is specified. + */ + // const uncommitted = true + /** + * Request a specific commit ID. If not specified, the entities from the + * latest commit are returned. + */ + // const commitId = 'abc123' + /** + * Filter the returned entities based on AIP-160 standard. + */ + // const filter = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callDescribeDatabaseEntities() { + // Construct request + const request = { + conversionWorkspace, + }; + + // Run request + const iterable = await clouddmsClient.describeDatabaseEntitiesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callDescribeDatabaseEntities(); + // [END datamigration_v1_generated_DataMigrationService_DescribeDatabaseEntities_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-clouddms/v1/samples/generated/v1/data_migration_service.fetch_static_ips.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.fetch_static_ips.js new file mode 100644 index 00000000000..8e43a0fb1e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.fetch_static_ips.js @@ -0,0 +1,72 @@ +// Copyright 2023 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(name) { + // [START datamigration_v1_generated_DataMigrationService_FetchStaticIps_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. + */ + /** + * Required. The resource name for the location for which static IPs should be + * returned. Must be in the format `projects/* /locations/*`. + */ + // const name = 'abc123' + /** + * Maximum number of IPs to return. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `FetchStaticIps` call. + */ + // const pageToken = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callFetchStaticIps() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await clouddmsClient.fetchStaticIpsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callFetchStaticIps(); + // [END datamigration_v1_generated_DataMigrationService_FetchStaticIps_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-clouddms/v1/samples/generated/v1/data_migration_service.generate_ssh_script.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.generate_ssh_script.js new file mode 100644 index 00000000000..41c49068a4d --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.generate_ssh_script.js @@ -0,0 +1,77 @@ +// Copyright 2023 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(vm) { + // [START datamigration_v1_generated_DataMigrationService_GenerateSshScript_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. + */ + /** + * Name of the migration job resource to generate the SSH script. + */ + // const migrationJob = 'abc123' + /** + * Required. Bastion VM Instance name to use or to create. + */ + // const vm = 'abc123' + /** + * The VM creation configuration + */ + // const vmCreationConfig = {} + /** + * The VM selection configuration + */ + // const vmSelectionConfig = {} + /** + * The port that will be open on the bastion host. + */ + // const vmPort = 1234 + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callGenerateSshScript() { + // Construct request + const request = { + vm, + }; + + // Run request + const response = await clouddmsClient.generateSshScript(request); + console.log(response); + } + + callGenerateSshScript(); + // [END datamigration_v1_generated_DataMigrationService_GenerateSshScript_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-clouddms/v1/samples/generated/v1/data_migration_service.get_connection_profile.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_connection_profile.js new file mode 100644 index 00000000000..865c6a17eb7 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_connection_profile.js @@ -0,0 +1,61 @@ +// Copyright 2023 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(name) { + // [START datamigration_v1_generated_DataMigrationService_GetConnectionProfile_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. + */ + /** + * Required. Name of the connection profile resource to get. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callGetConnectionProfile() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await clouddmsClient.getConnectionProfile(request); + console.log(response); + } + + callGetConnectionProfile(); + // [END datamigration_v1_generated_DataMigrationService_GetConnectionProfile_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-clouddms/v1/samples/generated/v1/data_migration_service.get_conversion_workspace.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_conversion_workspace.js new file mode 100644 index 00000000000..9404cbd5bb9 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_conversion_workspace.js @@ -0,0 +1,61 @@ +// Copyright 2023 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(name) { + // [START datamigration_v1_generated_DataMigrationService_GetConversionWorkspace_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. + */ + /** + * Required. Name of the conversion workspace resource to get. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callGetConversionWorkspace() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await clouddmsClient.getConversionWorkspace(request); + console.log(response); + } + + callGetConversionWorkspace(); + // [END datamigration_v1_generated_DataMigrationService_GetConversionWorkspace_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-clouddms/v1/samples/generated/v1/data_migration_service.get_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_migration_job.js new file mode 100644 index 00000000000..22d782e83db --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2023 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(name) { + // [START datamigration_v1_generated_DataMigrationService_GetMigrationJob_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. + */ + /** + * Required. Name of the migration job resource to get. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callGetMigrationJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await clouddmsClient.getMigrationJob(request); + console.log(response); + } + + callGetMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_GetMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.get_private_connection.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_private_connection.js new file mode 100644 index 00000000000..599f19db773 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_private_connection.js @@ -0,0 +1,61 @@ +// Copyright 2023 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(name) { + // [START datamigration_v1_generated_DataMigrationService_GetPrivateConnection_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. + */ + /** + * Required. The name of the private connection to get. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callGetPrivateConnection() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await clouddmsClient.getPrivateConnection(request); + console.log(response); + } + + callGetPrivateConnection(); + // [END datamigration_v1_generated_DataMigrationService_GetPrivateConnection_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-clouddms/v1/samples/generated/v1/data_migration_service.import_mapping_rules.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.import_mapping_rules.js new file mode 100644 index 00000000000..3f36ebaa657 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.import_mapping_rules.js @@ -0,0 +1,77 @@ +// Copyright 2023 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(parent) { + // [START datamigration_v1_generated_DataMigrationService_ImportMappingRules_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. + */ + /** + * Required. Name of the conversion workspace resource to import the rules to + * in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + */ + // const parent = 'abc123' + /** + * The format of the rules content file. + */ + // const rulesFormat = {} + /** + * One or more rules files. + */ + // const rulesFiles = 1234 + /** + * Should the conversion workspace be committed automatically after the + * import operation. + */ + // const autoCommit = true + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callImportMappingRules() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await clouddmsClient.importMappingRules(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportMappingRules(); + // [END datamigration_v1_generated_DataMigrationService_ImportMappingRules_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-clouddms/v1/samples/generated/v1/data_migration_service.list_connection_profiles.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_connection_profiles.js new file mode 100644 index 00000000000..6ef17632e23 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_connection_profiles.js @@ -0,0 +1,93 @@ +// Copyright 2023 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(parent) { + // [START datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_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. + */ + /** + * Required. The parent which owns this collection of connection profiles. + */ + // const parent = 'abc123' + /** + * The maximum number of connection profiles to return. The service may return + * fewer than this value. If unspecified, at most 50 connection profiles will + * be returned. The maximum value is 1000; values above 1000 are coerced + * to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListConnectionProfiles` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListConnectionProfiles` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * A filter expression that filters connection profiles listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list connection profiles created this year by + * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + * also filter nested fields. For example, you could specify **mySql.username + * = %lt;my_username%gt;** to list all connection profiles configured to + * connect with a specific username. + */ + // const filter = 'abc123' + /** + * A comma-separated list of fields to order results according to. + */ + // const orderBy = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callListConnectionProfiles() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await clouddmsClient.listConnectionProfilesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConnectionProfiles(); + // [END datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_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-clouddms/v1/samples/generated/v1/data_migration_service.list_conversion_workspaces.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_conversion_workspaces.js new file mode 100644 index 00000000000..ebc40be958e --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_conversion_workspaces.js @@ -0,0 +1,88 @@ +// Copyright 2023 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(parent) { + // [START datamigration_v1_generated_DataMigrationService_ListConversionWorkspaces_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. + */ + /** + * Required. The parent which owns this collection of conversion workspaces. + */ + // const parent = 'abc123' + /** + * The maximum number of conversion workspaces to return. The service may + * return fewer than this value. If unspecified, at most 50 sets are returned. + */ + // const pageSize = 1234 + /** + * The nextPageToken value received in the previous call to + * conversionWorkspaces.list, used in the subsequent request to retrieve the + * next page of results. On first call this should be left blank. When + * paginating, all other parameters provided to conversionWorkspaces.list must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * A filter expression that filters conversion workspaces listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list conversion workspaces created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can + * also filter nested fields. For example, you could specify + * **source.version = "12.c.1"** to select all conversion workspaces with + * source database version equal to 12.c.1. + */ + // const filter = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callListConversionWorkspaces() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await clouddmsClient.listConversionWorkspacesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConversionWorkspaces(); + // [END datamigration_v1_generated_DataMigrationService_ListConversionWorkspaces_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-clouddms/v1/samples/generated/v1/data_migration_service.list_migration_jobs.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_migration_jobs.js new file mode 100644 index 00000000000..35f88731cbf --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_migration_jobs.js @@ -0,0 +1,95 @@ +// Copyright 2023 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(parent) { + // [START datamigration_v1_generated_DataMigrationService_ListMigrationJobs_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. + */ + /** + * Required. The parent which owns this collection of migrationJobs. + */ + // const parent = 'abc123' + /** + * The maximum number of migration jobs to return. The service may return + * fewer than this value. If unspecified, at most 50 migration jobs will be + * returned. The maximum value is 1000; values above 1000 are coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * The nextPageToken value received in the previous call to + * migrationJobs.list, used in the subsequent request to retrieve the next + * page of results. On first call this should be left blank. When paginating, + * all other parameters provided to migrationJobs.list must match the call + * that provided the page token. + */ + // const pageToken = 'abc123' + /** + * A filter expression that filters migration jobs listed in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, + * a number, or a boolean. The comparison operator must be + * either =, !=, >, or <. For example, list migration jobs created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + * You can also filter nested fields. For example, you could specify + * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + * jobs connecting through the specific SSH tunnel bastion. + */ + // const filter = 'abc123' + /** + * Sort the results based on the migration job name. + * Valid values are: "name", "name asc", and "name desc". + */ + // const orderBy = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callListMigrationJobs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await clouddmsClient.listMigrationJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMigrationJobs(); + // [END datamigration_v1_generated_DataMigrationService_ListMigrationJobs_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-clouddms/v1/samples/generated/v1/data_migration_service.list_private_connections.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_private_connections.js new file mode 100644 index 00000000000..c26d7f629f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_private_connections.js @@ -0,0 +1,90 @@ +// Copyright 2023 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(parent) { + // [START datamigration_v1_generated_DataMigrationService_ListPrivateConnections_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. + */ + /** + * Required. The parent that owns the collection of private connections. + */ + // const parent = 'abc123' + /** + * Maximum number of private connections to return. + * If unspecified, at most 50 private connections that are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. + */ + // const pageSize = 1234 + /** + * Page token received from a previous `ListPrivateConnections` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListPrivateConnections` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * A filter expression that filters private connections listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list private connections created this year by + * specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. + */ + // const filter = 'abc123' + /** + * Order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callListPrivateConnections() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await clouddmsClient.listPrivateConnectionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPrivateConnections(); + // [END datamigration_v1_generated_DataMigrationService_ListPrivateConnections_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-clouddms/v1/samples/generated/v1/data_migration_service.promote_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.promote_migration_job.js new file mode 100644 index 00000000000..3342de7a6b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.promote_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_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. + */ + /** + * Name of the migration job resource to promote. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callPromoteMigrationJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.promoteMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPromoteMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.restart_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.restart_migration_job.js new file mode 100644 index 00000000000..c2bf7a8643e --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.restart_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_RestartMigrationJob_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. + */ + /** + * Name of the migration job resource to restart. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callRestartMigrationJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.restartMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestartMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_RestartMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.resume_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.resume_migration_job.js new file mode 100644 index 00000000000..8e6ea31d728 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.resume_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_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. + */ + /** + * Name of the migration job resource to resume. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callResumeMigrationJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.resumeMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callResumeMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js new file mode 100644 index 00000000000..82543b62268 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js @@ -0,0 +1,62 @@ +// Copyright 2023 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(name) { + // [START datamigration_v1_generated_DataMigrationService_RollbackConversionWorkspace_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. + */ + /** + * Required. Name of the conversion workspace resource to roll back to. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callRollbackConversionWorkspace() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await clouddmsClient.rollbackConversionWorkspace(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRollbackConversionWorkspace(); + // [END datamigration_v1_generated_DataMigrationService_RollbackConversionWorkspace_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-clouddms/v1/samples/generated/v1/data_migration_service.search_background_jobs.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.search_background_jobs.js new file mode 100644 index 00000000000..13315d18fb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.search_background_jobs.js @@ -0,0 +1,79 @@ +// Copyright 2023 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(conversionWorkspace) { + // [START datamigration_v1_generated_DataMigrationService_SearchBackgroundJobs_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. + */ + /** + * Required. Name of the conversion workspace resource whose jobs are listed, + * in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + */ + // const conversionWorkspace = 'abc123' + /** + * Optional. Whether or not to return just the most recent job per job type, + */ + // const returnMostRecentPerJobType = true + /** + * Optional. The maximum number of jobs to return. The service may return + * fewer than this value. If unspecified, at most 100 jobs are + * returned. The maximum value is 100; values above 100 are coerced to + * 100. + */ + // const maxSize = 1234 + /** + * Optional. If provided, only returns jobs that completed until (not + * including) the given timestamp. + */ + // const completedUntilTime = {} + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callSearchBackgroundJobs() { + // Construct request + const request = { + conversionWorkspace, + }; + + // Run request + const response = await clouddmsClient.searchBackgroundJobs(request); + console.log(response); + } + + callSearchBackgroundJobs(); + // [END datamigration_v1_generated_DataMigrationService_SearchBackgroundJobs_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-clouddms/v1/samples/generated/v1/data_migration_service.seed_conversion_workspace.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.seed_conversion_workspace.js new file mode 100644 index 00000000000..00a5882ef2f --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.seed_conversion_workspace.js @@ -0,0 +1,76 @@ +// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_SeedConversionWorkspace_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. + */ + /** + * Name of the conversion workspace resource to seed with new database + * structure, in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + */ + // const name = 'abc123' + /** + * Should the conversion workspace be committed automatically after the + * seed operation. + */ + // const autoCommit = true + /** + * Fully qualified (Uri) name of the source connection profile. + */ + // const sourceConnectionProfile = 'abc123' + /** + * Fully qualified (Uri) name of the destination connection profile. + */ + // const destinationConnectionProfile = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callSeedConversionWorkspace() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.seedConversionWorkspace(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSeedConversionWorkspace(); + // [END datamigration_v1_generated_DataMigrationService_SeedConversionWorkspace_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-clouddms/v1/samples/generated/v1/data_migration_service.start_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.start_migration_job.js new file mode 100644 index 00000000000..2fffef3d17f --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.start_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_StartMigrationJob_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. + */ + /** + * Name of the migration job resource to start. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callStartMigrationJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.startMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStartMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_StartMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.stop_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.stop_migration_job.js new file mode 100644 index 00000000000..c6c16e1194f --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.stop_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_StopMigrationJob_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. + */ + /** + * Name of the migration job resource to stop. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callStopMigrationJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.stopMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStopMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_StopMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.update_connection_profile.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_connection_profile.js new file mode 100644 index 00000000000..5cd2c736cdc --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_connection_profile.js @@ -0,0 +1,88 @@ +// Copyright 2023 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, connectionProfile) { + // [START datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_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. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the conversion workspace resource. + */ + // const updateMask = {} + /** + * Required. The connection profile parameters to update. + */ + // const connectionProfile = {} + /** + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. + * It is recommended to always set this value to a UUID. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + /** + * Optional. Only validate the connection profile, but don't update any + * resources. The default is false. Only supported for Oracle connection + * profiles. + */ + // const validateOnly = true + /** + * Optional. Update the connection profile without validating it. + * The default is false. + * Only supported for Oracle connection profiles. + */ + // const skipValidation = true + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callUpdateConnectionProfile() { + // Construct request + const request = { + updateMask, + connectionProfile, + }; + + // Run request + const [operation] = await clouddmsClient.updateConnectionProfile(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateConnectionProfile(); + // [END datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_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-clouddms/v1/samples/generated/v1/data_migration_service.update_conversion_workspace.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_conversion_workspace.js new file mode 100644 index 00000000000..8f17bbddc1a --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_conversion_workspace.js @@ -0,0 +1,76 @@ +// Copyright 2023 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, conversionWorkspace) { + // [START datamigration_v1_generated_DataMigrationService_UpdateConversionWorkspace_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. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the conversion workspace resource. + */ + // const updateMask = {} + /** + * Required. The conversion workspace parameters to update. + */ + // const conversionWorkspace = {} + /** + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * It is recommended to always set this value to a UUID. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callUpdateConversionWorkspace() { + // Construct request + const request = { + updateMask, + conversionWorkspace, + }; + + // Run request + const [operation] = await clouddmsClient.updateConversionWorkspace(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateConversionWorkspace(); + // [END datamigration_v1_generated_DataMigrationService_UpdateConversionWorkspace_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-clouddms/v1/samples/generated/v1/data_migration_service.update_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_migration_job.js new file mode 100644 index 00000000000..894a974f424 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_migration_job.js @@ -0,0 +1,76 @@ +// Copyright 2023 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, migrationJob) { + // [START datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_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. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the conversion workspace resource. + */ + // const updateMask = {} + /** + * Required. The migration job parameters to update. + */ + // const migrationJob = {} + /** + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * It is recommended to always set this value to a UUID. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callUpdateMigrationJob() { + // Construct request + const request = { + updateMask, + migrationJob, + }; + + // Run request + const [operation] = await clouddmsClient.updateMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.verify_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.verify_migration_job.js new file mode 100644 index 00000000000..3748fda9e9d --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.verify_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_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. + */ + /** + * Name of the migration job resource to verify. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callVerifyMigrationJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.verifyMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callVerifyMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_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-clouddms/v1/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json new file mode 100644 index 00000000000..9e75971c80c --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json @@ -0,0 +1,1739 @@ +{ + "clientLibrary": { + "name": "nodejs-clouddms", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.clouddms.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ListMigrationJobs_async", + "title": "DataMigrationService listMigrationJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists migration jobs in a given project and location.", + "canonical": true, + "file": "data_migration_service.list_migration_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMigrationJobs", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListMigrationJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.ListMigrationJobsResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ListMigrationJobs", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListMigrationJobs", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_GetMigrationJob_async", + "title": "DataMigrationService getMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single migration job.", + "canonical": true, + "file": "data_migration_service.get_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.MigrationJob", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "GetMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async", + "title": "DataMigrationService createMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Creates a new migration job in a given project and location.", + "canonical": true, + "file": "data_migration_service.create_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateMigrationJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "migration_job_id", + "type": "TYPE_STRING" + }, + { + "name": "migration_job", + "type": ".google.cloud.clouddms.v1.MigrationJob" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "CreateMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async", + "title": "DataMigrationService updateMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single migration job.", + "canonical": true, + "file": "data_migration_service.update_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateMigrationJob", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "migration_job", + "type": ".google.cloud.clouddms.v1.MigrationJob" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "UpdateMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async", + "title": "DataMigrationService deleteMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single migration job.", + "canonical": true, + "file": "data_migration_service.delete_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "DeleteMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_StartMigrationJob_async", + "title": "DataMigrationService startMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Start an already created migration job.", + "canonical": true, + "file": "data_migration_service.start_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.StartMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "StartMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.StartMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_StopMigrationJob_async", + "title": "DataMigrationService stopMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Stops a running migration job.", + "canonical": true, + "file": "data_migration_service.stop_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.StopMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "StopMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.StopMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async", + "title": "DataMigrationService resumeMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase).", + "canonical": true, + "file": "data_migration_service.resume_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResumeMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ResumeMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ResumeMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ResumeMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async", + "title": "DataMigrationService promoteMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database.", + "canonical": true, + "file": "data_migration_service.promote_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PromoteMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.PromoteMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "PromoteMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.PromoteMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async", + "title": "DataMigrationService verifyMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met.", + "canonical": true, + "file": "data_migration_service.verify_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "VerifyMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.VerifyMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "VerifyMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.VerifyMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async", + "title": "DataMigrationService restartMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch.", + "canonical": true, + "file": "data_migration_service.restart_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestartMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.RestartMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "RestartMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.RestartMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_GenerateSshScript_async", + "title": "DataMigrationService generateSshScript Sample", + "origin": "API_DEFINITION", + "description": " Generate a SSH configuration script to configure the reverse SSH connectivity.", + "canonical": true, + "file": "data_migration_service.generate_ssh_script.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateSshScript", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GenerateSshScript", + "async": true, + "parameters": [ + { + "name": "migration_job", + "type": "TYPE_STRING" + }, + { + "name": "vm", + "type": "TYPE_STRING" + }, + { + "name": "vm_creation_config", + "type": ".google.cloud.clouddms.v1.VmCreationConfig" + }, + { + "name": "vm_selection_config", + "type": ".google.cloud.clouddms.v1.VmSelectionConfig" + }, + { + "name": "vm_port", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.clouddms.v1.SshScript", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "GenerateSshScript", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GenerateSshScript", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_async", + "title": "DataMigrationService listConnectionProfiles Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a list of all connection profiles in a given project and location.", + "canonical": true, + "file": "data_migration_service.list_connection_profiles.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConnectionProfiles", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListConnectionProfiles", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.ListConnectionProfilesResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ListConnectionProfiles", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListConnectionProfiles", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_GetConnectionProfile_async", + "title": "DataMigrationService getConnectionProfile Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single connection profile.", + "canonical": true, + "file": "data_migration_service.get_connection_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetConnectionProfile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.ConnectionProfile", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "GetConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetConnectionProfile", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async", + "title": "DataMigrationService createConnectionProfile Sample", + "origin": "API_DEFINITION", + "description": " Creates a new connection profile in a given project and location.", + "canonical": true, + "file": "data_migration_service.create_connection_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateConnectionProfile", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "connection_profile_id", + "type": "TYPE_STRING" + }, + { + "name": "connection_profile", + "type": ".google.cloud.clouddms.v1.ConnectionProfile" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "skip_validation", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "CreateConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateConnectionProfile", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async", + "title": "DataMigrationService updateConnectionProfile Sample", + "origin": "API_DEFINITION", + "description": " Update the configuration of a single connection profile.", + "canonical": true, + "file": "data_migration_service.update_connection_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateConnectionProfile", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "connection_profile", + "type": ".google.cloud.clouddms.v1.ConnectionProfile" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "skip_validation", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "UpdateConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateConnectionProfile", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async", + "title": "DataMigrationService deleteConnectionProfile Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Database Migration Service connection profile. A connection profile can only be deleted if it is not in use by any active migration jobs.", + "canonical": true, + "file": "data_migration_service.delete_connection_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteConnectionProfile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "DeleteConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteConnectionProfile", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_CreatePrivateConnection_async", + "title": "DataMigrationService createPrivateConnection Sample", + "origin": "API_DEFINITION", + "description": " Creates a new private connection in a given project and location.", + "canonical": true, + "file": "data_migration_service.create_private_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePrivateConnection", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreatePrivateConnection", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "private_connection_id", + "type": "TYPE_STRING" + }, + { + "name": "private_connection", + "type": ".google.cloud.clouddms.v1.PrivateConnection" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "skip_validation", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "CreatePrivateConnection", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreatePrivateConnection", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_GetPrivateConnection_async", + "title": "DataMigrationService getPrivateConnection Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single private connection.", + "canonical": true, + "file": "data_migration_service.get_private_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPrivateConnection", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetPrivateConnection", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.PrivateConnection", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "GetPrivateConnection", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetPrivateConnection", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ListPrivateConnections_async", + "title": "DataMigrationService listPrivateConnections Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a list of private connections in a given project and location.", + "canonical": true, + "file": "data_migration_service.list_private_connections.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPrivateConnections", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListPrivateConnections", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.ListPrivateConnectionsResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ListPrivateConnections", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListPrivateConnections", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_DeletePrivateConnection_async", + "title": "DataMigrationService deletePrivateConnection Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Database Migration Service private connection.", + "canonical": true, + "file": "data_migration_service.delete_private_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePrivateConnection", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeletePrivateConnection", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "DeletePrivateConnection", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeletePrivateConnection", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_GetConversionWorkspace_async", + "title": "DataMigrationService getConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single conversion workspace.", + "canonical": true, + "file": "data_migration_service.get_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.ConversionWorkspace", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "GetConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ListConversionWorkspaces_async", + "title": "DataMigrationService listConversionWorkspaces Sample", + "origin": "API_DEFINITION", + "description": " Lists conversion workspaces in a given project and location.", + "canonical": true, + "file": "data_migration_service.list_conversion_workspaces.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConversionWorkspaces", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListConversionWorkspaces", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.ListConversionWorkspacesResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ListConversionWorkspaces", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListConversionWorkspaces", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_CreateConversionWorkspace_async", + "title": "DataMigrationService createConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Creates a new conversion workspace in a given project and location.", + "canonical": true, + "file": "data_migration_service.create_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "conversion_workspace_id", + "type": "TYPE_STRING" + }, + { + "name": "conversion_workspace", + "type": ".google.cloud.clouddms.v1.ConversionWorkspace" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "CreateConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_UpdateConversionWorkspace_async", + "title": "DataMigrationService updateConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single conversion workspace.", + "canonical": true, + "file": "data_migration_service.update_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "conversion_workspace", + "type": ".google.cloud.clouddms.v1.ConversionWorkspace" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "UpdateConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_DeleteConversionWorkspace_async", + "title": "DataMigrationService deleteConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single conversion workspace.", + "canonical": true, + "file": "data_migration_service.delete_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "DeleteConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_SeedConversionWorkspace_async", + "title": "DataMigrationService seedConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Imports a snapshot of the source database into the conversion workspace.", + "canonical": true, + "file": "data_migration_service.seed_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SeedConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.SeedConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "auto_commit", + "type": "TYPE_BOOL" + }, + { + "name": "source_connection_profile", + "type": "TYPE_STRING" + }, + { + "name": "destination_connection_profile", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "SeedConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.SeedConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ImportMappingRules_async", + "title": "DataMigrationService importMappingRules Sample", + "origin": "API_DEFINITION", + "description": " Imports the mapping rules for a given conversion workspace. Supports various formats of external rules files.", + "canonical": true, + "file": "data_migration_service.import_mapping_rules.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportMappingRules", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ImportMappingRules", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "rules_format", + "type": ".google.cloud.clouddms.v1.ImportRulesFileFormat" + }, + { + "name": "rules_files", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "auto_commit", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ImportMappingRules", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ImportMappingRules", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ConvertConversionWorkspace_async", + "title": "DataMigrationService convertConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Creates a draft tree schema for the destination database.", + "canonical": true, + "file": "data_migration_service.convert_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ConvertConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ConvertConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "auto_commit", + "type": "TYPE_BOOL" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ConvertConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ConvertConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_CommitConversionWorkspace_async", + "title": "DataMigrationService commitConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Marks all the data in the conversion workspace as committed.", + "canonical": true, + "file": "data_migration_service.commit_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CommitConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CommitConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "commit_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "CommitConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CommitConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_RollbackConversionWorkspace_async", + "title": "DataMigrationService rollbackConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Rolls back a conversion workspace to the last committed snapshot.", + "canonical": true, + "file": "data_migration_service.rollback_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.RollbackConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "RollbackConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.RollbackConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ApplyConversionWorkspace_async", + "title": "DataMigrationService applyConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Applies draft tree onto a specific destination database.", + "canonical": true, + "file": "data_migration_service.apply_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApplyConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ApplyConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "connection_profile", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ApplyConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ApplyConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_DescribeDatabaseEntities_async", + "title": "DataMigrationService describeDatabaseEntities Sample", + "origin": "API_DEFINITION", + "description": " Describes the database entities tree for a specific conversion workspace and a specific tree type. Database entities are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are simple data objects describing the structure of the client database.", + "canonical": true, + "file": "data_migration_service.describe_database_entities.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 89, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DescribeDatabaseEntities", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DescribeDatabaseEntities", + "async": true, + "parameters": [ + { + "name": "conversion_workspace", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "tree", + "type": ".google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType" + }, + { + "name": "uncommitted", + "type": "TYPE_BOOL" + }, + { + "name": "commit_id", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "DescribeDatabaseEntities", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DescribeDatabaseEntities", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_SearchBackgroundJobs_async", + "title": "DataMigrationService searchBackgroundJobs Sample", + "origin": "API_DEFINITION", + "description": " Searches/lists the background jobs for a specific conversion workspace. The background jobs are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are a way to expose the data plane jobs log.", + "canonical": true, + "file": "data_migration_service.search_background_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchBackgroundJobs", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.SearchBackgroundJobs", + "async": true, + "parameters": [ + { + "name": "conversion_workspace", + "type": "TYPE_STRING" + }, + { + "name": "return_most_recent_per_job_type", + "type": "TYPE_BOOL" + }, + { + "name": "max_size", + "type": "TYPE_INT32" + }, + { + "name": "completed_until_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.clouddms.v1.SearchBackgroundJobsResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "SearchBackgroundJobs", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.SearchBackgroundJobs", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_DescribeConversionWorkspaceRevisions_async", + "title": "DataMigrationService describeConversionWorkspaceRevisions Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a list of committed revisions of a specific conversion workspace.", + "canonical": true, + "file": "data_migration_service.describe_conversion_workspace_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DescribeConversionWorkspaceRevisions", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DescribeConversionWorkspaceRevisions", + "async": true, + "parameters": [ + { + "name": "conversion_workspace", + "type": "TYPE_STRING" + }, + { + "name": "commit_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "DescribeConversionWorkspaceRevisions", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DescribeConversionWorkspaceRevisions", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_FetchStaticIps_async", + "title": "DataMigrationService fetchStaticIps Sample", + "origin": "API_DEFINITION", + "description": " Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.", + "canonical": true, + "file": "data_migration_service.fetch_static_ips.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchStaticIps", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.FetchStaticIps", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.FetchStaticIpsResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "FetchStaticIps", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.FetchStaticIps", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/src/index.ts b/owl-bot-staging/google-cloud-clouddms/v1/src/index.ts new file mode 100644 index 00000000000..ba8110ea37e --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2023 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 DataMigrationServiceClient = v1.DataMigrationServiceClient; +type DataMigrationServiceClient = v1.DataMigrationServiceClient; +export {v1, DataMigrationServiceClient}; +export default {v1, DataMigrationServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client.ts b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client.ts new file mode 100644 index 00000000000..57e90891f14 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client.ts @@ -0,0 +1,5338 @@ +// Copyright 2023 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, IamClient, IamProtos, LocationsClient, LocationProtos} 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/data_migration_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './data_migration_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Database Migration service + * @class + * @memberof v1 + */ +export class DataMigrationServiceClient { + 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + dataMigrationServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataMigrationServiceClient. + * + * @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 DataMigrationServiceClient({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 DataMigrationServiceClient; + 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); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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 = { + connectionProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/connectionProfiles/{connection_profile}' + ), + conversionWorkspacePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + migrationJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/migrationJobs/{migration_job}' + ), + privateConnectionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/privateConnections/{private_connection}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // 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 = { + listMigrationJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'migrationJobs'), + listConnectionProfiles: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'connectionProfiles'), + listPrivateConnections: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'privateConnections'), + listConversionWorkspaces: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'conversionWorkspaces'), + describeDatabaseEntities: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databaseEntities'), + fetchStaticIps: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'staticIps') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/connectionProfiles/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/migrationJobs/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/conversionWorkspaces/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/privateConnections/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/connectionProfiles/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/migrationJobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/conversionWorkspaces/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/privateConnections/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/migrationJobs/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/connectionProfiles/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/conversionWorkspaces/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/privateConnections/*}:testIamPermissions',body: '*',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{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 createMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; + const createMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const updateMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; + const updateMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const deleteMigrationJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const startMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; + const startMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const stopMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; + const stopMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const resumeMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; + const resumeMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const promoteMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; + const promoteMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const verifyMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; + const verifyMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const restartMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; + const restartMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const createConnectionProfileResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConnectionProfile') as gax.protobuf.Type; + const createConnectionProfileMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const updateConnectionProfileResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConnectionProfile') as gax.protobuf.Type; + const updateConnectionProfileMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const deleteConnectionProfileResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteConnectionProfileMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const createPrivateConnectionResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.PrivateConnection') as gax.protobuf.Type; + const createPrivateConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const deletePrivateConnectionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deletePrivateConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const createConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; + const createConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const updateConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; + const updateConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const deleteConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const seedConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; + const seedConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const importMappingRulesResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; + const importMappingRulesMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const convertConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; + const convertConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const commitConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; + const commitConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const rollbackConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; + const rollbackConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + const applyConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; + const applyConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createMigrationJobResponse.decode.bind(createMigrationJobResponse), + createMigrationJobMetadata.decode.bind(createMigrationJobMetadata)), + updateMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateMigrationJobResponse.decode.bind(updateMigrationJobResponse), + updateMigrationJobMetadata.decode.bind(updateMigrationJobMetadata)), + deleteMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteMigrationJobResponse.decode.bind(deleteMigrationJobResponse), + deleteMigrationJobMetadata.decode.bind(deleteMigrationJobMetadata)), + startMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + startMigrationJobResponse.decode.bind(startMigrationJobResponse), + startMigrationJobMetadata.decode.bind(startMigrationJobMetadata)), + stopMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + stopMigrationJobResponse.decode.bind(stopMigrationJobResponse), + stopMigrationJobMetadata.decode.bind(stopMigrationJobMetadata)), + resumeMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + resumeMigrationJobResponse.decode.bind(resumeMigrationJobResponse), + resumeMigrationJobMetadata.decode.bind(resumeMigrationJobMetadata)), + promoteMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + promoteMigrationJobResponse.decode.bind(promoteMigrationJobResponse), + promoteMigrationJobMetadata.decode.bind(promoteMigrationJobMetadata)), + verifyMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + verifyMigrationJobResponse.decode.bind(verifyMigrationJobResponse), + verifyMigrationJobMetadata.decode.bind(verifyMigrationJobMetadata)), + restartMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restartMigrationJobResponse.decode.bind(restartMigrationJobResponse), + restartMigrationJobMetadata.decode.bind(restartMigrationJobMetadata)), + createConnectionProfile: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createConnectionProfileResponse.decode.bind(createConnectionProfileResponse), + createConnectionProfileMetadata.decode.bind(createConnectionProfileMetadata)), + updateConnectionProfile: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateConnectionProfileResponse.decode.bind(updateConnectionProfileResponse), + updateConnectionProfileMetadata.decode.bind(updateConnectionProfileMetadata)), + deleteConnectionProfile: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteConnectionProfileResponse.decode.bind(deleteConnectionProfileResponse), + deleteConnectionProfileMetadata.decode.bind(deleteConnectionProfileMetadata)), + createPrivateConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createPrivateConnectionResponse.decode.bind(createPrivateConnectionResponse), + createPrivateConnectionMetadata.decode.bind(createPrivateConnectionMetadata)), + deletePrivateConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deletePrivateConnectionResponse.decode.bind(deletePrivateConnectionResponse), + deletePrivateConnectionMetadata.decode.bind(deletePrivateConnectionMetadata)), + createConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createConversionWorkspaceResponse.decode.bind(createConversionWorkspaceResponse), + createConversionWorkspaceMetadata.decode.bind(createConversionWorkspaceMetadata)), + updateConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateConversionWorkspaceResponse.decode.bind(updateConversionWorkspaceResponse), + updateConversionWorkspaceMetadata.decode.bind(updateConversionWorkspaceMetadata)), + deleteConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteConversionWorkspaceResponse.decode.bind(deleteConversionWorkspaceResponse), + deleteConversionWorkspaceMetadata.decode.bind(deleteConversionWorkspaceMetadata)), + seedConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + seedConversionWorkspaceResponse.decode.bind(seedConversionWorkspaceResponse), + seedConversionWorkspaceMetadata.decode.bind(seedConversionWorkspaceMetadata)), + importMappingRules: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importMappingRulesResponse.decode.bind(importMappingRulesResponse), + importMappingRulesMetadata.decode.bind(importMappingRulesMetadata)), + convertConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + convertConversionWorkspaceResponse.decode.bind(convertConversionWorkspaceResponse), + convertConversionWorkspaceMetadata.decode.bind(convertConversionWorkspaceMetadata)), + commitConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + commitConversionWorkspaceResponse.decode.bind(commitConversionWorkspaceResponse), + commitConversionWorkspaceMetadata.decode.bind(commitConversionWorkspaceMetadata)), + rollbackConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + rollbackConversionWorkspaceResponse.decode.bind(rollbackConversionWorkspaceResponse), + rollbackConversionWorkspaceMetadata.decode.bind(rollbackConversionWorkspaceMetadata)), + applyConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + applyConversionWorkspaceResponse.decode.bind(applyConversionWorkspaceResponse), + applyConversionWorkspaceMetadata.decode.bind(applyConversionWorkspaceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.clouddms.v1.DataMigrationService', 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.dataMigrationServiceStub) { + return this.dataMigrationServiceStub; + } + + // Put together the "service stub" for + // google.cloud.clouddms.v1.DataMigrationService. + this.dataMigrationServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.clouddms.v1.DataMigrationService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.clouddms.v1.DataMigrationService, + 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 dataMigrationServiceStubMethods = + ['listMigrationJobs', 'getMigrationJob', 'createMigrationJob', 'updateMigrationJob', 'deleteMigrationJob', 'startMigrationJob', 'stopMigrationJob', 'resumeMigrationJob', 'promoteMigrationJob', 'verifyMigrationJob', 'restartMigrationJob', 'generateSshScript', 'listConnectionProfiles', 'getConnectionProfile', 'createConnectionProfile', 'updateConnectionProfile', 'deleteConnectionProfile', 'createPrivateConnection', 'getPrivateConnection', 'listPrivateConnections', 'deletePrivateConnection', 'getConversionWorkspace', 'listConversionWorkspaces', 'createConversionWorkspace', 'updateConversionWorkspace', 'deleteConversionWorkspace', 'seedConversionWorkspace', 'importMappingRules', 'convertConversionWorkspace', 'commitConversionWorkspace', 'rollbackConversionWorkspace', 'applyConversionWorkspace', 'describeDatabaseEntities', 'searchBackgroundJobs', 'describeConversionWorkspaceRevisions', 'fetchStaticIps']; + for (const methodName of dataMigrationServiceStubMethods) { + const callPromise = this.dataMigrationServiceStub.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.dataMigrationServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'datamigration.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 'datamigration.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 -- + // ------------------- +/** + * Gets details of a single migration job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the migration job resource to get. + * @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 {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob}. + * 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/data_migration_service.get_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_GetMigrationJob_async + */ + getMigrationJob( + request?: protos.google.cloud.clouddms.v1.IGetMigrationJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IGetMigrationJobRequest|undefined, {}|undefined + ]>; + getMigrationJob( + request: protos.google.cloud.clouddms.v1.IGetMigrationJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IGetMigrationJobRequest|null|undefined, + {}|null|undefined>): void; + getMigrationJob( + request: protos.google.cloud.clouddms.v1.IGetMigrationJobRequest, + callback: Callback< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IGetMigrationJobRequest|null|undefined, + {}|null|undefined>): void; + getMigrationJob( + request?: protos.google.cloud.clouddms.v1.IGetMigrationJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IGetMigrationJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IGetMigrationJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IGetMigrationJobRequest|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.getMigrationJob(request, options, callback); + } +/** + * Generate a SSH configuration script to configure the reverse SSH + * connectivity. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.migrationJob + * Name of the migration job resource to generate the SSH script. + * @param {string} request.vm + * Required. Bastion VM Instance name to use or to create. + * @param {google.cloud.clouddms.v1.VmCreationConfig} request.vmCreationConfig + * The VM creation configuration + * @param {google.cloud.clouddms.v1.VmSelectionConfig} request.vmSelectionConfig + * The VM selection configuration + * @param {number} request.vmPort + * The port that will be open on the bastion host. + * @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 {@link google.cloud.clouddms.v1.SshScript | SshScript}. + * 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/data_migration_service.generate_ssh_script.js + * region_tag:datamigration_v1_generated_DataMigrationService_GenerateSshScript_async + */ + generateSshScript( + request?: protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.clouddms.v1.ISshScript, + protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest|undefined, {}|undefined + ]>; + generateSshScript( + request: protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.clouddms.v1.ISshScript, + protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest|null|undefined, + {}|null|undefined>): void; + generateSshScript( + request: protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest, + callback: Callback< + protos.google.cloud.clouddms.v1.ISshScript, + protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest|null|undefined, + {}|null|undefined>): void; + generateSshScript( + request?: protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.clouddms.v1.ISshScript, + protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.clouddms.v1.ISshScript, + protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.clouddms.v1.ISshScript, + protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest|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({ + 'migration_job': request.migrationJob ?? '', + }); + this.initialize(); + return this.innerApiCalls.generateSshScript(request, options, callback); + } +/** + * Gets details of a single connection profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the connection profile resource to get. + * @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 {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile}. + * 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/data_migration_service.get_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_GetConnectionProfile_async + */ + getConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest|undefined, {}|undefined + ]>; + getConnectionProfile( + request: protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest|null|undefined, + {}|null|undefined>): void; + getConnectionProfile( + request: protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest, + callback: Callback< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest|null|undefined, + {}|null|undefined>): void; + getConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest|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.getConnectionProfile(request, options, callback); + } +/** + * Gets details of a single private connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the private connection to get. + * @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 {@link google.cloud.clouddms.v1.PrivateConnection | PrivateConnection}. + * 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/data_migration_service.get_private_connection.js + * region_tag:datamigration_v1_generated_DataMigrationService_GetPrivateConnection_async + */ + getPrivateConnection( + request?: protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest|undefined, {}|undefined + ]>; + getPrivateConnection( + request: protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest|null|undefined, + {}|null|undefined>): void; + getPrivateConnection( + request: protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest, + callback: Callback< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest|null|undefined, + {}|null|undefined>): void; + getPrivateConnection( + request?: protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest|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.getPrivateConnection(request, options, callback); + } +/** + * Gets details of a single conversion workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the conversion workspace resource to get. + * @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 {@link google.cloud.clouddms.v1.ConversionWorkspace | ConversionWorkspace}. + * 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/data_migration_service.get_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_GetConversionWorkspace_async + */ + getConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest|undefined, {}|undefined + ]>; + getConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + getConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, + callback: Callback< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + getConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest|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.getConversionWorkspace(request, options, callback); + } +/** + * Searches/lists the background jobs for a specific + * conversion workspace. + * + * The background jobs are not resources like conversion workspaces or + * mapping rules, and they can't be created, updated or deleted. + * Instead, they are a way to expose the data plane jobs log. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.conversionWorkspace + * Required. Name of the conversion workspace resource whose jobs are listed, + * in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {boolean} [request.returnMostRecentPerJobType] + * Optional. Whether or not to return just the most recent job per job type, + * @param {number} [request.maxSize] + * Optional. The maximum number of jobs to return. The service may return + * fewer than this value. If unspecified, at most 100 jobs are + * returned. The maximum value is 100; values above 100 are coerced to + * 100. + * @param {google.protobuf.Timestamp} [request.completedUntilTime] + * Optional. If provided, only returns jobs that completed until (not + * including) the given timestamp. + * @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 {@link google.cloud.clouddms.v1.SearchBackgroundJobsResponse | SearchBackgroundJobsResponse}. + * 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/data_migration_service.search_background_jobs.js + * region_tag:datamigration_v1_generated_DataMigrationService_SearchBackgroundJobs_async + */ + searchBackgroundJobs( + request?: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest|undefined, {}|undefined + ]>; + searchBackgroundJobs( + request: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest|null|undefined, + {}|null|undefined>): void; + searchBackgroundJobs( + request: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, + callback: Callback< + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest|null|undefined, + {}|null|undefined>): void; + searchBackgroundJobs( + request?: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest|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({ + 'conversion_workspace': request.conversionWorkspace ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchBackgroundJobs(request, options, callback); + } +/** + * Retrieves a list of committed revisions of a specific conversion + * workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.conversionWorkspace + * Required. Name of the conversion workspace resource whose revisions are + * listed. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {string} [request.commitId] + * Optional. Optional filter to request a specific commit ID. + * @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 {@link google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse | DescribeConversionWorkspaceRevisionsResponse}. + * 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/data_migration_service.describe_conversion_workspace_revisions.js + * region_tag:datamigration_v1_generated_DataMigrationService_DescribeConversionWorkspaceRevisions_async + */ + describeConversionWorkspaceRevisions( + request?: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest|undefined, {}|undefined + ]>; + describeConversionWorkspaceRevisions( + request: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest|null|undefined, + {}|null|undefined>): void; + describeConversionWorkspaceRevisions( + request: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, + callback: Callback< + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest|null|undefined, + {}|null|undefined>): void; + describeConversionWorkspaceRevisions( + request?: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest|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({ + 'conversion_workspace': request.conversionWorkspace ?? '', + }); + this.initialize(); + return this.innerApiCalls.describeConversionWorkspaceRevisions(request, options, callback); + } + +/** + * Creates a new migration job in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of migration jobs. + * @param {string} request.migrationJobId + * Required. The ID of the instance to create. + * @param {google.cloud.clouddms.v1.MigrationJob} request.migrationJob + * Required. Represents a [migration + * job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) + * object. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @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/data_migration_service.create_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async + */ + createMigrationJob( + request?: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createMigrationJob( + request: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMigrationJob( + request: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMigrationJob( + request?: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, + 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.createMigrationJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createMigrationJob()`. + * @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/data_migration_service.create_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async + */ + async checkCreateMigrationJobProgress(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.createMigrationJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single migration job. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the conversion workspace resource. + * @param {google.cloud.clouddms.v1.MigrationJob} request.migrationJob + * Required. The migration job parameters to update. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @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/data_migration_service.update_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async + */ + updateMigrationJob( + request?: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateMigrationJob( + request: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateMigrationJob( + request: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateMigrationJob( + request?: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, + 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({ + 'migration_job.name': request.migrationJob!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateMigrationJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateMigrationJob()`. + * @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/data_migration_service.update_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async + */ + async checkUpdateMigrationJobProgress(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.updateMigrationJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single migration job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the migration job resource to delete. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {boolean} request.force + * The destination CloudSQL connection profile is always deleted with the + * migration job. In case of force delete, the destination CloudSQL replica + * database is also deleted. + * @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/data_migration_service.delete_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async + */ + deleteMigrationJob( + request?: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteMigrationJob( + request: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMigrationJob( + request: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMigrationJob( + request?: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, + 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.deleteMigrationJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteMigrationJob()`. + * @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/data_migration_service.delete_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async + */ + async checkDeleteMigrationJobProgress(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.deleteMigrationJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Start an already created migration job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the migration job resource to start. + * @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/data_migration_service.start_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_StartMigrationJob_async + */ + startMigrationJob( + request?: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + startMigrationJob( + request: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + startMigrationJob( + request: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + startMigrationJob( + request?: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, + 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.startMigrationJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `startMigrationJob()`. + * @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/data_migration_service.start_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_StartMigrationJob_async + */ + async checkStartMigrationJobProgress(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.startMigrationJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Stops a running migration job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the migration job resource to stop. + * @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/data_migration_service.stop_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_StopMigrationJob_async + */ + stopMigrationJob( + request?: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + stopMigrationJob( + request: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + stopMigrationJob( + request: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + stopMigrationJob( + request?: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, + 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.stopMigrationJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `stopMigrationJob()`. + * @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/data_migration_service.stop_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_StopMigrationJob_async + */ + async checkStopMigrationJobProgress(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.stopMigrationJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Resume a migration job that is currently stopped and is resumable (was + * stopped during CDC phase). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the migration job resource to resume. + * @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/data_migration_service.resume_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async + */ + resumeMigrationJob( + request?: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + resumeMigrationJob( + request: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + resumeMigrationJob( + request: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + resumeMigrationJob( + request?: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, + 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.resumeMigrationJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `resumeMigrationJob()`. + * @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/data_migration_service.resume_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async + */ + async checkResumeMigrationJobProgress(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.resumeMigrationJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Promote a migration job, stopping replication to the destination and + * promoting the destination to be a standalone database. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the migration job resource to promote. + * @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/data_migration_service.promote_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async + */ + promoteMigrationJob( + request?: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + promoteMigrationJob( + request: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + promoteMigrationJob( + request: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + promoteMigrationJob( + request?: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, + 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.promoteMigrationJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `promoteMigrationJob()`. + * @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/data_migration_service.promote_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async + */ + async checkPromoteMigrationJobProgress(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.promoteMigrationJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Verify a migration job, making sure the destination can reach the source + * and that all configuration and prerequisites are met. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the migration job resource to verify. + * @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/data_migration_service.verify_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async + */ + verifyMigrationJob( + request?: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + verifyMigrationJob( + request: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + verifyMigrationJob( + request: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + verifyMigrationJob( + request?: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, + 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.verifyMigrationJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `verifyMigrationJob()`. + * @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/data_migration_service.verify_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async + */ + async checkVerifyMigrationJobProgress(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.verifyMigrationJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Restart a stopped or failed migration job, resetting the destination + * instance to its original state and starting the migration process from + * scratch. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the migration job resource to restart. + * @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/data_migration_service.restart_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async + */ + restartMigrationJob( + request?: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restartMigrationJob( + request: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartMigrationJob( + request: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartMigrationJob( + request?: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, + 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.restartMigrationJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `restartMigrationJob()`. + * @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/data_migration_service.restart_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async + */ + async checkRestartMigrationJobProgress(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.restartMigrationJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new connection profile in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of connection profiles. + * @param {string} request.connectionProfileId + * Required. The connection profile identifier. + * @param {google.cloud.clouddms.v1.ConnectionProfile} request.connectionProfile + * Required. The create request body including the connection profile data + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the connection profile, but don't create any + * resources. The default is false. Only supported for Oracle connection + * profiles. + * @param {boolean} [request.skipValidation] + * Optional. Create the connection profile without validating it. + * The default is false. + * Only supported for Oracle connection profiles. + * @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/data_migration_service.create_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async + */ + createConnectionProfile( + request?: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createConnectionProfile( + request: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createConnectionProfile( + request: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createConnectionProfile( + request?: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, + 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.createConnectionProfile(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createConnectionProfile()`. + * @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/data_migration_service.create_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async + */ + async checkCreateConnectionProfileProgress(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.createConnectionProfile, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Update the configuration of a single connection profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the conversion workspace resource. + * @param {google.cloud.clouddms.v1.ConnectionProfile} request.connectionProfile + * Required. The connection profile parameters to update. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the connection profile, but don't update any + * resources. The default is false. Only supported for Oracle connection + * profiles. + * @param {boolean} [request.skipValidation] + * Optional. Update the connection profile without validating it. + * The default is false. + * Only supported for Oracle connection profiles. + * @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/data_migration_service.update_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async + */ + updateConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateConnectionProfile( + request: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateConnectionProfile( + request: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + 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({ + 'connection_profile.name': request.connectionProfile!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateConnectionProfile(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateConnectionProfile()`. + * @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/data_migration_service.update_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async + */ + async checkUpdateConnectionProfileProgress(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.updateConnectionProfile, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Database Migration Service connection profile. + * A connection profile can only be deleted if it is not in use by any + * active migration jobs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the connection profile resource to delete. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {boolean} request.force + * In case of force delete, the CloudSQL replica database is also deleted + * (only for CloudSQL connection profile). + * @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/data_migration_service.delete_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async + */ + deleteConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteConnectionProfile( + request: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteConnectionProfile( + request: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + 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.deleteConnectionProfile(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteConnectionProfile()`. + * @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/data_migration_service.delete_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async + */ + async checkDeleteConnectionProfileProgress(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.deleteConnectionProfile, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new private connection in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent that owns the collection of PrivateConnections. + * @param {string} request.privateConnectionId + * Required. The private connection identifier. + * @param {google.cloud.clouddms.v1.PrivateConnection} request.privateConnection + * Required. The private connection resource to create. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {boolean} [request.skipValidation] + * Optional. If set to true, will skip validations. + * @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/data_migration_service.create_private_connection.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreatePrivateConnection_async + */ + createPrivateConnection( + request?: protos.google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createPrivateConnection( + request: protos.google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createPrivateConnection( + request: protos.google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createPrivateConnection( + request?: protos.google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, + 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.createPrivateConnection(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createPrivateConnection()`. + * @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/data_migration_service.create_private_connection.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreatePrivateConnection_async + */ + async checkCreatePrivateConnectionProgress(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.createPrivateConnection, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single Database Migration Service private connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the private connection to delete. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @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/data_migration_service.delete_private_connection.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeletePrivateConnection_async + */ + deletePrivateConnection( + request?: protos.google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deletePrivateConnection( + request: protos.google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deletePrivateConnection( + request: protos.google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deletePrivateConnection( + request?: protos.google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, + 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.deletePrivateConnection(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deletePrivateConnection()`. + * @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/data_migration_service.delete_private_connection.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeletePrivateConnection_async + */ + async checkDeletePrivateConnectionProgress(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.deletePrivateConnection, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new conversion workspace in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of conversion workspaces. + * @param {string} request.conversionWorkspaceId + * Required. The ID of the conversion workspace to create. + * @param {google.cloud.clouddms.v1.ConversionWorkspace} request.conversionWorkspace + * Required. Represents a conversion workspace object. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @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/data_migration_service.create_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateConversionWorkspace_async + */ + createConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createConversionWorkspace( + request: protos.google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createConversionWorkspace( + request: protos.google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, + 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.createConversionWorkspace(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createConversionWorkspace()`. + * @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/data_migration_service.create_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateConversionWorkspace_async + */ + async checkCreateConversionWorkspaceProgress(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.createConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single conversion workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the conversion workspace resource. + * @param {google.cloud.clouddms.v1.ConversionWorkspace} request.conversionWorkspace + * Required. The conversion workspace parameters to update. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @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/data_migration_service.update_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConversionWorkspace_async + */ + updateConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, + 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({ + 'conversion_workspace.name': request.conversionWorkspace!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateConversionWorkspace(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateConversionWorkspace()`. + * @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/data_migration_service.update_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConversionWorkspace_async + */ + async checkUpdateConversionWorkspaceProgress(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.updateConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single conversion workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the conversion workspace resource to delete. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @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/data_migration_service.delete_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConversionWorkspace_async + */ + deleteConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, + 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.deleteConversionWorkspace(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteConversionWorkspace()`. + * @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/data_migration_service.delete_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConversionWorkspace_async + */ + async checkDeleteConversionWorkspaceProgress(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.deleteConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports a snapshot of the source database into the + * conversion workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the conversion workspace resource to seed with new database + * structure, in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {boolean} request.autoCommit + * Should the conversion workspace be committed automatically after the + * seed operation. + * @param {string} request.sourceConnectionProfile + * Fully qualified (Uri) name of the source connection profile. + * @param {string} request.destinationConnectionProfile + * Fully qualified (Uri) name of the destination connection profile. + * @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/data_migration_service.seed_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_SeedConversionWorkspace_async + */ + seedConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + seedConversionWorkspace( + request: protos.google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + seedConversionWorkspace( + request: protos.google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + seedConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, + 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.seedConversionWorkspace(request, options, callback); + } +/** + * Check the status of the long running operation returned by `seedConversionWorkspace()`. + * @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/data_migration_service.seed_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_SeedConversionWorkspace_async + */ + async checkSeedConversionWorkspaceProgress(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.seedConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports the mapping rules for a given conversion workspace. + * Supports various formats of external rules files. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the conversion workspace resource to import the rules to + * in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {google.cloud.clouddms.v1.ImportRulesFileFormat} request.rulesFormat + * The format of the rules content file. + * @param {number[]} request.rulesFiles + * One or more rules files. + * @param {boolean} request.autoCommit + * Should the conversion workspace be committed automatically after the + * import operation. + * @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/data_migration_service.import_mapping_rules.js + * region_tag:datamigration_v1_generated_DataMigrationService_ImportMappingRules_async + */ + importMappingRules( + request?: protos.google.cloud.clouddms.v1.IImportMappingRulesRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importMappingRules( + request: protos.google.cloud.clouddms.v1.IImportMappingRulesRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importMappingRules( + request: protos.google.cloud.clouddms.v1.IImportMappingRulesRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importMappingRules( + request?: protos.google.cloud.clouddms.v1.IImportMappingRulesRequest, + 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.importMappingRules(request, options, callback); + } +/** + * Check the status of the long running operation returned by `importMappingRules()`. + * @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/data_migration_service.import_mapping_rules.js + * region_tag:datamigration_v1_generated_DataMigrationService_ImportMappingRules_async + */ + async checkImportMappingRulesProgress(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.importMappingRules, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a draft tree schema for the destination database. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the conversion workspace resource to convert in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {boolean} request.autoCommit + * Specifies whether the conversion workspace is to be committed automatically + * after the conversion. + * @param {string} request.filter + * Filter the entities to convert. Leaving this field empty will convert all + * of the entities. Supports Google AIP-160 style filtering. + * @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/data_migration_service.convert_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_ConvertConversionWorkspace_async + */ + convertConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + convertConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + convertConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + convertConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, + 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.convertConversionWorkspace(request, options, callback); + } +/** + * Check the status of the long running operation returned by `convertConversionWorkspace()`. + * @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/data_migration_service.convert_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_ConvertConversionWorkspace_async + */ + async checkConvertConversionWorkspaceProgress(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.convertConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Marks all the data in the conversion workspace as committed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the conversion workspace resource to commit. + * @param {string} [request.commitName] + * Optional. Optional name of the commit. + * @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/data_migration_service.commit_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_CommitConversionWorkspace_async + */ + commitConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + commitConversionWorkspace( + request: protos.google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + commitConversionWorkspace( + request: protos.google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + commitConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, + 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.commitConversionWorkspace(request, options, callback); + } +/** + * Check the status of the long running operation returned by `commitConversionWorkspace()`. + * @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/data_migration_service.commit_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_CommitConversionWorkspace_async + */ + async checkCommitConversionWorkspaceProgress(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.commitConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Rolls back a conversion workspace to the last committed snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the conversion workspace resource to roll back to. + * @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/data_migration_service.rollback_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_RollbackConversionWorkspace_async + */ + rollbackConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + rollbackConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + rollbackConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + rollbackConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, + 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.rollbackConversionWorkspace(request, options, callback); + } +/** + * Check the status of the long running operation returned by `rollbackConversionWorkspace()`. + * @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/data_migration_service.rollback_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_RollbackConversionWorkspace_async + */ + async checkRollbackConversionWorkspaceProgress(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.rollbackConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Applies draft tree onto a specific destination database. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversion workspace resource for which to apply + * the draft tree. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {string} request.filter + * Filter which entities to apply. Leaving this field empty will apply all of + * the entities. Supports Google AIP 160 based filtering. + * @param {string} request.connectionProfile + * Fully qualified (Uri) name of the destination connection profile. + * @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/data_migration_service.apply_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_ApplyConversionWorkspace_async + */ + applyConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + applyConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + applyConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + applyConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, + 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.applyConversionWorkspace(request, options, callback); + } +/** + * Check the status of the long running operation returned by `applyConversionWorkspace()`. + * @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/data_migration_service.apply_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_ApplyConversionWorkspace_async + */ + async checkApplyConversionWorkspaceProgress(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.applyConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists migration jobs in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of migrationJobs. + * @param {number} request.pageSize + * The maximum number of migration jobs to return. The service may return + * fewer than this value. If unspecified, at most 50 migration jobs will be + * returned. The maximum value is 1000; values above 1000 are coerced to + * 1000. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * migrationJobs.list, used in the subsequent request to retrieve the next + * page of results. On first call this should be left blank. When paginating, + * all other parameters provided to migrationJobs.list must match the call + * that provided the page token. + * @param {string} request.filter + * A filter expression that filters migration jobs listed in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, + * a number, or a boolean. The comparison operator must be + * either =, !=, >, or <. For example, list migration jobs created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + * You can also filter nested fields. For example, you could specify + * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + * jobs connecting through the specific SSH tunnel bastion. + * @param {string} request.orderBy + * Sort the results based on the migration job name. + * Valid values are: "name", "name asc", and "name desc". + * @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 {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob}. + * 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 `listMigrationJobsAsync()` + * 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. + */ + listMigrationJobs( + request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.clouddms.v1.IMigrationJob[], + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest|null, + protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + ]>; + listMigrationJobs( + request: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + protos.google.cloud.clouddms.v1.IListMigrationJobsResponse|null|undefined, + protos.google.cloud.clouddms.v1.IMigrationJob>): void; + listMigrationJobs( + request: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + protos.google.cloud.clouddms.v1.IListMigrationJobsResponse|null|undefined, + protos.google.cloud.clouddms.v1.IMigrationJob>): void; + listMigrationJobs( + request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + protos.google.cloud.clouddms.v1.IListMigrationJobsResponse|null|undefined, + protos.google.cloud.clouddms.v1.IMigrationJob>, + callback?: PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + protos.google.cloud.clouddms.v1.IListMigrationJobsResponse|null|undefined, + protos.google.cloud.clouddms.v1.IMigrationJob>): + Promise<[ + protos.google.cloud.clouddms.v1.IMigrationJob[], + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest|null, + protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + ]>|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.listMigrationJobs(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 + * Required. The parent which owns this collection of migrationJobs. + * @param {number} request.pageSize + * The maximum number of migration jobs to return. The service may return + * fewer than this value. If unspecified, at most 50 migration jobs will be + * returned. The maximum value is 1000; values above 1000 are coerced to + * 1000. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * migrationJobs.list, used in the subsequent request to retrieve the next + * page of results. On first call this should be left blank. When paginating, + * all other parameters provided to migrationJobs.list must match the call + * that provided the page token. + * @param {string} request.filter + * A filter expression that filters migration jobs listed in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, + * a number, or a boolean. The comparison operator must be + * either =, !=, >, or <. For example, list migration jobs created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + * You can also filter nested fields. For example, you could specify + * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + * jobs connecting through the specific SSH tunnel bastion. + * @param {string} request.orderBy + * Sort the results based on the migration job name. + * Valid values are: "name", "name asc", and "name desc". + * @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 {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob} 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 `listMigrationJobsAsync()` + * 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. + */ + listMigrationJobsStream( + request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + 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['listMigrationJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMigrationJobs.createStream( + this.innerApiCalls.listMigrationJobs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listMigrationJobs`, 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 + * Required. The parent which owns this collection of migrationJobs. + * @param {number} request.pageSize + * The maximum number of migration jobs to return. The service may return + * fewer than this value. If unspecified, at most 50 migration jobs will be + * returned. The maximum value is 1000; values above 1000 are coerced to + * 1000. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * migrationJobs.list, used in the subsequent request to retrieve the next + * page of results. On first call this should be left blank. When paginating, + * all other parameters provided to migrationJobs.list must match the call + * that provided the page token. + * @param {string} request.filter + * A filter expression that filters migration jobs listed in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, + * a number, or a boolean. The comparison operator must be + * either =, !=, >, or <. For example, list migration jobs created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + * You can also filter nested fields. For example, you could specify + * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + * jobs connecting through the specific SSH tunnel bastion. + * @param {string} request.orderBy + * Sort the results based on the migration job name. + * Valid values are: "name", "name asc", and "name desc". + * @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 + * {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob}. 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/data_migration_service.list_migration_jobs.js + * region_tag:datamigration_v1_generated_DataMigrationService_ListMigrationJobs_async + */ + listMigrationJobsAsync( + request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + 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['listMigrationJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMigrationJobs.asyncIterate( + this.innerApiCalls['listMigrationJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Retrieves a list of all connection profiles in a given project and + * location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of connection profiles. + * @param {number} request.pageSize + * The maximum number of connection profiles to return. The service may return + * fewer than this value. If unspecified, at most 50 connection profiles will + * be returned. The maximum value is 1000; values above 1000 are coerced + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListConnectionProfiles` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListConnectionProfiles` + * must match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters connection profiles listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list connection profiles created this year by + * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + * also filter nested fields. For example, you could specify **mySql.username + * = %lt;my_username%gt;** to list all connection profiles configured to + * connect with a specific username. + * @param {string} request.orderBy + * A comma-separated list of fields to order results according to. + * @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 {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile}. + * 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 `listConnectionProfilesAsync()` + * 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. + */ + listConnectionProfiles( + request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.clouddms.v1.IConnectionProfile[], + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest|null, + protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + ]>; + listConnectionProfiles( + request: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse|null|undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile>): void; + listConnectionProfiles( + request: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse|null|undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile>): void; + listConnectionProfiles( + request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse|null|undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile>, + callback?: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse|null|undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile>): + Promise<[ + protos.google.cloud.clouddms.v1.IConnectionProfile[], + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest|null, + protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + ]>|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.listConnectionProfiles(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 + * Required. The parent which owns this collection of connection profiles. + * @param {number} request.pageSize + * The maximum number of connection profiles to return. The service may return + * fewer than this value. If unspecified, at most 50 connection profiles will + * be returned. The maximum value is 1000; values above 1000 are coerced + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListConnectionProfiles` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListConnectionProfiles` + * must match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters connection profiles listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list connection profiles created this year by + * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + * also filter nested fields. For example, you could specify **mySql.username + * = %lt;my_username%gt;** to list all connection profiles configured to + * connect with a specific username. + * @param {string} request.orderBy + * A comma-separated list of fields to order results according to. + * @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 {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile} 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 `listConnectionProfilesAsync()` + * 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. + */ + listConnectionProfilesStream( + request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + 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['listConnectionProfiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectionProfiles.createStream( + this.innerApiCalls.listConnectionProfiles as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listConnectionProfiles`, 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 + * Required. The parent which owns this collection of connection profiles. + * @param {number} request.pageSize + * The maximum number of connection profiles to return. The service may return + * fewer than this value. If unspecified, at most 50 connection profiles will + * be returned. The maximum value is 1000; values above 1000 are coerced + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListConnectionProfiles` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListConnectionProfiles` + * must match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters connection profiles listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list connection profiles created this year by + * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + * also filter nested fields. For example, you could specify **mySql.username + * = %lt;my_username%gt;** to list all connection profiles configured to + * connect with a specific username. + * @param {string} request.orderBy + * A comma-separated list of fields to order results according to. + * @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 + * {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile}. 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/data_migration_service.list_connection_profiles.js + * region_tag:datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_async + */ + listConnectionProfilesAsync( + request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + 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['listConnectionProfiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectionProfiles.asyncIterate( + this.innerApiCalls['listConnectionProfiles'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Retrieves a list of private connections in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent that owns the collection of private connections. + * @param {number} request.pageSize + * Maximum number of private connections to return. + * If unspecified, at most 50 private connections that are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. + * @param {string} request.pageToken + * Page token received from a previous `ListPrivateConnections` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListPrivateConnections` must match the call that provided the page + * token. + * @param {string} request.filter + * A filter expression that filters private connections listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list private connections created this year by + * specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. + * @param {string} request.orderBy + * Order by fields for the result. + * @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 {@link google.cloud.clouddms.v1.PrivateConnection | PrivateConnection}. + * 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 `listPrivateConnectionsAsync()` + * 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. + */ + listPrivateConnections( + request?: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.clouddms.v1.IPrivateConnection[], + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest|null, + protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse + ]>; + listPrivateConnections( + request: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse|null|undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection>): void; + listPrivateConnections( + request: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse|null|undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection>): void; + listPrivateConnections( + request?: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse|null|undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection>, + callback?: PaginationCallback< + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse|null|undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection>): + Promise<[ + protos.google.cloud.clouddms.v1.IPrivateConnection[], + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest|null, + protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse + ]>|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.listPrivateConnections(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 + * Required. The parent that owns the collection of private connections. + * @param {number} request.pageSize + * Maximum number of private connections to return. + * If unspecified, at most 50 private connections that are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. + * @param {string} request.pageToken + * Page token received from a previous `ListPrivateConnections` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListPrivateConnections` must match the call that provided the page + * token. + * @param {string} request.filter + * A filter expression that filters private connections listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list private connections created this year by + * specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. + * @param {string} request.orderBy + * Order by fields for the result. + * @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 {@link google.cloud.clouddms.v1.PrivateConnection | PrivateConnection} 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 `listPrivateConnectionsAsync()` + * 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. + */ + listPrivateConnectionsStream( + request?: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + 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['listPrivateConnections']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPrivateConnections.createStream( + this.innerApiCalls.listPrivateConnections as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listPrivateConnections`, 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 + * Required. The parent that owns the collection of private connections. + * @param {number} request.pageSize + * Maximum number of private connections to return. + * If unspecified, at most 50 private connections that are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. + * @param {string} request.pageToken + * Page token received from a previous `ListPrivateConnections` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListPrivateConnections` must match the call that provided the page + * token. + * @param {string} request.filter + * A filter expression that filters private connections listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list private connections created this year by + * specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. + * @param {string} request.orderBy + * Order by fields for the result. + * @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 + * {@link google.cloud.clouddms.v1.PrivateConnection | PrivateConnection}. 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/data_migration_service.list_private_connections.js + * region_tag:datamigration_v1_generated_DataMigrationService_ListPrivateConnections_async + */ + listPrivateConnectionsAsync( + request?: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + 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['listPrivateConnections']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPrivateConnections.asyncIterate( + this.innerApiCalls['listPrivateConnections'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists conversion workspaces in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of conversion workspaces. + * @param {number} request.pageSize + * The maximum number of conversion workspaces to return. The service may + * return fewer than this value. If unspecified, at most 50 sets are returned. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * conversionWorkspaces.list, used in the subsequent request to retrieve the + * next page of results. On first call this should be left blank. When + * paginating, all other parameters provided to conversionWorkspaces.list must + * match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters conversion workspaces listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list conversion workspaces created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can + * also filter nested fields. For example, you could specify + * **source.version = "12.c.1"** to select all conversion workspaces with + * source database version equal to 12.c.1. + * @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 {@link google.cloud.clouddms.v1.ConversionWorkspace | ConversionWorkspace}. + * 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 `listConversionWorkspacesAsync()` + * 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. + */ + listConversionWorkspaces( + request?: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.clouddms.v1.IConversionWorkspace[], + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest|null, + protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse + ]>; + listConversionWorkspaces( + request: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse|null|undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace>): void; + listConversionWorkspaces( + request: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse|null|undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace>): void; + listConversionWorkspaces( + request?: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse|null|undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace>, + callback?: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse|null|undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace>): + Promise<[ + protos.google.cloud.clouddms.v1.IConversionWorkspace[], + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest|null, + protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse + ]>|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.listConversionWorkspaces(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 + * Required. The parent which owns this collection of conversion workspaces. + * @param {number} request.pageSize + * The maximum number of conversion workspaces to return. The service may + * return fewer than this value. If unspecified, at most 50 sets are returned. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * conversionWorkspaces.list, used in the subsequent request to retrieve the + * next page of results. On first call this should be left blank. When + * paginating, all other parameters provided to conversionWorkspaces.list must + * match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters conversion workspaces listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list conversion workspaces created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can + * also filter nested fields. For example, you could specify + * **source.version = "12.c.1"** to select all conversion workspaces with + * source database version equal to 12.c.1. + * @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 {@link google.cloud.clouddms.v1.ConversionWorkspace | ConversionWorkspace} 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 `listConversionWorkspacesAsync()` + * 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. + */ + listConversionWorkspacesStream( + request?: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + 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['listConversionWorkspaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConversionWorkspaces.createStream( + this.innerApiCalls.listConversionWorkspaces as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listConversionWorkspaces`, 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 + * Required. The parent which owns this collection of conversion workspaces. + * @param {number} request.pageSize + * The maximum number of conversion workspaces to return. The service may + * return fewer than this value. If unspecified, at most 50 sets are returned. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * conversionWorkspaces.list, used in the subsequent request to retrieve the + * next page of results. On first call this should be left blank. When + * paginating, all other parameters provided to conversionWorkspaces.list must + * match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters conversion workspaces listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list conversion workspaces created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can + * also filter nested fields. For example, you could specify + * **source.version = "12.c.1"** to select all conversion workspaces with + * source database version equal to 12.c.1. + * @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 + * {@link google.cloud.clouddms.v1.ConversionWorkspace | ConversionWorkspace}. 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/data_migration_service.list_conversion_workspaces.js + * region_tag:datamigration_v1_generated_DataMigrationService_ListConversionWorkspaces_async + */ + listConversionWorkspacesAsync( + request?: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + 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['listConversionWorkspaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConversionWorkspaces.asyncIterate( + this.innerApiCalls['listConversionWorkspaces'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Describes the database entities tree for a specific conversion workspace + * and a specific tree type. + * + * Database entities are not resources like conversion workspaces or mapping + * rules, and they can't be created, updated or deleted. Instead, they are + * simple data objects describing the structure of the client database. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.conversionWorkspace + * Required. Name of the conversion workspace resource whose database entities + * are described. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {number} request.pageSize + * The maximum number of entities to return. The service may return + * fewer entities than the value specifies. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * conversionWorkspace.describeDatabaseEntities, used in the subsequent + * request to retrieve the next page of results. On first call this should be + * left blank. When paginating, all other parameters provided to + * conversionWorkspace.describeDatabaseEntities must match the call that + * provided the page token. + * @param {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType} request.tree + * The tree to fetch. + * @param {boolean} request.uncommitted + * Whether to retrieve the latest committed version of the entities or the + * latest version. This field is ignored if a specific commit_id is specified. + * @param {string} request.commitId + * Request a specific commit ID. If not specified, the entities from the + * latest commit are returned. + * @param {string} request.filter + * Filter the returned entities based on AIP-160 standard. + * @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 {@link google.cloud.clouddms.v1.DatabaseEntity | DatabaseEntity}. + * 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 `describeDatabaseEntitiesAsync()` + * 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. + */ + describeDatabaseEntities( + request?: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.clouddms.v1.IDatabaseEntity[], + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest|null, + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse + ]>; + describeDatabaseEntities( + request: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse|null|undefined, + protos.google.cloud.clouddms.v1.IDatabaseEntity>): void; + describeDatabaseEntities( + request: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse|null|undefined, + protos.google.cloud.clouddms.v1.IDatabaseEntity>): void; + describeDatabaseEntities( + request?: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse|null|undefined, + protos.google.cloud.clouddms.v1.IDatabaseEntity>, + callback?: PaginationCallback< + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse|null|undefined, + protos.google.cloud.clouddms.v1.IDatabaseEntity>): + Promise<[ + protos.google.cloud.clouddms.v1.IDatabaseEntity[], + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest|null, + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse + ]>|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({ + 'conversion_workspace': request.conversionWorkspace ?? '', + }); + this.initialize(); + return this.innerApiCalls.describeDatabaseEntities(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.conversionWorkspace + * Required. Name of the conversion workspace resource whose database entities + * are described. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {number} request.pageSize + * The maximum number of entities to return. The service may return + * fewer entities than the value specifies. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * conversionWorkspace.describeDatabaseEntities, used in the subsequent + * request to retrieve the next page of results. On first call this should be + * left blank. When paginating, all other parameters provided to + * conversionWorkspace.describeDatabaseEntities must match the call that + * provided the page token. + * @param {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType} request.tree + * The tree to fetch. + * @param {boolean} request.uncommitted + * Whether to retrieve the latest committed version of the entities or the + * latest version. This field is ignored if a specific commit_id is specified. + * @param {string} request.commitId + * Request a specific commit ID. If not specified, the entities from the + * latest commit are returned. + * @param {string} request.filter + * Filter the returned entities based on AIP-160 standard. + * @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 {@link google.cloud.clouddms.v1.DatabaseEntity | DatabaseEntity} 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 `describeDatabaseEntitiesAsync()` + * 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. + */ + describeDatabaseEntitiesStream( + request?: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + 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({ + 'conversion_workspace': request.conversionWorkspace ?? '', + }); + const defaultCallSettings = this._defaults['describeDatabaseEntities']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.describeDatabaseEntities.createStream( + this.innerApiCalls.describeDatabaseEntities as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `describeDatabaseEntities`, 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.conversionWorkspace + * Required. Name of the conversion workspace resource whose database entities + * are described. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {number} request.pageSize + * The maximum number of entities to return. The service may return + * fewer entities than the value specifies. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * conversionWorkspace.describeDatabaseEntities, used in the subsequent + * request to retrieve the next page of results. On first call this should be + * left blank. When paginating, all other parameters provided to + * conversionWorkspace.describeDatabaseEntities must match the call that + * provided the page token. + * @param {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType} request.tree + * The tree to fetch. + * @param {boolean} request.uncommitted + * Whether to retrieve the latest committed version of the entities or the + * latest version. This field is ignored if a specific commit_id is specified. + * @param {string} request.commitId + * Request a specific commit ID. If not specified, the entities from the + * latest commit are returned. + * @param {string} request.filter + * Filter the returned entities based on AIP-160 standard. + * @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 + * {@link google.cloud.clouddms.v1.DatabaseEntity | DatabaseEntity}. 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/data_migration_service.describe_database_entities.js + * region_tag:datamigration_v1_generated_DataMigrationService_DescribeDatabaseEntities_async + */ + describeDatabaseEntitiesAsync( + request?: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + 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({ + 'conversion_workspace': request.conversionWorkspace ?? '', + }); + const defaultCallSettings = this._defaults['describeDatabaseEntities']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.describeDatabaseEntities.asyncIterate( + this.innerApiCalls['describeDatabaseEntities'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Fetches a set of static IP addresses that need to be allowlisted by the + * customer when using the static-IP connectivity method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for the location for which static IPs should be + * returned. Must be in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of IPs to return. + * @param {string} request.pageToken + * A page token, received from a previous `FetchStaticIps` call. + * @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 string. + * 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 `fetchStaticIpsAsync()` + * 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. + */ + fetchStaticIps( + request?: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + options?: CallOptions): + Promise<[ + string[], + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest|null, + protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse + ]>; + fetchStaticIps( + request: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse|null|undefined, + string>): void; + fetchStaticIps( + request: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse|null|undefined, + string>): void; + fetchStaticIps( + request?: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse|null|undefined, + string>, + callback?: PaginationCallback< + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse|null|undefined, + string>): + Promise<[ + string[], + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest|null, + protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse + ]>|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.fetchStaticIps(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.name + * Required. The resource name for the location for which static IPs should be + * returned. Must be in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of IPs to return. + * @param {string} request.pageToken + * A page token, received from a previous `FetchStaticIps` call. + * @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 string 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 `fetchStaticIpsAsync()` + * 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. + */ + fetchStaticIpsStream( + request?: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + 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({ + 'name': request.name ?? '', + }); + const defaultCallSettings = this._defaults['fetchStaticIps']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.fetchStaticIps.createStream( + this.innerApiCalls.fetchStaticIps as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `fetchStaticIps`, 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.name + * Required. The resource name for the location for which static IPs should be + * returned. Must be in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of IPs to return. + * @param {string} request.pageToken + * A page token, received from a previous `FetchStaticIps` call. + * @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 + * string. 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/data_migration_service.fetch_static_ips.js + * region_tag:datamigration_v1_generated_DataMigrationService_FetchStaticIps_async + */ + fetchStaticIpsAsync( + request?: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + 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({ + 'name': request.name ?? '', + }); + const defaultCallSettings = this._defaults['fetchStaticIps']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.fetchStaticIps.asyncIterate( + this.innerApiCalls['fetchStaticIps'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 connectionProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} connection_profile + * @returns {string} Resource name string. + */ + connectionProfilePath(project:string,location:string,connectionProfile:string) { + return this.pathTemplates.connectionProfilePathTemplate.render({ + project: project, + location: location, + connection_profile: connectionProfile, + }); + } + + /** + * Parse the project from ConnectionProfile resource. + * + * @param {string} connectionProfileName + * A fully-qualified path representing ConnectionProfile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectionProfileName(connectionProfileName: string) { + return this.pathTemplates.connectionProfilePathTemplate.match(connectionProfileName).project; + } + + /** + * Parse the location from ConnectionProfile resource. + * + * @param {string} connectionProfileName + * A fully-qualified path representing ConnectionProfile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectionProfileName(connectionProfileName: string) { + return this.pathTemplates.connectionProfilePathTemplate.match(connectionProfileName).location; + } + + /** + * Parse the connection_profile from ConnectionProfile resource. + * + * @param {string} connectionProfileName + * A fully-qualified path representing ConnectionProfile resource. + * @returns {string} A string representing the connection_profile. + */ + matchConnectionProfileFromConnectionProfileName(connectionProfileName: string) { + return this.pathTemplates.connectionProfilePathTemplate.match(connectionProfileName).connection_profile; + } + + /** + * Return a fully-qualified conversionWorkspace resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversion_workspace + * @returns {string} Resource name string. + */ + conversionWorkspacePath(project:string,location:string,conversionWorkspace:string) { + return this.pathTemplates.conversionWorkspacePathTemplate.render({ + project: project, + location: location, + conversion_workspace: conversionWorkspace, + }); + } + + /** + * Parse the project from ConversionWorkspace resource. + * + * @param {string} conversionWorkspaceName + * A fully-qualified path representing ConversionWorkspace resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConversionWorkspaceName(conversionWorkspaceName: string) { + return this.pathTemplates.conversionWorkspacePathTemplate.match(conversionWorkspaceName).project; + } + + /** + * Parse the location from ConversionWorkspace resource. + * + * @param {string} conversionWorkspaceName + * A fully-qualified path representing ConversionWorkspace resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConversionWorkspaceName(conversionWorkspaceName: string) { + return this.pathTemplates.conversionWorkspacePathTemplate.match(conversionWorkspaceName).location; + } + + /** + * Parse the conversion_workspace from ConversionWorkspace resource. + * + * @param {string} conversionWorkspaceName + * A fully-qualified path representing ConversionWorkspace resource. + * @returns {string} A string representing the conversion_workspace. + */ + matchConversionWorkspaceFromConversionWorkspaceName(conversionWorkspaceName: string) { + return this.pathTemplates.conversionWorkspacePathTemplate.match(conversionWorkspaceName).conversion_workspace; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified migrationJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} migration_job + * @returns {string} Resource name string. + */ + migrationJobPath(project:string,location:string,migrationJob:string) { + return this.pathTemplates.migrationJobPathTemplate.render({ + project: project, + location: location, + migration_job: migrationJob, + }); + } + + /** + * Parse the project from MigrationJob resource. + * + * @param {string} migrationJobName + * A fully-qualified path representing MigrationJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMigrationJobName(migrationJobName: string) { + return this.pathTemplates.migrationJobPathTemplate.match(migrationJobName).project; + } + + /** + * Parse the location from MigrationJob resource. + * + * @param {string} migrationJobName + * A fully-qualified path representing MigrationJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMigrationJobName(migrationJobName: string) { + return this.pathTemplates.migrationJobPathTemplate.match(migrationJobName).location; + } + + /** + * Parse the migration_job from MigrationJob resource. + * + * @param {string} migrationJobName + * A fully-qualified path representing MigrationJob resource. + * @returns {string} A string representing the migration_job. + */ + matchMigrationJobFromMigrationJobName(migrationJobName: string) { + return this.pathTemplates.migrationJobPathTemplate.match(migrationJobName).migration_job; + } + + /** + * Return a fully-qualified privateConnection resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} private_connection + * @returns {string} Resource name string. + */ + privateConnectionPath(project:string,location:string,privateConnection:string) { + return this.pathTemplates.privateConnectionPathTemplate.render({ + project: project, + location: location, + private_connection: privateConnection, + }); + } + + /** + * Parse the project from PrivateConnection resource. + * + * @param {string} privateConnectionName + * A fully-qualified path representing PrivateConnection resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPrivateConnectionName(privateConnectionName: string) { + return this.pathTemplates.privateConnectionPathTemplate.match(privateConnectionName).project; + } + + /** + * Parse the location from PrivateConnection resource. + * + * @param {string} privateConnectionName + * A fully-qualified path representing PrivateConnection resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPrivateConnectionName(privateConnectionName: string) { + return this.pathTemplates.privateConnectionPathTemplate.match(privateConnectionName).location; + } + + /** + * Parse the private_connection from PrivateConnection resource. + * + * @param {string} privateConnectionName + * A fully-qualified path representing PrivateConnection resource. + * @returns {string} A string representing the private_connection. + */ + matchPrivateConnectionFromPrivateConnectionName(privateConnectionName: string) { + return this.pathTemplates.privateConnectionPathTemplate.match(privateConnectionName).private_connection; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * 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.dataMigrationServiceStub && !this._terminated) { + return this.dataMigrationServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client_config.json b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client_config.json new file mode 100644 index 00000000000..8e34da8c8c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client_config.json @@ -0,0 +1,206 @@ +{ + "interfaces": { + "google.cloud.clouddms.v1.DataMigrationService": { + "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": { + "ListMigrationJobs": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StopMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResumeMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PromoteMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "VerifyMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestartMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GenerateSshScript": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListConnectionProfiles": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetConnectionProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateConnectionProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateConnectionProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteConnectionProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreatePrivateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPrivateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPrivateConnections": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePrivateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListConversionWorkspaces": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SeedConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportMappingRules": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ConvertConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CommitConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RollbackConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ApplyConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DescribeDatabaseEntities": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchBackgroundJobs": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DescribeConversionWorkspaceRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchStaticIps": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_proto_list.json b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_proto_list.json new file mode 100644 index 00000000000..9617525e5a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/clouddms/v1/clouddms.proto", + "../../protos/google/cloud/clouddms/v1/clouddms_resources.proto", + "../../protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto" +] diff --git a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..b6a2e2f6715 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/gapic_metadata.json @@ -0,0 +1,407 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.clouddms.v1", + "libraryPackage": "@google-cloud/dms", + "services": { + "DataMigrationService": { + "clients": { + "grpc": { + "libraryClient": "DataMigrationServiceClient", + "rpcs": { + "GetMigrationJob": { + "methods": [ + "getMigrationJob" + ] + }, + "GenerateSshScript": { + "methods": [ + "generateSshScript" + ] + }, + "GetConnectionProfile": { + "methods": [ + "getConnectionProfile" + ] + }, + "GetPrivateConnection": { + "methods": [ + "getPrivateConnection" + ] + }, + "GetConversionWorkspace": { + "methods": [ + "getConversionWorkspace" + ] + }, + "SearchBackgroundJobs": { + "methods": [ + "searchBackgroundJobs" + ] + }, + "DescribeConversionWorkspaceRevisions": { + "methods": [ + "describeConversionWorkspaceRevisions" + ] + }, + "CreateMigrationJob": { + "methods": [ + "createMigrationJob" + ] + }, + "UpdateMigrationJob": { + "methods": [ + "updateMigrationJob" + ] + }, + "DeleteMigrationJob": { + "methods": [ + "deleteMigrationJob" + ] + }, + "StartMigrationJob": { + "methods": [ + "startMigrationJob" + ] + }, + "StopMigrationJob": { + "methods": [ + "stopMigrationJob" + ] + }, + "ResumeMigrationJob": { + "methods": [ + "resumeMigrationJob" + ] + }, + "PromoteMigrationJob": { + "methods": [ + "promoteMigrationJob" + ] + }, + "VerifyMigrationJob": { + "methods": [ + "verifyMigrationJob" + ] + }, + "RestartMigrationJob": { + "methods": [ + "restartMigrationJob" + ] + }, + "CreateConnectionProfile": { + "methods": [ + "createConnectionProfile" + ] + }, + "UpdateConnectionProfile": { + "methods": [ + "updateConnectionProfile" + ] + }, + "DeleteConnectionProfile": { + "methods": [ + "deleteConnectionProfile" + ] + }, + "CreatePrivateConnection": { + "methods": [ + "createPrivateConnection" + ] + }, + "DeletePrivateConnection": { + "methods": [ + "deletePrivateConnection" + ] + }, + "CreateConversionWorkspace": { + "methods": [ + "createConversionWorkspace" + ] + }, + "UpdateConversionWorkspace": { + "methods": [ + "updateConversionWorkspace" + ] + }, + "DeleteConversionWorkspace": { + "methods": [ + "deleteConversionWorkspace" + ] + }, + "SeedConversionWorkspace": { + "methods": [ + "seedConversionWorkspace" + ] + }, + "ImportMappingRules": { + "methods": [ + "importMappingRules" + ] + }, + "ConvertConversionWorkspace": { + "methods": [ + "convertConversionWorkspace" + ] + }, + "CommitConversionWorkspace": { + "methods": [ + "commitConversionWorkspace" + ] + }, + "RollbackConversionWorkspace": { + "methods": [ + "rollbackConversionWorkspace" + ] + }, + "ApplyConversionWorkspace": { + "methods": [ + "applyConversionWorkspace" + ] + }, + "ListMigrationJobs": { + "methods": [ + "listMigrationJobs", + "listMigrationJobsStream", + "listMigrationJobsAsync" + ] + }, + "ListConnectionProfiles": { + "methods": [ + "listConnectionProfiles", + "listConnectionProfilesStream", + "listConnectionProfilesAsync" + ] + }, + "ListPrivateConnections": { + "methods": [ + "listPrivateConnections", + "listPrivateConnectionsStream", + "listPrivateConnectionsAsync" + ] + }, + "ListConversionWorkspaces": { + "methods": [ + "listConversionWorkspaces", + "listConversionWorkspacesStream", + "listConversionWorkspacesAsync" + ] + }, + "DescribeDatabaseEntities": { + "methods": [ + "describeDatabaseEntities", + "describeDatabaseEntitiesStream", + "describeDatabaseEntitiesAsync" + ] + }, + "FetchStaticIps": { + "methods": [ + "fetchStaticIps", + "fetchStaticIpsStream", + "fetchStaticIpsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataMigrationServiceClient", + "rpcs": { + "GetMigrationJob": { + "methods": [ + "getMigrationJob" + ] + }, + "GenerateSshScript": { + "methods": [ + "generateSshScript" + ] + }, + "GetConnectionProfile": { + "methods": [ + "getConnectionProfile" + ] + }, + "GetPrivateConnection": { + "methods": [ + "getPrivateConnection" + ] + }, + "GetConversionWorkspace": { + "methods": [ + "getConversionWorkspace" + ] + }, + "SearchBackgroundJobs": { + "methods": [ + "searchBackgroundJobs" + ] + }, + "DescribeConversionWorkspaceRevisions": { + "methods": [ + "describeConversionWorkspaceRevisions" + ] + }, + "CreateMigrationJob": { + "methods": [ + "createMigrationJob" + ] + }, + "UpdateMigrationJob": { + "methods": [ + "updateMigrationJob" + ] + }, + "DeleteMigrationJob": { + "methods": [ + "deleteMigrationJob" + ] + }, + "StartMigrationJob": { + "methods": [ + "startMigrationJob" + ] + }, + "StopMigrationJob": { + "methods": [ + "stopMigrationJob" + ] + }, + "ResumeMigrationJob": { + "methods": [ + "resumeMigrationJob" + ] + }, + "PromoteMigrationJob": { + "methods": [ + "promoteMigrationJob" + ] + }, + "VerifyMigrationJob": { + "methods": [ + "verifyMigrationJob" + ] + }, + "RestartMigrationJob": { + "methods": [ + "restartMigrationJob" + ] + }, + "CreateConnectionProfile": { + "methods": [ + "createConnectionProfile" + ] + }, + "UpdateConnectionProfile": { + "methods": [ + "updateConnectionProfile" + ] + }, + "DeleteConnectionProfile": { + "methods": [ + "deleteConnectionProfile" + ] + }, + "CreatePrivateConnection": { + "methods": [ + "createPrivateConnection" + ] + }, + "DeletePrivateConnection": { + "methods": [ + "deletePrivateConnection" + ] + }, + "CreateConversionWorkspace": { + "methods": [ + "createConversionWorkspace" + ] + }, + "UpdateConversionWorkspace": { + "methods": [ + "updateConversionWorkspace" + ] + }, + "DeleteConversionWorkspace": { + "methods": [ + "deleteConversionWorkspace" + ] + }, + "SeedConversionWorkspace": { + "methods": [ + "seedConversionWorkspace" + ] + }, + "ImportMappingRules": { + "methods": [ + "importMappingRules" + ] + }, + "ConvertConversionWorkspace": { + "methods": [ + "convertConversionWorkspace" + ] + }, + "CommitConversionWorkspace": { + "methods": [ + "commitConversionWorkspace" + ] + }, + "RollbackConversionWorkspace": { + "methods": [ + "rollbackConversionWorkspace" + ] + }, + "ApplyConversionWorkspace": { + "methods": [ + "applyConversionWorkspace" + ] + }, + "ListMigrationJobs": { + "methods": [ + "listMigrationJobs", + "listMigrationJobsStream", + "listMigrationJobsAsync" + ] + }, + "ListConnectionProfiles": { + "methods": [ + "listConnectionProfiles", + "listConnectionProfilesStream", + "listConnectionProfilesAsync" + ] + }, + "ListPrivateConnections": { + "methods": [ + "listPrivateConnections", + "listPrivateConnectionsStream", + "listPrivateConnectionsAsync" + ] + }, + "ListConversionWorkspaces": { + "methods": [ + "listConversionWorkspaces", + "listConversionWorkspacesStream", + "listConversionWorkspacesAsync" + ] + }, + "DescribeDatabaseEntities": { + "methods": [ + "describeDatabaseEntities", + "describeDatabaseEntitiesStream", + "describeDatabaseEntitiesAsync" + ] + }, + "FetchStaticIps": { + "methods": [ + "fetchStaticIps", + "fetchStaticIpsStream", + "fetchStaticIpsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/index.ts new file mode 100644 index 00000000000..e204933365c --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 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 {DataMigrationServiceClient} from './data_migration_service_client'; diff --git a/owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..a95ad264677 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2023 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 clouddms = require('@google-cloud/dms'); + +function main() { + const dataMigrationServiceClient = new clouddms.DataMigrationServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..93cba263288 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 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 {DataMigrationServiceClient} from '@google-cloud/dms'; + +// check that the client class type name can be used +function doStuffWithDataMigrationServiceClient(client: DataMigrationServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dataMigrationServiceClient = new DataMigrationServiceClient(); + doStuffWithDataMigrationServiceClient(dataMigrationServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-clouddms/v1/system-test/install.ts b/owl-bot-staging/google-cloud-clouddms/v1/system-test/install.ts new file mode 100644 index 00000000000..c8f81b25a86 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2023 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-clouddms/v1/test/gapic_data_migration_service_v1.ts b/owl-bot-staging/google-cloud-clouddms/v1/test/gapic_data_migration_service_v1.ts new file mode 100644 index 00000000000..05e79e2d670 --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/v1/test/gapic_data_migration_service_v1.ts @@ -0,0 +1,6929 @@ +// Copyright 2023 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 datamigrationserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} 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.DataMigrationServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = datamigrationserviceModule.v1.DataMigrationServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = datamigrationserviceModule.v1.DataMigrationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datamigrationserviceModule.v1.DataMigrationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataMigrationServiceStub, undefined); + await client.initialize(); + assert(client.dataMigrationServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dataMigrationServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataMigrationServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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('getMigrationJob', () => { + it('invokes getMigrationJob without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ); + client.innerApiCalls.getMigrationJob = stubSimpleCall(expectedResponse); + const [response] = await client.getMigrationJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMigrationJob without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ); + client.innerApiCalls.getMigrationJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMigrationJob( + request, + (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IMigrationJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMigrationJob with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMigrationJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMigrationJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMigrationJob with closed client', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMigrationJob(request), expectedError); + }); + }); + + describe('generateSshScript', () => { + it('invokes generateSshScript without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GenerateSshScriptRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GenerateSshScriptRequest', ['migrationJob']); + request.migrationJob = defaultValue1; + const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SshScript() + ); + client.innerApiCalls.generateSshScript = stubSimpleCall(expectedResponse); + const [response] = await client.generateSshScript(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateSshScript as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateSshScript as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateSshScript without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GenerateSshScriptRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GenerateSshScriptRequest', ['migrationJob']); + request.migrationJob = defaultValue1; + const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SshScript() + ); + client.innerApiCalls.generateSshScript = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateSshScript( + request, + (err?: Error|null, result?: protos.google.cloud.clouddms.v1.ISshScript|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.generateSshScript as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateSshScript as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateSshScript with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GenerateSshScriptRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GenerateSshScriptRequest', ['migrationJob']); + request.migrationJob = defaultValue1; + const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateSshScript = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.generateSshScript(request), expectedError); + const actualRequest = (client.innerApiCalls.generateSshScript as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.generateSshScript as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateSshScript with closed client', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GenerateSshScriptRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GenerateSshScriptRequest', ['migrationJob']); + request.migrationJob = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateSshScript(request), expectedError); + }); + }); + + describe('getConnectionProfile', () => { + it('invokes getConnectionProfile without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConnectionProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetConnectionProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ); + client.innerApiCalls.getConnectionProfile = stubSimpleCall(expectedResponse); + const [response] = await client.getConnectionProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionProfile without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConnectionProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetConnectionProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ); + client.innerApiCalls.getConnectionProfile = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnectionProfile( + request, + (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IConnectionProfile|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionProfile with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConnectionProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetConnectionProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnectionProfile = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConnectionProfile(request), expectedError); + const actualRequest = (client.innerApiCalls.getConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionProfile with closed client', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConnectionProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetConnectionProfileRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConnectionProfile(request), expectedError); + }); + }); + + describe('getPrivateConnection', () => { + it('invokes getPrivateConnection without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetPrivateConnectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetPrivateConnectionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ); + client.innerApiCalls.getPrivateConnection = stubSimpleCall(expectedResponse); + const [response] = await client.getPrivateConnection(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPrivateConnection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPrivateConnection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPrivateConnection without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetPrivateConnectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetPrivateConnectionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ); + client.innerApiCalls.getPrivateConnection = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPrivateConnection( + request, + (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IPrivateConnection|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPrivateConnection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPrivateConnection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPrivateConnection with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetPrivateConnectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetPrivateConnectionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPrivateConnection = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPrivateConnection(request), expectedError); + const actualRequest = (client.innerApiCalls.getPrivateConnection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPrivateConnection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPrivateConnection with closed client', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetPrivateConnectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetPrivateConnectionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPrivateConnection(request), expectedError); + }); + }); + + describe('getConversionWorkspace', () => { + it('invokes getConversionWorkspace without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ); + client.innerApiCalls.getConversionWorkspace = stubSimpleCall(expectedResponse); + const [response] = await client.getConversionWorkspace(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversionWorkspace without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ); + client.innerApiCalls.getConversionWorkspace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConversionWorkspace( + request, + (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IConversionWorkspace|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversionWorkspace with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConversionWorkspace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConversionWorkspace(request), expectedError); + const actualRequest = (client.innerApiCalls.getConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversionWorkspace with closed client', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.GetConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConversionWorkspace(request), expectedError); + }); + }); + + describe('searchBackgroundJobs', () => { + it('invokes searchBackgroundJobs without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SearchBackgroundJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.SearchBackgroundJobsRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SearchBackgroundJobsResponse() + ); + client.innerApiCalls.searchBackgroundJobs = stubSimpleCall(expectedResponse); + const [response] = await client.searchBackgroundJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchBackgroundJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchBackgroundJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchBackgroundJobs without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SearchBackgroundJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.SearchBackgroundJobsRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SearchBackgroundJobsResponse() + ); + client.innerApiCalls.searchBackgroundJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchBackgroundJobs( + request, + (err?: Error|null, result?: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchBackgroundJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchBackgroundJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchBackgroundJobs with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SearchBackgroundJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.SearchBackgroundJobsRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchBackgroundJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchBackgroundJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.searchBackgroundJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchBackgroundJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchBackgroundJobs with closed client', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SearchBackgroundJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.SearchBackgroundJobsRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.searchBackgroundJobs(request), expectedError); + }); + }); + + describe('describeConversionWorkspaceRevisions', () => { + it('invokes describeConversionWorkspaceRevisions without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse() + ); + client.innerApiCalls.describeConversionWorkspaceRevisions = stubSimpleCall(expectedResponse); + const [response] = await client.describeConversionWorkspaceRevisions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes describeConversionWorkspaceRevisions without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse() + ); + client.innerApiCalls.describeConversionWorkspaceRevisions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.describeConversionWorkspaceRevisions( + request, + (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes describeConversionWorkspaceRevisions with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.describeConversionWorkspaceRevisions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.describeConversionWorkspaceRevisions(request), expectedError); + const actualRequest = (client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes describeConversionWorkspaceRevisions with closed client', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.describeConversionWorkspaceRevisions(request), expectedError); + }); + }); + + describe('createMigrationJob', () => { + it('invokes createMigrationJob without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreateMigrationJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMigrationJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.createMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMigrationJob without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreateMigrationJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMigrationJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMigrationJob( + 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.createMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMigrationJob with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreateMigrationJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMigrationJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createMigrationJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMigrationJob with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreateMigrationJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateMigrationJobProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCreateMigrationJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateMigrationJobProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCreateMigrationJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateMigrationJob', () => { + it('invokes updateMigrationJob without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() + ); + request.migrationJob ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateMigrationJobRequest', ['migrationJob', 'name']); + request.migrationJob.name = defaultValue1; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMigrationJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMigrationJob without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() + ); + request.migrationJob ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateMigrationJobRequest', ['migrationJob', 'name']); + request.migrationJob.name = defaultValue1; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMigrationJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMigrationJob( + 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.updateMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMigrationJob with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() + ); + request.migrationJob ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateMigrationJobRequest', ['migrationJob', 'name']); + request.migrationJob.name = defaultValue1; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMigrationJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateMigrationJob(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMigrationJob with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() + ); + request.migrationJob ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateMigrationJobRequest', ['migrationJob', 'name']); + request.migrationJob.name = defaultValue1; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateMigrationJobProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkUpdateMigrationJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateMigrationJobProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkUpdateMigrationJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteMigrationJob', () => { + it('invokes deleteMigrationJob without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMigrationJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMigrationJob without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMigrationJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMigrationJob( + 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.deleteMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMigrationJob with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMigrationJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteMigrationJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMigrationJob with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteMigrationJobProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeleteMigrationJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteMigrationJobProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeleteMigrationJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('startMigrationJob', () => { + it('invokes startMigrationJob without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.StartMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startMigrationJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.startMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startMigrationJob without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.StartMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startMigrationJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startMigrationJob( + 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.startMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startMigrationJob with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.StartMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startMigrationJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.startMigrationJob(request), expectedError); + const actualRequest = (client.innerApiCalls.startMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startMigrationJob with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.StartMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.startMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.startMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStartMigrationJobProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkStartMigrationJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStartMigrationJobProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkStartMigrationJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('stopMigrationJob', () => { + it('invokes stopMigrationJob without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.StopMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopMigrationJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.stopMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.stopMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopMigrationJob without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.StopMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopMigrationJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopMigrationJob( + 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.stopMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopMigrationJob with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.StopMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopMigrationJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.stopMigrationJob(request), expectedError); + const actualRequest = (client.innerApiCalls.stopMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopMigrationJob with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.StopMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.stopMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.stopMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStopMigrationJobProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkStopMigrationJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStopMigrationJobProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkStopMigrationJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('resumeMigrationJob', () => { + it('invokes resumeMigrationJob without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ResumeMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resumeMigrationJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.resumeMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.resumeMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeMigrationJob without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ResumeMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resumeMigrationJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resumeMigrationJob( + 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.resumeMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeMigrationJob with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ResumeMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeMigrationJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.resumeMigrationJob(request), expectedError); + const actualRequest = (client.innerApiCalls.resumeMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeMigrationJob with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ResumeMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.resumeMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.resumeMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkResumeMigrationJobProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkResumeMigrationJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkResumeMigrationJobProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkResumeMigrationJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('promoteMigrationJob', () => { + it('invokes promoteMigrationJob without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.PromoteMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.promoteMigrationJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.promoteMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.promoteMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteMigrationJob without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.PromoteMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.promoteMigrationJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.promoteMigrationJob( + 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.promoteMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteMigrationJob with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.PromoteMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.promoteMigrationJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.promoteMigrationJob(request), expectedError); + const actualRequest = (client.innerApiCalls.promoteMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteMigrationJob with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.PromoteMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.promoteMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.promoteMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.promoteMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.promoteMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkPromoteMigrationJobProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkPromoteMigrationJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPromoteMigrationJobProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkPromoteMigrationJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('verifyMigrationJob', () => { + it('invokes verifyMigrationJob without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.VerifyMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.verifyMigrationJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.verifyMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.verifyMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.verifyMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes verifyMigrationJob without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.VerifyMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.verifyMigrationJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.verifyMigrationJob( + 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.verifyMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.verifyMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes verifyMigrationJob with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.VerifyMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.verifyMigrationJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.verifyMigrationJob(request), expectedError); + const actualRequest = (client.innerApiCalls.verifyMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.verifyMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes verifyMigrationJob with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.VerifyMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.verifyMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.verifyMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.verifyMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.verifyMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkVerifyMigrationJobProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkVerifyMigrationJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkVerifyMigrationJobProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkVerifyMigrationJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restartMigrationJob', () => { + it('invokes restartMigrationJob without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.RestartMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartMigrationJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.restartMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restartMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartMigrationJob without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.RestartMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartMigrationJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartMigrationJob( + 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.restartMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartMigrationJob with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.RestartMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartMigrationJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restartMigrationJob(request), expectedError); + const actualRequest = (client.innerApiCalls.restartMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartMigrationJob with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.RestartMigrationJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restartMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restartMigrationJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartMigrationJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestartMigrationJobProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkRestartMigrationJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestartMigrationJobProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkRestartMigrationJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createConnectionProfile', () => { + it('invokes createConnectionProfile without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConnectionProfileRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createConnectionProfile = stubLongRunningCall(expectedResponse); + const [operation] = await client.createConnectionProfile(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConnectionProfile without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConnectionProfileRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createConnectionProfile = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createConnectionProfile( + 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.createConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConnectionProfile with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConnectionProfileRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConnectionProfile = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createConnectionProfile(request), expectedError); + const actualRequest = (client.innerApiCalls.createConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConnectionProfile with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConnectionProfileRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConnectionProfile = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createConnectionProfile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateConnectionProfileProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCreateConnectionProfileProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateConnectionProfileProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCreateConnectionProfileProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateConnectionProfile', () => { + it('invokes updateConnectionProfile without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + ); + request.connectionProfile ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', ['connectionProfile', 'name']); + request.connectionProfile.name = defaultValue1; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConnectionProfile = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateConnectionProfile(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConnectionProfile without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + ); + request.connectionProfile ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', ['connectionProfile', 'name']); + request.connectionProfile.name = defaultValue1; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConnectionProfile = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateConnectionProfile( + 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.updateConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConnectionProfile with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + ); + request.connectionProfile ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', ['connectionProfile', 'name']); + request.connectionProfile.name = defaultValue1; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConnectionProfile = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateConnectionProfile(request), expectedError); + const actualRequest = (client.innerApiCalls.updateConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConnectionProfile with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + ); + request.connectionProfile ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', ['connectionProfile', 'name']); + request.connectionProfile.name = defaultValue1; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConnectionProfile = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateConnectionProfile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateConnectionProfileProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkUpdateConnectionProfileProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateConnectionProfileProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkUpdateConnectionProfileProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteConnectionProfile', () => { + it('invokes deleteConnectionProfile without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteConnectionProfile(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnectionProfile without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConnectionProfile = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteConnectionProfile( + 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.deleteConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnectionProfile with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteConnectionProfile(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnectionProfile with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteConnectionProfile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteConnectionProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConnectionProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteConnectionProfileProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeleteConnectionProfileProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteConnectionProfileProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeleteConnectionProfileProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createPrivateConnection', () => { + it('invokes createPrivateConnection without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreatePrivateConnectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreatePrivateConnectionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPrivateConnection = stubLongRunningCall(expectedResponse); + const [operation] = await client.createPrivateConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPrivateConnection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPrivateConnection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPrivateConnection without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreatePrivateConnectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreatePrivateConnectionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPrivateConnection = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPrivateConnection( + 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.createPrivateConnection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPrivateConnection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPrivateConnection with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreatePrivateConnectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreatePrivateConnectionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPrivateConnection = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createPrivateConnection(request), expectedError); + const actualRequest = (client.innerApiCalls.createPrivateConnection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPrivateConnection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPrivateConnection with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreatePrivateConnectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreatePrivateConnectionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPrivateConnection = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createPrivateConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createPrivateConnection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPrivateConnection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreatePrivateConnectionProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCreatePrivateConnectionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreatePrivateConnectionProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCreatePrivateConnectionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deletePrivateConnection', () => { + it('invokes deletePrivateConnection without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeletePrivateConnectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeletePrivateConnectionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePrivateConnection = stubLongRunningCall(expectedResponse); + const [operation] = await client.deletePrivateConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePrivateConnection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePrivateConnection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePrivateConnection without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeletePrivateConnectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeletePrivateConnectionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePrivateConnection = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePrivateConnection( + 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.deletePrivateConnection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePrivateConnection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePrivateConnection with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeletePrivateConnectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeletePrivateConnectionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePrivateConnection = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deletePrivateConnection(request), expectedError); + const actualRequest = (client.innerApiCalls.deletePrivateConnection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePrivateConnection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePrivateConnection with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeletePrivateConnectionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeletePrivateConnectionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePrivateConnection = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deletePrivateConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deletePrivateConnection as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePrivateConnection as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeletePrivateConnectionProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeletePrivateConnectionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeletePrivateConnectionProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeletePrivateConnectionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createConversionWorkspace', () => { + it('invokes createConversionWorkspace without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createConversionWorkspace = stubLongRunningCall(expectedResponse); + const [operation] = await client.createConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConversionWorkspace without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createConversionWorkspace( + 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.createConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConversionWorkspace with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConversionWorkspace = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createConversionWorkspace(request), expectedError); + const actualRequest = (client.innerApiCalls.createConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConversionWorkspace with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateConversionWorkspaceProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCreateConversionWorkspaceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateConversionWorkspaceProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCreateConversionWorkspaceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateConversionWorkspace', () => { + it('invokes updateConversionWorkspace without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest() + ); + request.conversionWorkspace ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest', ['conversionWorkspace', 'name']); + request.conversionWorkspace.name = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConversionWorkspace = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConversionWorkspace without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest() + ); + request.conversionWorkspace ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest', ['conversionWorkspace', 'name']); + request.conversionWorkspace.name = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateConversionWorkspace( + 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.updateConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConversionWorkspace with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest() + ); + request.conversionWorkspace ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest', ['conversionWorkspace', 'name']); + request.conversionWorkspace.name = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConversionWorkspace = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateConversionWorkspace(request), expectedError); + const actualRequest = (client.innerApiCalls.updateConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConversionWorkspace with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest() + ); + request.conversionWorkspace ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest', ['conversionWorkspace', 'name']); + request.conversionWorkspace.name = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateConversionWorkspaceProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkUpdateConversionWorkspaceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateConversionWorkspaceProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkUpdateConversionWorkspaceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteConversionWorkspace', () => { + it('invokes deleteConversionWorkspace without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConversionWorkspace = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversionWorkspace without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteConversionWorkspace( + 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.deleteConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversionWorkspace with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConversionWorkspace = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteConversionWorkspace(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversionWorkspace with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteConversionWorkspaceProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeleteConversionWorkspaceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteConversionWorkspaceProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeleteConversionWorkspaceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('seedConversionWorkspace', () => { + it('invokes seedConversionWorkspace without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.seedConversionWorkspace = stubLongRunningCall(expectedResponse); + const [operation] = await client.seedConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.seedConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.seedConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes seedConversionWorkspace without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.seedConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.seedConversionWorkspace( + 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.seedConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.seedConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes seedConversionWorkspace with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.seedConversionWorkspace = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.seedConversionWorkspace(request), expectedError); + const actualRequest = (client.innerApiCalls.seedConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.seedConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes seedConversionWorkspace with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.seedConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.seedConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.seedConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.seedConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSeedConversionWorkspaceProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkSeedConversionWorkspaceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSeedConversionWorkspaceProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkSeedConversionWorkspaceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importMappingRules', () => { + it('invokes importMappingRules without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ImportMappingRulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ImportMappingRulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importMappingRules = stubLongRunningCall(expectedResponse); + const [operation] = await client.importMappingRules(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.importMappingRules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importMappingRules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importMappingRules without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ImportMappingRulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ImportMappingRulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importMappingRules = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importMappingRules( + 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.importMappingRules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importMappingRules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importMappingRules with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ImportMappingRulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ImportMappingRulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importMappingRules = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importMappingRules(request), expectedError); + const actualRequest = (client.innerApiCalls.importMappingRules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importMappingRules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importMappingRules with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ImportMappingRulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ImportMappingRulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importMappingRules = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importMappingRules(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importMappingRules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importMappingRules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportMappingRulesProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkImportMappingRulesProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportMappingRulesProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkImportMappingRulesProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('convertConversionWorkspace', () => { + it('invokes convertConversionWorkspace without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.convertConversionWorkspace = stubLongRunningCall(expectedResponse); + const [operation] = await client.convertConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.convertConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.convertConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes convertConversionWorkspace without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.convertConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.convertConversionWorkspace( + 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.convertConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.convertConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes convertConversionWorkspace with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.convertConversionWorkspace = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.convertConversionWorkspace(request), expectedError); + const actualRequest = (client.innerApiCalls.convertConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.convertConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes convertConversionWorkspace with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.convertConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.convertConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.convertConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.convertConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkConvertConversionWorkspaceProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkConvertConversionWorkspaceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkConvertConversionWorkspaceProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkConvertConversionWorkspaceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('commitConversionWorkspace', () => { + it('invokes commitConversionWorkspace without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.commitConversionWorkspace = stubLongRunningCall(expectedResponse); + const [operation] = await client.commitConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.commitConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.commitConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commitConversionWorkspace without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.commitConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.commitConversionWorkspace( + 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.commitConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.commitConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commitConversionWorkspace with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.commitConversionWorkspace = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.commitConversionWorkspace(request), expectedError); + const actualRequest = (client.innerApiCalls.commitConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.commitConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commitConversionWorkspace with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.commitConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.commitConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.commitConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.commitConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCommitConversionWorkspaceProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCommitConversionWorkspaceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCommitConversionWorkspaceProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCommitConversionWorkspaceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('rollbackConversionWorkspace', () => { + it('invokes rollbackConversionWorkspace without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.rollbackConversionWorkspace = stubLongRunningCall(expectedResponse); + const [operation] = await client.rollbackConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackConversionWorkspace without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.rollbackConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollbackConversionWorkspace( + 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.rollbackConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackConversionWorkspace with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackConversionWorkspace = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.rollbackConversionWorkspace(request), expectedError); + const actualRequest = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackConversionWorkspace with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.rollbackConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRollbackConversionWorkspaceProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkRollbackConversionWorkspaceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRollbackConversionWorkspaceProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkRollbackConversionWorkspaceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('applyConversionWorkspace', () => { + it('invokes applyConversionWorkspace without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applyConversionWorkspace = stubLongRunningCall(expectedResponse); + const [operation] = await client.applyConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.applyConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.applyConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applyConversionWorkspace without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applyConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.applyConversionWorkspace( + 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.applyConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.applyConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applyConversionWorkspace with call error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.applyConversionWorkspace = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.applyConversionWorkspace(request), expectedError); + const actualRequest = (client.innerApiCalls.applyConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.applyConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applyConversionWorkspace with LRO error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.applyConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.applyConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.applyConversionWorkspace as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.applyConversionWorkspace as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkApplyConversionWorkspaceProgress without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkApplyConversionWorkspaceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkApplyConversionWorkspaceProgress with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkApplyConversionWorkspaceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listMigrationJobs', () => { + it('invokes listMigrationJobs without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), + ]; + client.innerApiCalls.listMigrationJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listMigrationJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMigrationJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMigrationJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMigrationJobs without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), + ]; + client.innerApiCalls.listMigrationJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMigrationJobs( + request, + (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IMigrationJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMigrationJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMigrationJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMigrationJobs with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMigrationJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMigrationJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listMigrationJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMigrationJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMigrationJobsStream without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), + ]; + client.descriptors.page.listMigrationJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMigrationJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.MigrationJob[] = []; + stream.on('data', (response: protos.google.cloud.clouddms.v1.MigrationJob) => { + 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.listMigrationJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMigrationJobs, request)); + assert( + (client.descriptors.page.listMigrationJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMigrationJobsStream with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMigrationJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listMigrationJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.MigrationJob[] = []; + stream.on('data', (response: protos.google.cloud.clouddms.v1.MigrationJob) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMigrationJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMigrationJobs, request)); + assert( + (client.descriptors.page.listMigrationJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMigrationJobs without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), + ]; + client.descriptors.page.listMigrationJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.clouddms.v1.IMigrationJob[] = []; + const iterable = client.listMigrationJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMigrationJobs with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMigrationJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMigrationJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.clouddms.v1.IMigrationJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listConnectionProfiles', () => { + it('invokes listConnectionProfiles without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), + ]; + client.innerApiCalls.listConnectionProfiles = stubSimpleCall(expectedResponse); + const [response] = await client.listConnectionProfiles(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listConnectionProfiles as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConnectionProfiles as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectionProfiles without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), + ]; + client.innerApiCalls.listConnectionProfiles = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConnectionProfiles( + request, + (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IConnectionProfile[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listConnectionProfiles as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConnectionProfiles as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectionProfiles with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConnectionProfiles = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listConnectionProfiles(request), expectedError); + const actualRequest = (client.innerApiCalls.listConnectionProfiles as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConnectionProfiles as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectionProfilesStream without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), + ]; + client.descriptors.page.listConnectionProfiles.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listConnectionProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.ConnectionProfile[] = []; + stream.on('data', (response: protos.google.cloud.clouddms.v1.ConnectionProfile) => { + 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.listConnectionProfiles.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listConnectionProfiles, request)); + assert( + (client.descriptors.page.listConnectionProfiles.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConnectionProfilesStream with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectionProfiles.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listConnectionProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.ConnectionProfile[] = []; + stream.on('data', (response: protos.google.cloud.clouddms.v1.ConnectionProfile) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listConnectionProfiles.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listConnectionProfiles, request)); + assert( + (client.descriptors.page.listConnectionProfiles.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectionProfiles without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), + ]; + client.descriptors.page.listConnectionProfiles.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.clouddms.v1.IConnectionProfile[] = []; + const iterable = client.listConnectionProfilesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listConnectionProfiles.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listConnectionProfiles.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectionProfiles with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectionProfiles.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConnectionProfilesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.clouddms.v1.IConnectionProfile[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listConnectionProfiles.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listConnectionProfiles.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listPrivateConnections', () => { + it('invokes listPrivateConnections without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), + ]; + client.innerApiCalls.listPrivateConnections = stubSimpleCall(expectedResponse); + const [response] = await client.listPrivateConnections(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPrivateConnections as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPrivateConnections as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrivateConnections without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), + ]; + client.innerApiCalls.listPrivateConnections = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPrivateConnections( + request, + (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IPrivateConnection[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPrivateConnections as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPrivateConnections as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrivateConnections with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPrivateConnections = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPrivateConnections(request), expectedError); + const actualRequest = (client.innerApiCalls.listPrivateConnections as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPrivateConnections as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrivateConnectionsStream without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), + ]; + client.descriptors.page.listPrivateConnections.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listPrivateConnectionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.PrivateConnection[] = []; + stream.on('data', (response: protos.google.cloud.clouddms.v1.PrivateConnection) => { + 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.listPrivateConnections.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPrivateConnections, request)); + assert( + (client.descriptors.page.listPrivateConnections.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPrivateConnectionsStream with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPrivateConnections.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listPrivateConnectionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.PrivateConnection[] = []; + stream.on('data', (response: protos.google.cloud.clouddms.v1.PrivateConnection) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listPrivateConnections.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPrivateConnections, request)); + assert( + (client.descriptors.page.listPrivateConnections.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPrivateConnections without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), + ]; + client.descriptors.page.listPrivateConnections.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.clouddms.v1.IPrivateConnection[] = []; + const iterable = client.listPrivateConnectionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPrivateConnections.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPrivateConnections.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPrivateConnections with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPrivateConnections.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPrivateConnectionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.clouddms.v1.IPrivateConnection[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPrivateConnections.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPrivateConnections.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listConversionWorkspaces', () => { + it('invokes listConversionWorkspaces without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), + ]; + client.innerApiCalls.listConversionWorkspaces = stubSimpleCall(expectedResponse); + const [response] = await client.listConversionWorkspaces(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listConversionWorkspaces as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversionWorkspaces as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversionWorkspaces without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), + ]; + client.innerApiCalls.listConversionWorkspaces = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConversionWorkspaces( + request, + (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IConversionWorkspace[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listConversionWorkspaces as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversionWorkspaces as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversionWorkspaces with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConversionWorkspaces = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listConversionWorkspaces(request), expectedError); + const actualRequest = (client.innerApiCalls.listConversionWorkspaces as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversionWorkspaces as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversionWorkspacesStream without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), + ]; + client.descriptors.page.listConversionWorkspaces.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listConversionWorkspacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.ConversionWorkspace[] = []; + stream.on('data', (response: protos.google.cloud.clouddms.v1.ConversionWorkspace) => { + 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.listConversionWorkspaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listConversionWorkspaces, request)); + assert( + (client.descriptors.page.listConversionWorkspaces.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConversionWorkspacesStream with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConversionWorkspaces.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listConversionWorkspacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.ConversionWorkspace[] = []; + stream.on('data', (response: protos.google.cloud.clouddms.v1.ConversionWorkspace) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listConversionWorkspaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listConversionWorkspaces, request)); + assert( + (client.descriptors.page.listConversionWorkspaces.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConversionWorkspaces without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), + ]; + client.descriptors.page.listConversionWorkspaces.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.clouddms.v1.IConversionWorkspace[] = []; + const iterable = client.listConversionWorkspacesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listConversionWorkspaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listConversionWorkspaces.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConversionWorkspaces with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConversionWorkspaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConversionWorkspacesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.clouddms.v1.IConversionWorkspace[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listConversionWorkspaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listConversionWorkspaces.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('describeDatabaseEntities', () => { + it('invokes describeDatabaseEntities without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), + ]; + client.innerApiCalls.describeDatabaseEntities = stubSimpleCall(expectedResponse); + const [response] = await client.describeDatabaseEntities(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.describeDatabaseEntities as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.describeDatabaseEntities as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes describeDatabaseEntities without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), + ]; + client.innerApiCalls.describeDatabaseEntities = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.describeDatabaseEntities( + request, + (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IDatabaseEntity[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.describeDatabaseEntities as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.describeDatabaseEntities as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes describeDatabaseEntities with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.describeDatabaseEntities = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.describeDatabaseEntities(request), expectedError); + const actualRequest = (client.innerApiCalls.describeDatabaseEntities as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.describeDatabaseEntities as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes describeDatabaseEntitiesStream without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), + ]; + client.descriptors.page.describeDatabaseEntities.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.describeDatabaseEntitiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.DatabaseEntity[] = []; + stream.on('data', (response: protos.google.cloud.clouddms.v1.DatabaseEntity) => { + 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.describeDatabaseEntities.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.describeDatabaseEntities, request)); + assert( + (client.descriptors.page.describeDatabaseEntities.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes describeDatabaseEntitiesStream with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.describeDatabaseEntities.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.describeDatabaseEntitiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.DatabaseEntity[] = []; + stream.on('data', (response: protos.google.cloud.clouddms.v1.DatabaseEntity) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.describeDatabaseEntities.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.describeDatabaseEntities, request)); + assert( + (client.descriptors.page.describeDatabaseEntities.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with describeDatabaseEntities without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), + generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), + ]; + client.descriptors.page.describeDatabaseEntities.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.clouddms.v1.IDatabaseEntity[] = []; + const iterable = client.describeDatabaseEntitiesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.describeDatabaseEntities.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.describeDatabaseEntities.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with describeDatabaseEntities with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.describeDatabaseEntities.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.describeDatabaseEntitiesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.clouddms.v1.IDatabaseEntity[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.describeDatabaseEntities.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.describeDatabaseEntities.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('fetchStaticIps', () => { + it('invokes fetchStaticIps without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.fetchStaticIps = stubSimpleCall(expectedResponse); + const [response] = await client.fetchStaticIps(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchStaticIps as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchStaticIps as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchStaticIps without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.fetchStaticIps = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchStaticIps( + request, + (err?: Error|null, result?: string[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchStaticIps as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchStaticIps as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchStaticIps with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchStaticIps = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchStaticIps(request), expectedError); + const actualRequest = (client.innerApiCalls.fetchStaticIps as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchStaticIps as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchStaticIpsStream without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.fetchStaticIps.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.fetchStaticIpsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + 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.fetchStaticIps.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.fetchStaticIps, request)); + assert( + (client.descriptors.page.fetchStaticIps.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes fetchStaticIpsStream with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchStaticIps.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.fetchStaticIpsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.fetchStaticIps.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.fetchStaticIps, request)); + assert( + (client.descriptors.page.fetchStaticIps.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchStaticIps without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.fetchStaticIps.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: string[] = []; + const iterable = client.fetchStaticIpsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.fetchStaticIps.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.fetchStaticIps.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchStaticIps with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchStaticIps.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.fetchStaticIpsAsync(request); + await assert.rejects(async () => { + const responses: string[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.fetchStaticIps.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.fetchStaticIps.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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('connectionProfile', () => { + const fakePath = "/rendered/path/connectionProfile"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + connection_profile: "connectionProfileValue", + }; + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.connectionProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.connectionProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('connectionProfilePath', () => { + const result = client.connectionProfilePath("projectValue", "locationValue", "connectionProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.connectionProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConnectionProfileName', () => { + const result = client.matchProjectFromConnectionProfileName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.connectionProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConnectionProfileName', () => { + const result = client.matchLocationFromConnectionProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.connectionProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConnectionProfileFromConnectionProfileName', () => { + const result = client.matchConnectionProfileFromConnectionProfileName(fakePath); + assert.strictEqual(result, "connectionProfileValue"); + assert((client.pathTemplates.connectionProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('conversionWorkspace', () => { + const fakePath = "/rendered/path/conversionWorkspace"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + conversion_workspace: "conversionWorkspaceValue", + }; + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.conversionWorkspacePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.conversionWorkspacePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('conversionWorkspacePath', () => { + const result = client.conversionWorkspacePath("projectValue", "locationValue", "conversionWorkspaceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.conversionWorkspacePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConversionWorkspaceName', () => { + const result = client.matchProjectFromConversionWorkspaceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.conversionWorkspacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConversionWorkspaceName', () => { + const result = client.matchLocationFromConversionWorkspaceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.conversionWorkspacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversionWorkspaceFromConversionWorkspaceName', () => { + const result = client.matchConversionWorkspaceFromConversionWorkspaceName(fakePath); + assert.strictEqual(result, "conversionWorkspaceValue"); + assert((client.pathTemplates.conversionWorkspacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('migrationJob', () => { + const fakePath = "/rendered/path/migrationJob"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + migration_job: "migrationJobValue", + }; + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.migrationJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.migrationJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('migrationJobPath', () => { + const result = client.migrationJobPath("projectValue", "locationValue", "migrationJobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.migrationJobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMigrationJobName', () => { + const result = client.matchProjectFromMigrationJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.migrationJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMigrationJobName', () => { + const result = client.matchLocationFromMigrationJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.migrationJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMigrationJobFromMigrationJobName', () => { + const result = client.matchMigrationJobFromMigrationJobName(fakePath); + assert.strictEqual(result, "migrationJobValue"); + assert((client.pathTemplates.migrationJobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('privateConnection', () => { + const fakePath = "/rendered/path/privateConnection"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + private_connection: "privateConnectionValue", + }; + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.privateConnectionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.privateConnectionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('privateConnectionPath', () => { + const result = client.privateConnectionPath("projectValue", "locationValue", "privateConnectionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.privateConnectionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPrivateConnectionName', () => { + const result = client.matchProjectFromPrivateConnectionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.privateConnectionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPrivateConnectionName', () => { + const result = client.matchLocationFromPrivateConnectionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.privateConnectionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPrivateConnectionFromPrivateConnectionName', () => { + const result = client.matchPrivateConnectionFromPrivateConnectionName(fakePath); + assert.strictEqual(result, "privateConnectionValue"); + assert((client.pathTemplates.privateConnectionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-clouddms/v1/tsconfig.json b/owl-bot-staging/google-cloud-clouddms/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/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-clouddms/v1/webpack.config.js b/owl-bot-staging/google-cloud-clouddms/v1/webpack.config.js new file mode 100644 index 00000000000..97e2580c8eb --- /dev/null +++ b/owl-bot-staging/google-cloud-clouddms/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: 'DataMigrationService', + filename: './data-migration-service.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 e50faf21cfc4c2acfa78f0932ef3ba459e6eed6a Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 18 May 2023 09:02:52 +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 --- .../google-cloud-clouddms/v1/.eslintignore | 7 - .../google-cloud-clouddms/v1/.eslintrc.json | 3 - .../google-cloud-clouddms/v1/.gitignore | 14 - .../google-cloud-clouddms/v1/.jsdoc.js | 55 - .../google-cloud-clouddms/v1/.mocharc.js | 33 - .../google-cloud-clouddms/v1/.prettierrc.js | 22 - .../google-cloud-clouddms/v1/README.md | 1 - .../v1/linkinator.config.json | 16 - .../google-cloud-clouddms/v1/package.json | 64 - .../google/cloud/clouddms/v1/clouddms.proto | 1412 - .../clouddms/v1/clouddms_resources.proto | 1139 - ...ation_service.create_connection_profile.js | 92 - ..._migration_service.create_migration_job.js | 82 - ...ation_service.delete_connection_profile.js | 75 - ..._migration_service.delete_migration_job.js | 76 - ...a_migration_service.generate_ssh_script.js | 77 - ...igration_service.get_connection_profile.js | 61 - ...ata_migration_service.get_migration_job.js | 61 - ...ration_service.list_connection_profiles.js | 93 - ...a_migration_service.list_migration_jobs.js | 95 - ...migration_service.promote_migration_job.js | 61 - ...migration_service.restart_migration_job.js | 61 - ..._migration_service.resume_migration_job.js | 61 - ...a_migration_service.start_migration_job.js | 61 - ...ta_migration_service.stop_migration_job.js | 61 - ...ation_service.update_connection_profile.js | 88 - ..._migration_service.update_migration_job.js | 76 - ..._migration_service.verify_migration_job.js | 61 - ...pet_metadata.google.cloud.clouddms.v1.json | 1739 - .../google-cloud-clouddms/v1/src/index.ts | 25 - .../src/v1/data_migration_service_client.ts | 5338 --- .../data_migration_service_client_config.json | 206 - .../v1/data_migration_service_proto_list.json | 5 - .../v1/src/v1/gapic_metadata.json | 407 - .../google-cloud-clouddms/v1/src/v1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1/system-test/install.ts | 49 - .../test/gapic_data_migration_service_v1.ts | 6929 --- .../google-cloud-clouddms/v1/tsconfig.json | 19 - .../v1/webpack.config.js | 64 - packages/google-cloud-clouddms/README.md | 60 +- .../google/cloud/clouddms/v1/clouddms.proto | 941 +- .../clouddms/v1/clouddms_resources.proto | 520 +- .../v1/conversionworkspace_resources.proto | 0 .../google-cloud-clouddms/protos/protos.d.ts | 10218 +++- .../google-cloud-clouddms/protos/protos.js | 39194 ++++++++++++---- .../google-cloud-clouddms/protos/protos.json | 3639 +- .../google-cloud-clouddms/samples/README.md | 356 +- ...tion_service.apply_conversion_workspace.js | 0 ...ion_service.commit_conversion_workspace.js | 0 ...on_service.convert_conversion_workspace.js | 0 ...ation_service.create_connection_profile.js | 20 +- ...ion_service.create_conversion_workspace.js | 0 ..._migration_service.create_migration_job.js | 8 +- ...ation_service.create_private_connection.js | 0 ...ation_service.delete_connection_profile.js | 6 +- ...ion_service.delete_conversion_workspace.js | 0 ..._migration_service.delete_migration_job.js | 6 +- ...ation_service.delete_private_connection.js | 0 ...describe_conversion_workspace_revisions.js | 0 ...tion_service.describe_database_entities.js | 0 ...data_migration_service.fetch_static_ips.js | 0 ...a_migration_service.generate_ssh_script.js | 2 +- ...ration_service.get_conversion_workspace.js | 0 ...igration_service.get_private_connection.js | 0 ..._migration_service.import_mapping_rules.js | 0 ...ration_service.list_connection_profiles.js | 6 +- ...tion_service.list_conversion_workspaces.js | 0 ...a_migration_service.list_migration_jobs.js | 4 +- ...ration_service.list_private_connections.js | 0 ...n_service.rollback_conversion_workspace.js | 0 ...igration_service.search_background_jobs.js | 0 ...ation_service.seed_conversion_workspace.js | 0 ...ation_service.update_connection_profile.js | 22 +- ...ion_service.update_conversion_workspace.js | 0 ..._migration_service.update_migration_job.js | 10 +- ...pet_metadata.google.cloud.clouddms.v1.json | 948 +- .../src/v1/data_migration_service_client.ts | 5269 ++- .../data_migration_service_client_config.json | 95 + .../v1/data_migration_service_proto_list.json | 3 +- .../src/v1/gapic_metadata.json | 206 + .../test/gapic_data_migration_service_v1.ts | 7100 ++- 83 files changed, 55895 insertions(+), 31605 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/README.md delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/linkinator.config.json delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/package.json delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms.proto delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms_resources.proto delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_connection_profile.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_migration_job.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_connection_profile.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_migration_job.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.generate_ssh_script.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_connection_profile.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_migration_job.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_connection_profiles.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_migration_jobs.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.promote_migration_job.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.restart_migration_job.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.resume_migration_job.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.start_migration_job.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.stop_migration_job.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_connection_profile.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_migration_job.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.verify_migration_job.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/test/gapic_data_migration_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-clouddms/v1/webpack.config.js rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.apply_conversion_workspace.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.commit_conversion_workspace.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.convert_conversion_workspace.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.create_conversion_workspace.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.create_private_connection.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.delete_conversion_workspace.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.delete_private_connection.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.describe_database_entities.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.fetch_static_ips.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.get_conversion_workspace.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.get_private_connection.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.import_mapping_rules.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.list_conversion_workspaces.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.list_private_connections.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.search_background_jobs.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.seed_conversion_workspace.js (100%) rename {owl-bot-staging/google-cloud-clouddms/v1 => packages/google-cloud-clouddms}/samples/generated/v1/data_migration_service.update_conversion_workspace.js (100%) diff --git a/owl-bot-staging/google-cloud-clouddms/v1/.eslintignore b/owl-bot-staging/google-cloud-clouddms/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/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-clouddms/v1/.eslintrc.json b/owl-bot-staging/google-cloud-clouddms/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/.gitignore b/owl-bot-staging/google-cloud-clouddms/v1/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/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-clouddms/v1/.jsdoc.js b/owl-bot-staging/google-cloud-clouddms/v1/.jsdoc.js deleted file mode 100644 index c2acb4b4a1c..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 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 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/dms', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-clouddms/v1/.mocharc.js b/owl-bot-staging/google-cloud-clouddms/v1/.mocharc.js deleted file mode 100644 index 1a38f257db7..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 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-clouddms/v1/.prettierrc.js b/owl-bot-staging/google-cloud-clouddms/v1/.prettierrc.js deleted file mode 100644 index 55639e70f9e..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 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-clouddms/v1/README.md b/owl-bot-staging/google-cloud-clouddms/v1/README.md deleted file mode 100644 index 55024e41595..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Clouddms: Nodejs Client diff --git a/owl-bot-staging/google-cloud-clouddms/v1/linkinator.config.json b/owl-bot-staging/google-cloud-clouddms/v1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/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-clouddms/v1/package.json b/owl-bot-staging/google-cloud-clouddms/v1/package.json deleted file mode 100644 index 38af89d6f5f..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/dms", - "version": "0.1.0", - "description": "Clouddms client for Node.js", - "repository": "googleapis/nodejs-clouddms", - "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 clouddms", - "clouddms", - "data migration service" - ], - "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.7" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.0.1", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms.proto b/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms.proto deleted file mode 100644 index 69d7d93d016..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms.proto +++ /dev/null @@ -1,1412 +0,0 @@ -// Copyright 2023 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.clouddms.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/clouddms/v1/clouddms_resources.proto"; -import "google/cloud/clouddms/v1/conversionworkspace_resources.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.CloudDms.V1"; -option go_package = "cloud.google.com/go/clouddms/apiv1/clouddmspb;clouddmspb"; -option java_multiple_files = true; -option java_outer_classname = "ClouddmsProto"; -option java_package = "com.google.cloud.clouddms.v1"; -option php_namespace = "Google\\Cloud\\CloudDms\\V1"; -option ruby_package = "Google::Cloud::CloudDMS::V1"; - -// Database Migration service -service DataMigrationService { - option (google.api.default_host) = "datamigration.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Lists migration jobs in a given project and location. - rpc ListMigrationJobs(ListMigrationJobsRequest) - returns (ListMigrationJobsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/migrationJobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single migration job. - rpc GetMigrationJob(GetMigrationJobRequest) returns (MigrationJob) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/migrationJobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new migration job in a given project and location. - rpc CreateMigrationJob(CreateMigrationJobRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/migrationJobs" - body: "migration_job" - }; - option (google.api.method_signature) = - "parent,migration_job,migration_job_id"; - option (google.longrunning.operation_info) = { - response_type: "MigrationJob" - metadata_type: "OperationMetadata" - }; - } - - // Updates the parameters of a single migration job. - rpc UpdateMigrationJob(UpdateMigrationJobRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{migration_job.name=projects/*/locations/*/migrationJobs/*}" - body: "migration_job" - }; - option (google.api.method_signature) = "migration_job,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "MigrationJob" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single migration job. - rpc DeleteMigrationJob(DeleteMigrationJobRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/migrationJobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Start an already created migration job. - rpc StartMigrationJob(StartMigrationJobRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:start" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "MigrationJob" - metadata_type: "OperationMetadata" - }; - } - - // Stops a running migration job. - rpc StopMigrationJob(StopMigrationJobRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:stop" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "MigrationJob" - metadata_type: "OperationMetadata" - }; - } - - // Resume a migration job that is currently stopped and is resumable (was - // stopped during CDC phase). - rpc ResumeMigrationJob(ResumeMigrationJobRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:resume" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "MigrationJob" - metadata_type: "OperationMetadata" - }; - } - - // Promote a migration job, stopping replication to the destination and - // promoting the destination to be a standalone database. - rpc PromoteMigrationJob(PromoteMigrationJobRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:promote" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "MigrationJob" - metadata_type: "OperationMetadata" - }; - } - - // Verify a migration job, making sure the destination can reach the source - // and that all configuration and prerequisites are met. - rpc VerifyMigrationJob(VerifyMigrationJobRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:verify" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "MigrationJob" - metadata_type: "OperationMetadata" - }; - } - - // Restart a stopped or failed migration job, resetting the destination - // instance to its original state and starting the migration process from - // scratch. - rpc RestartMigrationJob(RestartMigrationJobRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:restart" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "MigrationJob" - metadata_type: "OperationMetadata" - }; - } - - // Generate a SSH configuration script to configure the reverse SSH - // connectivity. - rpc GenerateSshScript(GenerateSshScriptRequest) returns (SshScript) { - option (google.api.http) = { - post: "/v1/{migration_job=projects/*/locations/*/migrationJobs/*}:generateSshScript" - body: "*" - }; - } - - // Retrieves a list of all connection profiles in a given project and - // location. - rpc ListConnectionProfiles(ListConnectionProfilesRequest) - returns (ListConnectionProfilesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/connectionProfiles" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single connection profile. - rpc GetConnectionProfile(GetConnectionProfileRequest) - returns (ConnectionProfile) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/connectionProfiles/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new connection profile in a given project and location. - rpc CreateConnectionProfile(CreateConnectionProfileRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/connectionProfiles" - body: "connection_profile" - }; - option (google.api.method_signature) = - "parent,connection_profile,connection_profile_id"; - option (google.longrunning.operation_info) = { - response_type: "ConnectionProfile" - metadata_type: "OperationMetadata" - }; - } - - // Update the configuration of a single connection profile. - rpc UpdateConnectionProfile(UpdateConnectionProfileRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{connection_profile.name=projects/*/locations/*/connectionProfiles/*}" - body: "connection_profile" - }; - option (google.api.method_signature) = "connection_profile,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "ConnectionProfile" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single Database Migration Service connection profile. - // A connection profile can only be deleted if it is not in use by any - // active migration jobs. - rpc DeleteConnectionProfile(DeleteConnectionProfileRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/connectionProfiles/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Creates a new private connection in a given project and location. - rpc CreatePrivateConnection(CreatePrivateConnectionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/privateConnections" - body: "private_connection" - }; - option (google.api.method_signature) = - "parent,private_connection,private_connection_id"; - option (google.longrunning.operation_info) = { - response_type: "PrivateConnection" - metadata_type: "OperationMetadata" - }; - } - - // Gets details of a single private connection. - rpc GetPrivateConnection(GetPrivateConnectionRequest) - returns (PrivateConnection) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/privateConnections/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Retrieves a list of private connections in a given project and location. - rpc ListPrivateConnections(ListPrivateConnectionsRequest) - returns (ListPrivateConnectionsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/privateConnections" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a single Database Migration Service private connection. - rpc DeletePrivateConnection(DeletePrivateConnectionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/privateConnections/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Gets details of a single conversion workspace. - rpc GetConversionWorkspace(GetConversionWorkspaceRequest) - returns (ConversionWorkspace) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists conversion workspaces in a given project and location. - rpc ListConversionWorkspaces(ListConversionWorkspacesRequest) - returns (ListConversionWorkspacesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/conversionWorkspaces" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates a new conversion workspace in a given project and location. - rpc CreateConversionWorkspace(CreateConversionWorkspaceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/conversionWorkspaces" - body: "conversion_workspace" - }; - option (google.api.method_signature) = - "parent,conversion_workspace,conversion_workspace_id"; - option (google.longrunning.operation_info) = { - response_type: "ConversionWorkspace" - metadata_type: "OperationMetadata" - }; - } - - // Updates the parameters of a single conversion workspace. - rpc UpdateConversionWorkspace(UpdateConversionWorkspaceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{conversion_workspace.name=projects/*/locations/*/conversionWorkspaces/*}" - body: "conversion_workspace" - }; - option (google.api.method_signature) = "conversion_workspace,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "ConversionWorkspace" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single conversion workspace. - rpc DeleteConversionWorkspace(DeleteConversionWorkspaceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Imports a snapshot of the source database into the - // conversion workspace. - rpc SeedConversionWorkspace(SeedConversionWorkspaceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:seed" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "ConversionWorkspace" - metadata_type: "OperationMetadata" - }; - } - - // Imports the mapping rules for a given conversion workspace. - // Supports various formats of external rules files. - rpc ImportMappingRules(ImportMappingRulesRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/conversionWorkspaces/*}/mappingRules:import" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "ConversionWorkspace" - metadata_type: "OperationMetadata" - }; - } - - // Creates a draft tree schema for the destination database. - rpc ConvertConversionWorkspace(ConvertConversionWorkspaceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:convert" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "ConversionWorkspace" - metadata_type: "OperationMetadata" - }; - } - - // Marks all the data in the conversion workspace as committed. - rpc CommitConversionWorkspace(CommitConversionWorkspaceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:commit" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "ConversionWorkspace" - metadata_type: "OperationMetadata" - }; - } - - // Rolls back a conversion workspace to the last committed snapshot. - rpc RollbackConversionWorkspace(RollbackConversionWorkspaceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:rollback" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "ConversionWorkspace" - metadata_type: "OperationMetadata" - }; - } - - // Applies draft tree onto a specific destination database. - rpc ApplyConversionWorkspace(ApplyConversionWorkspaceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:apply" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "ConversionWorkspace" - metadata_type: "OperationMetadata" - }; - } - - // Describes the database entities tree for a specific conversion workspace - // and a specific tree type. - // - // Database entities are not resources like conversion workspaces or mapping - // rules, and they can't be created, updated or deleted. Instead, they are - // simple data objects describing the structure of the client database. - rpc DescribeDatabaseEntities(DescribeDatabaseEntitiesRequest) - returns (DescribeDatabaseEntitiesResponse) { - option (google.api.http) = { - get: "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:describeDatabaseEntities" - }; - } - - // Searches/lists the background jobs for a specific - // conversion workspace. - // - // The background jobs are not resources like conversion workspaces or - // mapping rules, and they can't be created, updated or deleted. - // Instead, they are a way to expose the data plane jobs log. - rpc SearchBackgroundJobs(SearchBackgroundJobsRequest) - returns (SearchBackgroundJobsResponse) { - option (google.api.http) = { - get: "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:searchBackgroundJobs" - }; - } - - // Retrieves a list of committed revisions of a specific conversion - // workspace. - rpc DescribeConversionWorkspaceRevisions( - DescribeConversionWorkspaceRevisionsRequest) - returns (DescribeConversionWorkspaceRevisionsResponse) { - option (google.api.http) = { - get: "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:describeConversionWorkspaceRevisions" - }; - } - - // Fetches a set of static IP addresses that need to be allowlisted by the - // customer when using the static-IP connectivity method. - rpc FetchStaticIps(FetchStaticIpsRequest) returns (FetchStaticIpsResponse) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*}:fetchStaticIps" - }; - option (google.api.method_signature) = "name"; - } -} - -// Retrieves a list of all migration jobs in a given project and location. -message ListMigrationJobsRequest { - // Required. The parent which owns this collection of migrationJobs. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "datamigration.googleapis.com/MigrationJob" - } - ]; - - // The maximum number of migration jobs to return. The service may return - // fewer than this value. If unspecified, at most 50 migration jobs will be - // returned. The maximum value is 1000; values above 1000 are coerced to - // 1000. - int32 page_size = 2; - - // The nextPageToken value received in the previous call to - // migrationJobs.list, used in the subsequent request to retrieve the next - // page of results. On first call this should be left blank. When paginating, - // all other parameters provided to migrationJobs.list must match the call - // that provided the page token. - string page_token = 3; - - // A filter expression that filters migration jobs listed in the response. - // The expression must specify the field name, a comparison operator, and the - // value that you want to use for filtering. The value must be a string, - // a number, or a boolean. The comparison operator must be - // either =, !=, >, or <. For example, list migration jobs created this year - // by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** - // You can also filter nested fields. For example, you could specify - // **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration - // jobs connecting through the specific SSH tunnel bastion. - string filter = 4; - - // Sort the results based on the migration job name. - // Valid values are: "name", "name asc", and "name desc". - string order_by = 5; -} - -// Response message for 'ListMigrationJobs' request. -message ListMigrationJobsResponse { - // The list of migration jobs objects. - repeated MigrationJob migration_jobs = 1; - - // A token which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message for 'GetMigrationJob' request. -message GetMigrationJobRequest { - // Required. Name of the migration job resource to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - } - ]; -} - -// Request message to create a new Database Migration Service migration job -// in the specified project and region. -message CreateMigrationJobRequest { - // Required. The parent which owns this collection of migration jobs. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "datamigration.googleapis.com/MigrationJob" - } - ]; - - // Required. The ID of the instance to create. - string migration_job_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Represents a [migration - // job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) - // object. - MigrationJob migration_job = 3 [(google.api.field_behavior) = REQUIRED]; - - // A unique ID used to identify the request. If the server receives two - // requests with the same ID, then the second request is ignored. - // - // It is recommended to always set this value to a UUID. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 4; -} - -// Request message for 'UpdateMigrationJob' request. -message UpdateMigrationJobRequest { - // Required. Field mask is used to specify the fields to be overwritten by the - // update in the conversion workspace resource. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The migration job parameters to update. - MigrationJob migration_job = 2 [(google.api.field_behavior) = REQUIRED]; - - // A unique ID used to identify the request. If the server receives two - // requests with the same ID, then the second request is ignored. - // - // It is recommended to always set this value to a UUID. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 3; -} - -// Request message for 'DeleteMigrationJob' request. -message DeleteMigrationJobRequest { - // Required. Name of the migration job resource to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - } - ]; - - // A unique ID used to identify the request. If the server receives two - // requests with the same ID, then the second request is ignored. - // - // It is recommended to always set this value to a UUID. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 2; - - // The destination CloudSQL connection profile is always deleted with the - // migration job. In case of force delete, the destination CloudSQL replica - // database is also deleted. - bool force = 3; -} - -// Request message for 'StartMigrationJob' request. -message StartMigrationJobRequest { - // Name of the migration job resource to start. - string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; -} - -// Request message for 'StopMigrationJob' request. -message StopMigrationJobRequest { - // Name of the migration job resource to stop. - string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; -} - -// Request message for 'ResumeMigrationJob' request. -message ResumeMigrationJobRequest { - // Name of the migration job resource to resume. - string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; -} - -// Request message for 'PromoteMigrationJob' request. -message PromoteMigrationJobRequest { - // Name of the migration job resource to promote. - string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; -} - -// Request message for 'VerifyMigrationJob' request. -message VerifyMigrationJobRequest { - // Name of the migration job resource to verify. - string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; -} - -// Request message for 'RestartMigrationJob' request. -message RestartMigrationJobRequest { - // Name of the migration job resource to restart. - string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; -} - -// Request message for 'GenerateSshScript' request. -message GenerateSshScriptRequest { - // Name of the migration job resource to generate the SSH script. - string migration_job = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; - - // Required. Bastion VM Instance name to use or to create. - string vm = 2 [(google.api.field_behavior) = REQUIRED]; - - // The VM configuration - oneof vm_config { - // The VM creation configuration - VmCreationConfig vm_creation_config = 100; - - // The VM selection configuration - VmSelectionConfig vm_selection_config = 101; - } - - // The port that will be open on the bastion host. - int32 vm_port = 3; -} - -// VM creation configuration message -message VmCreationConfig { - // Required. VM instance machine type to create. - string vm_machine_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // The Google Cloud Platform zone to create the VM in. - string vm_zone = 2; - - // The subnet name the vm needs to be created in. - string subnet = 3; -} - -// VM selection configuration message -message VmSelectionConfig { - // Required. The Google Cloud Platform zone the VM is located. - string vm_zone = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for 'GenerateSshScript' request. -message SshScript { - // The ssh configuration script. - string script = 1; -} - -// Request message for 'ListConnectionProfiles' request. -message ListConnectionProfilesRequest { - // Required. The parent which owns this collection of connection profiles. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "datamigration.googleapis.com/ConnectionProfile" - } - ]; - - // The maximum number of connection profiles to return. The service may return - // fewer than this value. If unspecified, at most 50 connection profiles will - // be returned. The maximum value is 1000; values above 1000 are coerced - // to 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListConnectionProfiles` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListConnectionProfiles` - // must match the call that provided the page token. - string page_token = 3; - - // A filter expression that filters connection profiles listed in the - // response. The expression must specify the field name, a comparison - // operator, and the value that you want to use for filtering. The value must - // be a string, a number, or a boolean. The comparison operator must be either - // =, !=, >, or <. For example, list connection profiles created this year by - // specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can - // also filter nested fields. For example, you could specify **mySql.username - // = %lt;my_username%gt;** to list all connection profiles configured to - // connect with a specific username. - string filter = 4; - - // A comma-separated list of fields to order results according to. - string order_by = 5; -} - -// Response message for 'ListConnectionProfiles' request. -message ListConnectionProfilesResponse { - // The response list of connection profiles. - repeated ConnectionProfile connection_profiles = 1; - - // A token which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message for 'GetConnectionProfile' request. -message GetConnectionProfileRequest { - // Required. Name of the connection profile resource to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConnectionProfile" - } - ]; -} - -// Request message for 'CreateConnectionProfile' request. -message CreateConnectionProfileRequest { - // Required. The parent which owns this collection of connection profiles. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConnectionProfile" - } - ]; - - // Required. The connection profile identifier. - string connection_profile_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The create request body including the connection profile data - ConnectionProfile connection_profile = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. A unique ID used to identify the request. If the server receives - // two requests with the same ID, then the second request is ignored. - // - // It is recommended to always set this value to a UUID. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only validate the connection profile, but don't create any - // resources. The default is false. Only supported for Oracle connection - // profiles. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Create the connection profile without validating it. - // The default is false. - // Only supported for Oracle connection profiles. - bool skip_validation = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for 'UpdateConnectionProfile' request. -message UpdateConnectionProfileRequest { - // Required. Field mask is used to specify the fields to be overwritten by the - // update in the conversion workspace resource. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The connection profile parameters to update. - ConnectionProfile connection_profile = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. A unique ID used to identify the request. If the server receives - // two requests with the same ID, then the second request is ignored. - // - // It is recommended to always set this value to a UUID. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only validate the connection profile, but don't update any - // resources. The default is false. Only supported for Oracle connection - // profiles. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Update the connection profile without validating it. - // The default is false. - // Only supported for Oracle connection profiles. - bool skip_validation = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for 'DeleteConnectionProfile' request. -message DeleteConnectionProfileRequest { - // Required. Name of the connection profile resource to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConnectionProfile" - } - ]; - - // A unique ID used to identify the request. If the server receives two - // requests with the same ID, then the second request is ignored. - // - // It is recommended to always set this value to a UUID. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 2; - - // In case of force delete, the CloudSQL replica database is also deleted - // (only for CloudSQL connection profile). - bool force = 3; -} - -// Request message to create a new private connection in the specified project -// and region. -message CreatePrivateConnectionRequest { - // Required. The parent that owns the collection of PrivateConnections. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "datamigration.googleapis.com/PrivateConnection" - } - ]; - - // Required. The private connection identifier. - string private_connection_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The private connection resource to create. - PrivateConnection private_connection = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. A unique ID used to identify the request. If the server receives - // two requests with the same ID, then the second request is ignored. - // - // It is recommended to always set this value to a UUID. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to true, will skip validations. - bool skip_validation = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message to retrieve a list of private connections in a given project -// and location. -message ListPrivateConnectionsRequest { - // Required. The parent that owns the collection of private connections. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "datamigration.googleapis.com/PrivateConnection" - } - ]; - - // Maximum number of private connections to return. - // If unspecified, at most 50 private connections that are returned. - // The maximum value is 1000; values above 1000 are coerced to 1000. - int32 page_size = 2; - - // Page token received from a previous `ListPrivateConnections` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `ListPrivateConnections` must match the call that provided the page - // token. - string page_token = 3; - - // A filter expression that filters private connections listed in the - // response. The expression must specify the field name, a comparison - // operator, and the value that you want to use for filtering. The value must - // be a string, a number, or a boolean. The comparison operator must be either - // =, !=, >, or <. For example, list private connections created this year by - // specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. - string filter = 4; - - // Order by fields for the result. - string order_by = 5; -} - -// Response message for 'ListPrivateConnections' request. -message ListPrivateConnectionsResponse { - // List of private connections. - repeated PrivateConnection private_connections = 1; - - // A token which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message to delete a private connection. -message DeletePrivateConnectionRequest { - // Required. The name of the private connection to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/PrivateConnection" - } - ]; - - // Optional. A unique ID used to identify the request. If the server receives - // two requests with the same ID, then the second request is ignored. - // - // It is recommended to always set this value to a UUID. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message to get a private connection resource. -message GetPrivateConnectionRequest { - // Required. The name of the private connection to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/PrivateConnection" - } - ]; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined resource path for the target of the operation. - string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the verb executed by the operation. - string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Human-readable status of the operation, if any. - string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. - bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. API version used to start the operation. - string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Retrieve a list of all conversion workspaces in a given project and location. -message ListConversionWorkspacesRequest { - // Required. The parent which owns this collection of conversion workspaces. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "datamigration.googleapis.com/ConversionWorkspace" - } - ]; - - // The maximum number of conversion workspaces to return. The service may - // return fewer than this value. If unspecified, at most 50 sets are returned. - int32 page_size = 2; - - // The nextPageToken value received in the previous call to - // conversionWorkspaces.list, used in the subsequent request to retrieve the - // next page of results. On first call this should be left blank. When - // paginating, all other parameters provided to conversionWorkspaces.list must - // match the call that provided the page token. - string page_token = 3; - - // A filter expression that filters conversion workspaces listed in the - // response. The expression must specify the field name, a comparison - // operator, and the value that you want to use for filtering. The value must - // be a string, a number, or a boolean. The comparison operator must be either - // =, !=, >, or <. For example, list conversion workspaces created this year - // by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can - // also filter nested fields. For example, you could specify - // **source.version = "12.c.1"** to select all conversion workspaces with - // source database version equal to 12.c.1. - string filter = 4; -} - -// Response message for 'ListConversionWorkspaces' request. -message ListConversionWorkspacesResponse { - // The list of conversion workspace objects. - repeated ConversionWorkspace conversion_workspaces = 1; - - // A token which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message for 'GetConversionWorkspace' request. -message GetConversionWorkspaceRequest { - // Required. Name of the conversion workspace resource to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConversionWorkspace" - } - ]; -} - -// Request message to create a new Conversion Workspace -// in the specified project and region. -message CreateConversionWorkspaceRequest { - // Required. The parent which owns this collection of conversion workspaces. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "datamigration.googleapis.com/ConversionWorkspace" - } - ]; - - // Required. The ID of the conversion workspace to create. - string conversion_workspace_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Represents a conversion workspace object. - ConversionWorkspace conversion_workspace = 3 - [(google.api.field_behavior) = REQUIRED]; - - // A unique ID used to identify the request. If the server receives two - // requests with the same ID, then the second request is ignored. - // - // It is recommended to always set this value to a UUID. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 4; -} - -// Request message for 'UpdateConversionWorkspace' request. -message UpdateConversionWorkspaceRequest { - // Required. Field mask is used to specify the fields to be overwritten by the - // update in the conversion workspace resource. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The conversion workspace parameters to update. - ConversionWorkspace conversion_workspace = 2 - [(google.api.field_behavior) = REQUIRED]; - - // A unique ID used to identify the request. If the server receives two - // requests with the same ID, then the second request is ignored. - // - // It is recommended to always set this value to a UUID. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 3; -} - -// Request message for 'DeleteConversionWorkspace' request. -message DeleteConversionWorkspaceRequest { - // Required. Name of the conversion workspace resource to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConversionWorkspace" - } - ]; - - // A unique ID used to identify the request. If the server receives two - // requests with the same ID, then the second request is ignored. - // - // It is recommended to always set this value to a UUID. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 2; -} - -// Request message for 'CommitConversionWorkspace' request. -message CommitConversionWorkspaceRequest { - // Required. Name of the conversion workspace resource to commit. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConversionWorkspace" - } - ]; - - // Optional. Optional name of the commit. - string commit_name = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for 'RollbackConversionWorkspace' request. -message RollbackConversionWorkspaceRequest { - // Required. Name of the conversion workspace resource to roll back to. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConversionWorkspace" - } - ]; -} - -// Request message for 'ApplyConversionWorkspace' request. -message ApplyConversionWorkspaceRequest { - // Required. The name of the conversion workspace resource for which to apply - // the draft tree. Must be in the form of: - // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConversionWorkspace" - } - ]; - - // Filter which entities to apply. Leaving this field empty will apply all of - // the entities. Supports Google AIP 160 based filtering. - string filter = 2; - - // Which destination to use when applying the conversion workspace. - oneof destination { - // Fully qualified (Uri) name of the destination connection profile. - string connection_profile = 100; - } -} - -// Request message for 'SeedConversionWorkspace' request. -message SeedConversionWorkspaceRequest { - // Name of the conversion workspace resource to seed with new database - // structure, in the form of: - // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConversionWorkspace" - }]; - - // Should the conversion workspace be committed automatically after the - // seed operation. - bool auto_commit = 2; - - // The input to be used for seeding the conversion workspace. The input can - // either be from the source or destination databases and it can be provided - // through a connection profile or a DDL file. - oneof seed_from { - // Fully qualified (Uri) name of the source connection profile. - string source_connection_profile = 100; - - // Fully qualified (Uri) name of the destination connection profile. - string destination_connection_profile = 101; - } -} - -// Request message for 'ConvertConversionWorkspace' request. -message ConvertConversionWorkspaceRequest { - // Name of the conversion workspace resource to convert in the form of: - // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConversionWorkspace" - }]; - - // Specifies whether the conversion workspace is to be committed automatically - // after the conversion. - bool auto_commit = 4; - - // Filter the entities to convert. Leaving this field empty will convert all - // of the entities. Supports Google AIP-160 style filtering. - string filter = 5; -} - -// Request message for 'ImportMappingRules' request. -message ImportMappingRulesRequest { - // Details of a single rules file. - message RulesFile { - // The filename of the rules that needs to be converted. The filename is - // used mainly so that future logs of the import rules job contain it, and - // can therefore be searched by it. - string rules_source_filename = 1; - - // The text content of the rules that needs to be converted. - string rules_content = 2; - } - - // Required. Name of the conversion workspace resource to import the rules to - // in the form of: - // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConversionWorkspace" - } - ]; - - // The format of the rules content file. - ImportRulesFileFormat rules_format = 2; - - // One or more rules files. - repeated RulesFile rules_files = 3; - - // Should the conversion workspace be committed automatically after the - // import operation. - bool auto_commit = 6; -} - -// Request message for 'DescribeDatabaseEntities' request. -message DescribeDatabaseEntitiesRequest { - // The type of a tree to return - enum DBTreeType { - // Unspecified tree type. - DB_TREE_TYPE_UNSPECIFIED = 0; - - // The source database tree. - SOURCE_TREE = 1; - - // The draft database tree. - DRAFT_TREE = 2; - - // The destination database tree. - DESTINATION_TREE = 3; - } - - // Required. Name of the conversion workspace resource whose database entities - // are described. Must be in the form of: - // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - string conversion_workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConversionWorkspace" - } - ]; - - // The maximum number of entities to return. The service may return - // fewer entities than the value specifies. - int32 page_size = 3; - - // The nextPageToken value received in the previous call to - // conversionWorkspace.describeDatabaseEntities, used in the subsequent - // request to retrieve the next page of results. On first call this should be - // left blank. When paginating, all other parameters provided to - // conversionWorkspace.describeDatabaseEntities must match the call that - // provided the page token. - string page_token = 4; - - // The tree to fetch. - DBTreeType tree = 6; - - // Whether to retrieve the latest committed version of the entities or the - // latest version. This field is ignored if a specific commit_id is specified. - bool uncommitted = 11; - - // Request a specific commit ID. If not specified, the entities from the - // latest commit are returned. - string commit_id = 12; - - // Filter the returned entities based on AIP-160 standard. - string filter = 13; -} - -// Response message for 'DescribeDatabaseEntities' request. -message DescribeDatabaseEntitiesResponse { - // The list of database entities for the conversion workspace. - repeated DatabaseEntity database_entities = 1; - - // A token which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for 'SearchBackgroundJobs' request. -message SearchBackgroundJobsRequest { - // Required. Name of the conversion workspace resource whose jobs are listed, - // in the form of: - // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - string conversion_workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConversionWorkspace" - } - ]; - - // Optional. Whether or not to return just the most recent job per job type, - bool return_most_recent_per_job_type = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of jobs to return. The service may return - // fewer than this value. If unspecified, at most 100 jobs are - // returned. The maximum value is 100; values above 100 are coerced to - // 100. - int32 max_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If provided, only returns jobs that completed until (not - // including) the given timestamp. - google.protobuf.Timestamp completed_until_time = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for 'SearchBackgroundJobs' request. -message SearchBackgroundJobsResponse { - // The list of conversion workspace mapping rules. - repeated BackgroundJobLogEntry jobs = 1; -} - -// Request message for 'DescribeConversionWorkspaceRevisions' request. -message DescribeConversionWorkspaceRevisionsRequest { - // Required. Name of the conversion workspace resource whose revisions are - // listed. Must be in the form of: - // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - string conversion_workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datamigration.googleapis.com/ConversionWorkspace" - } - ]; - - // Optional. Optional filter to request a specific commit ID. - string commit_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for 'DescribeConversionWorkspaceRevisions' request. -message DescribeConversionWorkspaceRevisionsResponse { - // The list of conversion workspace revisions. - repeated ConversionWorkspace revisions = 1; -} - -// Request message for 'FetchStaticIps' request. -message FetchStaticIpsRequest { - // Required. The resource name for the location for which static IPs should be - // returned. Must be in the format `projects/*/locations/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Maximum number of IPs to return. - int32 page_size = 2; - - // A page token, received from a previous `FetchStaticIps` call. - string page_token = 3; -} - -// Response message for a 'FetchStaticIps' request. -message FetchStaticIpsResponse { - // List of static IPs. - repeated string static_ips = 1; - - // A token that can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms_resources.proto b/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms_resources.proto deleted file mode 100644 index 0b66a82de58..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/clouddms_resources.proto +++ /dev/null @@ -1,1139 +0,0 @@ -// Copyright 2023 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.clouddms.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.CloudDms.V1"; -option go_package = "cloud.google.com/go/clouddms/apiv1/clouddmspb;clouddmspb"; -option java_multiple_files = true; -option java_outer_classname = "ClouddmsResourcesProto"; -option java_package = "com.google.cloud.clouddms.v1"; -option php_namespace = "Google\\Cloud\\CloudDms\\V1"; -option ruby_package = "Google::Cloud::CloudDMS::V1"; -option (google.api.resource_definition) = { - type: "compute.googleapis.com/Networks" - pattern: "projects/{project}/global/networks/{network}" -}; - -// SSL configuration information. -message SslConfig { - // Specifies The kind of ssl configuration used. - enum SslType { - // Unspecified. - SSL_TYPE_UNSPECIFIED = 0; - - // Only 'ca_certificate' specified. - SERVER_ONLY = 1; - - // Both server ('ca_certificate'), and client ('client_key', - // 'client_certificate') specified. - SERVER_CLIENT = 2; - } - - // Output only. The ssl config type according to 'client_key', - // 'client_certificate' and 'ca_certificate'. - SslType type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key - // associated with the Client Certificate. If this field is used then the - // 'client_certificate' field is mandatory. - string client_key = 2 [(google.api.field_behavior) = INPUT_ONLY]; - - // Input only. The x509 PEM-encoded certificate that will be used by the - // replica to authenticate against the source database server.If this field is - // used then the 'client_key' field is mandatory. - string client_certificate = 3 [(google.api.field_behavior) = INPUT_ONLY]; - - // Required. Input only. The x509 PEM-encoded certificate of the CA that - // signed the source database server's certificate. The replica will use this - // certificate to verify it's connecting to the right host. - string ca_certificate = 4 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = REQUIRED - ]; -} - -// Specifies connection parameters required specifically for MySQL databases. -message MySqlConnectionProfile { - // Required. The IP or hostname of the source MySQL database. - string host = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The network port of the source MySQL database. - int32 port = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The username that Database Migration Service will use to connect - // to the database. The value is encrypted when stored in Database Migration - // Service. - string username = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Input only. The password for the user that Database Migration - // Service will be using to connect to the database. This field is not - // returned on request, and the value is encrypted when stored in Database - // Migration Service. - string password = 4 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = REQUIRED - ]; - - // Output only. Indicates If this connection profile password is stored. - bool password_set = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // SSL configuration for the destination to connect to the source database. - SslConfig ssl = 6; - - // If the source is a Cloud SQL database, use this field to - // provide the Cloud SQL instance ID of the source. - string cloud_sql_id = 7; -} - -enum NetworkArchitecture { - NETWORK_ARCHITECTURE_UNSPECIFIED = 0; - - // Instance is in Cloud SQL's old producer network architecture. - NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER = 1; - - // Instance is in Cloud SQL's new producer network architecture. - NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER = 2; -} - -// Specifies connection parameters required specifically for PostgreSQL -// databases. -message PostgreSqlConnectionProfile { - // Required. The IP or hostname of the source PostgreSQL database. - string host = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The network port of the source PostgreSQL database. - int32 port = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The username that Database Migration Service will use to connect - // to the database. The value is encrypted when stored in Database Migration - // Service. - string username = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Input only. The password for the user that Database Migration - // Service will be using to connect to the database. This field is not - // returned on request, and the value is encrypted when stored in Database - // Migration Service. - string password = 4 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = REQUIRED - ]; - - // Output only. Indicates If this connection profile password is stored. - bool password_set = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // SSL configuration for the destination to connect to the source database. - SslConfig ssl = 6; - - // If the source is a Cloud SQL database, use this field to - // provide the Cloud SQL instance ID of the source. - string cloud_sql_id = 7; - - // Output only. If the source is a Cloud SQL database, this field indicates - // the network architecture it's associated with. - NetworkArchitecture network_architecture = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Connectivity options used to establish a connection to the database server. - oneof connectivity { - // Static ip connectivity data (default, no additional details needed). - StaticIpConnectivity static_ip_connectivity = 100; - - // Private service connect connectivity. - PrivateServiceConnectConnectivity private_service_connect_connectivity = - 101; - } -} - -// Specifies connection parameters required specifically for Oracle -// databases. -message OracleConnectionProfile { - // Required. The IP or hostname of the source Oracle database. - string host = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The network port of the source Oracle database. - int32 port = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The username that Database Migration Service will use to connect - // to the database. The value is encrypted when stored in Database Migration - // Service. - string username = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Input only. The password for the user that Database Migration - // Service will be using to connect to the database. This field is not - // returned on request, and the value is encrypted when stored in Database - // Migration Service. - string password = 4 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = REQUIRED - ]; - - // Output only. Indicates whether a new password is included in the request. - bool password_set = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Database service for the Oracle connection. - string database_service = 6 [(google.api.field_behavior) = REQUIRED]; - - // Connectivity options used to establish a connection to the database server. - oneof connectivity { - // Static Service IP connectivity. - StaticServiceIpConnectivity static_service_ip_connectivity = 100; - - // Forward SSH tunnel connectivity. - ForwardSshTunnelConnectivity forward_ssh_connectivity = 101; - - // Private connectivity. - PrivateConnectivity private_connectivity = 102; - } -} - -// Specifies required connection parameters, and, optionally, the parameters -// required to create a Cloud SQL destination database instance. -message CloudSqlConnectionProfile { - // Output only. The Cloud SQL instance ID that this connection profile is - // associated with. - string cloud_sql_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. Metadata used to create the destination Cloud SQL database. - CloudSqlSettings settings = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The Cloud SQL database instance's private IP. - string private_ip = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Cloud SQL database instance's public IP. - string public_ip = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Cloud SQL database instance's additional (outgoing) public - // IP. Used when the Cloud SQL database availability type is REGIONAL (i.e. - // multiple zones / highly available). - string additional_public_ip = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Specifies required connection parameters, and the parameters -// required to create an AlloyDB destination cluster. -message AlloyDbConnectionProfile { - // Required. The AlloyDB cluster ID that this connection profile is associated - // with. - string cluster_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Immutable. Metadata used to create the destination AlloyDB cluster. - AlloyDbSettings settings = 2 [(google.api.field_behavior) = IMMUTABLE]; -} - -// An entry for an Access Control list. -message SqlAclEntry { - // The allowlisted value for the access control list. - string value = 1; - - // The access control entry entry expiration. - oneof expiration { - // The time when this access control entry expires in - // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example: - // `2012-11-15T16:19:00.094Z`. - google.protobuf.Timestamp expire_time = 10; - - // Input only. The time-to-leave of this access control entry. - google.protobuf.Duration ttl = 11 - [(google.api.field_behavior) = INPUT_ONLY]; - } - - // A label to identify this entry. - string label = 3; -} - -// IP Management configuration. -message SqlIpConfig { - // Whether the instance should be assigned an IPv4 address or not. - google.protobuf.BoolValue enable_ipv4 = 1; - - // The resource link for the VPC network from which the Cloud SQL instance is - // accessible for private IP. For example, - // `projects/myProject/global/networks/default`. This setting can - // be updated, but it cannot be removed after it is set. - string private_network = 2; - - // Optional. The name of the allocated IP address range for the private IP - // Cloud SQL instance. This name refers to an already allocated IP range - // address. If set, the instance IP address will be created in the allocated - // range. Note that this IP address range can't be modified after the instance - // is created. If you change the VPC when configuring connectivity settings - // for the migration job, this field is not relevant. - string allocated_ip_range = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Whether SSL connections over IP should be enforced or not. - google.protobuf.BoolValue require_ssl = 3; - - // The list of external networks that are allowed to connect to the instance - // using the IP. See - // https://en.wikipedia.org/wiki/CIDR_notation#CIDR_notation, also known as - // 'slash' notation (e.g. `192.168.100.0/24`). - repeated SqlAclEntry authorized_networks = 4; -} - -// Settings for creating a Cloud SQL database instance. -message CloudSqlSettings { - // Specifies when the instance should be activated. - enum SqlActivationPolicy { - // unspecified policy. - SQL_ACTIVATION_POLICY_UNSPECIFIED = 0; - - // The instance is always up and running. - ALWAYS = 1; - - // The instance should never spin up. - NEVER = 2; - } - - // The storage options for Cloud SQL databases. - enum SqlDataDiskType { - // Unspecified. - SQL_DATA_DISK_TYPE_UNSPECIFIED = 0; - - // SSD disk. - PD_SSD = 1; - - // HDD disk. - PD_HDD = 2; - } - - // The database engine type and version. - enum SqlDatabaseVersion { - // Unspecified version. - SQL_DATABASE_VERSION_UNSPECIFIED = 0; - - // MySQL 5.6. - MYSQL_5_6 = 1; - - // MySQL 5.7. - MYSQL_5_7 = 2; - - // PostgreSQL 9.6. - POSTGRES_9_6 = 3; - - // PostgreSQL 11. - POSTGRES_11 = 4; - - // PostgreSQL 10. - POSTGRES_10 = 5; - - // MySQL 8.0. - MYSQL_8_0 = 6; - - // PostgreSQL 12. - POSTGRES_12 = 7; - - // PostgreSQL 13. - POSTGRES_13 = 8; - - // PostgreSQL 14. - POSTGRES_14 = 17; - } - - // The availability type of the given Cloud SQL instance. - enum SqlAvailabilityType { - // This is an unknown Availability type. - SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0; - - // Zonal availablility instance. - ZONAL = 1; - - // Regional availability instance. - REGIONAL = 2; - } - - // The database engine type and version. - SqlDatabaseVersion database_version = 1; - - // The resource labels for a Cloud SQL instance to use to annotate any related - // underlying resources such as Compute Engine VMs. - // An object containing a list of "key": "value" pairs. - // - // Example: `{ "name": "wrench", "mass": "18kg", "count": "3" }`. - map user_labels = 2; - - // The tier (or machine type) for this instance, for example: - // `db-n1-standard-1` (MySQL instances) or - // `db-custom-1-3840` (PostgreSQL instances). - // For more information, see - // [Cloud SQL Instance - // Settings](https://cloud.google.com/sql/docs/mysql/instance-settings). - string tier = 3; - - // The maximum size to which storage capacity can be automatically increased. - // The default value is 0, which specifies that there is no limit. - google.protobuf.Int64Value storage_auto_resize_limit = 4; - - // The activation policy specifies when the instance is activated; it is - // applicable only when the instance state is 'RUNNABLE'. Valid values: - // - // 'ALWAYS': The instance is on, and remains so even in - // the absence of connection requests. - // - // `NEVER`: The instance is off; it is not activated, even if a - // connection request arrives. - SqlActivationPolicy activation_policy = 5; - - // The settings for IP Management. This allows to enable or disable the - // instance IP and manage which external networks can connect to the instance. - // The IPv4 address cannot be disabled. - SqlIpConfig ip_config = 6; - - // [default: ON] If you enable this setting, Cloud SQL checks your available - // storage every 30 seconds. If the available storage falls below a threshold - // size, Cloud SQL automatically adds additional storage capacity. If the - // available storage repeatedly falls below the threshold size, Cloud SQL - // continues to add storage until it reaches the maximum of 30 TB. - google.protobuf.BoolValue auto_storage_increase = 7; - - // The database flags passed to the Cloud SQL instance at startup. - // An object containing a list of "key": value pairs. - // Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. - map database_flags = 8; - - // The type of storage: `PD_SSD` (default) or `PD_HDD`. - SqlDataDiskType data_disk_type = 9; - - // The storage capacity available to the database, in GB. - // The minimum (and default) size is 10GB. - google.protobuf.Int64Value data_disk_size_gb = 10; - - // The Google Cloud Platform zone where your Cloud SQL database instance is - // located. - string zone = 11; - - // Optional. The Google Cloud Platform zone where the failover Cloud SQL - // database instance is located. Used when the Cloud SQL database availability - // type is REGIONAL (i.e. multiple zones / highly available). - string secondary_zone = 18 [(google.api.field_behavior) = OPTIONAL]; - - // The Database Migration Service source connection profile ID, - // in the format: - // `projects/my_project_name/locations/us-central1/connectionProfiles/connection_profile_ID` - string source_id = 12; - - // Input only. Initial root password. - string root_password = 13 [(google.api.field_behavior) = INPUT_ONLY]; - - // Output only. Indicates If this connection profile root password is stored. - bool root_password_set = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The Cloud SQL default instance level collation. - string collation = 15; - - // The KMS key name used for the csql instance. - string cmek_key_name = 16; - - // Optional. Availability type. Potential values: - // * `ZONAL`: The instance serves data from only one zone. Outages in that - // zone affect data availability. - // * `REGIONAL`: The instance can serve data from more than one zone in a - // region (it is highly available). - SqlAvailabilityType availability_type = 17 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Settings for creating an AlloyDB cluster. -message AlloyDbSettings { - // The username/password for a database user. Used for specifying initial - // users at cluster creation time. - message UserPassword { - // The database username. - string user = 1; - - // The initial password for the user. - string password = 2; - - // Output only. Indicates if the initial_user.password field has been set. - bool password_set = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Settings for the cluster's primary instance - message PrimaryInstanceSettings { - // MachineConfig describes the configuration of a machine. - message MachineConfig { - // The number of CPU's in the VM instance. - int32 cpu_count = 1; - } - - // Required. The ID of the AlloyDB primary instance. The ID must satisfy the - // regex expression "[a-z0-9-]+". - string id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Configuration for the machines that host the underlying - // database engine. - MachineConfig machine_config = 2; - - // Database flags to pass to AlloyDB when DMS is creating the AlloyDB - // cluster and instances. See the AlloyDB documentation for how these can be - // used. - map database_flags = 6; - - // Labels for the AlloyDB primary instance created by DMS. An object - // containing a list of 'key', 'value' pairs. - map labels = 7; - - // Output only. The private IP address for the Instance. - // This is the connection endpoint for an end-user application. - string private_ip = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // EncryptionConfig describes the encryption config of a cluster that is - // encrypted with a CMEK (customer-managed encryption key). - message EncryptionConfig { - // The fully-qualified resource name of the KMS key. - // Each Cloud KMS key is regionalized and has the following format: - // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - string kms_key_name = 1; - } - - // Required. Input only. Initial user to setup during cluster creation. - // Required. - UserPassword initial_user = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = INPUT_ONLY - ]; - - // Required. The resource link for the VPC network in which cluster resources - // are created and from which they are accessible via Private IP. The network - // must belong to the same project as the cluster. It is specified in the - // form: "projects/{project_number}/global/networks/{network_id}". This is - // required to create a cluster. - string vpc_network = 2 [(google.api.field_behavior) = REQUIRED]; - - // Labels for the AlloyDB cluster created by DMS. An object containing a list - // of 'key', 'value' pairs. - map labels = 3; - - PrimaryInstanceSettings primary_instance_settings = 4; - - // Optional. The encryption config can be specified to encrypt the data disks - // and other persistent data resources of a cluster with a - // customer-managed encryption key (CMEK). When this field is not - // specified, the cluster will then use default encryption scheme to - // protect the user data. - EncryptionConfig encryption_config = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The source database will allow incoming connections from the public IP of the -// destination database. You can retrieve the public IP of the Cloud SQL -// instance from the Cloud SQL console or using Cloud SQL APIs. No additional -// configuration is required. -message StaticIpConnectivity {} - -// Private Service Connect connectivity -// (https://cloud.google.com/vpc/docs/private-service-connect#service-attachments) -message PrivateServiceConnectConnectivity { - // Required. A service attachment that exposes a database, and has the - // following format: - // projects/{project}/regions/{region}/serviceAttachments/{service_attachment_name} - string service_attachment = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The details needed to configure a reverse SSH tunnel between the source and -// destination databases. These details will be used when calling the -// generateSshScript method (see -// https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs/generateSshScript) -// to produce the script that will help set up the reverse SSH tunnel, and to -// set up the VPC peering between the Cloud SQL private network and the VPC. -message ReverseSshConnectivity { - // Required. The IP of the virtual machine (Compute Engine) used as the - // bastion server for the SSH tunnel. - string vm_ip = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The forwarding port of the virtual machine (Compute Engine) used - // as the bastion server for the SSH tunnel. - int32 vm_port = 2 [(google.api.field_behavior) = REQUIRED]; - - // The name of the virtual machine (Compute Engine) used as the bastion server - // for the SSH tunnel. - string vm = 3; - - // The name of the VPC to peer with the Cloud SQL private network. - string vpc = 4; -} - -// The details of the VPC where the source database is located in Google Cloud. -// We will use this information to set up the VPC peering connection between -// Cloud SQL and this VPC. -message VpcPeeringConnectivity { - // The name of the VPC network to peer with the Cloud SQL private network. - string vpc = 1; -} - -// Forward SSH Tunnel connectivity. -message ForwardSshTunnelConnectivity { - // Required. Hostname for the SSH tunnel. - string hostname = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Username for the SSH tunnel. - string username = 2 [(google.api.field_behavior) = REQUIRED]; - - // Port for the SSH tunnel, default value is 22. - int32 port = 3; - - oneof authentication_method { - // Input only. SSH password. - string password = 100 [(google.api.field_behavior) = INPUT_ONLY]; - - // Input only. SSH private key. - string private_key = 101 [(google.api.field_behavior) = INPUT_ONLY]; - } -} - -// Static IP address connectivity configured on service project. -message StaticServiceIpConnectivity {} - -// Private Connectivity. -message PrivateConnectivity { - // Required. The resource name (URI) of the private connection. - string private_connection = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// A message defining the database engine and provider. -message DatabaseType { - // The database provider. - DatabaseProvider provider = 1; - - // The database engine. - DatabaseEngine engine = 2; -} - -// Represents a Database Migration Service migration job object. -message MigrationJob { - option (google.api.resource) = { - type: "datamigration.googleapis.com/MigrationJob" - pattern: "projects/{project}/locations/{location}/migrationJobs/{migration_job}" - }; - - // The current migration job states. - enum State { - // The state of the migration job is unknown. - STATE_UNSPECIFIED = 0; - - // The migration job is down for maintenance. - MAINTENANCE = 1; - - // The migration job is in draft mode and no resources are created. - DRAFT = 2; - - // The migration job is being created. - CREATING = 3; - - // The migration job is created and not started. - NOT_STARTED = 4; - - // The migration job is running. - RUNNING = 5; - - // The migration job failed. - FAILED = 6; - - // The migration job has been completed. - COMPLETED = 7; - - // The migration job is being deleted. - DELETING = 8; - - // The migration job is being stopped. - STOPPING = 9; - - // The migration job is currently stopped. - STOPPED = 10; - - // The migration job has been deleted. - DELETED = 11; - - // The migration job is being updated. - UPDATING = 12; - - // The migration job is starting. - STARTING = 13; - - // The migration job is restarting. - RESTARTING = 14; - - // The migration job is resuming. - RESUMING = 15; - } - - // The current migration job phase. - enum Phase { - // The phase of the migration job is unknown. - PHASE_UNSPECIFIED = 0; - - // The migration job is in the full dump phase. - FULL_DUMP = 1; - - // The migration job is CDC phase. - CDC = 2; - - // The migration job is running the promote phase. - PROMOTE_IN_PROGRESS = 3; - - // Only RDS flow - waiting for source writes to stop - WAITING_FOR_SOURCE_WRITES_TO_STOP = 4; - - // Only RDS flow - the sources writes stopped, waiting for dump to begin - PREPARING_THE_DUMP = 5; - } - - // The type of migration job (one-time or continuous). - enum Type { - // The type of the migration job is unknown. - TYPE_UNSPECIFIED = 0; - - // The migration job is a one time migration. - ONE_TIME = 1; - - // The migration job is a continuous migration. - CONTINUOUS = 2; - } - - // Dump flag definition. - message DumpFlag { - // The name of the flag - string name = 1; - - // The value of the flag. - string value = 2; - } - - // Dump flags definition. - message DumpFlags { - // The flags for the initial dump. - repeated DumpFlag dump_flags = 1; - } - - // The name (URI) of this migration job resource, in the form of: - // projects/{project}/locations/{location}/migrationJobs/{migrationJob}. - string name = 1; - - // Output only. The timestamp when the migration job resource was created. - // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. - // Example: "2014-10-02T15:01:23.045123456Z". - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The timestamp when the migration job resource was last - // updated. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. - // Example: "2014-10-02T15:01:23.045123456Z". - google.protobuf.Timestamp update_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The resource labels for migration job to use to annotate any related - // underlying resources such as Compute Engine VMs. An object containing a - // list of "key": "value" pairs. - // - // Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. - map labels = 4; - - // The migration job display name. - string display_name = 5; - - // The current migration job state. - State state = 6; - - // Output only. The current migration job phase. - Phase phase = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The migration job type. - Type type = 8 [(google.api.field_behavior) = REQUIRED]; - - // The path to the dump file in Google Cloud Storage, - // in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). - // This field and the "dump_flags" field are mutually exclusive. - string dump_path = 9; - - // The initial dump flags. - // This field and the "dump_path" field are mutually exclusive. - DumpFlags dump_flags = 17; - - // Required. The resource name (URI) of the source connection profile. - string source = 10 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource name (URI) of the destination connection profile. - string destination = 11 [(google.api.field_behavior) = REQUIRED]; - - // The connectivity method. - oneof connectivity { - // The details needed to communicate to the source over Reverse SSH - // tunnel connectivity. - ReverseSshConnectivity reverse_ssh_connectivity = 101; - - // The details of the VPC network that the source database is located in. - VpcPeeringConnectivity vpc_peering_connectivity = 102; - - // static ip connectivity data (default, no additional details needed). - StaticIpConnectivity static_ip_connectivity = 103; - } - - // Output only. The duration of the migration job (in seconds). A duration in - // seconds with up to nine fractional digits, terminated by 's'. Example: - // "3.5s". - google.protobuf.Duration duration = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The error details in case of state FAILED. - google.rpc.Status error = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The database engine type and provider of the source. - DatabaseType source_database = 14; - - // The database engine type and provider of the destination. - DatabaseType destination_database = 15; - - // Output only. If the migration job is completed, the time when it was - // completed. - google.protobuf.Timestamp end_time = 16 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The conversion workspace used by the migration. - ConversionWorkspaceInfo conversion_workspace = 18; - - // This field can be used to select the entities to migrate as part of - // the migration job. It uses AIP-160 notation to select a subset of the - // entities configured on the associated conversion-workspace. This field - // should not be set on migration-jobs that are not associated with a - // conversion workspace. - string filter = 20; - - // The CMEK (customer-managed encryption key) fully qualified key name used - // for the migration job. - // This field supports all migration jobs types except for: - // * Mysql to Mysql (use the cmek field in the cloudsql connection profile - // instead). - // * PostrgeSQL to PostgreSQL (use the cmek field in the cloudsql - // connection profile instead). - // * PostgreSQL to AlloyDB (use the kms_key_name field in the alloydb - // connection profile instead). - // Each Cloud CMEK key has the following format: - // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - string cmek_key_name = 21; -} - -// A conversion workspace's version. -message ConversionWorkspaceInfo { - // The resource name (URI) of the conversion workspace. - string name = 1; - - // The commit ID of the conversion workspace. - string commit_id = 2; -} - -// A connection profile definition. -message ConnectionProfile { - option (google.api.resource) = { - type: "datamigration.googleapis.com/ConnectionProfile" - pattern: "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}" - }; - - // The current connection profile state (e.g. DRAFT, READY, or FAILED). - enum State { - // The state of the connection profile is unknown. - STATE_UNSPECIFIED = 0; - - // The connection profile is in draft mode and fully editable. - DRAFT = 1; - - // The connection profile is being created. - CREATING = 2; - - // The connection profile is ready. - READY = 3; - - // The connection profile is being updated. - UPDATING = 4; - - // The connection profile is being deleted. - DELETING = 5; - - // The connection profile has been deleted. - DELETED = 6; - - // The last action on the connection profile failed. - FAILED = 7; - } - - // The name of this connection profile resource in the form of - // projects/{project}/locations/{location}/connectionProfiles/{connectionProfile}. - string name = 1; - - // Output only. The timestamp when the resource was created. - // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. - // Example: "2014-10-02T15:01:23.045123456Z". - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The timestamp when the resource was last updated. - // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. - // Example: "2014-10-02T15:01:23.045123456Z". - google.protobuf.Timestamp update_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The resource labels for connection profile to use to annotate any related - // underlying resources such as Compute Engine VMs. An object containing a - // list of "key": "value" pairs. - // - // Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. - map labels = 4; - - // The current connection profile state (e.g. DRAFT, READY, or FAILED). - State state = 5; - - // The connection profile display name. - string display_name = 6; - - // The connection profile definition. - oneof connection_profile { - // A MySQL database connection profile. - MySqlConnectionProfile mysql = 100; - - // A PostgreSQL database connection profile. - PostgreSqlConnectionProfile postgresql = 101; - - // An Oracle database connection profile. - OracleConnectionProfile oracle = 104; - - // A CloudSQL database connection profile. - CloudSqlConnectionProfile cloudsql = 102; - - // An AlloyDB cluster connection profile. - AlloyDbConnectionProfile alloydb = 105; - } - - // Output only. The error details in case of state FAILED. - google.rpc.Status error = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The database provider. - DatabaseProvider provider = 8; -} - -// Error message of a verification Migration job. -message MigrationJobVerificationError { - // A general error code describing the type of error that occurred. - enum ErrorCode { - // An unknown error occurred - ERROR_CODE_UNSPECIFIED = 0; - - // We failed to connect to one of the connection profile. - CONNECTION_FAILURE = 1; - - // We failed to authenticate to one of the connection profile. - AUTHENTICATION_FAILURE = 2; - - // One of the involved connection profiles has an invalid configuration. - INVALID_CONNECTION_PROFILE_CONFIG = 3; - - // The versions of the source and the destination are incompatible. - VERSION_INCOMPATIBILITY = 4; - - // The types of the source and the destination are incompatible. - CONNECTION_PROFILE_TYPES_INCOMPATIBILITY = 5; - - // No pglogical extension installed on databases, applicable for postgres. - NO_PGLOGICAL_INSTALLED = 7; - - // pglogical node already exists on databases, applicable for postgres. - PGLOGICAL_NODE_ALREADY_EXISTS = 8; - - // The value of parameter wal_level is not set to logical. - INVALID_WAL_LEVEL = 9; - - // The value of parameter shared_preload_libraries does not include - // pglogical. - INVALID_SHARED_PRELOAD_LIBRARY = 10; - - // The value of parameter max_replication_slots is not sufficient. - INSUFFICIENT_MAX_REPLICATION_SLOTS = 11; - - // The value of parameter max_wal_senders is not sufficient. - INSUFFICIENT_MAX_WAL_SENDERS = 12; - - // The value of parameter max_worker_processes is not sufficient. - INSUFFICIENT_MAX_WORKER_PROCESSES = 13; - - // Extensions installed are either not supported or having unsupported - // versions. - UNSUPPORTED_EXTENSIONS = 14; - - // Unsupported migration type. - UNSUPPORTED_MIGRATION_TYPE = 15; - - // Invalid RDS logical replication. - INVALID_RDS_LOGICAL_REPLICATION = 16; - - // The gtid_mode is not supported, applicable for MySQL. - UNSUPPORTED_GTID_MODE = 17; - - // The table definition is not support due to missing primary key or replica - // identity. - UNSUPPORTED_TABLE_DEFINITION = 18; - - // The definer is not supported. - UNSUPPORTED_DEFINER = 19; - - // Migration is already running at the time of restart request. - CANT_RESTART_RUNNING_MIGRATION = 21; - - // The source has tables with limited support. - // E.g. PostgreSQL tables without primary keys. - TABLES_WITH_LIMITED_SUPPORT = 24; - - // The source uses an unsupported locale. - UNSUPPORTED_DATABASE_LOCALE = 25; - - // The source uses an unsupported Foreign Data Wrapper configuration. - UNSUPPORTED_DATABASE_FDW_CONFIG = 26; - - // There was an underlying RDBMS error. - ERROR_RDBMS = 27; - - // The source DB size in Bytes exceeds a certain threshold. The migration - // might require an increase of quota, or might not be supported. - SOURCE_SIZE_EXCEEDS_THRESHOLD = 28; - } - - // Output only. An instance of ErrorCode specifying the error that occurred. - ErrorCode error_code = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A formatted message with further details about the error and a - // CTA. - string error_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A specific detailed error message, if supplied by the engine. - string error_detail_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The database engine types. -enum DatabaseEngine { - // The source database engine of the migration job is unknown. - DATABASE_ENGINE_UNSPECIFIED = 0; - - // The source engine is MySQL. - MYSQL = 1; - - // The source engine is PostgreSQL. - POSTGRESQL = 2; - - // The source engine is Oracle. - ORACLE = 4; -} - -// The database providers. -enum DatabaseProvider { - // The database provider is unknown. - DATABASE_PROVIDER_UNSPECIFIED = 0; - - // CloudSQL runs the database. - CLOUDSQL = 1; - - // RDS runs the database. - RDS = 2; - - // Amazon Aurora. - AURORA = 3; - - // AlloyDB. - ALLOYDB = 4; -} - -// The PrivateConnection resource is used to establish private connectivity -// with the customer's network. -message PrivateConnection { - option (google.api.resource) = { - type: "datamigration.googleapis.com/PrivateConnection" - pattern: "projects/{project}/locations/{location}/privateConnections/{private_connection}" - }; - - // Private Connection state. - enum State { - STATE_UNSPECIFIED = 0; - - // The private connection is in creation state - creating resources. - CREATING = 1; - - // The private connection has been created with all of its resources. - CREATED = 2; - - // The private connection creation has failed. - FAILED = 3; - - // The private connection is being deleted. - DELETING = 4; - - // Delete request has failed, resource is in invalid state. - FAILED_TO_DELETE = 5; - - // The private connection has been deleted. - DELETED = 6; - } - - // The name of the resource. - string name = 1; - - // Output only. The create time of the resource. - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last update time of the resource. - google.protobuf.Timestamp update_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The resource labels for private connections to use to annotate any related - // underlying resources such as Compute Engine VMs. An object containing a - // list of "key": "value" pairs. - // - // Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. - map labels = 4; - - // The private connection display name. - string display_name = 5; - - // Output only. The state of the private connection. - State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The error details in case of state FAILED. - google.rpc.Status error = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - oneof connectivity { - // VPC peering configuration. - VpcPeeringConfig vpc_peering_config = 100; - } -} - -// The VPC peering configuration is used to create VPC peering with the -// consumer's VPC. -message VpcPeeringConfig { - // Required. Fully qualified name of the VPC that Database Migration Service - // will peer to. - string vpc_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "compute.googleapis.com/Networks" - } - ]; - - // Required. A free subnet for peering. (CIDR of /29) - string subnet = 2 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_connection_profile.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_connection_profile.js deleted file mode 100644 index 8580dab4f6a..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_connection_profile.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2023 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(parent, connectionProfileId, connectionProfile) { - // [START datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_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. - */ - /** - * Required. The parent which owns this collection of connection profiles. - */ - // const parent = 'abc123' - /** - * Required. The connection profile identifier. - */ - // const connectionProfileId = 'abc123' - /** - * Required. The create request body including the connection profile data - */ - // const connectionProfile = {} - /** - * Optional. A unique ID used to identify the request. If the server receives - * two requests with the same ID, then the second request is ignored. - * It is recommended to always set this value to a UUID. - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - /** - * Optional. Only validate the connection profile, but don't create any - * resources. The default is false. Only supported for Oracle connection - * profiles. - */ - // const validateOnly = true - /** - * Optional. Create the connection profile without validating it. - * The default is false. - * Only supported for Oracle connection profiles. - */ - // const skipValidation = true - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callCreateConnectionProfile() { - // Construct request - const request = { - parent, - connectionProfileId, - connectionProfile, - }; - - // Run request - const [operation] = await clouddmsClient.createConnectionProfile(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateConnectionProfile(); - // [END datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_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-clouddms/v1/samples/generated/v1/data_migration_service.create_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_migration_job.js deleted file mode 100644 index 58f2117f811..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_migration_job.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2023 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(parent, migrationJobId, migrationJob) { - // [START datamigration_v1_generated_DataMigrationService_CreateMigrationJob_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. - */ - /** - * Required. The parent which owns this collection of migration jobs. - */ - // const parent = 'abc123' - /** - * Required. The ID of the instance to create. - */ - // const migrationJobId = 'abc123' - /** - * Required. Represents a migration - * job (https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) - * object. - */ - // const migrationJob = {} - /** - * A unique ID used to identify the request. If the server receives two - * requests with the same ID, then the second request is ignored. - * It is recommended to always set this value to a UUID. - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callCreateMigrationJob() { - // Construct request - const request = { - parent, - migrationJobId, - migrationJob, - }; - - // Run request - const [operation] = await clouddmsClient.createMigrationJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateMigrationJob(); - // [END datamigration_v1_generated_DataMigrationService_CreateMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.delete_connection_profile.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_connection_profile.js deleted file mode 100644 index 1cfb2661d82..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_connection_profile.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2023 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(name) { - // [START datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_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. - */ - /** - * Required. Name of the connection profile resource to delete. - */ - // const name = 'abc123' - /** - * A unique ID used to identify the request. If the server receives two - * requests with the same ID, then the second request is ignored. - * It is recommended to always set this value to a UUID. - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - /** - * In case of force delete, the CloudSQL replica database is also deleted - * (only for CloudSQL connection profile). - */ - // const force = true - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callDeleteConnectionProfile() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await clouddmsClient.deleteConnectionProfile(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteConnectionProfile(); - // [END datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_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-clouddms/v1/samples/generated/v1/data_migration_service.delete_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_migration_job.js deleted file mode 100644 index 1269bfb4e20..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_migration_job.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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(name) { - // [START datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_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. - */ - /** - * Required. Name of the migration job resource to delete. - */ - // const name = 'abc123' - /** - * A unique ID used to identify the request. If the server receives two - * requests with the same ID, then the second request is ignored. - * It is recommended to always set this value to a UUID. - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - /** - * The destination CloudSQL connection profile is always deleted with the - * migration job. In case of force delete, the destination CloudSQL replica - * database is also deleted. - */ - // const force = true - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callDeleteMigrationJob() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await clouddmsClient.deleteMigrationJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteMigrationJob(); - // [END datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.generate_ssh_script.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.generate_ssh_script.js deleted file mode 100644 index 41c49068a4d..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.generate_ssh_script.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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(vm) { - // [START datamigration_v1_generated_DataMigrationService_GenerateSshScript_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. - */ - /** - * Name of the migration job resource to generate the SSH script. - */ - // const migrationJob = 'abc123' - /** - * Required. Bastion VM Instance name to use or to create. - */ - // const vm = 'abc123' - /** - * The VM creation configuration - */ - // const vmCreationConfig = {} - /** - * The VM selection configuration - */ - // const vmSelectionConfig = {} - /** - * The port that will be open on the bastion host. - */ - // const vmPort = 1234 - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callGenerateSshScript() { - // Construct request - const request = { - vm, - }; - - // Run request - const response = await clouddmsClient.generateSshScript(request); - console.log(response); - } - - callGenerateSshScript(); - // [END datamigration_v1_generated_DataMigrationService_GenerateSshScript_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-clouddms/v1/samples/generated/v1/data_migration_service.get_connection_profile.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_connection_profile.js deleted file mode 100644 index 865c6a17eb7..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_connection_profile.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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(name) { - // [START datamigration_v1_generated_DataMigrationService_GetConnectionProfile_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. - */ - /** - * Required. Name of the connection profile resource to get. - */ - // const name = 'abc123' - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callGetConnectionProfile() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await clouddmsClient.getConnectionProfile(request); - console.log(response); - } - - callGetConnectionProfile(); - // [END datamigration_v1_generated_DataMigrationService_GetConnectionProfile_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-clouddms/v1/samples/generated/v1/data_migration_service.get_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_migration_job.js deleted file mode 100644 index 22d782e83db..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_migration_job.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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(name) { - // [START datamigration_v1_generated_DataMigrationService_GetMigrationJob_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. - */ - /** - * Required. Name of the migration job resource to get. - */ - // const name = 'abc123' - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callGetMigrationJob() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await clouddmsClient.getMigrationJob(request); - console.log(response); - } - - callGetMigrationJob(); - // [END datamigration_v1_generated_DataMigrationService_GetMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.list_connection_profiles.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_connection_profiles.js deleted file mode 100644 index 6ef17632e23..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_connection_profiles.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2023 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(parent) { - // [START datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_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. - */ - /** - * Required. The parent which owns this collection of connection profiles. - */ - // const parent = 'abc123' - /** - * The maximum number of connection profiles to return. The service may return - * fewer than this value. If unspecified, at most 50 connection profiles will - * be returned. The maximum value is 1000; values above 1000 are coerced - * to 1000. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListConnectionProfiles` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListConnectionProfiles` - * must match the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * A filter expression that filters connection profiles listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list connection profiles created this year by - * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can - * also filter nested fields. For example, you could specify **mySql.username - * = %lt;my_username%gt;** to list all connection profiles configured to - * connect with a specific username. - */ - // const filter = 'abc123' - /** - * A comma-separated list of fields to order results according to. - */ - // const orderBy = 'abc123' - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callListConnectionProfiles() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await clouddmsClient.listConnectionProfilesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListConnectionProfiles(); - // [END datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_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-clouddms/v1/samples/generated/v1/data_migration_service.list_migration_jobs.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_migration_jobs.js deleted file mode 100644 index 35f88731cbf..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_migration_jobs.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2023 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(parent) { - // [START datamigration_v1_generated_DataMigrationService_ListMigrationJobs_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. - */ - /** - * Required. The parent which owns this collection of migrationJobs. - */ - // const parent = 'abc123' - /** - * The maximum number of migration jobs to return. The service may return - * fewer than this value. If unspecified, at most 50 migration jobs will be - * returned. The maximum value is 1000; values above 1000 are coerced to - * 1000. - */ - // const pageSize = 1234 - /** - * The nextPageToken value received in the previous call to - * migrationJobs.list, used in the subsequent request to retrieve the next - * page of results. On first call this should be left blank. When paginating, - * all other parameters provided to migrationJobs.list must match the call - * that provided the page token. - */ - // const pageToken = 'abc123' - /** - * A filter expression that filters migration jobs listed in the response. - * The expression must specify the field name, a comparison operator, and the - * value that you want to use for filtering. The value must be a string, - * a number, or a boolean. The comparison operator must be - * either =, !=, >, or <. For example, list migration jobs created this year - * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** - * You can also filter nested fields. For example, you could specify - * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration - * jobs connecting through the specific SSH tunnel bastion. - */ - // const filter = 'abc123' - /** - * Sort the results based on the migration job name. - * Valid values are: "name", "name asc", and "name desc". - */ - // const orderBy = 'abc123' - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callListMigrationJobs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await clouddmsClient.listMigrationJobsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListMigrationJobs(); - // [END datamigration_v1_generated_DataMigrationService_ListMigrationJobs_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-clouddms/v1/samples/generated/v1/data_migration_service.promote_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.promote_migration_job.js deleted file mode 100644 index 3342de7a6b5..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.promote_migration_job.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_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. - */ - /** - * Name of the migration job resource to promote. - */ - // const name = 'abc123' - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callPromoteMigrationJob() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await clouddmsClient.promoteMigrationJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callPromoteMigrationJob(); - // [END datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.restart_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.restart_migration_job.js deleted file mode 100644 index c2bf7a8643e..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.restart_migration_job.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_RestartMigrationJob_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. - */ - /** - * Name of the migration job resource to restart. - */ - // const name = 'abc123' - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callRestartMigrationJob() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await clouddmsClient.restartMigrationJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestartMigrationJob(); - // [END datamigration_v1_generated_DataMigrationService_RestartMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.resume_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.resume_migration_job.js deleted file mode 100644 index 8e6ea31d728..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.resume_migration_job.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_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. - */ - /** - * Name of the migration job resource to resume. - */ - // const name = 'abc123' - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callResumeMigrationJob() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await clouddmsClient.resumeMigrationJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callResumeMigrationJob(); - // [END datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.start_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.start_migration_job.js deleted file mode 100644 index 2fffef3d17f..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.start_migration_job.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_StartMigrationJob_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. - */ - /** - * Name of the migration job resource to start. - */ - // const name = 'abc123' - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callStartMigrationJob() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await clouddmsClient.startMigrationJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callStartMigrationJob(); - // [END datamigration_v1_generated_DataMigrationService_StartMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.stop_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.stop_migration_job.js deleted file mode 100644 index c6c16e1194f..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.stop_migration_job.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_StopMigrationJob_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. - */ - /** - * Name of the migration job resource to stop. - */ - // const name = 'abc123' - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callStopMigrationJob() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await clouddmsClient.stopMigrationJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callStopMigrationJob(); - // [END datamigration_v1_generated_DataMigrationService_StopMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.update_connection_profile.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_connection_profile.js deleted file mode 100644 index 5cd2c736cdc..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_connection_profile.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2023 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, connectionProfile) { - // [START datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_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. - */ - /** - * Required. Field mask is used to specify the fields to be overwritten by the - * update in the conversion workspace resource. - */ - // const updateMask = {} - /** - * Required. The connection profile parameters to update. - */ - // const connectionProfile = {} - /** - * Optional. A unique ID used to identify the request. If the server receives - * two requests with the same ID, then the second request is ignored. - * It is recommended to always set this value to a UUID. - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - /** - * Optional. Only validate the connection profile, but don't update any - * resources. The default is false. Only supported for Oracle connection - * profiles. - */ - // const validateOnly = true - /** - * Optional. Update the connection profile without validating it. - * The default is false. - * Only supported for Oracle connection profiles. - */ - // const skipValidation = true - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callUpdateConnectionProfile() { - // Construct request - const request = { - updateMask, - connectionProfile, - }; - - // Run request - const [operation] = await clouddmsClient.updateConnectionProfile(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateConnectionProfile(); - // [END datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_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-clouddms/v1/samples/generated/v1/data_migration_service.update_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_migration_job.js deleted file mode 100644 index 894a974f424..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_migration_job.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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, migrationJob) { - // [START datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_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. - */ - /** - * Required. Field mask is used to specify the fields to be overwritten by the - * update in the conversion workspace resource. - */ - // const updateMask = {} - /** - * Required. The migration job parameters to update. - */ - // const migrationJob = {} - /** - * A unique ID used to identify the request. If the server receives two - * requests with the same ID, then the second request is ignored. - * It is recommended to always set this value to a UUID. - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callUpdateMigrationJob() { - // Construct request - const request = { - updateMask, - migrationJob, - }; - - // Run request - const [operation] = await clouddmsClient.updateMigrationJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateMigrationJob(); - // [END datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_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-clouddms/v1/samples/generated/v1/data_migration_service.verify_migration_job.js b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.verify_migration_job.js deleted file mode 100644 index 3748fda9e9d..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.verify_migration_job.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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 datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_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. - */ - /** - * Name of the migration job resource to verify. - */ - // const name = 'abc123' - - // Imports the Clouddms library - const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; - - // Instantiates a client - const clouddmsClient = new DataMigrationServiceClient(); - - async function callVerifyMigrationJob() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await clouddmsClient.verifyMigrationJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callVerifyMigrationJob(); - // [END datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_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-clouddms/v1/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json b/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json deleted file mode 100644 index 9e75971c80c..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json +++ /dev/null @@ -1,1739 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-clouddms", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.clouddms.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "datamigration_v1_generated_DataMigrationService_ListMigrationJobs_async", - "title": "DataMigrationService listMigrationJobs Sample", - "origin": "API_DEFINITION", - "description": " Lists migration jobs in a given project and location.", - "canonical": true, - "file": "data_migration_service.list_migration_jobs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListMigrationJobs", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListMigrationJobs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.clouddms.v1.ListMigrationJobsResponse", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "ListMigrationJobs", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListMigrationJobs", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_GetMigrationJob_async", - "title": "DataMigrationService getMigrationJob Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single migration job.", - "canonical": true, - "file": "data_migration_service.get_migration_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetMigrationJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.clouddms.v1.MigrationJob", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "GetMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetMigrationJob", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async", - "title": "DataMigrationService createMigrationJob Sample", - "origin": "API_DEFINITION", - "description": " Creates a new migration job in a given project and location.", - "canonical": true, - "file": "data_migration_service.create_migration_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateMigrationJob", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "migration_job_id", - "type": "TYPE_STRING" - }, - { - "name": "migration_job", - "type": ".google.cloud.clouddms.v1.MigrationJob" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "CreateMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateMigrationJob", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async", - "title": "DataMigrationService updateMigrationJob Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single migration job.", - "canonical": true, - "file": "data_migration_service.update_migration_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateMigrationJob", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "migration_job", - "type": ".google.cloud.clouddms.v1.MigrationJob" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "UpdateMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateMigrationJob", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async", - "title": "DataMigrationService deleteMigrationJob Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single migration job.", - "canonical": true, - "file": "data_migration_service.delete_migration_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteMigrationJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "DeleteMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteMigrationJob", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_StartMigrationJob_async", - "title": "DataMigrationService startMigrationJob Sample", - "origin": "API_DEFINITION", - "description": " Start an already created migration job.", - "canonical": true, - "file": "data_migration_service.start_migration_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StartMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.StartMigrationJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "StartMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.StartMigrationJob", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_StopMigrationJob_async", - "title": "DataMigrationService stopMigrationJob Sample", - "origin": "API_DEFINITION", - "description": " Stops a running migration job.", - "canonical": true, - "file": "data_migration_service.stop_migration_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StopMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.StopMigrationJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "StopMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.StopMigrationJob", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async", - "title": "DataMigrationService resumeMigrationJob Sample", - "origin": "API_DEFINITION", - "description": " Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase).", - "canonical": true, - "file": "data_migration_service.resume_migration_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ResumeMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ResumeMigrationJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "ResumeMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ResumeMigrationJob", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async", - "title": "DataMigrationService promoteMigrationJob Sample", - "origin": "API_DEFINITION", - "description": " Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database.", - "canonical": true, - "file": "data_migration_service.promote_migration_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PromoteMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.PromoteMigrationJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "PromoteMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.PromoteMigrationJob", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async", - "title": "DataMigrationService verifyMigrationJob Sample", - "origin": "API_DEFINITION", - "description": " Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met.", - "canonical": true, - "file": "data_migration_service.verify_migration_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "VerifyMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.VerifyMigrationJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "VerifyMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.VerifyMigrationJob", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async", - "title": "DataMigrationService restartMigrationJob Sample", - "origin": "API_DEFINITION", - "description": " Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch.", - "canonical": true, - "file": "data_migration_service.restart_migration_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestartMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.RestartMigrationJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "RestartMigrationJob", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.RestartMigrationJob", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_GenerateSshScript_async", - "title": "DataMigrationService generateSshScript Sample", - "origin": "API_DEFINITION", - "description": " Generate a SSH configuration script to configure the reverse SSH connectivity.", - "canonical": true, - "file": "data_migration_service.generate_ssh_script.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GenerateSshScript", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.GenerateSshScript", - "async": true, - "parameters": [ - { - "name": "migration_job", - "type": "TYPE_STRING" - }, - { - "name": "vm", - "type": "TYPE_STRING" - }, - { - "name": "vm_creation_config", - "type": ".google.cloud.clouddms.v1.VmCreationConfig" - }, - { - "name": "vm_selection_config", - "type": ".google.cloud.clouddms.v1.VmSelectionConfig" - }, - { - "name": "vm_port", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.clouddms.v1.SshScript", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "GenerateSshScript", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.GenerateSshScript", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_async", - "title": "DataMigrationService listConnectionProfiles Sample", - "origin": "API_DEFINITION", - "description": " Retrieves a list of all connection profiles in a given project and location.", - "canonical": true, - "file": "data_migration_service.list_connection_profiles.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListConnectionProfiles", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListConnectionProfiles", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.clouddms.v1.ListConnectionProfilesResponse", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "ListConnectionProfiles", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListConnectionProfiles", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_GetConnectionProfile_async", - "title": "DataMigrationService getConnectionProfile Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single connection profile.", - "canonical": true, - "file": "data_migration_service.get_connection_profile.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetConnectionProfile", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetConnectionProfile", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.clouddms.v1.ConnectionProfile", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "GetConnectionProfile", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetConnectionProfile", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async", - "title": "DataMigrationService createConnectionProfile Sample", - "origin": "API_DEFINITION", - "description": " Creates a new connection profile in a given project and location.", - "canonical": true, - "file": "data_migration_service.create_connection_profile.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateConnectionProfile", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateConnectionProfile", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "connection_profile_id", - "type": "TYPE_STRING" - }, - { - "name": "connection_profile", - "type": ".google.cloud.clouddms.v1.ConnectionProfile" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "skip_validation", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "CreateConnectionProfile", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateConnectionProfile", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async", - "title": "DataMigrationService updateConnectionProfile Sample", - "origin": "API_DEFINITION", - "description": " Update the configuration of a single connection profile.", - "canonical": true, - "file": "data_migration_service.update_connection_profile.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateConnectionProfile", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateConnectionProfile", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "connection_profile", - "type": ".google.cloud.clouddms.v1.ConnectionProfile" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "skip_validation", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "UpdateConnectionProfile", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateConnectionProfile", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async", - "title": "DataMigrationService deleteConnectionProfile Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Database Migration Service connection profile. A connection profile can only be deleted if it is not in use by any active migration jobs.", - "canonical": true, - "file": "data_migration_service.delete_connection_profile.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteConnectionProfile", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteConnectionProfile", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "DeleteConnectionProfile", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteConnectionProfile", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_CreatePrivateConnection_async", - "title": "DataMigrationService createPrivateConnection Sample", - "origin": "API_DEFINITION", - "description": " Creates a new private connection in a given project and location.", - "canonical": true, - "file": "data_migration_service.create_private_connection.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreatePrivateConnection", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreatePrivateConnection", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "private_connection_id", - "type": "TYPE_STRING" - }, - { - "name": "private_connection", - "type": ".google.cloud.clouddms.v1.PrivateConnection" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "skip_validation", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "CreatePrivateConnection", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreatePrivateConnection", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_GetPrivateConnection_async", - "title": "DataMigrationService getPrivateConnection Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single private connection.", - "canonical": true, - "file": "data_migration_service.get_private_connection.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetPrivateConnection", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetPrivateConnection", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.clouddms.v1.PrivateConnection", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "GetPrivateConnection", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetPrivateConnection", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_ListPrivateConnections_async", - "title": "DataMigrationService listPrivateConnections Sample", - "origin": "API_DEFINITION", - "description": " Retrieves a list of private connections in a given project and location.", - "canonical": true, - "file": "data_migration_service.list_private_connections.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListPrivateConnections", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListPrivateConnections", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.clouddms.v1.ListPrivateConnectionsResponse", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "ListPrivateConnections", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListPrivateConnections", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_DeletePrivateConnection_async", - "title": "DataMigrationService deletePrivateConnection Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Database Migration Service private connection.", - "canonical": true, - "file": "data_migration_service.delete_private_connection.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeletePrivateConnection", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeletePrivateConnection", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "DeletePrivateConnection", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeletePrivateConnection", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_GetConversionWorkspace_async", - "title": "DataMigrationService getConversionWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single conversion workspace.", - "canonical": true, - "file": "data_migration_service.get_conversion_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetConversionWorkspace", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.clouddms.v1.ConversionWorkspace", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "GetConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetConversionWorkspace", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_ListConversionWorkspaces_async", - "title": "DataMigrationService listConversionWorkspaces Sample", - "origin": "API_DEFINITION", - "description": " Lists conversion workspaces in a given project and location.", - "canonical": true, - "file": "data_migration_service.list_conversion_workspaces.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListConversionWorkspaces", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListConversionWorkspaces", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.clouddms.v1.ListConversionWorkspacesResponse", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "ListConversionWorkspaces", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListConversionWorkspaces", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_CreateConversionWorkspace_async", - "title": "DataMigrationService createConversionWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Creates a new conversion workspace in a given project and location.", - "canonical": true, - "file": "data_migration_service.create_conversion_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateConversionWorkspace", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "conversion_workspace_id", - "type": "TYPE_STRING" - }, - { - "name": "conversion_workspace", - "type": ".google.cloud.clouddms.v1.ConversionWorkspace" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "CreateConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateConversionWorkspace", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_UpdateConversionWorkspace_async", - "title": "DataMigrationService updateConversionWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Updates the parameters of a single conversion workspace.", - "canonical": true, - "file": "data_migration_service.update_conversion_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateConversionWorkspace", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "conversion_workspace", - "type": ".google.cloud.clouddms.v1.ConversionWorkspace" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "UpdateConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateConversionWorkspace", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_DeleteConversionWorkspace_async", - "title": "DataMigrationService deleteConversionWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single conversion workspace.", - "canonical": true, - "file": "data_migration_service.delete_conversion_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteConversionWorkspace", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "DeleteConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteConversionWorkspace", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_SeedConversionWorkspace_async", - "title": "DataMigrationService seedConversionWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Imports a snapshot of the source database into the conversion workspace.", - "canonical": true, - "file": "data_migration_service.seed_conversion_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SeedConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.SeedConversionWorkspace", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "auto_commit", - "type": "TYPE_BOOL" - }, - { - "name": "source_connection_profile", - "type": "TYPE_STRING" - }, - { - "name": "destination_connection_profile", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "SeedConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.SeedConversionWorkspace", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_ImportMappingRules_async", - "title": "DataMigrationService importMappingRules Sample", - "origin": "API_DEFINITION", - "description": " Imports the mapping rules for a given conversion workspace. Supports various formats of external rules files.", - "canonical": true, - "file": "data_migration_service.import_mapping_rules.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ImportMappingRules", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ImportMappingRules", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "rules_format", - "type": ".google.cloud.clouddms.v1.ImportRulesFileFormat" - }, - { - "name": "rules_files", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "auto_commit", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "ImportMappingRules", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ImportMappingRules", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_ConvertConversionWorkspace_async", - "title": "DataMigrationService convertConversionWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Creates a draft tree schema for the destination database.", - "canonical": true, - "file": "data_migration_service.convert_conversion_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ConvertConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ConvertConversionWorkspace", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "auto_commit", - "type": "TYPE_BOOL" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "ConvertConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ConvertConversionWorkspace", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_CommitConversionWorkspace_async", - "title": "DataMigrationService commitConversionWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Marks all the data in the conversion workspace as committed.", - "canonical": true, - "file": "data_migration_service.commit_conversion_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CommitConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.CommitConversionWorkspace", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "commit_name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "CommitConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.CommitConversionWorkspace", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_RollbackConversionWorkspace_async", - "title": "DataMigrationService rollbackConversionWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Rolls back a conversion workspace to the last committed snapshot.", - "canonical": true, - "file": "data_migration_service.rollback_conversion_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RollbackConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.RollbackConversionWorkspace", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "RollbackConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.RollbackConversionWorkspace", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_ApplyConversionWorkspace_async", - "title": "DataMigrationService applyConversionWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Applies draft tree onto a specific destination database.", - "canonical": true, - "file": "data_migration_service.apply_conversion_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ApplyConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ApplyConversionWorkspace", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "connection_profile", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "ApplyConversionWorkspace", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.ApplyConversionWorkspace", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_DescribeDatabaseEntities_async", - "title": "DataMigrationService describeDatabaseEntities Sample", - "origin": "API_DEFINITION", - "description": " Describes the database entities tree for a specific conversion workspace and a specific tree type. Database entities are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are simple data objects describing the structure of the client database.", - "canonical": true, - "file": "data_migration_service.describe_database_entities.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 89, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DescribeDatabaseEntities", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.DescribeDatabaseEntities", - "async": true, - "parameters": [ - { - "name": "conversion_workspace", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "tree", - "type": ".google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType" - }, - { - "name": "uncommitted", - "type": "TYPE_BOOL" - }, - { - "name": "commit_id", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "DescribeDatabaseEntities", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.DescribeDatabaseEntities", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_SearchBackgroundJobs_async", - "title": "DataMigrationService searchBackgroundJobs Sample", - "origin": "API_DEFINITION", - "description": " Searches/lists the background jobs for a specific conversion workspace. The background jobs are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are a way to expose the data plane jobs log.", - "canonical": true, - "file": "data_migration_service.search_background_jobs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchBackgroundJobs", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.SearchBackgroundJobs", - "async": true, - "parameters": [ - { - "name": "conversion_workspace", - "type": "TYPE_STRING" - }, - { - "name": "return_most_recent_per_job_type", - "type": "TYPE_BOOL" - }, - { - "name": "max_size", - "type": "TYPE_INT32" - }, - { - "name": "completed_until_time", - "type": ".google.protobuf.Timestamp" - } - ], - "resultType": ".google.cloud.clouddms.v1.SearchBackgroundJobsResponse", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "SearchBackgroundJobs", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.SearchBackgroundJobs", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_DescribeConversionWorkspaceRevisions_async", - "title": "DataMigrationService describeConversionWorkspaceRevisions Sample", - "origin": "API_DEFINITION", - "description": " Retrieves a list of committed revisions of a specific conversion workspace.", - "canonical": true, - "file": "data_migration_service.describe_conversion_workspace_revisions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DescribeConversionWorkspaceRevisions", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.DescribeConversionWorkspaceRevisions", - "async": true, - "parameters": [ - { - "name": "conversion_workspace", - "type": "TYPE_STRING" - }, - { - "name": "commit_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "DescribeConversionWorkspaceRevisions", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.DescribeConversionWorkspaceRevisions", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - }, - { - "regionTag": "datamigration_v1_generated_DataMigrationService_FetchStaticIps_async", - "title": "DataMigrationService fetchStaticIps Sample", - "origin": "API_DEFINITION", - "description": " Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.", - "canonical": true, - "file": "data_migration_service.fetch_static_ips.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchStaticIps", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.FetchStaticIps", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.clouddms.v1.FetchStaticIpsResponse", - "client": { - "shortName": "DataMigrationServiceClient", - "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" - }, - "method": { - "shortName": "FetchStaticIps", - "fullName": "google.cloud.clouddms.v1.DataMigrationService.FetchStaticIps", - "service": { - "shortName": "DataMigrationService", - "fullName": "google.cloud.clouddms.v1.DataMigrationService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/src/index.ts b/owl-bot-staging/google-cloud-clouddms/v1/src/index.ts deleted file mode 100644 index ba8110ea37e..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 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 DataMigrationServiceClient = v1.DataMigrationServiceClient; -type DataMigrationServiceClient = v1.DataMigrationServiceClient; -export {v1, DataMigrationServiceClient}; -export default {v1, DataMigrationServiceClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client.ts b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client.ts deleted file mode 100644 index 57e90891f14..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client.ts +++ /dev/null @@ -1,5338 +0,0 @@ -// Copyright 2023 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, IamClient, IamProtos, LocationsClient, LocationProtos} 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/data_migration_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './data_migration_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Database Migration service - * @class - * @memberof v1 - */ -export class DataMigrationServiceClient { - 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}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - dataMigrationServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DataMigrationServiceClient. - * - * @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 DataMigrationServiceClient({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 DataMigrationServiceClient; - 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); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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 = { - connectionProfilePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/connectionProfiles/{connection_profile}' - ), - conversionWorkspacePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - migrationJobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/migrationJobs/{migration_job}' - ), - privateConnectionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/privateConnections/{private_connection}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - }; - - // 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 = { - listMigrationJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'migrationJobs'), - listConnectionProfiles: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'connectionProfiles'), - listPrivateConnections: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'privateConnections'), - listConversionWorkspaces: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'conversionWorkspaces'), - describeDatabaseEntities: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'databaseEntities'), - fetchStaticIps: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'staticIps') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/connectionProfiles/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/migrationJobs/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/conversionWorkspaces/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/privateConnections/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/connectionProfiles/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/migrationJobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/conversionWorkspaces/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/privateConnections/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/migrationJobs/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/connectionProfiles/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/conversionWorkspaces/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/privateConnections/*}:testIamPermissions',body: '*',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{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 createMigrationJobResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; - const createMigrationJobMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const updateMigrationJobResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; - const updateMigrationJobMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const deleteMigrationJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteMigrationJobMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const startMigrationJobResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; - const startMigrationJobMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const stopMigrationJobResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; - const stopMigrationJobMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const resumeMigrationJobResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; - const resumeMigrationJobMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const promoteMigrationJobResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; - const promoteMigrationJobMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const verifyMigrationJobResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; - const verifyMigrationJobMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const restartMigrationJobResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.MigrationJob') as gax.protobuf.Type; - const restartMigrationJobMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const createConnectionProfileResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.ConnectionProfile') as gax.protobuf.Type; - const createConnectionProfileMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const updateConnectionProfileResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.ConnectionProfile') as gax.protobuf.Type; - const updateConnectionProfileMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const deleteConnectionProfileResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteConnectionProfileMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const createPrivateConnectionResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.PrivateConnection') as gax.protobuf.Type; - const createPrivateConnectionMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const deletePrivateConnectionResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deletePrivateConnectionMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const createConversionWorkspaceResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; - const createConversionWorkspaceMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const updateConversionWorkspaceResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; - const updateConversionWorkspaceMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const deleteConversionWorkspaceResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteConversionWorkspaceMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const seedConversionWorkspaceResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; - const seedConversionWorkspaceMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const importMappingRulesResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; - const importMappingRulesMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const convertConversionWorkspaceResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; - const convertConversionWorkspaceMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const commitConversionWorkspaceResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; - const commitConversionWorkspaceMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const rollbackConversionWorkspaceResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; - const rollbackConversionWorkspaceMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - const applyConversionWorkspaceResponse = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.ConversionWorkspace') as gax.protobuf.Type; - const applyConversionWorkspaceMetadata = protoFilesRoot.lookup( - '.google.cloud.clouddms.v1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createMigrationJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createMigrationJobResponse.decode.bind(createMigrationJobResponse), - createMigrationJobMetadata.decode.bind(createMigrationJobMetadata)), - updateMigrationJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateMigrationJobResponse.decode.bind(updateMigrationJobResponse), - updateMigrationJobMetadata.decode.bind(updateMigrationJobMetadata)), - deleteMigrationJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteMigrationJobResponse.decode.bind(deleteMigrationJobResponse), - deleteMigrationJobMetadata.decode.bind(deleteMigrationJobMetadata)), - startMigrationJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - startMigrationJobResponse.decode.bind(startMigrationJobResponse), - startMigrationJobMetadata.decode.bind(startMigrationJobMetadata)), - stopMigrationJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - stopMigrationJobResponse.decode.bind(stopMigrationJobResponse), - stopMigrationJobMetadata.decode.bind(stopMigrationJobMetadata)), - resumeMigrationJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - resumeMigrationJobResponse.decode.bind(resumeMigrationJobResponse), - resumeMigrationJobMetadata.decode.bind(resumeMigrationJobMetadata)), - promoteMigrationJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - promoteMigrationJobResponse.decode.bind(promoteMigrationJobResponse), - promoteMigrationJobMetadata.decode.bind(promoteMigrationJobMetadata)), - verifyMigrationJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - verifyMigrationJobResponse.decode.bind(verifyMigrationJobResponse), - verifyMigrationJobMetadata.decode.bind(verifyMigrationJobMetadata)), - restartMigrationJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restartMigrationJobResponse.decode.bind(restartMigrationJobResponse), - restartMigrationJobMetadata.decode.bind(restartMigrationJobMetadata)), - createConnectionProfile: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createConnectionProfileResponse.decode.bind(createConnectionProfileResponse), - createConnectionProfileMetadata.decode.bind(createConnectionProfileMetadata)), - updateConnectionProfile: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateConnectionProfileResponse.decode.bind(updateConnectionProfileResponse), - updateConnectionProfileMetadata.decode.bind(updateConnectionProfileMetadata)), - deleteConnectionProfile: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteConnectionProfileResponse.decode.bind(deleteConnectionProfileResponse), - deleteConnectionProfileMetadata.decode.bind(deleteConnectionProfileMetadata)), - createPrivateConnection: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createPrivateConnectionResponse.decode.bind(createPrivateConnectionResponse), - createPrivateConnectionMetadata.decode.bind(createPrivateConnectionMetadata)), - deletePrivateConnection: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deletePrivateConnectionResponse.decode.bind(deletePrivateConnectionResponse), - deletePrivateConnectionMetadata.decode.bind(deletePrivateConnectionMetadata)), - createConversionWorkspace: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createConversionWorkspaceResponse.decode.bind(createConversionWorkspaceResponse), - createConversionWorkspaceMetadata.decode.bind(createConversionWorkspaceMetadata)), - updateConversionWorkspace: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateConversionWorkspaceResponse.decode.bind(updateConversionWorkspaceResponse), - updateConversionWorkspaceMetadata.decode.bind(updateConversionWorkspaceMetadata)), - deleteConversionWorkspace: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteConversionWorkspaceResponse.decode.bind(deleteConversionWorkspaceResponse), - deleteConversionWorkspaceMetadata.decode.bind(deleteConversionWorkspaceMetadata)), - seedConversionWorkspace: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - seedConversionWorkspaceResponse.decode.bind(seedConversionWorkspaceResponse), - seedConversionWorkspaceMetadata.decode.bind(seedConversionWorkspaceMetadata)), - importMappingRules: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - importMappingRulesResponse.decode.bind(importMappingRulesResponse), - importMappingRulesMetadata.decode.bind(importMappingRulesMetadata)), - convertConversionWorkspace: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - convertConversionWorkspaceResponse.decode.bind(convertConversionWorkspaceResponse), - convertConversionWorkspaceMetadata.decode.bind(convertConversionWorkspaceMetadata)), - commitConversionWorkspace: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - commitConversionWorkspaceResponse.decode.bind(commitConversionWorkspaceResponse), - commitConversionWorkspaceMetadata.decode.bind(commitConversionWorkspaceMetadata)), - rollbackConversionWorkspace: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - rollbackConversionWorkspaceResponse.decode.bind(rollbackConversionWorkspaceResponse), - rollbackConversionWorkspaceMetadata.decode.bind(rollbackConversionWorkspaceMetadata)), - applyConversionWorkspace: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - applyConversionWorkspaceResponse.decode.bind(applyConversionWorkspaceResponse), - applyConversionWorkspaceMetadata.decode.bind(applyConversionWorkspaceMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.clouddms.v1.DataMigrationService', 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.dataMigrationServiceStub) { - return this.dataMigrationServiceStub; - } - - // Put together the "service stub" for - // google.cloud.clouddms.v1.DataMigrationService. - this.dataMigrationServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.clouddms.v1.DataMigrationService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.clouddms.v1.DataMigrationService, - 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 dataMigrationServiceStubMethods = - ['listMigrationJobs', 'getMigrationJob', 'createMigrationJob', 'updateMigrationJob', 'deleteMigrationJob', 'startMigrationJob', 'stopMigrationJob', 'resumeMigrationJob', 'promoteMigrationJob', 'verifyMigrationJob', 'restartMigrationJob', 'generateSshScript', 'listConnectionProfiles', 'getConnectionProfile', 'createConnectionProfile', 'updateConnectionProfile', 'deleteConnectionProfile', 'createPrivateConnection', 'getPrivateConnection', 'listPrivateConnections', 'deletePrivateConnection', 'getConversionWorkspace', 'listConversionWorkspaces', 'createConversionWorkspace', 'updateConversionWorkspace', 'deleteConversionWorkspace', 'seedConversionWorkspace', 'importMappingRules', 'convertConversionWorkspace', 'commitConversionWorkspace', 'rollbackConversionWorkspace', 'applyConversionWorkspace', 'describeDatabaseEntities', 'searchBackgroundJobs', 'describeConversionWorkspaceRevisions', 'fetchStaticIps']; - for (const methodName of dataMigrationServiceStubMethods) { - const callPromise = this.dataMigrationServiceStub.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.dataMigrationServiceStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'datamigration.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 'datamigration.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 -- - // ------------------- -/** - * Gets details of a single migration job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the migration job resource to get. - * @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 {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob}. - * 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/data_migration_service.get_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_GetMigrationJob_async - */ - getMigrationJob( - request?: protos.google.cloud.clouddms.v1.IGetMigrationJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IGetMigrationJobRequest|undefined, {}|undefined - ]>; - getMigrationJob( - request: protos.google.cloud.clouddms.v1.IGetMigrationJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IGetMigrationJobRequest|null|undefined, - {}|null|undefined>): void; - getMigrationJob( - request: protos.google.cloud.clouddms.v1.IGetMigrationJobRequest, - callback: Callback< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IGetMigrationJobRequest|null|undefined, - {}|null|undefined>): void; - getMigrationJob( - request?: protos.google.cloud.clouddms.v1.IGetMigrationJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IGetMigrationJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IGetMigrationJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IGetMigrationJobRequest|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.getMigrationJob(request, options, callback); - } -/** - * Generate a SSH configuration script to configure the reverse SSH - * connectivity. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.migrationJob - * Name of the migration job resource to generate the SSH script. - * @param {string} request.vm - * Required. Bastion VM Instance name to use or to create. - * @param {google.cloud.clouddms.v1.VmCreationConfig} request.vmCreationConfig - * The VM creation configuration - * @param {google.cloud.clouddms.v1.VmSelectionConfig} request.vmSelectionConfig - * The VM selection configuration - * @param {number} request.vmPort - * The port that will be open on the bastion host. - * @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 {@link google.cloud.clouddms.v1.SshScript | SshScript}. - * 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/data_migration_service.generate_ssh_script.js - * region_tag:datamigration_v1_generated_DataMigrationService_GenerateSshScript_async - */ - generateSshScript( - request?: protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.clouddms.v1.ISshScript, - protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest|undefined, {}|undefined - ]>; - generateSshScript( - request: protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.clouddms.v1.ISshScript, - protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest|null|undefined, - {}|null|undefined>): void; - generateSshScript( - request: protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest, - callback: Callback< - protos.google.cloud.clouddms.v1.ISshScript, - protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest|null|undefined, - {}|null|undefined>): void; - generateSshScript( - request?: protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.clouddms.v1.ISshScript, - protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.clouddms.v1.ISshScript, - protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.clouddms.v1.ISshScript, - protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest|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({ - 'migration_job': request.migrationJob ?? '', - }); - this.initialize(); - return this.innerApiCalls.generateSshScript(request, options, callback); - } -/** - * Gets details of a single connection profile. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the connection profile resource to get. - * @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 {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile}. - * 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/data_migration_service.get_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_GetConnectionProfile_async - */ - getConnectionProfile( - request?: protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.clouddms.v1.IConnectionProfile, - protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest|undefined, {}|undefined - ]>; - getConnectionProfile( - request: protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.clouddms.v1.IConnectionProfile, - protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest|null|undefined, - {}|null|undefined>): void; - getConnectionProfile( - request: protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest, - callback: Callback< - protos.google.cloud.clouddms.v1.IConnectionProfile, - protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest|null|undefined, - {}|null|undefined>): void; - getConnectionProfile( - request?: protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.clouddms.v1.IConnectionProfile, - protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.clouddms.v1.IConnectionProfile, - protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.clouddms.v1.IConnectionProfile, - protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest|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.getConnectionProfile(request, options, callback); - } -/** - * Gets details of a single private connection. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the private connection to get. - * @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 {@link google.cloud.clouddms.v1.PrivateConnection | PrivateConnection}. - * 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/data_migration_service.get_private_connection.js - * region_tag:datamigration_v1_generated_DataMigrationService_GetPrivateConnection_async - */ - getPrivateConnection( - request?: protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.clouddms.v1.IPrivateConnection, - protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest|undefined, {}|undefined - ]>; - getPrivateConnection( - request: protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.clouddms.v1.IPrivateConnection, - protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest|null|undefined, - {}|null|undefined>): void; - getPrivateConnection( - request: protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest, - callback: Callback< - protos.google.cloud.clouddms.v1.IPrivateConnection, - protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest|null|undefined, - {}|null|undefined>): void; - getPrivateConnection( - request?: protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.clouddms.v1.IPrivateConnection, - protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.clouddms.v1.IPrivateConnection, - protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.clouddms.v1.IPrivateConnection, - protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest|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.getPrivateConnection(request, options, callback); - } -/** - * Gets details of a single conversion workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the conversion workspace resource to get. - * @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 {@link google.cloud.clouddms.v1.ConversionWorkspace | ConversionWorkspace}. - * 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/data_migration_service.get_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_GetConversionWorkspace_async - */ - getConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.clouddms.v1.IConversionWorkspace, - protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest|undefined, {}|undefined - ]>; - getConversionWorkspace( - request: protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.clouddms.v1.IConversionWorkspace, - protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - getConversionWorkspace( - request: protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, - callback: Callback< - protos.google.cloud.clouddms.v1.IConversionWorkspace, - protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - getConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.clouddms.v1.IConversionWorkspace, - protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.clouddms.v1.IConversionWorkspace, - protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.clouddms.v1.IConversionWorkspace, - protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest|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.getConversionWorkspace(request, options, callback); - } -/** - * Searches/lists the background jobs for a specific - * conversion workspace. - * - * The background jobs are not resources like conversion workspaces or - * mapping rules, and they can't be created, updated or deleted. - * Instead, they are a way to expose the data plane jobs log. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.conversionWorkspace - * Required. Name of the conversion workspace resource whose jobs are listed, - * in the form of: - * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - * @param {boolean} [request.returnMostRecentPerJobType] - * Optional. Whether or not to return just the most recent job per job type, - * @param {number} [request.maxSize] - * Optional. The maximum number of jobs to return. The service may return - * fewer than this value. If unspecified, at most 100 jobs are - * returned. The maximum value is 100; values above 100 are coerced to - * 100. - * @param {google.protobuf.Timestamp} [request.completedUntilTime] - * Optional. If provided, only returns jobs that completed until (not - * including) the given timestamp. - * @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 {@link google.cloud.clouddms.v1.SearchBackgroundJobsResponse | SearchBackgroundJobsResponse}. - * 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/data_migration_service.search_background_jobs.js - * region_tag:datamigration_v1_generated_DataMigrationService_SearchBackgroundJobs_async - */ - searchBackgroundJobs( - request?: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, - protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest|undefined, {}|undefined - ]>; - searchBackgroundJobs( - request: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, - protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest|null|undefined, - {}|null|undefined>): void; - searchBackgroundJobs( - request: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, - callback: Callback< - protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, - protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest|null|undefined, - {}|null|undefined>): void; - searchBackgroundJobs( - request?: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, - protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, - protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, - protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest|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({ - 'conversion_workspace': request.conversionWorkspace ?? '', - }); - this.initialize(); - return this.innerApiCalls.searchBackgroundJobs(request, options, callback); - } -/** - * Retrieves a list of committed revisions of a specific conversion - * workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.conversionWorkspace - * Required. Name of the conversion workspace resource whose revisions are - * listed. Must be in the form of: - * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - * @param {string} [request.commitId] - * Optional. Optional filter to request a specific commit ID. - * @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 {@link google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse | DescribeConversionWorkspaceRevisionsResponse}. - * 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/data_migration_service.describe_conversion_workspace_revisions.js - * region_tag:datamigration_v1_generated_DataMigrationService_DescribeConversionWorkspaceRevisions_async - */ - describeConversionWorkspaceRevisions( - request?: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, - protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest|undefined, {}|undefined - ]>; - describeConversionWorkspaceRevisions( - request: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, - protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest|null|undefined, - {}|null|undefined>): void; - describeConversionWorkspaceRevisions( - request: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, - callback: Callback< - protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, - protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest|null|undefined, - {}|null|undefined>): void; - describeConversionWorkspaceRevisions( - request?: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, - protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, - protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, - protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest|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({ - 'conversion_workspace': request.conversionWorkspace ?? '', - }); - this.initialize(); - return this.innerApiCalls.describeConversionWorkspaceRevisions(request, options, callback); - } - -/** - * Creates a new migration job in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of migration jobs. - * @param {string} request.migrationJobId - * Required. The ID of the instance to create. - * @param {google.cloud.clouddms.v1.MigrationJob} request.migrationJob - * Required. Represents a [migration - * job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) - * object. - * @param {string} request.requestId - * A unique ID used to identify the request. If the server receives two - * requests with the same ID, then the second request is ignored. - * - * It is recommended to always set this value to a UUID. - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - * @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/data_migration_service.create_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async - */ - createMigrationJob( - request?: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createMigrationJob( - request: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createMigrationJob( - request: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createMigrationJob( - request?: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, - 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.createMigrationJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createMigrationJob()`. - * @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/data_migration_service.create_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async - */ - async checkCreateMigrationJobProgress(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.createMigrationJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single migration job. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten by the - * update in the conversion workspace resource. - * @param {google.cloud.clouddms.v1.MigrationJob} request.migrationJob - * Required. The migration job parameters to update. - * @param {string} request.requestId - * A unique ID used to identify the request. If the server receives two - * requests with the same ID, then the second request is ignored. - * - * It is recommended to always set this value to a UUID. - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - * @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/data_migration_service.update_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async - */ - updateMigrationJob( - request?: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateMigrationJob( - request: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateMigrationJob( - request: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateMigrationJob( - request?: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, - 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({ - 'migration_job.name': request.migrationJob!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateMigrationJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateMigrationJob()`. - * @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/data_migration_service.update_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async - */ - async checkUpdateMigrationJobProgress(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.updateMigrationJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single migration job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the migration job resource to delete. - * @param {string} request.requestId - * A unique ID used to identify the request. If the server receives two - * requests with the same ID, then the second request is ignored. - * - * It is recommended to always set this value to a UUID. - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - * @param {boolean} request.force - * The destination CloudSQL connection profile is always deleted with the - * migration job. In case of force delete, the destination CloudSQL replica - * database is also deleted. - * @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/data_migration_service.delete_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async - */ - deleteMigrationJob( - request?: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteMigrationJob( - request: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteMigrationJob( - request: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteMigrationJob( - request?: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, - 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.deleteMigrationJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteMigrationJob()`. - * @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/data_migration_service.delete_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async - */ - async checkDeleteMigrationJobProgress(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.deleteMigrationJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Start an already created migration job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the migration job resource to start. - * @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/data_migration_service.start_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_StartMigrationJob_async - */ - startMigrationJob( - request?: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - startMigrationJob( - request: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - startMigrationJob( - request: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - startMigrationJob( - request?: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, - 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.startMigrationJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `startMigrationJob()`. - * @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/data_migration_service.start_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_StartMigrationJob_async - */ - async checkStartMigrationJobProgress(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.startMigrationJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Stops a running migration job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the migration job resource to stop. - * @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/data_migration_service.stop_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_StopMigrationJob_async - */ - stopMigrationJob( - request?: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - stopMigrationJob( - request: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - stopMigrationJob( - request: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - stopMigrationJob( - request?: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, - 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.stopMigrationJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `stopMigrationJob()`. - * @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/data_migration_service.stop_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_StopMigrationJob_async - */ - async checkStopMigrationJobProgress(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.stopMigrationJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Resume a migration job that is currently stopped and is resumable (was - * stopped during CDC phase). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the migration job resource to resume. - * @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/data_migration_service.resume_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async - */ - resumeMigrationJob( - request?: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - resumeMigrationJob( - request: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - resumeMigrationJob( - request: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - resumeMigrationJob( - request?: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, - 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.resumeMigrationJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `resumeMigrationJob()`. - * @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/data_migration_service.resume_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async - */ - async checkResumeMigrationJobProgress(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.resumeMigrationJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Promote a migration job, stopping replication to the destination and - * promoting the destination to be a standalone database. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the migration job resource to promote. - * @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/data_migration_service.promote_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async - */ - promoteMigrationJob( - request?: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - promoteMigrationJob( - request: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - promoteMigrationJob( - request: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - promoteMigrationJob( - request?: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, - 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.promoteMigrationJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `promoteMigrationJob()`. - * @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/data_migration_service.promote_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async - */ - async checkPromoteMigrationJobProgress(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.promoteMigrationJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Verify a migration job, making sure the destination can reach the source - * and that all configuration and prerequisites are met. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the migration job resource to verify. - * @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/data_migration_service.verify_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async - */ - verifyMigrationJob( - request?: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - verifyMigrationJob( - request: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - verifyMigrationJob( - request: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - verifyMigrationJob( - request?: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, - 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.verifyMigrationJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `verifyMigrationJob()`. - * @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/data_migration_service.verify_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async - */ - async checkVerifyMigrationJobProgress(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.verifyMigrationJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Restart a stopped or failed migration job, resetting the destination - * instance to its original state and starting the migration process from - * scratch. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the migration job resource to restart. - * @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/data_migration_service.restart_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async - */ - restartMigrationJob( - request?: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restartMigrationJob( - request: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restartMigrationJob( - request: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restartMigrationJob( - request?: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, - 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.restartMigrationJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `restartMigrationJob()`. - * @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/data_migration_service.restart_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async - */ - async checkRestartMigrationJobProgress(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.restartMigrationJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new connection profile in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of connection profiles. - * @param {string} request.connectionProfileId - * Required. The connection profile identifier. - * @param {google.cloud.clouddms.v1.ConnectionProfile} request.connectionProfile - * Required. The create request body including the connection profile data - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the server receives - * two requests with the same ID, then the second request is ignored. - * - * It is recommended to always set this value to a UUID. - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - * @param {boolean} [request.validateOnly] - * Optional. Only validate the connection profile, but don't create any - * resources. The default is false. Only supported for Oracle connection - * profiles. - * @param {boolean} [request.skipValidation] - * Optional. Create the connection profile without validating it. - * The default is false. - * Only supported for Oracle connection profiles. - * @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/data_migration_service.create_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async - */ - createConnectionProfile( - request?: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createConnectionProfile( - request: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createConnectionProfile( - request: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createConnectionProfile( - request?: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, - 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.createConnectionProfile(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createConnectionProfile()`. - * @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/data_migration_service.create_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async - */ - async checkCreateConnectionProfileProgress(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.createConnectionProfile, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Update the configuration of a single connection profile. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten by the - * update in the conversion workspace resource. - * @param {google.cloud.clouddms.v1.ConnectionProfile} request.connectionProfile - * Required. The connection profile parameters to update. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the server receives - * two requests with the same ID, then the second request is ignored. - * - * It is recommended to always set this value to a UUID. - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - * @param {boolean} [request.validateOnly] - * Optional. Only validate the connection profile, but don't update any - * resources. The default is false. Only supported for Oracle connection - * profiles. - * @param {boolean} [request.skipValidation] - * Optional. Update the connection profile without validating it. - * The default is false. - * Only supported for Oracle connection profiles. - * @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/data_migration_service.update_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async - */ - updateConnectionProfile( - request?: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateConnectionProfile( - request: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateConnectionProfile( - request: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateConnectionProfile( - request?: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, - 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({ - 'connection_profile.name': request.connectionProfile!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateConnectionProfile(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateConnectionProfile()`. - * @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/data_migration_service.update_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async - */ - async checkUpdateConnectionProfileProgress(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.updateConnectionProfile, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Database Migration Service connection profile. - * A connection profile can only be deleted if it is not in use by any - * active migration jobs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the connection profile resource to delete. - * @param {string} request.requestId - * A unique ID used to identify the request. If the server receives two - * requests with the same ID, then the second request is ignored. - * - * It is recommended to always set this value to a UUID. - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - * @param {boolean} request.force - * In case of force delete, the CloudSQL replica database is also deleted - * (only for CloudSQL connection profile). - * @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/data_migration_service.delete_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async - */ - deleteConnectionProfile( - request?: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteConnectionProfile( - request: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteConnectionProfile( - request: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteConnectionProfile( - request?: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, - 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.deleteConnectionProfile(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteConnectionProfile()`. - * @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/data_migration_service.delete_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async - */ - async checkDeleteConnectionProfileProgress(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.deleteConnectionProfile, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new private connection in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent that owns the collection of PrivateConnections. - * @param {string} request.privateConnectionId - * Required. The private connection identifier. - * @param {google.cloud.clouddms.v1.PrivateConnection} request.privateConnection - * Required. The private connection resource to create. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the server receives - * two requests with the same ID, then the second request is ignored. - * - * It is recommended to always set this value to a UUID. - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - * @param {boolean} [request.skipValidation] - * Optional. If set to true, will skip validations. - * @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/data_migration_service.create_private_connection.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreatePrivateConnection_async - */ - createPrivateConnection( - request?: protos.google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createPrivateConnection( - request: protos.google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createPrivateConnection( - request: protos.google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createPrivateConnection( - request?: protos.google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, - 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.createPrivateConnection(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createPrivateConnection()`. - * @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/data_migration_service.create_private_connection.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreatePrivateConnection_async - */ - async checkCreatePrivateConnectionProgress(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.createPrivateConnection, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single Database Migration Service private connection. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the private connection to delete. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the server receives - * two requests with the same ID, then the second request is ignored. - * - * It is recommended to always set this value to a UUID. - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - * @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/data_migration_service.delete_private_connection.js - * region_tag:datamigration_v1_generated_DataMigrationService_DeletePrivateConnection_async - */ - deletePrivateConnection( - request?: protos.google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deletePrivateConnection( - request: protos.google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deletePrivateConnection( - request: protos.google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deletePrivateConnection( - request?: protos.google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, - 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.deletePrivateConnection(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deletePrivateConnection()`. - * @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/data_migration_service.delete_private_connection.js - * region_tag:datamigration_v1_generated_DataMigrationService_DeletePrivateConnection_async - */ - async checkDeletePrivateConnectionProgress(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.deletePrivateConnection, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new conversion workspace in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of conversion workspaces. - * @param {string} request.conversionWorkspaceId - * Required. The ID of the conversion workspace to create. - * @param {google.cloud.clouddms.v1.ConversionWorkspace} request.conversionWorkspace - * Required. Represents a conversion workspace object. - * @param {string} request.requestId - * A unique ID used to identify the request. If the server receives two - * requests with the same ID, then the second request is ignored. - * - * It is recommended to always set this value to a UUID. - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - * @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/data_migration_service.create_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreateConversionWorkspace_async - */ - createConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createConversionWorkspace( - request: protos.google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createConversionWorkspace( - request: protos.google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, - 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.createConversionWorkspace(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createConversionWorkspace()`. - * @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/data_migration_service.create_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreateConversionWorkspace_async - */ - async checkCreateConversionWorkspaceProgress(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.createConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the parameters of a single conversion workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten by the - * update in the conversion workspace resource. - * @param {google.cloud.clouddms.v1.ConversionWorkspace} request.conversionWorkspace - * Required. The conversion workspace parameters to update. - * @param {string} request.requestId - * A unique ID used to identify the request. If the server receives two - * requests with the same ID, then the second request is ignored. - * - * It is recommended to always set this value to a UUID. - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - * @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/data_migration_service.update_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConversionWorkspace_async - */ - updateConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateConversionWorkspace( - request: protos.google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateConversionWorkspace( - request: protos.google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, - 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({ - 'conversion_workspace.name': request.conversionWorkspace!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateConversionWorkspace(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateConversionWorkspace()`. - * @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/data_migration_service.update_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConversionWorkspace_async - */ - async checkUpdateConversionWorkspaceProgress(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.updateConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single conversion workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the conversion workspace resource to delete. - * @param {string} request.requestId - * A unique ID used to identify the request. If the server receives two - * requests with the same ID, then the second request is ignored. - * - * It is recommended to always set this value to a UUID. - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. - * @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/data_migration_service.delete_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConversionWorkspace_async - */ - deleteConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteConversionWorkspace( - request: protos.google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteConversionWorkspace( - request: protos.google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, - 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.deleteConversionWorkspace(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteConversionWorkspace()`. - * @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/data_migration_service.delete_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConversionWorkspace_async - */ - async checkDeleteConversionWorkspaceProgress(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.deleteConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Imports a snapshot of the source database into the - * conversion workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the conversion workspace resource to seed with new database - * structure, in the form of: - * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - * @param {boolean} request.autoCommit - * Should the conversion workspace be committed automatically after the - * seed operation. - * @param {string} request.sourceConnectionProfile - * Fully qualified (Uri) name of the source connection profile. - * @param {string} request.destinationConnectionProfile - * Fully qualified (Uri) name of the destination connection profile. - * @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/data_migration_service.seed_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_SeedConversionWorkspace_async - */ - seedConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - seedConversionWorkspace( - request: protos.google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - seedConversionWorkspace( - request: protos.google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - seedConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, - 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.seedConversionWorkspace(request, options, callback); - } -/** - * Check the status of the long running operation returned by `seedConversionWorkspace()`. - * @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/data_migration_service.seed_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_SeedConversionWorkspace_async - */ - async checkSeedConversionWorkspaceProgress(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.seedConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Imports the mapping rules for a given conversion workspace. - * Supports various formats of external rules files. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of the conversion workspace resource to import the rules to - * in the form of: - * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - * @param {google.cloud.clouddms.v1.ImportRulesFileFormat} request.rulesFormat - * The format of the rules content file. - * @param {number[]} request.rulesFiles - * One or more rules files. - * @param {boolean} request.autoCommit - * Should the conversion workspace be committed automatically after the - * import operation. - * @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/data_migration_service.import_mapping_rules.js - * region_tag:datamigration_v1_generated_DataMigrationService_ImportMappingRules_async - */ - importMappingRules( - request?: protos.google.cloud.clouddms.v1.IImportMappingRulesRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - importMappingRules( - request: protos.google.cloud.clouddms.v1.IImportMappingRulesRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importMappingRules( - request: protos.google.cloud.clouddms.v1.IImportMappingRulesRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importMappingRules( - request?: protos.google.cloud.clouddms.v1.IImportMappingRulesRequest, - 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.importMappingRules(request, options, callback); - } -/** - * Check the status of the long running operation returned by `importMappingRules()`. - * @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/data_migration_service.import_mapping_rules.js - * region_tag:datamigration_v1_generated_DataMigrationService_ImportMappingRules_async - */ - async checkImportMappingRulesProgress(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.importMappingRules, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a draft tree schema for the destination database. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the conversion workspace resource to convert in the form of: - * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - * @param {boolean} request.autoCommit - * Specifies whether the conversion workspace is to be committed automatically - * after the conversion. - * @param {string} request.filter - * Filter the entities to convert. Leaving this field empty will convert all - * of the entities. Supports Google AIP-160 style filtering. - * @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/data_migration_service.convert_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_ConvertConversionWorkspace_async - */ - convertConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - convertConversionWorkspace( - request: protos.google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - convertConversionWorkspace( - request: protos.google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - convertConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, - 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.convertConversionWorkspace(request, options, callback); - } -/** - * Check the status of the long running operation returned by `convertConversionWorkspace()`. - * @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/data_migration_service.convert_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_ConvertConversionWorkspace_async - */ - async checkConvertConversionWorkspaceProgress(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.convertConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Marks all the data in the conversion workspace as committed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the conversion workspace resource to commit. - * @param {string} [request.commitName] - * Optional. Optional name of the commit. - * @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/data_migration_service.commit_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_CommitConversionWorkspace_async - */ - commitConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - commitConversionWorkspace( - request: protos.google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - commitConversionWorkspace( - request: protos.google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - commitConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, - 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.commitConversionWorkspace(request, options, callback); - } -/** - * Check the status of the long running operation returned by `commitConversionWorkspace()`. - * @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/data_migration_service.commit_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_CommitConversionWorkspace_async - */ - async checkCommitConversionWorkspaceProgress(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.commitConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Rolls back a conversion workspace to the last committed snapshot. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the conversion workspace resource to roll back to. - * @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/data_migration_service.rollback_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_RollbackConversionWorkspace_async - */ - rollbackConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - rollbackConversionWorkspace( - request: protos.google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - rollbackConversionWorkspace( - request: protos.google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - rollbackConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, - 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.rollbackConversionWorkspace(request, options, callback); - } -/** - * Check the status of the long running operation returned by `rollbackConversionWorkspace()`. - * @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/data_migration_service.rollback_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_RollbackConversionWorkspace_async - */ - async checkRollbackConversionWorkspaceProgress(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.rollbackConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Applies draft tree onto a specific destination database. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the conversion workspace resource for which to apply - * the draft tree. Must be in the form of: - * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - * @param {string} request.filter - * Filter which entities to apply. Leaving this field empty will apply all of - * the entities. Supports Google AIP 160 based filtering. - * @param {string} request.connectionProfile - * Fully qualified (Uri) name of the destination connection profile. - * @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/data_migration_service.apply_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_ApplyConversionWorkspace_async - */ - applyConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - applyConversionWorkspace( - request: protos.google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - applyConversionWorkspace( - request: protos.google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - applyConversionWorkspace( - request?: protos.google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, - 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.applyConversionWorkspace(request, options, callback); - } -/** - * Check the status of the long running operation returned by `applyConversionWorkspace()`. - * @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/data_migration_service.apply_conversion_workspace.js - * region_tag:datamigration_v1_generated_DataMigrationService_ApplyConversionWorkspace_async - */ - async checkApplyConversionWorkspaceProgress(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.applyConversionWorkspace, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists migration jobs in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of migrationJobs. - * @param {number} request.pageSize - * The maximum number of migration jobs to return. The service may return - * fewer than this value. If unspecified, at most 50 migration jobs will be - * returned. The maximum value is 1000; values above 1000 are coerced to - * 1000. - * @param {string} request.pageToken - * The nextPageToken value received in the previous call to - * migrationJobs.list, used in the subsequent request to retrieve the next - * page of results. On first call this should be left blank. When paginating, - * all other parameters provided to migrationJobs.list must match the call - * that provided the page token. - * @param {string} request.filter - * A filter expression that filters migration jobs listed in the response. - * The expression must specify the field name, a comparison operator, and the - * value that you want to use for filtering. The value must be a string, - * a number, or a boolean. The comparison operator must be - * either =, !=, >, or <. For example, list migration jobs created this year - * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** - * You can also filter nested fields. For example, you could specify - * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration - * jobs connecting through the specific SSH tunnel bastion. - * @param {string} request.orderBy - * Sort the results based on the migration job name. - * Valid values are: "name", "name asc", and "name desc". - * @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 {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob}. - * 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 `listMigrationJobsAsync()` - * 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. - */ - listMigrationJobs( - request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.clouddms.v1.IMigrationJob[], - protos.google.cloud.clouddms.v1.IListMigrationJobsRequest|null, - protos.google.cloud.clouddms.v1.IListMigrationJobsResponse - ]>; - listMigrationJobs( - request: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - protos.google.cloud.clouddms.v1.IListMigrationJobsResponse|null|undefined, - protos.google.cloud.clouddms.v1.IMigrationJob>): void; - listMigrationJobs( - request: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - protos.google.cloud.clouddms.v1.IListMigrationJobsResponse|null|undefined, - protos.google.cloud.clouddms.v1.IMigrationJob>): void; - listMigrationJobs( - request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - protos.google.cloud.clouddms.v1.IListMigrationJobsResponse|null|undefined, - protos.google.cloud.clouddms.v1.IMigrationJob>, - callback?: PaginationCallback< - protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - protos.google.cloud.clouddms.v1.IListMigrationJobsResponse|null|undefined, - protos.google.cloud.clouddms.v1.IMigrationJob>): - Promise<[ - protos.google.cloud.clouddms.v1.IMigrationJob[], - protos.google.cloud.clouddms.v1.IListMigrationJobsRequest|null, - protos.google.cloud.clouddms.v1.IListMigrationJobsResponse - ]>|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.listMigrationJobs(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 - * Required. The parent which owns this collection of migrationJobs. - * @param {number} request.pageSize - * The maximum number of migration jobs to return. The service may return - * fewer than this value. If unspecified, at most 50 migration jobs will be - * returned. The maximum value is 1000; values above 1000 are coerced to - * 1000. - * @param {string} request.pageToken - * The nextPageToken value received in the previous call to - * migrationJobs.list, used in the subsequent request to retrieve the next - * page of results. On first call this should be left blank. When paginating, - * all other parameters provided to migrationJobs.list must match the call - * that provided the page token. - * @param {string} request.filter - * A filter expression that filters migration jobs listed in the response. - * The expression must specify the field name, a comparison operator, and the - * value that you want to use for filtering. The value must be a string, - * a number, or a boolean. The comparison operator must be - * either =, !=, >, or <. For example, list migration jobs created this year - * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** - * You can also filter nested fields. For example, you could specify - * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration - * jobs connecting through the specific SSH tunnel bastion. - * @param {string} request.orderBy - * Sort the results based on the migration job name. - * Valid values are: "name", "name asc", and "name desc". - * @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 {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob} 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 `listMigrationJobsAsync()` - * 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. - */ - listMigrationJobsStream( - request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - 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['listMigrationJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listMigrationJobs.createStream( - this.innerApiCalls.listMigrationJobs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listMigrationJobs`, 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 - * Required. The parent which owns this collection of migrationJobs. - * @param {number} request.pageSize - * The maximum number of migration jobs to return. The service may return - * fewer than this value. If unspecified, at most 50 migration jobs will be - * returned. The maximum value is 1000; values above 1000 are coerced to - * 1000. - * @param {string} request.pageToken - * The nextPageToken value received in the previous call to - * migrationJobs.list, used in the subsequent request to retrieve the next - * page of results. On first call this should be left blank. When paginating, - * all other parameters provided to migrationJobs.list must match the call - * that provided the page token. - * @param {string} request.filter - * A filter expression that filters migration jobs listed in the response. - * The expression must specify the field name, a comparison operator, and the - * value that you want to use for filtering. The value must be a string, - * a number, or a boolean. The comparison operator must be - * either =, !=, >, or <. For example, list migration jobs created this year - * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** - * You can also filter nested fields. For example, you could specify - * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration - * jobs connecting through the specific SSH tunnel bastion. - * @param {string} request.orderBy - * Sort the results based on the migration job name. - * Valid values are: "name", "name asc", and "name desc". - * @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 - * {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob}. 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/data_migration_service.list_migration_jobs.js - * region_tag:datamigration_v1_generated_DataMigrationService_ListMigrationJobs_async - */ - listMigrationJobsAsync( - request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - 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['listMigrationJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listMigrationJobs.asyncIterate( - this.innerApiCalls['listMigrationJobs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Retrieves a list of all connection profiles in a given project and - * location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of connection profiles. - * @param {number} request.pageSize - * The maximum number of connection profiles to return. The service may return - * fewer than this value. If unspecified, at most 50 connection profiles will - * be returned. The maximum value is 1000; values above 1000 are coerced - * to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListConnectionProfiles` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListConnectionProfiles` - * must match the call that provided the page token. - * @param {string} request.filter - * A filter expression that filters connection profiles listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list connection profiles created this year by - * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can - * also filter nested fields. For example, you could specify **mySql.username - * = %lt;my_username%gt;** to list all connection profiles configured to - * connect with a specific username. - * @param {string} request.orderBy - * A comma-separated list of fields to order results according to. - * @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 {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile}. - * 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 `listConnectionProfilesAsync()` - * 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. - */ - listConnectionProfiles( - request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.clouddms.v1.IConnectionProfile[], - protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest|null, - protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse - ]>; - listConnectionProfiles( - request: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse|null|undefined, - protos.google.cloud.clouddms.v1.IConnectionProfile>): void; - listConnectionProfiles( - request: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse|null|undefined, - protos.google.cloud.clouddms.v1.IConnectionProfile>): void; - listConnectionProfiles( - request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse|null|undefined, - protos.google.cloud.clouddms.v1.IConnectionProfile>, - callback?: PaginationCallback< - protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse|null|undefined, - protos.google.cloud.clouddms.v1.IConnectionProfile>): - Promise<[ - protos.google.cloud.clouddms.v1.IConnectionProfile[], - protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest|null, - protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse - ]>|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.listConnectionProfiles(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 - * Required. The parent which owns this collection of connection profiles. - * @param {number} request.pageSize - * The maximum number of connection profiles to return. The service may return - * fewer than this value. If unspecified, at most 50 connection profiles will - * be returned. The maximum value is 1000; values above 1000 are coerced - * to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListConnectionProfiles` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListConnectionProfiles` - * must match the call that provided the page token. - * @param {string} request.filter - * A filter expression that filters connection profiles listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list connection profiles created this year by - * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can - * also filter nested fields. For example, you could specify **mySql.username - * = %lt;my_username%gt;** to list all connection profiles configured to - * connect with a specific username. - * @param {string} request.orderBy - * A comma-separated list of fields to order results according to. - * @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 {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile} 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 `listConnectionProfilesAsync()` - * 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. - */ - listConnectionProfilesStream( - request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - 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['listConnectionProfiles']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listConnectionProfiles.createStream( - this.innerApiCalls.listConnectionProfiles as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listConnectionProfiles`, 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 - * Required. The parent which owns this collection of connection profiles. - * @param {number} request.pageSize - * The maximum number of connection profiles to return. The service may return - * fewer than this value. If unspecified, at most 50 connection profiles will - * be returned. The maximum value is 1000; values above 1000 are coerced - * to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListConnectionProfiles` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListConnectionProfiles` - * must match the call that provided the page token. - * @param {string} request.filter - * A filter expression that filters connection profiles listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list connection profiles created this year by - * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can - * also filter nested fields. For example, you could specify **mySql.username - * = %lt;my_username%gt;** to list all connection profiles configured to - * connect with a specific username. - * @param {string} request.orderBy - * A comma-separated list of fields to order results according to. - * @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 - * {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile}. 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/data_migration_service.list_connection_profiles.js - * region_tag:datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_async - */ - listConnectionProfilesAsync( - request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - 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['listConnectionProfiles']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listConnectionProfiles.asyncIterate( - this.innerApiCalls['listConnectionProfiles'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Retrieves a list of private connections in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent that owns the collection of private connections. - * @param {number} request.pageSize - * Maximum number of private connections to return. - * If unspecified, at most 50 private connections that are returned. - * The maximum value is 1000; values above 1000 are coerced to 1000. - * @param {string} request.pageToken - * Page token received from a previous `ListPrivateConnections` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListPrivateConnections` must match the call that provided the page - * token. - * @param {string} request.filter - * A filter expression that filters private connections listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list private connections created this year by - * specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. - * @param {string} request.orderBy - * Order by fields for the result. - * @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 {@link google.cloud.clouddms.v1.PrivateConnection | PrivateConnection}. - * 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 `listPrivateConnectionsAsync()` - * 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. - */ - listPrivateConnections( - request?: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.clouddms.v1.IPrivateConnection[], - protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest|null, - protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse - ]>; - listPrivateConnections( - request: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, - protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse|null|undefined, - protos.google.cloud.clouddms.v1.IPrivateConnection>): void; - listPrivateConnections( - request: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, - callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, - protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse|null|undefined, - protos.google.cloud.clouddms.v1.IPrivateConnection>): void; - listPrivateConnections( - request?: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, - protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse|null|undefined, - protos.google.cloud.clouddms.v1.IPrivateConnection>, - callback?: PaginationCallback< - protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, - protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse|null|undefined, - protos.google.cloud.clouddms.v1.IPrivateConnection>): - Promise<[ - protos.google.cloud.clouddms.v1.IPrivateConnection[], - protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest|null, - protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse - ]>|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.listPrivateConnections(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 - * Required. The parent that owns the collection of private connections. - * @param {number} request.pageSize - * Maximum number of private connections to return. - * If unspecified, at most 50 private connections that are returned. - * The maximum value is 1000; values above 1000 are coerced to 1000. - * @param {string} request.pageToken - * Page token received from a previous `ListPrivateConnections` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListPrivateConnections` must match the call that provided the page - * token. - * @param {string} request.filter - * A filter expression that filters private connections listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list private connections created this year by - * specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. - * @param {string} request.orderBy - * Order by fields for the result. - * @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 {@link google.cloud.clouddms.v1.PrivateConnection | PrivateConnection} 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 `listPrivateConnectionsAsync()` - * 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. - */ - listPrivateConnectionsStream( - request?: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, - 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['listPrivateConnections']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listPrivateConnections.createStream( - this.innerApiCalls.listPrivateConnections as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listPrivateConnections`, 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 - * Required. The parent that owns the collection of private connections. - * @param {number} request.pageSize - * Maximum number of private connections to return. - * If unspecified, at most 50 private connections that are returned. - * The maximum value is 1000; values above 1000 are coerced to 1000. - * @param {string} request.pageToken - * Page token received from a previous `ListPrivateConnections` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListPrivateConnections` must match the call that provided the page - * token. - * @param {string} request.filter - * A filter expression that filters private connections listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list private connections created this year by - * specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. - * @param {string} request.orderBy - * Order by fields for the result. - * @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 - * {@link google.cloud.clouddms.v1.PrivateConnection | PrivateConnection}. 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/data_migration_service.list_private_connections.js - * region_tag:datamigration_v1_generated_DataMigrationService_ListPrivateConnections_async - */ - listPrivateConnectionsAsync( - request?: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, - 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['listPrivateConnections']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listPrivateConnections.asyncIterate( - this.innerApiCalls['listPrivateConnections'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists conversion workspaces in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent which owns this collection of conversion workspaces. - * @param {number} request.pageSize - * The maximum number of conversion workspaces to return. The service may - * return fewer than this value. If unspecified, at most 50 sets are returned. - * @param {string} request.pageToken - * The nextPageToken value received in the previous call to - * conversionWorkspaces.list, used in the subsequent request to retrieve the - * next page of results. On first call this should be left blank. When - * paginating, all other parameters provided to conversionWorkspaces.list must - * match the call that provided the page token. - * @param {string} request.filter - * A filter expression that filters conversion workspaces listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list conversion workspaces created this year - * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can - * also filter nested fields. For example, you could specify - * **source.version = "12.c.1"** to select all conversion workspaces with - * source database version equal to 12.c.1. - * @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 {@link google.cloud.clouddms.v1.ConversionWorkspace | ConversionWorkspace}. - * 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 `listConversionWorkspacesAsync()` - * 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. - */ - listConversionWorkspaces( - request?: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.clouddms.v1.IConversionWorkspace[], - protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest|null, - protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse - ]>; - listConversionWorkspaces( - request: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, - protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse|null|undefined, - protos.google.cloud.clouddms.v1.IConversionWorkspace>): void; - listConversionWorkspaces( - request: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, - callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, - protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse|null|undefined, - protos.google.cloud.clouddms.v1.IConversionWorkspace>): void; - listConversionWorkspaces( - request?: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, - protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse|null|undefined, - protos.google.cloud.clouddms.v1.IConversionWorkspace>, - callback?: PaginationCallback< - protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, - protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse|null|undefined, - protos.google.cloud.clouddms.v1.IConversionWorkspace>): - Promise<[ - protos.google.cloud.clouddms.v1.IConversionWorkspace[], - protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest|null, - protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse - ]>|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.listConversionWorkspaces(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 - * Required. The parent which owns this collection of conversion workspaces. - * @param {number} request.pageSize - * The maximum number of conversion workspaces to return. The service may - * return fewer than this value. If unspecified, at most 50 sets are returned. - * @param {string} request.pageToken - * The nextPageToken value received in the previous call to - * conversionWorkspaces.list, used in the subsequent request to retrieve the - * next page of results. On first call this should be left blank. When - * paginating, all other parameters provided to conversionWorkspaces.list must - * match the call that provided the page token. - * @param {string} request.filter - * A filter expression that filters conversion workspaces listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list conversion workspaces created this year - * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can - * also filter nested fields. For example, you could specify - * **source.version = "12.c.1"** to select all conversion workspaces with - * source database version equal to 12.c.1. - * @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 {@link google.cloud.clouddms.v1.ConversionWorkspace | ConversionWorkspace} 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 `listConversionWorkspacesAsync()` - * 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. - */ - listConversionWorkspacesStream( - request?: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, - 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['listConversionWorkspaces']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listConversionWorkspaces.createStream( - this.innerApiCalls.listConversionWorkspaces as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listConversionWorkspaces`, 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 - * Required. The parent which owns this collection of conversion workspaces. - * @param {number} request.pageSize - * The maximum number of conversion workspaces to return. The service may - * return fewer than this value. If unspecified, at most 50 sets are returned. - * @param {string} request.pageToken - * The nextPageToken value received in the previous call to - * conversionWorkspaces.list, used in the subsequent request to retrieve the - * next page of results. On first call this should be left blank. When - * paginating, all other parameters provided to conversionWorkspaces.list must - * match the call that provided the page token. - * @param {string} request.filter - * A filter expression that filters conversion workspaces listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list conversion workspaces created this year - * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can - * also filter nested fields. For example, you could specify - * **source.version = "12.c.1"** to select all conversion workspaces with - * source database version equal to 12.c.1. - * @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 - * {@link google.cloud.clouddms.v1.ConversionWorkspace | ConversionWorkspace}. 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/data_migration_service.list_conversion_workspaces.js - * region_tag:datamigration_v1_generated_DataMigrationService_ListConversionWorkspaces_async - */ - listConversionWorkspacesAsync( - request?: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, - 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['listConversionWorkspaces']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listConversionWorkspaces.asyncIterate( - this.innerApiCalls['listConversionWorkspaces'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Describes the database entities tree for a specific conversion workspace - * and a specific tree type. - * - * Database entities are not resources like conversion workspaces or mapping - * rules, and they can't be created, updated or deleted. Instead, they are - * simple data objects describing the structure of the client database. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.conversionWorkspace - * Required. Name of the conversion workspace resource whose database entities - * are described. Must be in the form of: - * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - * @param {number} request.pageSize - * The maximum number of entities to return. The service may return - * fewer entities than the value specifies. - * @param {string} request.pageToken - * The nextPageToken value received in the previous call to - * conversionWorkspace.describeDatabaseEntities, used in the subsequent - * request to retrieve the next page of results. On first call this should be - * left blank. When paginating, all other parameters provided to - * conversionWorkspace.describeDatabaseEntities must match the call that - * provided the page token. - * @param {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType} request.tree - * The tree to fetch. - * @param {boolean} request.uncommitted - * Whether to retrieve the latest committed version of the entities or the - * latest version. This field is ignored if a specific commit_id is specified. - * @param {string} request.commitId - * Request a specific commit ID. If not specified, the entities from the - * latest commit are returned. - * @param {string} request.filter - * Filter the returned entities based on AIP-160 standard. - * @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 {@link google.cloud.clouddms.v1.DatabaseEntity | DatabaseEntity}. - * 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 `describeDatabaseEntitiesAsync()` - * 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. - */ - describeDatabaseEntities( - request?: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.clouddms.v1.IDatabaseEntity[], - protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest|null, - protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse - ]>; - describeDatabaseEntities( - request: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, - protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse|null|undefined, - protos.google.cloud.clouddms.v1.IDatabaseEntity>): void; - describeDatabaseEntities( - request: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, - callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, - protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse|null|undefined, - protos.google.cloud.clouddms.v1.IDatabaseEntity>): void; - describeDatabaseEntities( - request?: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, - protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse|null|undefined, - protos.google.cloud.clouddms.v1.IDatabaseEntity>, - callback?: PaginationCallback< - protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, - protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse|null|undefined, - protos.google.cloud.clouddms.v1.IDatabaseEntity>): - Promise<[ - protos.google.cloud.clouddms.v1.IDatabaseEntity[], - protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest|null, - protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse - ]>|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({ - 'conversion_workspace': request.conversionWorkspace ?? '', - }); - this.initialize(); - return this.innerApiCalls.describeDatabaseEntities(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.conversionWorkspace - * Required. Name of the conversion workspace resource whose database entities - * are described. Must be in the form of: - * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - * @param {number} request.pageSize - * The maximum number of entities to return. The service may return - * fewer entities than the value specifies. - * @param {string} request.pageToken - * The nextPageToken value received in the previous call to - * conversionWorkspace.describeDatabaseEntities, used in the subsequent - * request to retrieve the next page of results. On first call this should be - * left blank. When paginating, all other parameters provided to - * conversionWorkspace.describeDatabaseEntities must match the call that - * provided the page token. - * @param {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType} request.tree - * The tree to fetch. - * @param {boolean} request.uncommitted - * Whether to retrieve the latest committed version of the entities or the - * latest version. This field is ignored if a specific commit_id is specified. - * @param {string} request.commitId - * Request a specific commit ID. If not specified, the entities from the - * latest commit are returned. - * @param {string} request.filter - * Filter the returned entities based on AIP-160 standard. - * @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 {@link google.cloud.clouddms.v1.DatabaseEntity | DatabaseEntity} 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 `describeDatabaseEntitiesAsync()` - * 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. - */ - describeDatabaseEntitiesStream( - request?: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, - 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({ - 'conversion_workspace': request.conversionWorkspace ?? '', - }); - const defaultCallSettings = this._defaults['describeDatabaseEntities']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.describeDatabaseEntities.createStream( - this.innerApiCalls.describeDatabaseEntities as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `describeDatabaseEntities`, 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.conversionWorkspace - * Required. Name of the conversion workspace resource whose database entities - * are described. Must be in the form of: - * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. - * @param {number} request.pageSize - * The maximum number of entities to return. The service may return - * fewer entities than the value specifies. - * @param {string} request.pageToken - * The nextPageToken value received in the previous call to - * conversionWorkspace.describeDatabaseEntities, used in the subsequent - * request to retrieve the next page of results. On first call this should be - * left blank. When paginating, all other parameters provided to - * conversionWorkspace.describeDatabaseEntities must match the call that - * provided the page token. - * @param {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType} request.tree - * The tree to fetch. - * @param {boolean} request.uncommitted - * Whether to retrieve the latest committed version of the entities or the - * latest version. This field is ignored if a specific commit_id is specified. - * @param {string} request.commitId - * Request a specific commit ID. If not specified, the entities from the - * latest commit are returned. - * @param {string} request.filter - * Filter the returned entities based on AIP-160 standard. - * @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 - * {@link google.cloud.clouddms.v1.DatabaseEntity | DatabaseEntity}. 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/data_migration_service.describe_database_entities.js - * region_tag:datamigration_v1_generated_DataMigrationService_DescribeDatabaseEntities_async - */ - describeDatabaseEntitiesAsync( - request?: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, - 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({ - 'conversion_workspace': request.conversionWorkspace ?? '', - }); - const defaultCallSettings = this._defaults['describeDatabaseEntities']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.describeDatabaseEntities.asyncIterate( - this.innerApiCalls['describeDatabaseEntities'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Fetches a set of static IP addresses that need to be allowlisted by the - * customer when using the static-IP connectivity method. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name for the location for which static IPs should be - * returned. Must be in the format `projects/* /locations/*`. - * @param {number} request.pageSize - * Maximum number of IPs to return. - * @param {string} request.pageToken - * A page token, received from a previous `FetchStaticIps` call. - * @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 string. - * 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 `fetchStaticIpsAsync()` - * 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. - */ - fetchStaticIps( - request?: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, - options?: CallOptions): - Promise<[ - string[], - protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest|null, - protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse - ]>; - fetchStaticIps( - request: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, - protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse|null|undefined, - string>): void; - fetchStaticIps( - request: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, - callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, - protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse|null|undefined, - string>): void; - fetchStaticIps( - request?: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, - protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse|null|undefined, - string>, - callback?: PaginationCallback< - protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, - protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse|null|undefined, - string>): - Promise<[ - string[], - protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest|null, - protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse - ]>|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.fetchStaticIps(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.name - * Required. The resource name for the location for which static IPs should be - * returned. Must be in the format `projects/* /locations/*`. - * @param {number} request.pageSize - * Maximum number of IPs to return. - * @param {string} request.pageToken - * A page token, received from a previous `FetchStaticIps` call. - * @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 string 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 `fetchStaticIpsAsync()` - * 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. - */ - fetchStaticIpsStream( - request?: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, - 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({ - 'name': request.name ?? '', - }); - const defaultCallSettings = this._defaults['fetchStaticIps']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.fetchStaticIps.createStream( - this.innerApiCalls.fetchStaticIps as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `fetchStaticIps`, 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.name - * Required. The resource name for the location for which static IPs should be - * returned. Must be in the format `projects/* /locations/*`. - * @param {number} request.pageSize - * Maximum number of IPs to return. - * @param {string} request.pageToken - * A page token, received from a previous `FetchStaticIps` call. - * @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 - * string. 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/data_migration_service.fetch_static_ips.js - * region_tag:datamigration_v1_generated_DataMigrationService_FetchStaticIps_async - */ - fetchStaticIpsAsync( - request?: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, - 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({ - 'name': request.name ?? '', - }); - const defaultCallSettings = this._defaults['fetchStaticIps']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.fetchStaticIps.asyncIterate( - this.innerApiCalls['fetchStaticIps'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @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 {@link google.cloud.location.Location | Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @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 - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 connectionProfile resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} connection_profile - * @returns {string} Resource name string. - */ - connectionProfilePath(project:string,location:string,connectionProfile:string) { - return this.pathTemplates.connectionProfilePathTemplate.render({ - project: project, - location: location, - connection_profile: connectionProfile, - }); - } - - /** - * Parse the project from ConnectionProfile resource. - * - * @param {string} connectionProfileName - * A fully-qualified path representing ConnectionProfile resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConnectionProfileName(connectionProfileName: string) { - return this.pathTemplates.connectionProfilePathTemplate.match(connectionProfileName).project; - } - - /** - * Parse the location from ConnectionProfile resource. - * - * @param {string} connectionProfileName - * A fully-qualified path representing ConnectionProfile resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConnectionProfileName(connectionProfileName: string) { - return this.pathTemplates.connectionProfilePathTemplate.match(connectionProfileName).location; - } - - /** - * Parse the connection_profile from ConnectionProfile resource. - * - * @param {string} connectionProfileName - * A fully-qualified path representing ConnectionProfile resource. - * @returns {string} A string representing the connection_profile. - */ - matchConnectionProfileFromConnectionProfileName(connectionProfileName: string) { - return this.pathTemplates.connectionProfilePathTemplate.match(connectionProfileName).connection_profile; - } - - /** - * Return a fully-qualified conversionWorkspace resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} conversion_workspace - * @returns {string} Resource name string. - */ - conversionWorkspacePath(project:string,location:string,conversionWorkspace:string) { - return this.pathTemplates.conversionWorkspacePathTemplate.render({ - project: project, - location: location, - conversion_workspace: conversionWorkspace, - }); - } - - /** - * Parse the project from ConversionWorkspace resource. - * - * @param {string} conversionWorkspaceName - * A fully-qualified path representing ConversionWorkspace resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConversionWorkspaceName(conversionWorkspaceName: string) { - return this.pathTemplates.conversionWorkspacePathTemplate.match(conversionWorkspaceName).project; - } - - /** - * Parse the location from ConversionWorkspace resource. - * - * @param {string} conversionWorkspaceName - * A fully-qualified path representing ConversionWorkspace resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConversionWorkspaceName(conversionWorkspaceName: string) { - return this.pathTemplates.conversionWorkspacePathTemplate.match(conversionWorkspaceName).location; - } - - /** - * Parse the conversion_workspace from ConversionWorkspace resource. - * - * @param {string} conversionWorkspaceName - * A fully-qualified path representing ConversionWorkspace resource. - * @returns {string} A string representing the conversion_workspace. - */ - matchConversionWorkspaceFromConversionWorkspaceName(conversionWorkspaceName: string) { - return this.pathTemplates.conversionWorkspacePathTemplate.match(conversionWorkspaceName).conversion_workspace; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified migrationJob resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} migration_job - * @returns {string} Resource name string. - */ - migrationJobPath(project:string,location:string,migrationJob:string) { - return this.pathTemplates.migrationJobPathTemplate.render({ - project: project, - location: location, - migration_job: migrationJob, - }); - } - - /** - * Parse the project from MigrationJob resource. - * - * @param {string} migrationJobName - * A fully-qualified path representing MigrationJob resource. - * @returns {string} A string representing the project. - */ - matchProjectFromMigrationJobName(migrationJobName: string) { - return this.pathTemplates.migrationJobPathTemplate.match(migrationJobName).project; - } - - /** - * Parse the location from MigrationJob resource. - * - * @param {string} migrationJobName - * A fully-qualified path representing MigrationJob resource. - * @returns {string} A string representing the location. - */ - matchLocationFromMigrationJobName(migrationJobName: string) { - return this.pathTemplates.migrationJobPathTemplate.match(migrationJobName).location; - } - - /** - * Parse the migration_job from MigrationJob resource. - * - * @param {string} migrationJobName - * A fully-qualified path representing MigrationJob resource. - * @returns {string} A string representing the migration_job. - */ - matchMigrationJobFromMigrationJobName(migrationJobName: string) { - return this.pathTemplates.migrationJobPathTemplate.match(migrationJobName).migration_job; - } - - /** - * Return a fully-qualified privateConnection resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} private_connection - * @returns {string} Resource name string. - */ - privateConnectionPath(project:string,location:string,privateConnection:string) { - return this.pathTemplates.privateConnectionPathTemplate.render({ - project: project, - location: location, - private_connection: privateConnection, - }); - } - - /** - * Parse the project from PrivateConnection resource. - * - * @param {string} privateConnectionName - * A fully-qualified path representing PrivateConnection resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPrivateConnectionName(privateConnectionName: string) { - return this.pathTemplates.privateConnectionPathTemplate.match(privateConnectionName).project; - } - - /** - * Parse the location from PrivateConnection resource. - * - * @param {string} privateConnectionName - * A fully-qualified path representing PrivateConnection resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPrivateConnectionName(privateConnectionName: string) { - return this.pathTemplates.privateConnectionPathTemplate.match(privateConnectionName).location; - } - - /** - * Parse the private_connection from PrivateConnection resource. - * - * @param {string} privateConnectionName - * A fully-qualified path representing PrivateConnection resource. - * @returns {string} A string representing the private_connection. - */ - matchPrivateConnectionFromPrivateConnectionName(privateConnectionName: string) { - return this.pathTemplates.privateConnectionPathTemplate.match(privateConnectionName).private_connection; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * 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.dataMigrationServiceStub && !this._terminated) { - return this.dataMigrationServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.iamClient.close(); - this.locationsClient.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client_config.json b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client_config.json deleted file mode 100644 index 8e34da8c8c8..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_client_config.json +++ /dev/null @@ -1,206 +0,0 @@ -{ - "interfaces": { - "google.cloud.clouddms.v1.DataMigrationService": { - "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": { - "ListMigrationJobs": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetMigrationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateMigrationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateMigrationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteMigrationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StartMigrationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StopMigrationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ResumeMigrationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PromoteMigrationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "VerifyMigrationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RestartMigrationJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GenerateSshScript": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListConnectionProfiles": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetConnectionProfile": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateConnectionProfile": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateConnectionProfile": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteConnectionProfile": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreatePrivateConnection": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetPrivateConnection": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListPrivateConnections": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeletePrivateConnection": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetConversionWorkspace": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListConversionWorkspaces": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateConversionWorkspace": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateConversionWorkspace": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteConversionWorkspace": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SeedConversionWorkspace": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportMappingRules": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ConvertConversionWorkspace": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CommitConversionWorkspace": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RollbackConversionWorkspace": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ApplyConversionWorkspace": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DescribeDatabaseEntities": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SearchBackgroundJobs": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DescribeConversionWorkspaceRevisions": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FetchStaticIps": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_proto_list.json b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_proto_list.json deleted file mode 100644 index 9617525e5a5..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/data_migration_service_proto_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "../../protos/google/cloud/clouddms/v1/clouddms.proto", - "../../protos/google/cloud/clouddms/v1/clouddms_resources.proto", - "../../protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto" -] diff --git a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/gapic_metadata.json deleted file mode 100644 index b6a2e2f6715..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,407 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.clouddms.v1", - "libraryPackage": "@google-cloud/dms", - "services": { - "DataMigrationService": { - "clients": { - "grpc": { - "libraryClient": "DataMigrationServiceClient", - "rpcs": { - "GetMigrationJob": { - "methods": [ - "getMigrationJob" - ] - }, - "GenerateSshScript": { - "methods": [ - "generateSshScript" - ] - }, - "GetConnectionProfile": { - "methods": [ - "getConnectionProfile" - ] - }, - "GetPrivateConnection": { - "methods": [ - "getPrivateConnection" - ] - }, - "GetConversionWorkspace": { - "methods": [ - "getConversionWorkspace" - ] - }, - "SearchBackgroundJobs": { - "methods": [ - "searchBackgroundJobs" - ] - }, - "DescribeConversionWorkspaceRevisions": { - "methods": [ - "describeConversionWorkspaceRevisions" - ] - }, - "CreateMigrationJob": { - "methods": [ - "createMigrationJob" - ] - }, - "UpdateMigrationJob": { - "methods": [ - "updateMigrationJob" - ] - }, - "DeleteMigrationJob": { - "methods": [ - "deleteMigrationJob" - ] - }, - "StartMigrationJob": { - "methods": [ - "startMigrationJob" - ] - }, - "StopMigrationJob": { - "methods": [ - "stopMigrationJob" - ] - }, - "ResumeMigrationJob": { - "methods": [ - "resumeMigrationJob" - ] - }, - "PromoteMigrationJob": { - "methods": [ - "promoteMigrationJob" - ] - }, - "VerifyMigrationJob": { - "methods": [ - "verifyMigrationJob" - ] - }, - "RestartMigrationJob": { - "methods": [ - "restartMigrationJob" - ] - }, - "CreateConnectionProfile": { - "methods": [ - "createConnectionProfile" - ] - }, - "UpdateConnectionProfile": { - "methods": [ - "updateConnectionProfile" - ] - }, - "DeleteConnectionProfile": { - "methods": [ - "deleteConnectionProfile" - ] - }, - "CreatePrivateConnection": { - "methods": [ - "createPrivateConnection" - ] - }, - "DeletePrivateConnection": { - "methods": [ - "deletePrivateConnection" - ] - }, - "CreateConversionWorkspace": { - "methods": [ - "createConversionWorkspace" - ] - }, - "UpdateConversionWorkspace": { - "methods": [ - "updateConversionWorkspace" - ] - }, - "DeleteConversionWorkspace": { - "methods": [ - "deleteConversionWorkspace" - ] - }, - "SeedConversionWorkspace": { - "methods": [ - "seedConversionWorkspace" - ] - }, - "ImportMappingRules": { - "methods": [ - "importMappingRules" - ] - }, - "ConvertConversionWorkspace": { - "methods": [ - "convertConversionWorkspace" - ] - }, - "CommitConversionWorkspace": { - "methods": [ - "commitConversionWorkspace" - ] - }, - "RollbackConversionWorkspace": { - "methods": [ - "rollbackConversionWorkspace" - ] - }, - "ApplyConversionWorkspace": { - "methods": [ - "applyConversionWorkspace" - ] - }, - "ListMigrationJobs": { - "methods": [ - "listMigrationJobs", - "listMigrationJobsStream", - "listMigrationJobsAsync" - ] - }, - "ListConnectionProfiles": { - "methods": [ - "listConnectionProfiles", - "listConnectionProfilesStream", - "listConnectionProfilesAsync" - ] - }, - "ListPrivateConnections": { - "methods": [ - "listPrivateConnections", - "listPrivateConnectionsStream", - "listPrivateConnectionsAsync" - ] - }, - "ListConversionWorkspaces": { - "methods": [ - "listConversionWorkspaces", - "listConversionWorkspacesStream", - "listConversionWorkspacesAsync" - ] - }, - "DescribeDatabaseEntities": { - "methods": [ - "describeDatabaseEntities", - "describeDatabaseEntitiesStream", - "describeDatabaseEntitiesAsync" - ] - }, - "FetchStaticIps": { - "methods": [ - "fetchStaticIps", - "fetchStaticIpsStream", - "fetchStaticIpsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DataMigrationServiceClient", - "rpcs": { - "GetMigrationJob": { - "methods": [ - "getMigrationJob" - ] - }, - "GenerateSshScript": { - "methods": [ - "generateSshScript" - ] - }, - "GetConnectionProfile": { - "methods": [ - "getConnectionProfile" - ] - }, - "GetPrivateConnection": { - "methods": [ - "getPrivateConnection" - ] - }, - "GetConversionWorkspace": { - "methods": [ - "getConversionWorkspace" - ] - }, - "SearchBackgroundJobs": { - "methods": [ - "searchBackgroundJobs" - ] - }, - "DescribeConversionWorkspaceRevisions": { - "methods": [ - "describeConversionWorkspaceRevisions" - ] - }, - "CreateMigrationJob": { - "methods": [ - "createMigrationJob" - ] - }, - "UpdateMigrationJob": { - "methods": [ - "updateMigrationJob" - ] - }, - "DeleteMigrationJob": { - "methods": [ - "deleteMigrationJob" - ] - }, - "StartMigrationJob": { - "methods": [ - "startMigrationJob" - ] - }, - "StopMigrationJob": { - "methods": [ - "stopMigrationJob" - ] - }, - "ResumeMigrationJob": { - "methods": [ - "resumeMigrationJob" - ] - }, - "PromoteMigrationJob": { - "methods": [ - "promoteMigrationJob" - ] - }, - "VerifyMigrationJob": { - "methods": [ - "verifyMigrationJob" - ] - }, - "RestartMigrationJob": { - "methods": [ - "restartMigrationJob" - ] - }, - "CreateConnectionProfile": { - "methods": [ - "createConnectionProfile" - ] - }, - "UpdateConnectionProfile": { - "methods": [ - "updateConnectionProfile" - ] - }, - "DeleteConnectionProfile": { - "methods": [ - "deleteConnectionProfile" - ] - }, - "CreatePrivateConnection": { - "methods": [ - "createPrivateConnection" - ] - }, - "DeletePrivateConnection": { - "methods": [ - "deletePrivateConnection" - ] - }, - "CreateConversionWorkspace": { - "methods": [ - "createConversionWorkspace" - ] - }, - "UpdateConversionWorkspace": { - "methods": [ - "updateConversionWorkspace" - ] - }, - "DeleteConversionWorkspace": { - "methods": [ - "deleteConversionWorkspace" - ] - }, - "SeedConversionWorkspace": { - "methods": [ - "seedConversionWorkspace" - ] - }, - "ImportMappingRules": { - "methods": [ - "importMappingRules" - ] - }, - "ConvertConversionWorkspace": { - "methods": [ - "convertConversionWorkspace" - ] - }, - "CommitConversionWorkspace": { - "methods": [ - "commitConversionWorkspace" - ] - }, - "RollbackConversionWorkspace": { - "methods": [ - "rollbackConversionWorkspace" - ] - }, - "ApplyConversionWorkspace": { - "methods": [ - "applyConversionWorkspace" - ] - }, - "ListMigrationJobs": { - "methods": [ - "listMigrationJobs", - "listMigrationJobsStream", - "listMigrationJobsAsync" - ] - }, - "ListConnectionProfiles": { - "methods": [ - "listConnectionProfiles", - "listConnectionProfilesStream", - "listConnectionProfilesAsync" - ] - }, - "ListPrivateConnections": { - "methods": [ - "listPrivateConnections", - "listPrivateConnectionsStream", - "listPrivateConnectionsAsync" - ] - }, - "ListConversionWorkspaces": { - "methods": [ - "listConversionWorkspaces", - "listConversionWorkspacesStream", - "listConversionWorkspacesAsync" - ] - }, - "DescribeDatabaseEntities": { - "methods": [ - "describeDatabaseEntities", - "describeDatabaseEntitiesStream", - "describeDatabaseEntitiesAsync" - ] - }, - "FetchStaticIps": { - "methods": [ - "fetchStaticIps", - "fetchStaticIpsStream", - "fetchStaticIpsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-clouddms/v1/src/v1/index.ts deleted file mode 100644 index e204933365c..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2023 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 {DataMigrationServiceClient} from './data_migration_service_client'; diff --git a/owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index a95ad264677..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 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 clouddms = require('@google-cloud/dms'); - -function main() { - const dataMigrationServiceClient = new clouddms.DataMigrationServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 93cba263288..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 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 {DataMigrationServiceClient} from '@google-cloud/dms'; - -// check that the client class type name can be used -function doStuffWithDataMigrationServiceClient(client: DataMigrationServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const dataMigrationServiceClient = new DataMigrationServiceClient(); - doStuffWithDataMigrationServiceClient(dataMigrationServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-clouddms/v1/system-test/install.ts b/owl-bot-staging/google-cloud-clouddms/v1/system-test/install.ts deleted file mode 100644 index c8f81b25a86..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 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-clouddms/v1/test/gapic_data_migration_service_v1.ts b/owl-bot-staging/google-cloud-clouddms/v1/test/gapic_data_migration_service_v1.ts deleted file mode 100644 index 05e79e2d670..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/v1/test/gapic_data_migration_service_v1.ts +++ /dev/null @@ -1,6929 +0,0 @@ -// Copyright 2023 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 datamigrationserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} 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.DataMigrationServiceClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = datamigrationserviceModule.v1.DataMigrationServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = datamigrationserviceModule.v1.DataMigrationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = datamigrationserviceModule.v1.DataMigrationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dataMigrationServiceStub, undefined); - await client.initialize(); - assert(client.dataMigrationServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.dataMigrationServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dataMigrationServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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('getMigrationJob', () => { - it('invokes getMigrationJob without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() - ); - client.innerApiCalls.getMigrationJob = stubSimpleCall(expectedResponse); - const [response] = await client.getMigrationJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getMigrationJob without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() - ); - client.innerApiCalls.getMigrationJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getMigrationJob( - request, - (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IMigrationJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getMigrationJob with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getMigrationJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMigrationJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getMigrationJob with closed client', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getMigrationJob(request), expectedError); - }); - }); - - describe('generateSshScript', () => { - it('invokes generateSshScript without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GenerateSshScriptRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GenerateSshScriptRequest', ['migrationJob']); - request.migrationJob = defaultValue1; - const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.SshScript() - ); - client.innerApiCalls.generateSshScript = stubSimpleCall(expectedResponse); - const [response] = await client.generateSshScript(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateSshScript as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateSshScript as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateSshScript without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GenerateSshScriptRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GenerateSshScriptRequest', ['migrationJob']); - request.migrationJob = defaultValue1; - const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.SshScript() - ); - client.innerApiCalls.generateSshScript = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.generateSshScript( - request, - (err?: Error|null, result?: protos.google.cloud.clouddms.v1.ISshScript|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateSshScript as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateSshScript as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateSshScript with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GenerateSshScriptRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GenerateSshScriptRequest', ['migrationJob']); - request.migrationJob = defaultValue1; - const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.generateSshScript = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.generateSshScript(request), expectedError); - const actualRequest = (client.innerApiCalls.generateSshScript as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateSshScript as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateSshScript with closed client', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GenerateSshScriptRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GenerateSshScriptRequest', ['migrationJob']); - request.migrationJob = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.generateSshScript(request), expectedError); - }); - }); - - describe('getConnectionProfile', () => { - it('invokes getConnectionProfile without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetConnectionProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetConnectionProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() - ); - client.innerApiCalls.getConnectionProfile = stubSimpleCall(expectedResponse); - const [response] = await client.getConnectionProfile(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConnectionProfile without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetConnectionProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetConnectionProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() - ); - client.innerApiCalls.getConnectionProfile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getConnectionProfile( - request, - (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IConnectionProfile|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConnectionProfile with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetConnectionProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetConnectionProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getConnectionProfile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getConnectionProfile(request), expectedError); - const actualRequest = (client.innerApiCalls.getConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConnectionProfile with closed client', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetConnectionProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetConnectionProfileRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getConnectionProfile(request), expectedError); - }); - }); - - describe('getPrivateConnection', () => { - it('invokes getPrivateConnection without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetPrivateConnectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetPrivateConnectionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.PrivateConnection() - ); - client.innerApiCalls.getPrivateConnection = stubSimpleCall(expectedResponse); - const [response] = await client.getPrivateConnection(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getPrivateConnection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPrivateConnection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getPrivateConnection without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetPrivateConnectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetPrivateConnectionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.PrivateConnection() - ); - client.innerApiCalls.getPrivateConnection = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getPrivateConnection( - request, - (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IPrivateConnection|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getPrivateConnection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPrivateConnection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getPrivateConnection with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetPrivateConnectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetPrivateConnectionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getPrivateConnection = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getPrivateConnection(request), expectedError); - const actualRequest = (client.innerApiCalls.getPrivateConnection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPrivateConnection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getPrivateConnection with closed client', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetPrivateConnectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetPrivateConnectionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getPrivateConnection(request), expectedError); - }); - }); - - describe('getConversionWorkspace', () => { - it('invokes getConversionWorkspace without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConversionWorkspace() - ); - client.innerApiCalls.getConversionWorkspace = stubSimpleCall(expectedResponse); - const [response] = await client.getConversionWorkspace(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConversionWorkspace without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConversionWorkspace() - ); - client.innerApiCalls.getConversionWorkspace = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getConversionWorkspace( - request, - (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IConversionWorkspace|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConversionWorkspace with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getConversionWorkspace = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getConversionWorkspace(request), expectedError); - const actualRequest = (client.innerApiCalls.getConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConversionWorkspace with closed client', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.GetConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.GetConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getConversionWorkspace(request), expectedError); - }); - }); - - describe('searchBackgroundJobs', () => { - it('invokes searchBackgroundJobs without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.SearchBackgroundJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.SearchBackgroundJobsRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.SearchBackgroundJobsResponse() - ); - client.innerApiCalls.searchBackgroundJobs = stubSimpleCall(expectedResponse); - const [response] = await client.searchBackgroundJobs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchBackgroundJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchBackgroundJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchBackgroundJobs without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.SearchBackgroundJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.SearchBackgroundJobsRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.SearchBackgroundJobsResponse() - ); - client.innerApiCalls.searchBackgroundJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.searchBackgroundJobs( - request, - (err?: Error|null, result?: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.searchBackgroundJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchBackgroundJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchBackgroundJobs with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.SearchBackgroundJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.SearchBackgroundJobsRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchBackgroundJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchBackgroundJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.searchBackgroundJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchBackgroundJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes searchBackgroundJobs with closed client', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.SearchBackgroundJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.SearchBackgroundJobsRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.searchBackgroundJobs(request), expectedError); - }); - }); - - describe('describeConversionWorkspaceRevisions', () => { - it('invokes describeConversionWorkspaceRevisions without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse() - ); - client.innerApiCalls.describeConversionWorkspaceRevisions = stubSimpleCall(expectedResponse); - const [response] = await client.describeConversionWorkspaceRevisions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes describeConversionWorkspaceRevisions without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse() - ); - client.innerApiCalls.describeConversionWorkspaceRevisions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.describeConversionWorkspaceRevisions( - request, - (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes describeConversionWorkspaceRevisions with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.describeConversionWorkspaceRevisions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.describeConversionWorkspaceRevisions(request), expectedError); - const actualRequest = (client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes describeConversionWorkspaceRevisions with closed client', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.describeConversionWorkspaceRevisions(request), expectedError); - }); - }); - - describe('createMigrationJob', () => { - it('invokes createMigrationJob without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreateMigrationJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.createMigrationJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createMigrationJob without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreateMigrationJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createMigrationJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createMigrationJob( - 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.createMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createMigrationJob with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreateMigrationJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createMigrationJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createMigrationJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createMigrationJob with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreateMigrationJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createMigrationJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateMigrationJobProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkCreateMigrationJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateMigrationJobProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkCreateMigrationJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateMigrationJob', () => { - it('invokes updateMigrationJob without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() - ); - request.migrationJob ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateMigrationJobRequest', ['migrationJob', 'name']); - request.migrationJob.name = defaultValue1; - const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateMigrationJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMigrationJob without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() - ); - request.migrationJob ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateMigrationJobRequest', ['migrationJob', 'name']); - request.migrationJob.name = defaultValue1; - const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateMigrationJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateMigrationJob( - 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.updateMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMigrationJob with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() - ); - request.migrationJob ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateMigrationJobRequest', ['migrationJob', 'name']); - request.migrationJob.name = defaultValue1; - const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateMigrationJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateMigrationJob(request), expectedError); - const actualRequest = (client.innerApiCalls.updateMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateMigrationJob with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() - ); - request.migrationJob ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateMigrationJobRequest', ['migrationJob', 'name']); - request.migrationJob.name = defaultValue1; - const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateMigrationJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateMigrationJobProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkUpdateMigrationJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateMigrationJobProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkUpdateMigrationJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteMigrationJob', () => { - it('invokes deleteMigrationJob without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteMigrationJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteMigrationJob without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteMigrationJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteMigrationJob( - 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.deleteMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteMigrationJob with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMigrationJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteMigrationJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteMigrationJob with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteMigrationJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteMigrationJobProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkDeleteMigrationJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteMigrationJobProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkDeleteMigrationJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('startMigrationJob', () => { - it('invokes startMigrationJob without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.StartMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.startMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.startMigrationJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.startMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startMigrationJob without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.StartMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.startMigrationJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.startMigrationJob( - 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.startMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startMigrationJob with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.StartMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.startMigrationJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.startMigrationJob(request), expectedError); - const actualRequest = (client.innerApiCalls.startMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startMigrationJob with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.StartMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.startMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.startMigrationJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.startMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkStartMigrationJobProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkStartMigrationJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkStartMigrationJobProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkStartMigrationJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('stopMigrationJob', () => { - it('invokes stopMigrationJob without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.StopMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.stopMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.stopMigrationJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.stopMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes stopMigrationJob without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.StopMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.stopMigrationJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.stopMigrationJob( - 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.stopMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes stopMigrationJob with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.StopMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.stopMigrationJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.stopMigrationJob(request), expectedError); - const actualRequest = (client.innerApiCalls.stopMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes stopMigrationJob with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.StopMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.stopMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.stopMigrationJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.stopMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkStopMigrationJobProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkStopMigrationJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkStopMigrationJobProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkStopMigrationJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('resumeMigrationJob', () => { - it('invokes resumeMigrationJob without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ResumeMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.resumeMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.resumeMigrationJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.resumeMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeMigrationJob without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ResumeMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.resumeMigrationJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.resumeMigrationJob( - 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.resumeMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeMigrationJob with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ResumeMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.resumeMigrationJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.resumeMigrationJob(request), expectedError); - const actualRequest = (client.innerApiCalls.resumeMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeMigrationJob with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ResumeMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.resumeMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.resumeMigrationJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.resumeMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkResumeMigrationJobProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkResumeMigrationJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkResumeMigrationJobProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkResumeMigrationJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('promoteMigrationJob', () => { - it('invokes promoteMigrationJob without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.PromoteMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.promoteMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.promoteMigrationJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.promoteMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes promoteMigrationJob without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.PromoteMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.promoteMigrationJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.promoteMigrationJob( - 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.promoteMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes promoteMigrationJob with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.PromoteMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.promoteMigrationJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.promoteMigrationJob(request), expectedError); - const actualRequest = (client.innerApiCalls.promoteMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes promoteMigrationJob with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.PromoteMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.promoteMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.promoteMigrationJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.promoteMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.promoteMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkPromoteMigrationJobProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkPromoteMigrationJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkPromoteMigrationJobProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkPromoteMigrationJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('verifyMigrationJob', () => { - it('invokes verifyMigrationJob without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.VerifyMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.verifyMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.verifyMigrationJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.verifyMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.verifyMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes verifyMigrationJob without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.VerifyMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.verifyMigrationJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.verifyMigrationJob( - 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.verifyMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.verifyMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes verifyMigrationJob with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.VerifyMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.verifyMigrationJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.verifyMigrationJob(request), expectedError); - const actualRequest = (client.innerApiCalls.verifyMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.verifyMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes verifyMigrationJob with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.VerifyMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.verifyMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.verifyMigrationJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.verifyMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.verifyMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkVerifyMigrationJobProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkVerifyMigrationJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkVerifyMigrationJobProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkVerifyMigrationJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restartMigrationJob', () => { - it('invokes restartMigrationJob without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.RestartMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restartMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartMigrationJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restartMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartMigrationJob without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.RestartMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restartMigrationJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restartMigrationJob( - 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.restartMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartMigrationJob with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.RestartMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.restartMigrationJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restartMigrationJob(request), expectedError); - const actualRequest = (client.innerApiCalls.restartMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartMigrationJob with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.RestartMigrationJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.restartMigrationJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restartMigrationJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restartMigrationJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartMigrationJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestartMigrationJobProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkRestartMigrationJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestartMigrationJobProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkRestartMigrationJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createConnectionProfile', () => { - it('invokes createConnectionProfile without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConnectionProfileRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createConnectionProfile = stubLongRunningCall(expectedResponse); - const [operation] = await client.createConnectionProfile(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createConnectionProfile without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConnectionProfileRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createConnectionProfile = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createConnectionProfile( - 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.createConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createConnectionProfile with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConnectionProfileRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createConnectionProfile = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createConnectionProfile(request), expectedError); - const actualRequest = (client.innerApiCalls.createConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createConnectionProfile with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConnectionProfileRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createConnectionProfile = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createConnectionProfile(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateConnectionProfileProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkCreateConnectionProfileProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateConnectionProfileProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkCreateConnectionProfileProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateConnectionProfile', () => { - it('invokes updateConnectionProfile without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() - ); - request.connectionProfile ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', ['connectionProfile', 'name']); - request.connectionProfile.name = defaultValue1; - const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateConnectionProfile = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateConnectionProfile(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateConnectionProfile without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() - ); - request.connectionProfile ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', ['connectionProfile', 'name']); - request.connectionProfile.name = defaultValue1; - const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateConnectionProfile = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateConnectionProfile( - 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.updateConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateConnectionProfile with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() - ); - request.connectionProfile ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', ['connectionProfile', 'name']); - request.connectionProfile.name = defaultValue1; - const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateConnectionProfile = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateConnectionProfile(request), expectedError); - const actualRequest = (client.innerApiCalls.updateConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateConnectionProfile with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() - ); - request.connectionProfile ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', ['connectionProfile', 'name']); - request.connectionProfile.name = defaultValue1; - const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateConnectionProfile = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateConnectionProfile(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateConnectionProfileProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkUpdateConnectionProfileProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateConnectionProfileProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkUpdateConnectionProfileProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteConnectionProfile', () => { - it('invokes deleteConnectionProfile without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteConnectionProfile(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConnectionProfile without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteConnectionProfile = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteConnectionProfile( - 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.deleteConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConnectionProfile with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteConnectionProfile(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConnectionProfile with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteConnectionProfile(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteConnectionProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConnectionProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteConnectionProfileProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkDeleteConnectionProfileProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteConnectionProfileProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkDeleteConnectionProfileProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createPrivateConnection', () => { - it('invokes createPrivateConnection without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreatePrivateConnectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreatePrivateConnectionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createPrivateConnection = stubLongRunningCall(expectedResponse); - const [operation] = await client.createPrivateConnection(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createPrivateConnection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPrivateConnection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createPrivateConnection without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreatePrivateConnectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreatePrivateConnectionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createPrivateConnection = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createPrivateConnection( - 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.createPrivateConnection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPrivateConnection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createPrivateConnection with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreatePrivateConnectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreatePrivateConnectionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createPrivateConnection = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createPrivateConnection(request), expectedError); - const actualRequest = (client.innerApiCalls.createPrivateConnection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPrivateConnection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createPrivateConnection with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreatePrivateConnectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreatePrivateConnectionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createPrivateConnection = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createPrivateConnection(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createPrivateConnection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPrivateConnection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreatePrivateConnectionProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkCreatePrivateConnectionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreatePrivateConnectionProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkCreatePrivateConnectionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deletePrivateConnection', () => { - it('invokes deletePrivateConnection without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeletePrivateConnectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeletePrivateConnectionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deletePrivateConnection = stubLongRunningCall(expectedResponse); - const [operation] = await client.deletePrivateConnection(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deletePrivateConnection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePrivateConnection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deletePrivateConnection without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeletePrivateConnectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeletePrivateConnectionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deletePrivateConnection = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deletePrivateConnection( - 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.deletePrivateConnection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePrivateConnection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deletePrivateConnection with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeletePrivateConnectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeletePrivateConnectionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deletePrivateConnection = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deletePrivateConnection(request), expectedError); - const actualRequest = (client.innerApiCalls.deletePrivateConnection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePrivateConnection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deletePrivateConnection with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeletePrivateConnectionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeletePrivateConnectionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deletePrivateConnection = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deletePrivateConnection(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deletePrivateConnection as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePrivateConnection as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeletePrivateConnectionProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkDeletePrivateConnectionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeletePrivateConnectionProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkDeletePrivateConnectionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createConversionWorkspace', () => { - it('invokes createConversionWorkspace without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createConversionWorkspace = stubLongRunningCall(expectedResponse); - const [operation] = await client.createConversionWorkspace(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createConversionWorkspace without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createConversionWorkspace( - 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.createConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createConversionWorkspace with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createConversionWorkspace = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createConversionWorkspace(request), expectedError); - const actualRequest = (client.innerApiCalls.createConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createConversionWorkspace with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createConversionWorkspace(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateConversionWorkspaceProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkCreateConversionWorkspaceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateConversionWorkspaceProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkCreateConversionWorkspaceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateConversionWorkspace', () => { - it('invokes updateConversionWorkspace without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest() - ); - request.conversionWorkspace ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest', ['conversionWorkspace', 'name']); - request.conversionWorkspace.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateConversionWorkspace = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateConversionWorkspace(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateConversionWorkspace without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest() - ); - request.conversionWorkspace ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest', ['conversionWorkspace', 'name']); - request.conversionWorkspace.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateConversionWorkspace( - 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.updateConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateConversionWorkspace with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest() - ); - request.conversionWorkspace ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest', ['conversionWorkspace', 'name']); - request.conversionWorkspace.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateConversionWorkspace = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateConversionWorkspace(request), expectedError); - const actualRequest = (client.innerApiCalls.updateConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateConversionWorkspace with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest() - ); - request.conversionWorkspace ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest', ['conversionWorkspace', 'name']); - request.conversionWorkspace.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateConversionWorkspace(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateConversionWorkspaceProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkUpdateConversionWorkspaceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateConversionWorkspaceProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkUpdateConversionWorkspaceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteConversionWorkspace', () => { - it('invokes deleteConversionWorkspace without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteConversionWorkspace = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteConversionWorkspace(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConversionWorkspace without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteConversionWorkspace( - 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.deleteConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConversionWorkspace with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteConversionWorkspace = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteConversionWorkspace(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConversionWorkspace with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteConversionWorkspace(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteConversionWorkspaceProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkDeleteConversionWorkspaceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteConversionWorkspaceProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkDeleteConversionWorkspaceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('seedConversionWorkspace', () => { - it('invokes seedConversionWorkspace without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.seedConversionWorkspace = stubLongRunningCall(expectedResponse); - const [operation] = await client.seedConversionWorkspace(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.seedConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.seedConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes seedConversionWorkspace without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.seedConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.seedConversionWorkspace( - 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.seedConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.seedConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes seedConversionWorkspace with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.seedConversionWorkspace = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.seedConversionWorkspace(request), expectedError); - const actualRequest = (client.innerApiCalls.seedConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.seedConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes seedConversionWorkspace with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.seedConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.seedConversionWorkspace(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.seedConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.seedConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkSeedConversionWorkspaceProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkSeedConversionWorkspaceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkSeedConversionWorkspaceProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkSeedConversionWorkspaceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('importMappingRules', () => { - it('invokes importMappingRules without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ImportMappingRulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ImportMappingRulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importMappingRules = stubLongRunningCall(expectedResponse); - const [operation] = await client.importMappingRules(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.importMappingRules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importMappingRules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importMappingRules without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ImportMappingRulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ImportMappingRulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importMappingRules = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importMappingRules( - 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.importMappingRules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importMappingRules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importMappingRules with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ImportMappingRulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ImportMappingRulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importMappingRules = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importMappingRules(request), expectedError); - const actualRequest = (client.innerApiCalls.importMappingRules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importMappingRules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importMappingRules with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ImportMappingRulesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ImportMappingRulesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importMappingRules = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importMappingRules(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.importMappingRules as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importMappingRules as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkImportMappingRulesProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkImportMappingRulesProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkImportMappingRulesProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkImportMappingRulesProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('convertConversionWorkspace', () => { - it('invokes convertConversionWorkspace without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.convertConversionWorkspace = stubLongRunningCall(expectedResponse); - const [operation] = await client.convertConversionWorkspace(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.convertConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.convertConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes convertConversionWorkspace without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.convertConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.convertConversionWorkspace( - 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.convertConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.convertConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes convertConversionWorkspace with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.convertConversionWorkspace = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.convertConversionWorkspace(request), expectedError); - const actualRequest = (client.innerApiCalls.convertConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.convertConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes convertConversionWorkspace with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.convertConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.convertConversionWorkspace(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.convertConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.convertConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkConvertConversionWorkspaceProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkConvertConversionWorkspaceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkConvertConversionWorkspaceProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkConvertConversionWorkspaceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('commitConversionWorkspace', () => { - it('invokes commitConversionWorkspace without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.commitConversionWorkspace = stubLongRunningCall(expectedResponse); - const [operation] = await client.commitConversionWorkspace(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.commitConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.commitConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes commitConversionWorkspace without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.commitConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.commitConversionWorkspace( - 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.commitConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.commitConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes commitConversionWorkspace with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.commitConversionWorkspace = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.commitConversionWorkspace(request), expectedError); - const actualRequest = (client.innerApiCalls.commitConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.commitConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes commitConversionWorkspace with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.commitConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.commitConversionWorkspace(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.commitConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.commitConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCommitConversionWorkspaceProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkCommitConversionWorkspaceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCommitConversionWorkspaceProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkCommitConversionWorkspaceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('rollbackConversionWorkspace', () => { - it('invokes rollbackConversionWorkspace without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.rollbackConversionWorkspace = stubLongRunningCall(expectedResponse); - const [operation] = await client.rollbackConversionWorkspace(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackConversionWorkspace without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.rollbackConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rollbackConversionWorkspace( - 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.rollbackConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackConversionWorkspace with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.rollbackConversionWorkspace = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.rollbackConversionWorkspace(request), expectedError); - const actualRequest = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackConversionWorkspace with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.rollbackConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.rollbackConversionWorkspace(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRollbackConversionWorkspaceProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkRollbackConversionWorkspaceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRollbackConversionWorkspaceProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkRollbackConversionWorkspaceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('applyConversionWorkspace', () => { - it('invokes applyConversionWorkspace without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.applyConversionWorkspace = stubLongRunningCall(expectedResponse); - const [operation] = await client.applyConversionWorkspace(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.applyConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.applyConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes applyConversionWorkspace without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.applyConversionWorkspace = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.applyConversionWorkspace( - 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.applyConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.applyConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes applyConversionWorkspace with call error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.applyConversionWorkspace = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.applyConversionWorkspace(request), expectedError); - const actualRequest = (client.innerApiCalls.applyConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.applyConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes applyConversionWorkspace with LRO error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.applyConversionWorkspace = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.applyConversionWorkspace(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.applyConversionWorkspace as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.applyConversionWorkspace as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkApplyConversionWorkspaceProgress without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkApplyConversionWorkspaceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkApplyConversionWorkspaceProgress with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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.checkApplyConversionWorkspaceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listMigrationJobs', () => { - it('invokes listMigrationJobs without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), - ]; - client.innerApiCalls.listMigrationJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listMigrationJobs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listMigrationJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMigrationJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listMigrationJobs without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), - ]; - client.innerApiCalls.listMigrationJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listMigrationJobs( - request, - (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IMigrationJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listMigrationJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMigrationJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listMigrationJobs with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listMigrationJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMigrationJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listMigrationJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMigrationJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listMigrationJobsStream without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), - ]; - client.descriptors.page.listMigrationJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listMigrationJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.MigrationJob[] = []; - stream.on('data', (response: protos.google.cloud.clouddms.v1.MigrationJob) => { - 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.listMigrationJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMigrationJobs, request)); - assert( - (client.descriptors.page.listMigrationJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listMigrationJobsStream with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listMigrationJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listMigrationJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.MigrationJob[] = []; - stream.on('data', (response: protos.google.cloud.clouddms.v1.MigrationJob) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listMigrationJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listMigrationJobs, request)); - assert( - (client.descriptors.page.listMigrationJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listMigrationJobs without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.MigrationJob()), - ]; - client.descriptors.page.listMigrationJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.clouddms.v1.IMigrationJob[] = []; - const iterable = client.listMigrationJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listMigrationJobs with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListMigrationJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listMigrationJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listMigrationJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.clouddms.v1.IMigrationJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listConnectionProfiles', () => { - it('invokes listConnectionProfiles without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), - ]; - client.innerApiCalls.listConnectionProfiles = stubSimpleCall(expectedResponse); - const [response] = await client.listConnectionProfiles(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listConnectionProfiles as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConnectionProfiles as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConnectionProfiles without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), - ]; - client.innerApiCalls.listConnectionProfiles = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listConnectionProfiles( - request, - (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IConnectionProfile[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listConnectionProfiles as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConnectionProfiles as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConnectionProfiles with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listConnectionProfiles = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listConnectionProfiles(request), expectedError); - const actualRequest = (client.innerApiCalls.listConnectionProfiles as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConnectionProfiles as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConnectionProfilesStream without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), - ]; - client.descriptors.page.listConnectionProfiles.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listConnectionProfilesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.ConnectionProfile[] = []; - stream.on('data', (response: protos.google.cloud.clouddms.v1.ConnectionProfile) => { - 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.listConnectionProfiles.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listConnectionProfiles, request)); - assert( - (client.descriptors.page.listConnectionProfiles.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listConnectionProfilesStream with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listConnectionProfiles.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listConnectionProfilesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.ConnectionProfile[] = []; - stream.on('data', (response: protos.google.cloud.clouddms.v1.ConnectionProfile) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listConnectionProfiles.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listConnectionProfiles, request)); - assert( - (client.descriptors.page.listConnectionProfiles.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listConnectionProfiles without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConnectionProfile()), - ]; - client.descriptors.page.listConnectionProfiles.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.clouddms.v1.IConnectionProfile[] = []; - const iterable = client.listConnectionProfilesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listConnectionProfiles.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listConnectionProfiles.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listConnectionProfiles with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConnectionProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listConnectionProfiles.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listConnectionProfilesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.clouddms.v1.IConnectionProfile[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listConnectionProfiles.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listConnectionProfiles.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listPrivateConnections', () => { - it('invokes listPrivateConnections without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), - ]; - client.innerApiCalls.listPrivateConnections = stubSimpleCall(expectedResponse); - const [response] = await client.listPrivateConnections(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listPrivateConnections as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPrivateConnections as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listPrivateConnections without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), - ]; - client.innerApiCalls.listPrivateConnections = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listPrivateConnections( - request, - (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IPrivateConnection[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listPrivateConnections as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPrivateConnections as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listPrivateConnections with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listPrivateConnections = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listPrivateConnections(request), expectedError); - const actualRequest = (client.innerApiCalls.listPrivateConnections as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPrivateConnections as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listPrivateConnectionsStream without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), - ]; - client.descriptors.page.listPrivateConnections.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listPrivateConnectionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.PrivateConnection[] = []; - stream.on('data', (response: protos.google.cloud.clouddms.v1.PrivateConnection) => { - 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.listPrivateConnections.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listPrivateConnections, request)); - assert( - (client.descriptors.page.listPrivateConnections.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listPrivateConnectionsStream with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listPrivateConnections.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listPrivateConnectionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.PrivateConnection[] = []; - stream.on('data', (response: protos.google.cloud.clouddms.v1.PrivateConnection) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listPrivateConnections.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listPrivateConnections, request)); - assert( - (client.descriptors.page.listPrivateConnections.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listPrivateConnections without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.PrivateConnection()), - ]; - client.descriptors.page.listPrivateConnections.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.clouddms.v1.IPrivateConnection[] = []; - const iterable = client.listPrivateConnectionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listPrivateConnections.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listPrivateConnections.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listPrivateConnections with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listPrivateConnections.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listPrivateConnectionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.clouddms.v1.IPrivateConnection[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listPrivateConnections.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listPrivateConnections.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listConversionWorkspaces', () => { - it('invokes listConversionWorkspaces without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), - ]; - client.innerApiCalls.listConversionWorkspaces = stubSimpleCall(expectedResponse); - const [response] = await client.listConversionWorkspaces(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listConversionWorkspaces as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversionWorkspaces as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConversionWorkspaces without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), - ]; - client.innerApiCalls.listConversionWorkspaces = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listConversionWorkspaces( - request, - (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IConversionWorkspace[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listConversionWorkspaces as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversionWorkspaces as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConversionWorkspaces with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listConversionWorkspaces = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listConversionWorkspaces(request), expectedError); - const actualRequest = (client.innerApiCalls.listConversionWorkspaces as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversionWorkspaces as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConversionWorkspacesStream without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), - ]; - client.descriptors.page.listConversionWorkspaces.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listConversionWorkspacesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.ConversionWorkspace[] = []; - stream.on('data', (response: protos.google.cloud.clouddms.v1.ConversionWorkspace) => { - 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.listConversionWorkspaces.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listConversionWorkspaces, request)); - assert( - (client.descriptors.page.listConversionWorkspaces.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listConversionWorkspacesStream with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listConversionWorkspaces.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listConversionWorkspacesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.ConversionWorkspace[] = []; - stream.on('data', (response: protos.google.cloud.clouddms.v1.ConversionWorkspace) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listConversionWorkspaces.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listConversionWorkspaces, request)); - assert( - (client.descriptors.page.listConversionWorkspaces.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listConversionWorkspaces without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.ConversionWorkspace()), - ]; - client.descriptors.page.listConversionWorkspaces.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.clouddms.v1.IConversionWorkspace[] = []; - const iterable = client.listConversionWorkspacesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listConversionWorkspaces.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listConversionWorkspaces.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listConversionWorkspaces with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listConversionWorkspaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listConversionWorkspacesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.clouddms.v1.IConversionWorkspace[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listConversionWorkspaces.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listConversionWorkspaces.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('describeDatabaseEntities', () => { - it('invokes describeDatabaseEntities without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), - ]; - client.innerApiCalls.describeDatabaseEntities = stubSimpleCall(expectedResponse); - const [response] = await client.describeDatabaseEntities(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.describeDatabaseEntities as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.describeDatabaseEntities as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes describeDatabaseEntities without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), - ]; - client.innerApiCalls.describeDatabaseEntities = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.describeDatabaseEntities( - request, - (err?: Error|null, result?: protos.google.cloud.clouddms.v1.IDatabaseEntity[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.describeDatabaseEntities as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.describeDatabaseEntities as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes describeDatabaseEntities with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.describeDatabaseEntities = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.describeDatabaseEntities(request), expectedError); - const actualRequest = (client.innerApiCalls.describeDatabaseEntities as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.describeDatabaseEntities as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes describeDatabaseEntitiesStream without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), - ]; - client.descriptors.page.describeDatabaseEntities.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.describeDatabaseEntitiesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.DatabaseEntity[] = []; - stream.on('data', (response: protos.google.cloud.clouddms.v1.DatabaseEntity) => { - 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.describeDatabaseEntities.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.describeDatabaseEntities, request)); - assert( - (client.descriptors.page.describeDatabaseEntities.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes describeDatabaseEntitiesStream with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.describeDatabaseEntities.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.describeDatabaseEntitiesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.DatabaseEntity[] = []; - stream.on('data', (response: protos.google.cloud.clouddms.v1.DatabaseEntity) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.describeDatabaseEntities.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.describeDatabaseEntities, request)); - assert( - (client.descriptors.page.describeDatabaseEntities.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with describeDatabaseEntities without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), - generateSampleMessage(new protos.google.cloud.clouddms.v1.DatabaseEntity()), - ]; - client.descriptors.page.describeDatabaseEntities.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.clouddms.v1.IDatabaseEntity[] = []; - const iterable = client.describeDatabaseEntitiesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.describeDatabaseEntities.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.describeDatabaseEntities.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with describeDatabaseEntities with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', ['conversionWorkspace']); - request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.describeDatabaseEntities.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.describeDatabaseEntitiesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.clouddms.v1.IDatabaseEntity[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.describeDatabaseEntities.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.describeDatabaseEntities.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('fetchStaticIps', () => { - it('invokes fetchStaticIps without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [new String(), new String(), new String()]; - client.innerApiCalls.fetchStaticIps = stubSimpleCall(expectedResponse); - const [response] = await client.fetchStaticIps(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchStaticIps as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchStaticIps as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchStaticIps without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [new String(), new String(), new String()]; - client.innerApiCalls.fetchStaticIps = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchStaticIps( - request, - (err?: Error|null, result?: string[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchStaticIps as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchStaticIps as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchStaticIps with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchStaticIps = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchStaticIps(request), expectedError); - const actualRequest = (client.innerApiCalls.fetchStaticIps as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchStaticIps as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchStaticIpsStream without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = [new String(), new String(), new String()]; - client.descriptors.page.fetchStaticIps.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.fetchStaticIpsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: string[] = []; - stream.on('data', (response: string) => { - 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.fetchStaticIps.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.fetchStaticIps, request)); - assert( - (client.descriptors.page.fetchStaticIps.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes fetchStaticIpsStream with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.fetchStaticIps.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.fetchStaticIpsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: string[] = []; - stream.on('data', (response: string) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.fetchStaticIps.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.fetchStaticIps, request)); - assert( - (client.descriptors.page.fetchStaticIps.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with fetchStaticIps without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = [new String(), new String(), new String()]; - client.descriptors.page.fetchStaticIps.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: string[] = []; - const iterable = client.fetchStaticIpsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.fetchStaticIps.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.fetchStaticIps.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with fetchStaticIps with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.clouddms.v1.FetchStaticIpsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.fetchStaticIps.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.fetchStaticIpsAsync(request); - await assert.rejects(async () => { - const responses: string[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.fetchStaticIps.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.fetchStaticIps.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.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 datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ - 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('connectionProfile', () => { - const fakePath = "/rendered/path/connectionProfile"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - connection_profile: "connectionProfileValue", - }; - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.connectionProfilePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.connectionProfilePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('connectionProfilePath', () => { - const result = client.connectionProfilePath("projectValue", "locationValue", "connectionProfileValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.connectionProfilePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConnectionProfileName', () => { - const result = client.matchProjectFromConnectionProfileName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.connectionProfilePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConnectionProfileName', () => { - const result = client.matchLocationFromConnectionProfileName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.connectionProfilePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConnectionProfileFromConnectionProfileName', () => { - const result = client.matchConnectionProfileFromConnectionProfileName(fakePath); - assert.strictEqual(result, "connectionProfileValue"); - assert((client.pathTemplates.connectionProfilePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('conversionWorkspace', () => { - const fakePath = "/rendered/path/conversionWorkspace"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - conversion_workspace: "conversionWorkspaceValue", - }; - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.conversionWorkspacePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.conversionWorkspacePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('conversionWorkspacePath', () => { - const result = client.conversionWorkspacePath("projectValue", "locationValue", "conversionWorkspaceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.conversionWorkspacePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConversionWorkspaceName', () => { - const result = client.matchProjectFromConversionWorkspaceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.conversionWorkspacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConversionWorkspaceName', () => { - const result = client.matchLocationFromConversionWorkspaceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.conversionWorkspacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConversionWorkspaceFromConversionWorkspaceName', () => { - const result = client.matchConversionWorkspaceFromConversionWorkspaceName(fakePath); - assert.strictEqual(result, "conversionWorkspaceValue"); - assert((client.pathTemplates.conversionWorkspacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('migrationJob', () => { - const fakePath = "/rendered/path/migrationJob"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - migration_job: "migrationJobValue", - }; - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.migrationJobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.migrationJobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('migrationJobPath', () => { - const result = client.migrationJobPath("projectValue", "locationValue", "migrationJobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.migrationJobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromMigrationJobName', () => { - const result = client.matchProjectFromMigrationJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.migrationJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromMigrationJobName', () => { - const result = client.matchLocationFromMigrationJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.migrationJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchMigrationJobFromMigrationJobName', () => { - const result = client.matchMigrationJobFromMigrationJobName(fakePath); - assert.strictEqual(result, "migrationJobValue"); - assert((client.pathTemplates.migrationJobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('privateConnection', () => { - const fakePath = "/rendered/path/privateConnection"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - private_connection: "privateConnectionValue", - }; - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.privateConnectionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.privateConnectionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('privateConnectionPath', () => { - const result = client.privateConnectionPath("projectValue", "locationValue", "privateConnectionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.privateConnectionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPrivateConnectionName', () => { - const result = client.matchProjectFromPrivateConnectionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.privateConnectionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPrivateConnectionName', () => { - const result = client.matchLocationFromPrivateConnectionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.privateConnectionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPrivateConnectionFromPrivateConnectionName', () => { - const result = client.matchPrivateConnectionFromPrivateConnectionName(fakePath); - assert.strictEqual(result, "privateConnectionValue"); - assert((client.pathTemplates.privateConnectionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-clouddms/v1/tsconfig.json b/owl-bot-staging/google-cloud-clouddms/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/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-clouddms/v1/webpack.config.js b/owl-bot-staging/google-cloud-clouddms/v1/webpack.config.js deleted file mode 100644 index 97e2580c8eb..00000000000 --- a/owl-bot-staging/google-cloud-clouddms/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: 'DataMigrationService', - filename: './data-migration-service.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-clouddms/README.md b/packages/google-cloud-clouddms/README.md index 5fbdf8d3661..d9e84b33370 100644 --- a/packages/google-cloud-clouddms/README.md +++ b/packages/google-cloud-clouddms/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Cloud Database Migration Service: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Cloud Database Migration Service: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-clouddms) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/dms.svg)](https://www.npmjs.org/package/@google-cloud/dms) @@ -79,29 +79,47 @@ listMigrationJobs(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-clouddms/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Data_migration_service.create_connection_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.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-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js,samples/README.md) | -| Data_migration_service.create_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.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-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js,samples/README.md) | -| Data_migration_service.delete_connection_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.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-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js,samples/README.md) | -| Data_migration_service.delete_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.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-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js,samples/README.md) | -| Data_migration_service.generate_ssh_script | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.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-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js,samples/README.md) | -| Data_migration_service.get_connection_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.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-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js,samples/README.md) | -| Data_migration_service.get_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.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-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js,samples/README.md) | -| Data_migration_service.list_connection_profiles | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.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-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js,samples/README.md) | -| Data_migration_service.list_migration_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.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-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js,samples/README.md) | -| Data_migration_service.promote_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.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-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js,samples/README.md) | -| Data_migration_service.restart_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.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-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js,samples/README.md) | -| Data_migration_service.resume_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.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-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js,samples/README.md) | -| Data_migration_service.start_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.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-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js,samples/README.md) | -| Data_migration_service.stop_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.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-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js,samples/README.md) | -| Data_migration_service.update_connection_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.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-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js,samples/README.md) | -| Data_migration_service.update_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.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-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js,samples/README.md) | -| Data_migration_service.verify_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.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-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/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-clouddms/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/test/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-clouddms/samples/test/quickstart.js,samples/README.md) | +| Data_migration_service.apply_conversion_workspace | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.apply_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.apply_conversion_workspace.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.commit_conversion_workspace | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.commit_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.commit_conversion_workspace.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.convert_conversion_workspace | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.convert_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.convert_conversion_workspace.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.create_connection_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.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-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.create_conversion_workspace | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.create_conversion_workspace.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.create_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.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-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.create_private_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_private_connection.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-clouddms/samples/generated/v1/data_migration_service.create_private_connection.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.delete_connection_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.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-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.delete_conversion_workspace | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.delete_conversion_workspace.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.delete_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.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-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.delete_private_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_private_connection.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-clouddms/samples/generated/v1/data_migration_service.delete_private_connection.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.describe_conversion_workspace_revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.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-clouddms/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.describe_database_entities | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_database_entities.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-clouddms/samples/generated/v1/data_migration_service.describe_database_entities.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.fetch_static_ips | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.fetch_static_ips.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-clouddms/samples/generated/v1/data_migration_service.fetch_static_ips.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.generate_ssh_script | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.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-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.get_connection_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.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-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.get_conversion_workspace | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.get_conversion_workspace.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.get_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.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-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.get_private_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_private_connection.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-clouddms/samples/generated/v1/data_migration_service.get_private_connection.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.import_mapping_rules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.import_mapping_rules.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-clouddms/samples/generated/v1/data_migration_service.import_mapping_rules.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.list_connection_profiles | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.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-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.list_conversion_workspaces | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_conversion_workspaces.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-clouddms/samples/generated/v1/data_migration_service.list_conversion_workspaces.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.list_migration_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.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-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.list_private_connections | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_private_connections.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-clouddms/samples/generated/v1/data_migration_service.list_private_connections.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.promote_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.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-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.restart_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.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-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.resume_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.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-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.rollback_conversion_workspace | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.rollback_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.search_background_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.search_background_jobs.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-clouddms/samples/generated/v1/data_migration_service.search_background_jobs.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.seed_conversion_workspace | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.seed_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.seed_conversion_workspace.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.start_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.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-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.stop_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.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-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.update_connection_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.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-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.update_conversion_workspace | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.update_conversion_workspace.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.update_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.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-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js,packages/google-cloud-clouddms/samples/README.md) | +| Data_migration_service.verify_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.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-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js,packages/google-cloud-clouddms/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/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-clouddms/samples/quickstart.js,packages/google-cloud-clouddms/samples/README.md) | diff --git a/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms.proto b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms.proto index 0126c9c3a20..69d7d93d016 100644 --- a/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms.proto +++ b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/clouddms/v1/clouddms_resources.proto"; +import "google/cloud/clouddms/v1/conversionworkspace_resources.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -36,10 +37,12 @@ option ruby_package = "Google::Cloud::CloudDMS::V1"; // Database Migration service service DataMigrationService { option (google.api.default_host) = "datamigration.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Lists migration jobs in a given project and location. - rpc ListMigrationJobs(ListMigrationJobsRequest) returns (ListMigrationJobsResponse) { + rpc ListMigrationJobs(ListMigrationJobsRequest) + returns (ListMigrationJobsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}/migrationJobs" }; @@ -55,12 +58,14 @@ service DataMigrationService { } // Creates a new migration job in a given project and location. - rpc CreateMigrationJob(CreateMigrationJobRequest) returns (google.longrunning.Operation) { + rpc CreateMigrationJob(CreateMigrationJobRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/migrationJobs" body: "migration_job" }; - option (google.api.method_signature) = "parent,migration_job,migration_job_id"; + option (google.api.method_signature) = + "parent,migration_job,migration_job_id"; option (google.longrunning.operation_info) = { response_type: "MigrationJob" metadata_type: "OperationMetadata" @@ -68,7 +73,8 @@ service DataMigrationService { } // Updates the parameters of a single migration job. - rpc UpdateMigrationJob(UpdateMigrationJobRequest) returns (google.longrunning.Operation) { + rpc UpdateMigrationJob(UpdateMigrationJobRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{migration_job.name=projects/*/locations/*/migrationJobs/*}" body: "migration_job" @@ -81,7 +87,8 @@ service DataMigrationService { } // Deletes a single migration job. - rpc DeleteMigrationJob(DeleteMigrationJobRequest) returns (google.longrunning.Operation) { + rpc DeleteMigrationJob(DeleteMigrationJobRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/migrationJobs/*}" }; @@ -93,7 +100,8 @@ service DataMigrationService { } // Start an already created migration job. - rpc StartMigrationJob(StartMigrationJobRequest) returns (google.longrunning.Operation) { + rpc StartMigrationJob(StartMigrationJobRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:start" body: "*" @@ -105,7 +113,8 @@ service DataMigrationService { } // Stops a running migration job. - rpc StopMigrationJob(StopMigrationJobRequest) returns (google.longrunning.Operation) { + rpc StopMigrationJob(StopMigrationJobRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:stop" body: "*" @@ -118,7 +127,8 @@ service DataMigrationService { // Resume a migration job that is currently stopped and is resumable (was // stopped during CDC phase). - rpc ResumeMigrationJob(ResumeMigrationJobRequest) returns (google.longrunning.Operation) { + rpc ResumeMigrationJob(ResumeMigrationJobRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:resume" body: "*" @@ -131,7 +141,8 @@ service DataMigrationService { // Promote a migration job, stopping replication to the destination and // promoting the destination to be a standalone database. - rpc PromoteMigrationJob(PromoteMigrationJobRequest) returns (google.longrunning.Operation) { + rpc PromoteMigrationJob(PromoteMigrationJobRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:promote" body: "*" @@ -144,7 +155,8 @@ service DataMigrationService { // Verify a migration job, making sure the destination can reach the source // and that all configuration and prerequisites are met. - rpc VerifyMigrationJob(VerifyMigrationJobRequest) returns (google.longrunning.Operation) { + rpc VerifyMigrationJob(VerifyMigrationJobRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:verify" body: "*" @@ -158,7 +170,8 @@ service DataMigrationService { // Restart a stopped or failed migration job, resetting the destination // instance to its original state and starting the migration process from // scratch. - rpc RestartMigrationJob(RestartMigrationJobRequest) returns (google.longrunning.Operation) { + rpc RestartMigrationJob(RestartMigrationJobRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:restart" body: "*" @@ -178,8 +191,10 @@ service DataMigrationService { }; } - // Retrieve a list of all connection profiles in a given project and location. - rpc ListConnectionProfiles(ListConnectionProfilesRequest) returns (ListConnectionProfilesResponse) { + // Retrieves a list of all connection profiles in a given project and + // location. + rpc ListConnectionProfiles(ListConnectionProfilesRequest) + returns (ListConnectionProfilesResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}/connectionProfiles" }; @@ -187,7 +202,8 @@ service DataMigrationService { } // Gets details of a single connection profile. - rpc GetConnectionProfile(GetConnectionProfileRequest) returns (ConnectionProfile) { + rpc GetConnectionProfile(GetConnectionProfileRequest) + returns (ConnectionProfile) { option (google.api.http) = { get: "/v1/{name=projects/*/locations/*/connectionProfiles/*}" }; @@ -195,12 +211,14 @@ service DataMigrationService { } // Creates a new connection profile in a given project and location. - rpc CreateConnectionProfile(CreateConnectionProfileRequest) returns (google.longrunning.Operation) { + rpc CreateConnectionProfile(CreateConnectionProfileRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/connectionProfiles" body: "connection_profile" }; - option (google.api.method_signature) = "parent,connection_profile,connection_profile_id"; + option (google.api.method_signature) = + "parent,connection_profile,connection_profile_id"; option (google.longrunning.operation_info) = { response_type: "ConnectionProfile" metadata_type: "OperationMetadata" @@ -208,7 +226,8 @@ service DataMigrationService { } // Update the configuration of a single connection profile. - rpc UpdateConnectionProfile(UpdateConnectionProfileRequest) returns (google.longrunning.Operation) { + rpc UpdateConnectionProfile(UpdateConnectionProfileRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{connection_profile.name=projects/*/locations/*/connectionProfiles/*}" body: "connection_profile" @@ -223,7 +242,8 @@ service DataMigrationService { // Deletes a single Database Migration Service connection profile. // A connection profile can only be deleted if it is not in use by any // active migration jobs. - rpc DeleteConnectionProfile(DeleteConnectionProfileRequest) returns (google.longrunning.Operation) { + rpc DeleteConnectionProfile(DeleteConnectionProfileRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/connectionProfiles/*}" }; @@ -233,11 +253,242 @@ service DataMigrationService { metadata_type: "OperationMetadata" }; } + + // Creates a new private connection in a given project and location. + rpc CreatePrivateConnection(CreatePrivateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/privateConnections" + body: "private_connection" + }; + option (google.api.method_signature) = + "parent,private_connection,private_connection_id"; + option (google.longrunning.operation_info) = { + response_type: "PrivateConnection" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single private connection. + rpc GetPrivateConnection(GetPrivateConnectionRequest) + returns (PrivateConnection) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/privateConnections/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves a list of private connections in a given project and location. + rpc ListPrivateConnections(ListPrivateConnectionsRequest) + returns (ListPrivateConnectionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/privateConnections" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a single Database Migration Service private connection. + rpc DeletePrivateConnection(DeletePrivateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/privateConnections/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single conversion workspace. + rpc GetConversionWorkspace(GetConversionWorkspaceRequest) + returns (ConversionWorkspace) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists conversion workspaces in a given project and location. + rpc ListConversionWorkspaces(ListConversionWorkspacesRequest) + returns (ListConversionWorkspacesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/conversionWorkspaces" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new conversion workspace in a given project and location. + rpc CreateConversionWorkspace(CreateConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/conversionWorkspaces" + body: "conversion_workspace" + }; + option (google.api.method_signature) = + "parent,conversion_workspace,conversion_workspace_id"; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single conversion workspace. + rpc UpdateConversionWorkspace(UpdateConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{conversion_workspace.name=projects/*/locations/*/conversionWorkspaces/*}" + body: "conversion_workspace" + }; + option (google.api.method_signature) = "conversion_workspace,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single conversion workspace. + rpc DeleteConversionWorkspace(DeleteConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Imports a snapshot of the source database into the + // conversion workspace. + rpc SeedConversionWorkspace(SeedConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:seed" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Imports the mapping rules for a given conversion workspace. + // Supports various formats of external rules files. + rpc ImportMappingRules(ImportMappingRulesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/conversionWorkspaces/*}/mappingRules:import" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Creates a draft tree schema for the destination database. + rpc ConvertConversionWorkspace(ConvertConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:convert" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Marks all the data in the conversion workspace as committed. + rpc CommitConversionWorkspace(CommitConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:commit" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Rolls back a conversion workspace to the last committed snapshot. + rpc RollbackConversionWorkspace(RollbackConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:rollback" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Applies draft tree onto a specific destination database. + rpc ApplyConversionWorkspace(ApplyConversionWorkspaceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:apply" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ConversionWorkspace" + metadata_type: "OperationMetadata" + }; + } + + // Describes the database entities tree for a specific conversion workspace + // and a specific tree type. + // + // Database entities are not resources like conversion workspaces or mapping + // rules, and they can't be created, updated or deleted. Instead, they are + // simple data objects describing the structure of the client database. + rpc DescribeDatabaseEntities(DescribeDatabaseEntitiesRequest) + returns (DescribeDatabaseEntitiesResponse) { + option (google.api.http) = { + get: "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:describeDatabaseEntities" + }; + } + + // Searches/lists the background jobs for a specific + // conversion workspace. + // + // The background jobs are not resources like conversion workspaces or + // mapping rules, and they can't be created, updated or deleted. + // Instead, they are a way to expose the data plane jobs log. + rpc SearchBackgroundJobs(SearchBackgroundJobsRequest) + returns (SearchBackgroundJobsResponse) { + option (google.api.http) = { + get: "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:searchBackgroundJobs" + }; + } + + // Retrieves a list of committed revisions of a specific conversion + // workspace. + rpc DescribeConversionWorkspaceRevisions( + DescribeConversionWorkspaceRevisionsRequest) + returns (DescribeConversionWorkspaceRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:describeConversionWorkspaceRevisions" + }; + } + + // Fetches a set of static IP addresses that need to be allowlisted by the + // customer when using the static-IP connectivity method. + rpc FetchStaticIps(FetchStaticIpsRequest) returns (FetchStaticIpsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*}:fetchStaticIps" + }; + option (google.api.method_signature) = "name"; + } } -// Retrieve a list of all migration jobs in a given project and location. +// Retrieves a list of all migration jobs in a given project and location. message ListMigrationJobsRequest { - // Required. The parent, which owns this collection of migrationJobs. + // Required. The parent which owns this collection of migrationJobs. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -247,7 +498,7 @@ message ListMigrationJobsRequest { // The maximum number of migration jobs to return. The service may return // fewer than this value. If unspecified, at most 50 migration jobs will be - // returned. The maximum value is 1000; values above 1000 will be coerced to + // returned. The maximum value is 1000; values above 1000 are coerced to // 1000. int32 page_size = 2; @@ -279,7 +530,7 @@ message ListMigrationJobsResponse { // The list of migration jobs objects. repeated MigrationJob migration_jobs = 1; - // A token, which can be sent as `page_token` to retrieve the next page. + // A token which can be sent as `page_token` to retrieve the next page. // If this field is omitted, there are no subsequent pages. string next_page_token = 2; @@ -301,7 +552,7 @@ message GetMigrationJobRequest { // Request message to create a new Database Migration Service migration job // in the specified project and region. message CreateMigrationJobRequest { - // Required. The parent, which owns this collection of migration jobs. + // Required. The parent which owns this collection of migration jobs. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -317,31 +568,32 @@ message CreateMigrationJobRequest { // object. MigrationJob migration_job = 3 [(google.api.field_behavior) = REQUIRED]; - // A unique id used to identify the request. If the server receives two - // requests with the same id, then the second request will be ignored. + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. // // It is recommended to always set this value to a UUID. // - // The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores // (_), and hyphens (-). The maximum length is 40 characters. string request_id = 4; } // Request message for 'UpdateMigrationJob' request. message UpdateMigrationJobRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // migration job resource by the update. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + // Required. Field mask is used to specify the fields to be overwritten by the + // update in the conversion workspace resource. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; // Required. The migration job parameters to update. MigrationJob migration_job = 2 [(google.api.field_behavior) = REQUIRED]; - // A unique id used to identify the request. If the server receives two - // requests with the same id, then the second request will be ignored. + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. // // It is recommended to always set this value to a UUID. // - // The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores // (_), and hyphens (-). The maximum length is 40 characters. string request_id = 3; } @@ -356,12 +608,12 @@ message DeleteMigrationJobRequest { } ]; - // A unique id used to identify the request. If the server receives two - // requests with the same id, then the second request will be ignored. + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. // // It is recommended to always set this value to a UUID. // - // The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores // (_), and hyphens (-). The maximum length is 40 characters. string request_id = 2; @@ -375,56 +627,56 @@ message DeleteMigrationJobRequest { message StartMigrationJobRequest { // Name of the migration job resource to start. string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; + type: "datamigration.googleapis.com/MigrationJob" + }]; } // Request message for 'StopMigrationJob' request. message StopMigrationJobRequest { // Name of the migration job resource to stop. string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; + type: "datamigration.googleapis.com/MigrationJob" + }]; } // Request message for 'ResumeMigrationJob' request. message ResumeMigrationJobRequest { // Name of the migration job resource to resume. string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; + type: "datamigration.googleapis.com/MigrationJob" + }]; } // Request message for 'PromoteMigrationJob' request. message PromoteMigrationJobRequest { // Name of the migration job resource to promote. string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; + type: "datamigration.googleapis.com/MigrationJob" + }]; } // Request message for 'VerifyMigrationJob' request. message VerifyMigrationJobRequest { // Name of the migration job resource to verify. string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; + type: "datamigration.googleapis.com/MigrationJob" + }]; } // Request message for 'RestartMigrationJob' request. message RestartMigrationJobRequest { // Name of the migration job resource to restart. string name = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; + type: "datamigration.googleapis.com/MigrationJob" + }]; } // Request message for 'GenerateSshScript' request. message GenerateSshScriptRequest { // Name of the migration job resource to generate the SSH script. string migration_job = 1 [(google.api.resource_reference) = { - type: "datamigration.googleapis.com/MigrationJob" - }]; + type: "datamigration.googleapis.com/MigrationJob" + }]; // Required. Bastion VM Instance name to use or to create. string vm = 2 [(google.api.field_behavior) = REQUIRED]; @@ -438,7 +690,7 @@ message GenerateSshScriptRequest { VmSelectionConfig vm_selection_config = 101; } - // The port that will be open on the bastion host + // The port that will be open on the bastion host. int32 vm_port = 3; } @@ -468,7 +720,7 @@ message SshScript { // Request message for 'ListConnectionProfiles' request. message ListConnectionProfilesRequest { - // Required. The parent, which owns this collection of connection profiles. + // Required. The parent which owns this collection of connection profiles. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -478,7 +730,7 @@ message ListConnectionProfilesRequest { // The maximum number of connection profiles to return. The service may return // fewer than this value. If unspecified, at most 50 connection profiles will - // be returned. The maximum value is 1000; values above 1000 will be coerced + // be returned. The maximum value is 1000; values above 1000 are coerced // to 1000. int32 page_size = 2; @@ -500,7 +752,7 @@ message ListConnectionProfilesRequest { // connect with a specific username. string filter = 4; - // the order by fields for the result. + // A comma-separated list of fields to order results according to. string order_by = 5; } @@ -509,7 +761,7 @@ message ListConnectionProfilesResponse { // The response list of connection profiles. repeated ConnectionProfile connection_profiles = 1; - // A token, which can be sent as `page_token` to retrieve the next page. + // A token which can be sent as `page_token` to retrieve the next page. // If this field is omitted, there are no subsequent pages. string next_page_token = 2; @@ -530,7 +782,7 @@ message GetConnectionProfileRequest { // Request message for 'CreateConnectionProfile' request. message CreateConnectionProfileRequest { - // Required. The parent, which owns this collection of connection profiles. + // Required. The parent which owns this collection of connection profiles. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -542,35 +794,58 @@ message CreateConnectionProfileRequest { string connection_profile_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The create request body including the connection profile data - ConnectionProfile connection_profile = 3 [(google.api.field_behavior) = REQUIRED]; + ConnectionProfile connection_profile = 3 + [(google.api.field_behavior) = REQUIRED]; - // A unique id used to identify the request. If the server receives two - // requests with the same id, then the second request will be ignored. + // Optional. A unique ID used to identify the request. If the server receives + // two requests with the same ID, then the second request is ignored. // // It is recommended to always set this value to a UUID. // - // The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 4; + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only validate the connection profile, but don't create any + // resources. The default is false. Only supported for Oracle connection + // profiles. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Create the connection profile without validating it. + // The default is false. + // Only supported for Oracle connection profiles. + bool skip_validation = 6 [(google.api.field_behavior) = OPTIONAL]; } // Request message for 'UpdateConnectionProfile' request. message UpdateConnectionProfileRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // connection profile resource by the update. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + // Required. Field mask is used to specify the fields to be overwritten by the + // update in the conversion workspace resource. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; // Required. The connection profile parameters to update. - ConnectionProfile connection_profile = 2 [(google.api.field_behavior) = REQUIRED]; + ConnectionProfile connection_profile = 2 + [(google.api.field_behavior) = REQUIRED]; - // A unique id used to identify the request. If the server receives two - // requests with the same id, then the second request will be ignored. + // Optional. A unique ID used to identify the request. If the server receives + // two requests with the same ID, then the second request is ignored. // // It is recommended to always set this value to a UUID. // - // The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores // (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 3; + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only validate the connection profile, but don't update any + // resources. The default is false. Only supported for Oracle connection + // profiles. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Update the connection profile without validating it. + // The default is false. + // Only supported for Oracle connection profiles. + bool skip_validation = 5 [(google.api.field_behavior) = OPTIONAL]; } // Request message for 'DeleteConnectionProfile' request. @@ -583,12 +858,12 @@ message DeleteConnectionProfileRequest { } ]; - // A unique id used to identify the request. If the server receives two - // requests with the same id, then the second request will be ignored. + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. // // It is recommended to always set this value to a UUID. // - // The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores // (_), and hyphens (-). The maximum length is 40 characters. string request_id = 2; @@ -597,13 +872,126 @@ message DeleteConnectionProfileRequest { bool force = 3; } +// Request message to create a new private connection in the specified project +// and region. +message CreatePrivateConnectionRequest { + // Required. The parent that owns the collection of PrivateConnections. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/PrivateConnection" + } + ]; + + // Required. The private connection identifier. + string private_connection_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The private connection resource to create. + PrivateConnection private_connection = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique ID used to identify the request. If the server receives + // two requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, will skip validations. + bool skip_validation = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message to retrieve a list of private connections in a given project +// and location. +message ListPrivateConnectionsRequest { + // Required. The parent that owns the collection of private connections. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/PrivateConnection" + } + ]; + + // Maximum number of private connections to return. + // If unspecified, at most 50 private connections that are returned. + // The maximum value is 1000; values above 1000 are coerced to 1000. + int32 page_size = 2; + + // Page token received from a previous `ListPrivateConnections` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListPrivateConnections` must match the call that provided the page + // token. + string page_token = 3; + + // A filter expression that filters private connections listed in the + // response. The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. The value must + // be a string, a number, or a boolean. The comparison operator must be either + // =, !=, >, or <. For example, list private connections created this year by + // specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. + string filter = 4; + + // Order by fields for the result. + string order_by = 5; +} + +// Response message for 'ListPrivateConnections' request. +message ListPrivateConnectionsResponse { + // List of private connections. + repeated PrivateConnection private_connections = 1; + + // A token which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message to delete a private connection. +message DeletePrivateConnectionRequest { + // Required. The name of the private connection to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/PrivateConnection" + } + ]; + + // Optional. A unique ID used to identify the request. If the server receives + // two requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message to get a private connection resource. +message GetPrivateConnectionRequest { + // Required. The name of the private connection to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/PrivateConnection" + } + ]; +} + // Represents the metadata of the long-running operation. message OperationMetadata { // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server-defined resource path for the target of the operation. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -616,10 +1004,409 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Retrieve a list of all conversion workspaces in a given project and location. +message ListConversionWorkspacesRequest { + // Required. The parent which owns this collection of conversion workspaces. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // The maximum number of conversion workspaces to return. The service may + // return fewer than this value. If unspecified, at most 50 sets are returned. + int32 page_size = 2; + + // The nextPageToken value received in the previous call to + // conversionWorkspaces.list, used in the subsequent request to retrieve the + // next page of results. On first call this should be left blank. When + // paginating, all other parameters provided to conversionWorkspaces.list must + // match the call that provided the page token. + string page_token = 3; + + // A filter expression that filters conversion workspaces listed in the + // response. The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. The value must + // be a string, a number, or a boolean. The comparison operator must be either + // =, !=, >, or <. For example, list conversion workspaces created this year + // by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can + // also filter nested fields. For example, you could specify + // **source.version = "12.c.1"** to select all conversion workspaces with + // source database version equal to 12.c.1. + string filter = 4; +} + +// Response message for 'ListConversionWorkspaces' request. +message ListConversionWorkspacesResponse { + // The list of conversion workspace objects. + repeated ConversionWorkspace conversion_workspaces = 1; + + // A token which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for 'GetConversionWorkspace' request. +message GetConversionWorkspaceRequest { + // Required. Name of the conversion workspace resource to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; +} + +// Request message to create a new Conversion Workspace +// in the specified project and region. +message CreateConversionWorkspaceRequest { + // Required. The parent which owns this collection of conversion workspaces. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // Required. The ID of the conversion workspace to create. + string conversion_workspace_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Represents a conversion workspace object. + ConversionWorkspace conversion_workspace = 3 + [(google.api.field_behavior) = REQUIRED]; + + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 4; +} + +// Request message for 'UpdateConversionWorkspace' request. +message UpdateConversionWorkspaceRequest { + // Required. Field mask is used to specify the fields to be overwritten by the + // update in the conversion workspace resource. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The conversion workspace parameters to update. + ConversionWorkspace conversion_workspace = 2 + [(google.api.field_behavior) = REQUIRED]; + + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 3; +} + +// Request message for 'DeleteConversionWorkspace' request. +message DeleteConversionWorkspaceRequest { + // Required. Name of the conversion workspace resource to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // A unique ID used to identify the request. If the server receives two + // requests with the same ID, then the second request is ignored. + // + // It is recommended to always set this value to a UUID. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 2; +} + +// Request message for 'CommitConversionWorkspace' request. +message CommitConversionWorkspaceRequest { + // Required. Name of the conversion workspace resource to commit. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // Optional. Optional name of the commit. + string commit_name = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for 'RollbackConversionWorkspace' request. +message RollbackConversionWorkspaceRequest { + // Required. Name of the conversion workspace resource to roll back to. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; +} + +// Request message for 'ApplyConversionWorkspace' request. +message ApplyConversionWorkspaceRequest { + // Required. The name of the conversion workspace resource for which to apply + // the draft tree. Must be in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // Filter which entities to apply. Leaving this field empty will apply all of + // the entities. Supports Google AIP 160 based filtering. + string filter = 2; + + // Which destination to use when applying the conversion workspace. + oneof destination { + // Fully qualified (Uri) name of the destination connection profile. + string connection_profile = 100; + } +} + +// Request message for 'SeedConversionWorkspace' request. +message SeedConversionWorkspaceRequest { + // Name of the conversion workspace resource to seed with new database + // structure, in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + }]; + + // Should the conversion workspace be committed automatically after the + // seed operation. + bool auto_commit = 2; + + // The input to be used for seeding the conversion workspace. The input can + // either be from the source or destination databases and it can be provided + // through a connection profile or a DDL file. + oneof seed_from { + // Fully qualified (Uri) name of the source connection profile. + string source_connection_profile = 100; + + // Fully qualified (Uri) name of the destination connection profile. + string destination_connection_profile = 101; + } +} + +// Request message for 'ConvertConversionWorkspace' request. +message ConvertConversionWorkspaceRequest { + // Name of the conversion workspace resource to convert in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + }]; + + // Specifies whether the conversion workspace is to be committed automatically + // after the conversion. + bool auto_commit = 4; + + // Filter the entities to convert. Leaving this field empty will convert all + // of the entities. Supports Google AIP-160 style filtering. + string filter = 5; +} + +// Request message for 'ImportMappingRules' request. +message ImportMappingRulesRequest { + // Details of a single rules file. + message RulesFile { + // The filename of the rules that needs to be converted. The filename is + // used mainly so that future logs of the import rules job contain it, and + // can therefore be searched by it. + string rules_source_filename = 1; + + // The text content of the rules that needs to be converted. + string rules_content = 2; + } + + // Required. Name of the conversion workspace resource to import the rules to + // in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // The format of the rules content file. + ImportRulesFileFormat rules_format = 2; + + // One or more rules files. + repeated RulesFile rules_files = 3; + + // Should the conversion workspace be committed automatically after the + // import operation. + bool auto_commit = 6; +} + +// Request message for 'DescribeDatabaseEntities' request. +message DescribeDatabaseEntitiesRequest { + // The type of a tree to return + enum DBTreeType { + // Unspecified tree type. + DB_TREE_TYPE_UNSPECIFIED = 0; + + // The source database tree. + SOURCE_TREE = 1; + + // The draft database tree. + DRAFT_TREE = 2; + + // The destination database tree. + DESTINATION_TREE = 3; + } + + // Required. Name of the conversion workspace resource whose database entities + // are described. Must be in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string conversion_workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // The maximum number of entities to return. The service may return + // fewer entities than the value specifies. + int32 page_size = 3; + + // The nextPageToken value received in the previous call to + // conversionWorkspace.describeDatabaseEntities, used in the subsequent + // request to retrieve the next page of results. On first call this should be + // left blank. When paginating, all other parameters provided to + // conversionWorkspace.describeDatabaseEntities must match the call that + // provided the page token. + string page_token = 4; + + // The tree to fetch. + DBTreeType tree = 6; + + // Whether to retrieve the latest committed version of the entities or the + // latest version. This field is ignored if a specific commit_id is specified. + bool uncommitted = 11; + + // Request a specific commit ID. If not specified, the entities from the + // latest commit are returned. + string commit_id = 12; + + // Filter the returned entities based on AIP-160 standard. + string filter = 13; +} + +// Response message for 'DescribeDatabaseEntities' request. +message DescribeDatabaseEntitiesResponse { + // The list of database entities for the conversion workspace. + repeated DatabaseEntity database_entities = 1; + + // A token which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for 'SearchBackgroundJobs' request. +message SearchBackgroundJobsRequest { + // Required. Name of the conversion workspace resource whose jobs are listed, + // in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string conversion_workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // Optional. Whether or not to return just the most recent job per job type, + bool return_most_recent_per_job_type = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of jobs to return. The service may return + // fewer than this value. If unspecified, at most 100 jobs are + // returned. The maximum value is 100; values above 100 are coerced to + // 100. + int32 max_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If provided, only returns jobs that completed until (not + // including) the given timestamp. + google.protobuf.Timestamp completed_until_time = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for 'SearchBackgroundJobs' request. +message SearchBackgroundJobsResponse { + // The list of conversion workspace mapping rules. + repeated BackgroundJobLogEntry jobs = 1; +} + +// Request message for 'DescribeConversionWorkspaceRevisions' request. +message DescribeConversionWorkspaceRevisionsRequest { + // Required. Name of the conversion workspace resource whose revisions are + // listed. Must be in the form of: + // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + string conversion_workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConversionWorkspace" + } + ]; + + // Optional. Optional filter to request a specific commit ID. + string commit_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for 'DescribeConversionWorkspaceRevisions' request. +message DescribeConversionWorkspaceRevisionsResponse { + // The list of conversion workspace revisions. + repeated ConversionWorkspace revisions = 1; +} + +// Request message for 'FetchStaticIps' request. +message FetchStaticIpsRequest { + // Required. The resource name for the location for which static IPs should be + // returned. Must be in the format `projects/*/locations/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of IPs to return. + int32 page_size = 2; + + // A page token, received from a previous `FetchStaticIps` call. + string page_token = 3; +} + +// Response message for a 'FetchStaticIps' request. +message FetchStaticIpsResponse { + // List of static IPs. + repeated string static_ips = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms_resources.proto b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms_resources.proto index 67a6356d210..0b66a82de58 100644 --- a/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms_resources.proto +++ b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms_resources.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,6 +30,10 @@ option java_outer_classname = "ClouddmsResourcesProto"; option java_package = "com.google.cloud.clouddms.v1"; option php_namespace = "Google\\Cloud\\CloudDms\\V1"; option ruby_package = "Google::Cloud::CloudDMS::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Networks" + pattern: "projects/{project}/global/networks/{network}" +}; // SSL configuration information. message SslConfig { @@ -46,23 +50,23 @@ message SslConfig { SERVER_CLIENT = 2; } - // Output only. The ssl config type according to 'client_key', 'client_certificate' and - // 'ca_certificate'. + // Output only. The ssl config type according to 'client_key', + // 'client_certificate' and 'ca_certificate'. SslType type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key associated with - // the Client Certificate. If this field is used then the 'client_certificate' - // field is mandatory. + // Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key + // associated with the Client Certificate. If this field is used then the + // 'client_certificate' field is mandatory. string client_key = 2 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. The x509 PEM-encoded certificate that will be used by the replica to - // authenticate against the source database server.If this field is used then - // the 'client_key' field is mandatory. + // Input only. The x509 PEM-encoded certificate that will be used by the + // replica to authenticate against the source database server.If this field is + // used then the 'client_key' field is mandatory. string client_certificate = 3 [(google.api.field_behavior) = INPUT_ONLY]; - // Required. Input only. The x509 PEM-encoded certificate of the CA that signed the source database - // server's certificate. The replica will use this certificate to verify - // it's connecting to the right host. + // Required. Input only. The x509 PEM-encoded certificate of the CA that + // signed the source database server's certificate. The replica will use this + // certificate to verify it's connecting to the right host. string ca_certificate = 4 [ (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = REQUIRED @@ -77,13 +81,15 @@ message MySqlConnectionProfile { // Required. The network port of the source MySQL database. int32 port = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The username that Database Migration Service will use to connect to the - // database. The value is encrypted when stored in Database Migration Service. + // Required. The username that Database Migration Service will use to connect + // to the database. The value is encrypted when stored in Database Migration + // Service. string username = 3 [(google.api.field_behavior) = REQUIRED]; - // Required. Input only. The password for the user that Database Migration Service will be using to - // connect to the database. This field is not returned on request, and the - // value is encrypted when stored in Database Migration Service. + // Required. Input only. The password for the user that Database Migration + // Service will be using to connect to the database. This field is not + // returned on request, and the value is encrypted when stored in Database + // Migration Service. string password = 4 [ (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = REQUIRED @@ -100,6 +106,16 @@ message MySqlConnectionProfile { string cloud_sql_id = 7; } +enum NetworkArchitecture { + NETWORK_ARCHITECTURE_UNSPECIFIED = 0; + + // Instance is in Cloud SQL's old producer network architecture. + NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER = 1; + + // Instance is in Cloud SQL's new producer network architecture. + NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER = 2; +} + // Specifies connection parameters required specifically for PostgreSQL // databases. message PostgreSqlConnectionProfile { @@ -109,13 +125,15 @@ message PostgreSqlConnectionProfile { // Required. The network port of the source PostgreSQL database. int32 port = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The username that Database Migration Service will use to connect to the - // database. The value is encrypted when stored in Database Migration Service. + // Required. The username that Database Migration Service will use to connect + // to the database. The value is encrypted when stored in Database Migration + // Service. string username = 3 [(google.api.field_behavior) = REQUIRED]; - // Required. Input only. The password for the user that Database Migration Service will be using to - // connect to the database. This field is not returned on request, and the - // value is encrypted when stored in Database Migration Service. + // Required. Input only. The password for the user that Database Migration + // Service will be using to connect to the database. This field is not + // returned on request, and the value is encrypted when stored in Database + // Migration Service. string password = 4 [ (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = REQUIRED @@ -130,12 +148,70 @@ message PostgreSqlConnectionProfile { // If the source is a Cloud SQL database, use this field to // provide the Cloud SQL instance ID of the source. string cloud_sql_id = 7; + + // Output only. If the source is a Cloud SQL database, this field indicates + // the network architecture it's associated with. + NetworkArchitecture network_architecture = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Connectivity options used to establish a connection to the database server. + oneof connectivity { + // Static ip connectivity data (default, no additional details needed). + StaticIpConnectivity static_ip_connectivity = 100; + + // Private service connect connectivity. + PrivateServiceConnectConnectivity private_service_connect_connectivity = + 101; + } +} + +// Specifies connection parameters required specifically for Oracle +// databases. +message OracleConnectionProfile { + // Required. The IP or hostname of the source Oracle database. + string host = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The network port of the source Oracle database. + int32 port = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The username that Database Migration Service will use to connect + // to the database. The value is encrypted when stored in Database Migration + // Service. + string username = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The password for the user that Database Migration + // Service will be using to connect to the database. This field is not + // returned on request, and the value is encrypted when stored in Database + // Migration Service. + string password = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. Indicates whether a new password is included in the request. + bool password_set = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Database service for the Oracle connection. + string database_service = 6 [(google.api.field_behavior) = REQUIRED]; + + // Connectivity options used to establish a connection to the database server. + oneof connectivity { + // Static Service IP connectivity. + StaticServiceIpConnectivity static_service_ip_connectivity = 100; + + // Forward SSH tunnel connectivity. + ForwardSshTunnelConnectivity forward_ssh_connectivity = 101; + + // Private connectivity. + PrivateConnectivity private_connectivity = 102; + } } // Specifies required connection parameters, and, optionally, the parameters // required to create a Cloud SQL destination database instance. message CloudSqlConnectionProfile { - // Output only. The Cloud SQL instance ID that this connection profile is associated with. + // Output only. The Cloud SQL instance ID that this connection profile is + // associated with. string cloud_sql_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Immutable. Metadata used to create the destination Cloud SQL database. @@ -146,6 +222,22 @@ message CloudSqlConnectionProfile { // Output only. The Cloud SQL database instance's public IP. string public_ip = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Cloud SQL database instance's additional (outgoing) public + // IP. Used when the Cloud SQL database availability type is REGIONAL (i.e. + // multiple zones / highly available). + string additional_public_ip = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Specifies required connection parameters, and the parameters +// required to create an AlloyDB destination cluster. +message AlloyDbConnectionProfile { + // Required. The AlloyDB cluster ID that this connection profile is associated + // with. + string cluster_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Immutable. Metadata used to create the destination AlloyDB cluster. + AlloyDbSettings settings = 2 [(google.api.field_behavior) = IMMUTABLE]; } // An entry for an Access Control list. @@ -161,7 +253,8 @@ message SqlAclEntry { google.protobuf.Timestamp expire_time = 10; // Input only. The time-to-leave of this access control entry. - google.protobuf.Duration ttl = 11 [(google.api.field_behavior) = INPUT_ONLY]; + google.protobuf.Duration ttl = 11 + [(google.api.field_behavior) = INPUT_ONLY]; } // A label to identify this entry. @@ -179,6 +272,14 @@ message SqlIpConfig { // be updated, but it cannot be removed after it is set. string private_network = 2; + // Optional. The name of the allocated IP address range for the private IP + // Cloud SQL instance. This name refers to an already allocated IP range + // address. If set, the instance IP address will be created in the allocated + // range. Note that this IP address range can't be modified after the instance + // is created. If you change the VPC when configuring connectivity settings + // for the migration job, this field is not relevant. + string allocated_ip_range = 5 [(google.api.field_behavior) = OPTIONAL]; + // Whether SSL connections over IP should be enforced or not. google.protobuf.BoolValue require_ssl = 3; @@ -243,6 +344,21 @@ message CloudSqlSettings { // PostgreSQL 13. POSTGRES_13 = 8; + + // PostgreSQL 14. + POSTGRES_14 = 17; + } + + // The availability type of the given Cloud SQL instance. + enum SqlAvailabilityType { + // This is an unknown Availability type. + SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0; + + // Zonal availablility instance. + ZONAL = 1; + + // Regional availability instance. + REGIONAL = 2; } // The database engine type and version. @@ -301,10 +417,15 @@ message CloudSqlSettings { // The minimum (and default) size is 10GB. google.protobuf.Int64Value data_disk_size_gb = 10; - // The Google Cloud Platform zone where your Cloud SQL datdabse instance is + // The Google Cloud Platform zone where your Cloud SQL database instance is // located. string zone = 11; + // Optional. The Google Cloud Platform zone where the failover Cloud SQL + // database instance is located. Used when the Cloud SQL database availability + // type is REGIONAL (i.e. multiple zones / highly available). + string secondary_zone = 18 [(google.api.field_behavior) = OPTIONAL]; + // The Database Migration Service source connection profile ID, // in the format: // `projects/my_project_name/locations/us-central1/connectionProfiles/connection_profile_ID` @@ -318,14 +439,115 @@ message CloudSqlSettings { // The Cloud SQL default instance level collation. string collation = 15; + + // The KMS key name used for the csql instance. + string cmek_key_name = 16; + + // Optional. Availability type. Potential values: + // * `ZONAL`: The instance serves data from only one zone. Outages in that + // zone affect data availability. + // * `REGIONAL`: The instance can serve data from more than one zone in a + // region (it is highly available). + SqlAvailabilityType availability_type = 17 + [(google.api.field_behavior) = OPTIONAL]; } -// The source database will allow incoming connections from the destination -// database's public IP. You can retrieve the Cloud SQL instance's public IP -// from the Cloud SQL console or using Cloud SQL APIs. No additional -// configuration is required. -message StaticIpConnectivity { +// Settings for creating an AlloyDB cluster. +message AlloyDbSettings { + // The username/password for a database user. Used for specifying initial + // users at cluster creation time. + message UserPassword { + // The database username. + string user = 1; + + // The initial password for the user. + string password = 2; + + // Output only. Indicates if the initial_user.password field has been set. + bool password_set = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Settings for the cluster's primary instance + message PrimaryInstanceSettings { + // MachineConfig describes the configuration of a machine. + message MachineConfig { + // The number of CPU's in the VM instance. + int32 cpu_count = 1; + } + + // Required. The ID of the AlloyDB primary instance. The ID must satisfy the + // regex expression "[a-z0-9-]+". + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Configuration for the machines that host the underlying + // database engine. + MachineConfig machine_config = 2; + + // Database flags to pass to AlloyDB when DMS is creating the AlloyDB + // cluster and instances. See the AlloyDB documentation for how these can be + // used. + map database_flags = 6; + + // Labels for the AlloyDB primary instance created by DMS. An object + // containing a list of 'key', 'value' pairs. + map labels = 7; + + // Output only. The private IP address for the Instance. + // This is the connection endpoint for an end-user application. + string private_ip = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // EncryptionConfig describes the encryption config of a cluster that is + // encrypted with a CMEK (customer-managed encryption key). + message EncryptionConfig { + // The fully-qualified resource name of the KMS key. + // Each Cloud KMS key is regionalized and has the following format: + // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + string kms_key_name = 1; + } + + // Required. Input only. Initial user to setup during cluster creation. + // Required. + UserPassword initial_user = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Required. The resource link for the VPC network in which cluster resources + // are created and from which they are accessible via Private IP. The network + // must belong to the same project as the cluster. It is specified in the + // form: "projects/{project_number}/global/networks/{network_id}". This is + // required to create a cluster. + string vpc_network = 2 [(google.api.field_behavior) = REQUIRED]; + + // Labels for the AlloyDB cluster created by DMS. An object containing a list + // of 'key', 'value' pairs. + map labels = 3; + + PrimaryInstanceSettings primary_instance_settings = 4; + + // Optional. The encryption config can be specified to encrypt the data disks + // and other persistent data resources of a cluster with a + // customer-managed encryption key (CMEK). When this field is not + // specified, the cluster will then use default encryption scheme to + // protect the user data. + EncryptionConfig encryption_config = 5 + [(google.api.field_behavior) = OPTIONAL]; +} +// The source database will allow incoming connections from the public IP of the +// destination database. You can retrieve the public IP of the Cloud SQL +// instance from the Cloud SQL console or using Cloud SQL APIs. No additional +// configuration is required. +message StaticIpConnectivity {} + +// Private Service Connect connectivity +// (https://cloud.google.com/vpc/docs/private-service-connect#service-attachments) +message PrivateServiceConnectConnectivity { + // Required. A service attachment that exposes a database, and has the + // following format: + // projects/{project}/regions/{region}/serviceAttachments/{service_attachment_name} + string service_attachment = 1 [(google.api.field_behavior) = REQUIRED]; } // The details needed to configure a reverse SSH tunnel between the source and @@ -335,12 +557,12 @@ message StaticIpConnectivity { // to produce the script that will help set up the reverse SSH tunnel, and to // set up the VPC peering between the Cloud SQL private network and the VPC. message ReverseSshConnectivity { - // Required. The IP of the virtual machine (Compute Engine) used as the bastion server - // for the SSH tunnel. + // Required. The IP of the virtual machine (Compute Engine) used as the + // bastion server for the SSH tunnel. string vm_ip = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The forwarding port of the virtual machine (Compute Engine) used as the - // bastion server for the SSH tunnel. + // Required. The forwarding port of the virtual machine (Compute Engine) used + // as the bastion server for the SSH tunnel. int32 vm_port = 2 [(google.api.field_behavior) = REQUIRED]; // The name of the virtual machine (Compute Engine) used as the bastion server @@ -359,6 +581,35 @@ message VpcPeeringConnectivity { string vpc = 1; } +// Forward SSH Tunnel connectivity. +message ForwardSshTunnelConnectivity { + // Required. Hostname for the SSH tunnel. + string hostname = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Username for the SSH tunnel. + string username = 2 [(google.api.field_behavior) = REQUIRED]; + + // Port for the SSH tunnel, default value is 22. + int32 port = 3; + + oneof authentication_method { + // Input only. SSH password. + string password = 100 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. SSH private key. + string private_key = 101 [(google.api.field_behavior) = INPUT_ONLY]; + } +} + +// Static IP address connectivity configured on service project. +message StaticServiceIpConnectivity {} + +// Private Connectivity. +message PrivateConnectivity { + // Required. The resource name (URI) of the private connection. + string private_connection = 1 [(google.api.field_behavior) = REQUIRED]; +} + // A message defining the database engine and provider. message DatabaseType { // The database provider. @@ -459,19 +710,36 @@ message MigrationJob { CONTINUOUS = 2; } + // Dump flag definition. + message DumpFlag { + // The name of the flag + string name = 1; + + // The value of the flag. + string value = 2; + } + + // Dump flags definition. + message DumpFlags { + // The flags for the initial dump. + repeated DumpFlag dump_flags = 1; + } + // The name (URI) of this migration job resource, in the form of: - // projects/{project}/locations/{location}/instances/{instance}. + // projects/{project}/locations/{location}/migrationJobs/{migrationJob}. string name = 1; // Output only. The timestamp when the migration job resource was created. // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. // Example: "2014-10-02T15:01:23.045123456Z". - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The timestamp when the migration job resource was last updated. - // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + // Output only. The timestamp when the migration job resource was last + // updated. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. // Example: "2014-10-02T15:01:23.045123456Z". - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // The resource labels for migration job to use to annotate any related // underlying resources such as Compute Engine VMs. An object containing a @@ -494,8 +762,13 @@ message MigrationJob { // The path to the dump file in Google Cloud Storage, // in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). + // This field and the "dump_flags" field are mutually exclusive. string dump_path = 9; + // The initial dump flags. + // This field and the "dump_path" field are mutually exclusive. + DumpFlags dump_flags = 17; + // Required. The resource name (URI) of the source connection profile. string source = 10 [(google.api.field_behavior) = REQUIRED]; @@ -515,9 +788,11 @@ message MigrationJob { StaticIpConnectivity static_ip_connectivity = 103; } - // Output only. The duration of the migration job (in seconds). A duration in seconds - // with up to nine fractional digits, terminated by 's'. Example: "3.5s". - google.protobuf.Duration duration = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The duration of the migration job (in seconds). A duration in + // seconds with up to nine fractional digits, terminated by 's'. Example: + // "3.5s". + google.protobuf.Duration duration = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The error details in case of state FAILED. google.rpc.Status error = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -528,8 +803,42 @@ message MigrationJob { // The database engine type and provider of the destination. DatabaseType destination_database = 15; - // Output only. If the migration job is completed, the time when it was completed. - google.protobuf.Timestamp end_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. If the migration job is completed, the time when it was + // completed. + google.protobuf.Timestamp end_time = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The conversion workspace used by the migration. + ConversionWorkspaceInfo conversion_workspace = 18; + + // This field can be used to select the entities to migrate as part of + // the migration job. It uses AIP-160 notation to select a subset of the + // entities configured on the associated conversion-workspace. This field + // should not be set on migration-jobs that are not associated with a + // conversion workspace. + string filter = 20; + + // The CMEK (customer-managed encryption key) fully qualified key name used + // for the migration job. + // This field supports all migration jobs types except for: + // * Mysql to Mysql (use the cmek field in the cloudsql connection profile + // instead). + // * PostrgeSQL to PostgreSQL (use the cmek field in the cloudsql + // connection profile instead). + // * PostgreSQL to AlloyDB (use the kms_key_name field in the alloydb + // connection profile instead). + // Each Cloud CMEK key has the following format: + // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + string cmek_key_name = 21; +} + +// A conversion workspace's version. +message ConversionWorkspaceInfo { + // The resource name (URI) of the conversion workspace. + string name = 1; + + // The commit ID of the conversion workspace. + string commit_id = 2; } // A connection profile definition. @@ -567,18 +876,20 @@ message ConnectionProfile { } // The name of this connection profile resource in the form of - // projects/{project}/locations/{location}/instances/{instance}. + // projects/{project}/locations/{location}/connectionProfiles/{connectionProfile}. string name = 1; // Output only. The timestamp when the resource was created. // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. // Example: "2014-10-02T15:01:23.045123456Z". - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when the resource was last updated. // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. // Example: "2014-10-02T15:01:23.045123456Z". - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // The resource labels for connection profile to use to annotate any related // underlying resources such as Compute Engine VMs. An object containing a @@ -601,8 +912,14 @@ message ConnectionProfile { // A PostgreSQL database connection profile. PostgreSqlConnectionProfile postgresql = 101; + // An Oracle database connection profile. + OracleConnectionProfile oracle = 104; + // A CloudSQL database connection profile. CloudSqlConnectionProfile cloudsql = 102; + + // An AlloyDB cluster connection profile. + AlloyDbConnectionProfile alloydb = 105; } // Output only. The error details in case of state FAILED. @@ -678,12 +995,30 @@ message MigrationJobVerificationError { // Migration is already running at the time of restart request. CANT_RESTART_RUNNING_MIGRATION = 21; + + // The source has tables with limited support. + // E.g. PostgreSQL tables without primary keys. + TABLES_WITH_LIMITED_SUPPORT = 24; + + // The source uses an unsupported locale. + UNSUPPORTED_DATABASE_LOCALE = 25; + + // The source uses an unsupported Foreign Data Wrapper configuration. + UNSUPPORTED_DATABASE_FDW_CONFIG = 26; + + // There was an underlying RDBMS error. + ERROR_RDBMS = 27; + + // The source DB size in Bytes exceeds a certain threshold. The migration + // might require an increase of quota, or might not be supported. + SOURCE_SIZE_EXCEEDS_THRESHOLD = 28; } // Output only. An instance of ErrorCode specifying the error that occurred. ErrorCode error_code = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. A formatted message with further details about the error and a CTA. + // Output only. A formatted message with further details about the error and a + // CTA. string error_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. A specific detailed error message, if supplied by the engine. @@ -700,6 +1035,9 @@ enum DatabaseEngine { // The source engine is PostgreSQL. POSTGRESQL = 2; + + // The source engine is Oracle. + ORACLE = 4; } // The database providers. @@ -712,4 +1050,90 @@ enum DatabaseProvider { // RDS runs the database. RDS = 2; + + // Amazon Aurora. + AURORA = 3; + + // AlloyDB. + ALLOYDB = 4; +} + +// The PrivateConnection resource is used to establish private connectivity +// with the customer's network. +message PrivateConnection { + option (google.api.resource) = { + type: "datamigration.googleapis.com/PrivateConnection" + pattern: "projects/{project}/locations/{location}/privateConnections/{private_connection}" + }; + + // Private Connection state. + enum State { + STATE_UNSPECIFIED = 0; + + // The private connection is in creation state - creating resources. + CREATING = 1; + + // The private connection has been created with all of its resources. + CREATED = 2; + + // The private connection creation has failed. + FAILED = 3; + + // The private connection is being deleted. + DELETING = 4; + + // Delete request has failed, resource is in invalid state. + FAILED_TO_DELETE = 5; + + // The private connection has been deleted. + DELETED = 6; + } + + // The name of the resource. + string name = 1; + + // Output only. The create time of the resource. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update time of the resource. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The resource labels for private connections to use to annotate any related + // underlying resources such as Compute Engine VMs. An object containing a + // list of "key": "value" pairs. + // + // Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. + map labels = 4; + + // The private connection display name. + string display_name = 5; + + // Output only. The state of the private connection. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error details in case of state FAILED. + google.rpc.Status error = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + oneof connectivity { + // VPC peering configuration. + VpcPeeringConfig vpc_peering_config = 100; + } +} + +// The VPC peering configuration is used to create VPC peering with the +// consumer's VPC. +message VpcPeeringConfig { + // Required. Fully qualified name of the VPC that Database Migration Service + // will peer to. + string vpc_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Networks" + } + ]; + + // Required. A free subnet for peering. (CIDR of /29) + string subnet = 2 [(google.api.field_behavior) = REQUIRED]; } diff --git a/owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto rename to packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto diff --git a/packages/google-cloud-clouddms/protos/protos.d.ts b/packages/google-cloud-clouddms/protos/protos.d.ts index df0b6176962..3ad2c1ea8f2 100644 --- a/packages/google-cloud-clouddms/protos/protos.d.ts +++ b/packages/google-cloud-clouddms/protos/protos.d.ts @@ -283,6 +283,272 @@ export namespace google { * @returns Promise */ public deleteConnectionProfile(request: google.cloud.clouddms.v1.IDeleteConnectionProfileRequest): Promise; + + /** + * Calls CreatePrivateConnection. + * @param request CreatePrivateConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createPrivateConnection(request: google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, callback: google.cloud.clouddms.v1.DataMigrationService.CreatePrivateConnectionCallback): void; + + /** + * Calls CreatePrivateConnection. + * @param request CreatePrivateConnectionRequest message or plain object + * @returns Promise + */ + public createPrivateConnection(request: google.cloud.clouddms.v1.ICreatePrivateConnectionRequest): Promise; + + /** + * Calls GetPrivateConnection. + * @param request GetPrivateConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PrivateConnection + */ + public getPrivateConnection(request: google.cloud.clouddms.v1.IGetPrivateConnectionRequest, callback: google.cloud.clouddms.v1.DataMigrationService.GetPrivateConnectionCallback): void; + + /** + * Calls GetPrivateConnection. + * @param request GetPrivateConnectionRequest message or plain object + * @returns Promise + */ + public getPrivateConnection(request: google.cloud.clouddms.v1.IGetPrivateConnectionRequest): Promise; + + /** + * Calls ListPrivateConnections. + * @param request ListPrivateConnectionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPrivateConnectionsResponse + */ + public listPrivateConnections(request: google.cloud.clouddms.v1.IListPrivateConnectionsRequest, callback: google.cloud.clouddms.v1.DataMigrationService.ListPrivateConnectionsCallback): void; + + /** + * Calls ListPrivateConnections. + * @param request ListPrivateConnectionsRequest message or plain object + * @returns Promise + */ + public listPrivateConnections(request: google.cloud.clouddms.v1.IListPrivateConnectionsRequest): Promise; + + /** + * Calls DeletePrivateConnection. + * @param request DeletePrivateConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deletePrivateConnection(request: google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, callback: google.cloud.clouddms.v1.DataMigrationService.DeletePrivateConnectionCallback): void; + + /** + * Calls DeletePrivateConnection. + * @param request DeletePrivateConnectionRequest message or plain object + * @returns Promise + */ + public deletePrivateConnection(request: google.cloud.clouddms.v1.IDeletePrivateConnectionRequest): Promise; + + /** + * Calls GetConversionWorkspace. + * @param request GetConversionWorkspaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConversionWorkspace + */ + public getConversionWorkspace(request: google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, callback: google.cloud.clouddms.v1.DataMigrationService.GetConversionWorkspaceCallback): void; + + /** + * Calls GetConversionWorkspace. + * @param request GetConversionWorkspaceRequest message or plain object + * @returns Promise + */ + public getConversionWorkspace(request: google.cloud.clouddms.v1.IGetConversionWorkspaceRequest): Promise; + + /** + * Calls ListConversionWorkspaces. + * @param request ListConversionWorkspacesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConversionWorkspacesResponse + */ + public listConversionWorkspaces(request: google.cloud.clouddms.v1.IListConversionWorkspacesRequest, callback: google.cloud.clouddms.v1.DataMigrationService.ListConversionWorkspacesCallback): void; + + /** + * Calls ListConversionWorkspaces. + * @param request ListConversionWorkspacesRequest message or plain object + * @returns Promise + */ + public listConversionWorkspaces(request: google.cloud.clouddms.v1.IListConversionWorkspacesRequest): Promise; + + /** + * Calls CreateConversionWorkspace. + * @param request CreateConversionWorkspaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createConversionWorkspace(request: google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, callback: google.cloud.clouddms.v1.DataMigrationService.CreateConversionWorkspaceCallback): void; + + /** + * Calls CreateConversionWorkspace. + * @param request CreateConversionWorkspaceRequest message or plain object + * @returns Promise + */ + public createConversionWorkspace(request: google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest): Promise; + + /** + * Calls UpdateConversionWorkspace. + * @param request UpdateConversionWorkspaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateConversionWorkspace(request: google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, callback: google.cloud.clouddms.v1.DataMigrationService.UpdateConversionWorkspaceCallback): void; + + /** + * Calls UpdateConversionWorkspace. + * @param request UpdateConversionWorkspaceRequest message or plain object + * @returns Promise + */ + public updateConversionWorkspace(request: google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest): Promise; + + /** + * Calls DeleteConversionWorkspace. + * @param request DeleteConversionWorkspaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteConversionWorkspace(request: google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, callback: google.cloud.clouddms.v1.DataMigrationService.DeleteConversionWorkspaceCallback): void; + + /** + * Calls DeleteConversionWorkspace. + * @param request DeleteConversionWorkspaceRequest message or plain object + * @returns Promise + */ + public deleteConversionWorkspace(request: google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest): Promise; + + /** + * Calls SeedConversionWorkspace. + * @param request SeedConversionWorkspaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public seedConversionWorkspace(request: google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, callback: google.cloud.clouddms.v1.DataMigrationService.SeedConversionWorkspaceCallback): void; + + /** + * Calls SeedConversionWorkspace. + * @param request SeedConversionWorkspaceRequest message or plain object + * @returns Promise + */ + public seedConversionWorkspace(request: google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest): Promise; + + /** + * Calls ImportMappingRules. + * @param request ImportMappingRulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importMappingRules(request: google.cloud.clouddms.v1.IImportMappingRulesRequest, callback: google.cloud.clouddms.v1.DataMigrationService.ImportMappingRulesCallback): void; + + /** + * Calls ImportMappingRules. + * @param request ImportMappingRulesRequest message or plain object + * @returns Promise + */ + public importMappingRules(request: google.cloud.clouddms.v1.IImportMappingRulesRequest): Promise; + + /** + * Calls ConvertConversionWorkspace. + * @param request ConvertConversionWorkspaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public convertConversionWorkspace(request: google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, callback: google.cloud.clouddms.v1.DataMigrationService.ConvertConversionWorkspaceCallback): void; + + /** + * Calls ConvertConversionWorkspace. + * @param request ConvertConversionWorkspaceRequest message or plain object + * @returns Promise + */ + public convertConversionWorkspace(request: google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest): Promise; + + /** + * Calls CommitConversionWorkspace. + * @param request CommitConversionWorkspaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public commitConversionWorkspace(request: google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, callback: google.cloud.clouddms.v1.DataMigrationService.CommitConversionWorkspaceCallback): void; + + /** + * Calls CommitConversionWorkspace. + * @param request CommitConversionWorkspaceRequest message or plain object + * @returns Promise + */ + public commitConversionWorkspace(request: google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest): Promise; + + /** + * Calls RollbackConversionWorkspace. + * @param request RollbackConversionWorkspaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public rollbackConversionWorkspace(request: google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, callback: google.cloud.clouddms.v1.DataMigrationService.RollbackConversionWorkspaceCallback): void; + + /** + * Calls RollbackConversionWorkspace. + * @param request RollbackConversionWorkspaceRequest message or plain object + * @returns Promise + */ + public rollbackConversionWorkspace(request: google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest): Promise; + + /** + * Calls ApplyConversionWorkspace. + * @param request ApplyConversionWorkspaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public applyConversionWorkspace(request: google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, callback: google.cloud.clouddms.v1.DataMigrationService.ApplyConversionWorkspaceCallback): void; + + /** + * Calls ApplyConversionWorkspace. + * @param request ApplyConversionWorkspaceRequest message or plain object + * @returns Promise + */ + public applyConversionWorkspace(request: google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest): Promise; + + /** + * Calls DescribeDatabaseEntities. + * @param request DescribeDatabaseEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DescribeDatabaseEntitiesResponse + */ + public describeDatabaseEntities(request: google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, callback: google.cloud.clouddms.v1.DataMigrationService.DescribeDatabaseEntitiesCallback): void; + + /** + * Calls DescribeDatabaseEntities. + * @param request DescribeDatabaseEntitiesRequest message or plain object + * @returns Promise + */ + public describeDatabaseEntities(request: google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest): Promise; + + /** + * Calls SearchBackgroundJobs. + * @param request SearchBackgroundJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchBackgroundJobsResponse + */ + public searchBackgroundJobs(request: google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, callback: google.cloud.clouddms.v1.DataMigrationService.SearchBackgroundJobsCallback): void; + + /** + * Calls SearchBackgroundJobs. + * @param request SearchBackgroundJobsRequest message or plain object + * @returns Promise + */ + public searchBackgroundJobs(request: google.cloud.clouddms.v1.ISearchBackgroundJobsRequest): Promise; + + /** + * Calls DescribeConversionWorkspaceRevisions. + * @param request DescribeConversionWorkspaceRevisionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DescribeConversionWorkspaceRevisionsResponse + */ + public describeConversionWorkspaceRevisions(request: google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, callback: google.cloud.clouddms.v1.DataMigrationService.DescribeConversionWorkspaceRevisionsCallback): void; + + /** + * Calls DescribeConversionWorkspaceRevisions. + * @param request DescribeConversionWorkspaceRevisionsRequest message or plain object + * @returns Promise + */ + public describeConversionWorkspaceRevisions(request: google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest): Promise; + + /** + * Calls FetchStaticIps. + * @param request FetchStaticIpsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchStaticIpsResponse + */ + public fetchStaticIps(request: google.cloud.clouddms.v1.IFetchStaticIpsRequest, callback: google.cloud.clouddms.v1.DataMigrationService.FetchStaticIpsCallback): void; + + /** + * Calls FetchStaticIps. + * @param request FetchStaticIpsRequest message or plain object + * @returns Promise + */ + public fetchStaticIps(request: google.cloud.clouddms.v1.IFetchStaticIpsRequest): Promise; } namespace DataMigrationService { @@ -405,6 +671,139 @@ export namespace google { * @param [response] Operation */ type DeleteConnectionProfileCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|createPrivateConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type CreatePrivateConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|getPrivateConnection}. + * @param error Error, if any + * @param [response] PrivateConnection + */ + type GetPrivateConnectionCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.PrivateConnection) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|listPrivateConnections}. + * @param error Error, if any + * @param [response] ListPrivateConnectionsResponse + */ + type ListPrivateConnectionsCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.ListPrivateConnectionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|deletePrivateConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type DeletePrivateConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|getConversionWorkspace}. + * @param error Error, if any + * @param [response] ConversionWorkspace + */ + type GetConversionWorkspaceCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.ConversionWorkspace) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|listConversionWorkspaces}. + * @param error Error, if any + * @param [response] ListConversionWorkspacesResponse + */ + type ListConversionWorkspacesCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.ListConversionWorkspacesResponse) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|createConversionWorkspace}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateConversionWorkspaceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|updateConversionWorkspace}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateConversionWorkspaceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|deleteConversionWorkspace}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteConversionWorkspaceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|seedConversionWorkspace}. + * @param error Error, if any + * @param [response] Operation + */ + type SeedConversionWorkspaceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|importMappingRules}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportMappingRulesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|convertConversionWorkspace}. + * @param error Error, if any + * @param [response] Operation + */ + type ConvertConversionWorkspaceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|commitConversionWorkspace}. + * @param error Error, if any + * @param [response] Operation + */ + type CommitConversionWorkspaceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|rollbackConversionWorkspace}. + * @param error Error, if any + * @param [response] Operation + */ + type RollbackConversionWorkspaceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|applyConversionWorkspace}. + * @param error Error, if any + * @param [response] Operation + */ + type ApplyConversionWorkspaceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|describeDatabaseEntities}. + * @param error Error, if any + * @param [response] DescribeDatabaseEntitiesResponse + */ + type DescribeDatabaseEntitiesCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|searchBackgroundJobs}. + * @param error Error, if any + * @param [response] SearchBackgroundJobsResponse + */ + type SearchBackgroundJobsCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.SearchBackgroundJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|describeConversionWorkspaceRevisions}. + * @param error Error, if any + * @param [response] DescribeConversionWorkspaceRevisionsResponse + */ + type DescribeConversionWorkspaceRevisionsCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|fetchStaticIps}. + * @param error Error, if any + * @param [response] FetchStaticIpsResponse + */ + type FetchStaticIpsCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.FetchStaticIpsResponse) => void; } /** Properties of a ListMigrationJobsRequest. */ @@ -2417,6 +2816,12 @@ export namespace google { /** CreateConnectionProfileRequest requestId */ requestId?: (string|null); + + /** CreateConnectionProfileRequest validateOnly */ + validateOnly?: (boolean|null); + + /** CreateConnectionProfileRequest skipValidation */ + skipValidation?: (boolean|null); } /** Represents a CreateConnectionProfileRequest. */ @@ -2440,6 +2845,12 @@ export namespace google { /** CreateConnectionProfileRequest requestId. */ public requestId: string; + /** CreateConnectionProfileRequest validateOnly. */ + public validateOnly: boolean; + + /** CreateConnectionProfileRequest skipValidation. */ + public skipValidation: boolean; + /** * Creates a new CreateConnectionProfileRequest instance using the specified properties. * @param [properties] Properties to set @@ -2529,6 +2940,12 @@ export namespace google { /** UpdateConnectionProfileRequest requestId */ requestId?: (string|null); + + /** UpdateConnectionProfileRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateConnectionProfileRequest skipValidation */ + skipValidation?: (boolean|null); } /** Represents an UpdateConnectionProfileRequest. */ @@ -2549,6 +2966,12 @@ export namespace google { /** UpdateConnectionProfileRequest requestId. */ public requestId: string; + /** UpdateConnectionProfileRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateConnectionProfileRequest skipValidation. */ + public skipValidation: boolean; + /** * Creates a new UpdateConnectionProfileRequest instance using the specified properties. * @param [properties] Properties to set @@ -2736,2066 +3159,9516 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { + /** Properties of a CreatePrivateConnectionRequest. */ + interface ICreatePrivateConnectionRequest { - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** CreatePrivateConnectionRequest parent */ + parent?: (string|null); - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** CreatePrivateConnectionRequest privateConnectionId */ + privateConnectionId?: (string|null); - /** OperationMetadata target */ - target?: (string|null); + /** CreatePrivateConnectionRequest privateConnection */ + privateConnection?: (google.cloud.clouddms.v1.IPrivateConnection|null); - /** OperationMetadata verb */ - verb?: (string|null); + /** CreatePrivateConnectionRequest requestId */ + requestId?: (string|null); - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); + /** CreatePrivateConnectionRequest skipValidation */ + skipValidation?: (boolean|null); + } - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { + /** Represents a CreatePrivateConnectionRequest. */ + class CreatePrivateConnectionRequest implements ICreatePrivateConnectionRequest { /** - * Constructs a new OperationMetadata. + * Constructs a new CreatePrivateConnectionRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.clouddms.v1.ICreatePrivateConnectionRequest); - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; + /** CreatePrivateConnectionRequest parent. */ + public parent: string; - /** OperationMetadata verb. */ - public verb: string; + /** CreatePrivateConnectionRequest privateConnectionId. */ + public privateConnectionId: string; - /** OperationMetadata statusMessage. */ - public statusMessage: string; + /** CreatePrivateConnectionRequest privateConnection. */ + public privateConnection?: (google.cloud.clouddms.v1.IPrivateConnection|null); - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; + /** CreatePrivateConnectionRequest requestId. */ + public requestId: string; - /** OperationMetadata apiVersion. */ - public apiVersion: string; + /** CreatePrivateConnectionRequest skipValidation. */ + public skipValidation: boolean; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new CreatePrivateConnectionRequest instance using the specified properties. * @param [properties] Properties to set - * @returns OperationMetadata instance + * @returns CreatePrivateConnectionRequest instance */ - public static create(properties?: google.cloud.clouddms.v1.IOperationMetadata): google.cloud.clouddms.v1.OperationMetadata; + public static create(properties?: google.cloud.clouddms.v1.ICreatePrivateConnectionRequest): google.cloud.clouddms.v1.CreatePrivateConnectionRequest; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.clouddms.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified CreatePrivateConnectionRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CreatePrivateConnectionRequest.verify|verify} messages. + * @param message CreatePrivateConnectionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified CreatePrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CreatePrivateConnectionRequest.verify|verify} messages. + * @param message CreatePrivateConnectionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a CreatePrivateConnectionRequest 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 CreatePrivateConnectionRequest * @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.clouddms.v1.OperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.CreatePrivateConnectionRequest; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a CreatePrivateConnectionRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OperationMetadata + * @returns CreatePrivateConnectionRequest * @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.clouddms.v1.OperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.CreatePrivateConnectionRequest; /** - * Verifies an OperationMetadata message. + * Verifies a CreatePrivateConnectionRequest 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 CreatePrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OperationMetadata + * @returns CreatePrivateConnectionRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.OperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.CreatePrivateConnectionRequest; /** - * 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 CreatePrivateConnectionRequest message. Also converts values to other types if specified. + * @param message CreatePrivateConnectionRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.CreatePrivateConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OperationMetadata to JSON. + * Converts this CreatePrivateConnectionRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for CreatePrivateConnectionRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SslConfig. */ - interface ISslConfig { + /** Properties of a ListPrivateConnectionsRequest. */ + interface IListPrivateConnectionsRequest { - /** SslConfig type */ - type?: (google.cloud.clouddms.v1.SslConfig.SslType|keyof typeof google.cloud.clouddms.v1.SslConfig.SslType|null); + /** ListPrivateConnectionsRequest parent */ + parent?: (string|null); - /** SslConfig clientKey */ - clientKey?: (string|null); + /** ListPrivateConnectionsRequest pageSize */ + pageSize?: (number|null); - /** SslConfig clientCertificate */ - clientCertificate?: (string|null); + /** ListPrivateConnectionsRequest pageToken */ + pageToken?: (string|null); - /** SslConfig caCertificate */ - caCertificate?: (string|null); + /** ListPrivateConnectionsRequest filter */ + filter?: (string|null); + + /** ListPrivateConnectionsRequest orderBy */ + orderBy?: (string|null); } - /** Represents a SslConfig. */ - class SslConfig implements ISslConfig { + /** Represents a ListPrivateConnectionsRequest. */ + class ListPrivateConnectionsRequest implements IListPrivateConnectionsRequest { /** - * Constructs a new SslConfig. + * Constructs a new ListPrivateConnectionsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.ISslConfig); + constructor(properties?: google.cloud.clouddms.v1.IListPrivateConnectionsRequest); - /** SslConfig type. */ - public type: (google.cloud.clouddms.v1.SslConfig.SslType|keyof typeof google.cloud.clouddms.v1.SslConfig.SslType); + /** ListPrivateConnectionsRequest parent. */ + public parent: string; - /** SslConfig clientKey. */ - public clientKey: string; + /** ListPrivateConnectionsRequest pageSize. */ + public pageSize: number; - /** SslConfig clientCertificate. */ - public clientCertificate: string; + /** ListPrivateConnectionsRequest pageToken. */ + public pageToken: string; - /** SslConfig caCertificate. */ - public caCertificate: string; + /** ListPrivateConnectionsRequest filter. */ + public filter: string; + + /** ListPrivateConnectionsRequest orderBy. */ + public orderBy: string; /** - * Creates a new SslConfig instance using the specified properties. + * Creates a new ListPrivateConnectionsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SslConfig instance + * @returns ListPrivateConnectionsRequest instance */ - public static create(properties?: google.cloud.clouddms.v1.ISslConfig): google.cloud.clouddms.v1.SslConfig; + public static create(properties?: google.cloud.clouddms.v1.IListPrivateConnectionsRequest): google.cloud.clouddms.v1.ListPrivateConnectionsRequest; /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.clouddms.v1.SslConfig.verify|verify} messages. - * @param message SslConfig message or plain object to encode + * Encodes the specified ListPrivateConnectionsRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ListPrivateConnectionsRequest.verify|verify} messages. + * @param message ListPrivateConnectionsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.IListPrivateConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SslConfig.verify|verify} messages. - * @param message SslConfig message or plain object to encode + * Encodes the specified ListPrivateConnectionsRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListPrivateConnectionsRequest.verify|verify} messages. + * @param message ListPrivateConnectionsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.IListPrivateConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SslConfig message from the specified reader or buffer. + * Decodes a ListPrivateConnectionsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SslConfig + * @returns ListPrivateConnectionsRequest * @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.clouddms.v1.SslConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.ListPrivateConnectionsRequest; /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * Decodes a ListPrivateConnectionsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SslConfig + * @returns ListPrivateConnectionsRequest * @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.clouddms.v1.SslConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.ListPrivateConnectionsRequest; /** - * Verifies a SslConfig message. + * Verifies a ListPrivateConnectionsRequest 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 SslConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListPrivateConnectionsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SslConfig + * @returns ListPrivateConnectionsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SslConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ListPrivateConnectionsRequest; /** - * Creates a plain object from a SslConfig message. Also converts values to other types if specified. - * @param message SslConfig + * Creates a plain object from a ListPrivateConnectionsRequest message. Also converts values to other types if specified. + * @param message ListPrivateConnectionsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.ListPrivateConnectionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SslConfig to JSON. + * Converts this ListPrivateConnectionsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SslConfig + * Gets the default type url for ListPrivateConnectionsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace SslConfig { - - /** SslType enum. */ - enum SslType { - SSL_TYPE_UNSPECIFIED = 0, - SERVER_ONLY = 1, - SERVER_CLIENT = 2 - } - } - - /** Properties of a MySqlConnectionProfile. */ - interface IMySqlConnectionProfile { - - /** MySqlConnectionProfile host */ - host?: (string|null); - - /** MySqlConnectionProfile port */ - port?: (number|null); - - /** MySqlConnectionProfile username */ - username?: (string|null); - - /** MySqlConnectionProfile password */ - password?: (string|null); + /** Properties of a ListPrivateConnectionsResponse. */ + interface IListPrivateConnectionsResponse { - /** MySqlConnectionProfile passwordSet */ - passwordSet?: (boolean|null); + /** ListPrivateConnectionsResponse privateConnections */ + privateConnections?: (google.cloud.clouddms.v1.IPrivateConnection[]|null); - /** MySqlConnectionProfile ssl */ - ssl?: (google.cloud.clouddms.v1.ISslConfig|null); + /** ListPrivateConnectionsResponse nextPageToken */ + nextPageToken?: (string|null); - /** MySqlConnectionProfile cloudSqlId */ - cloudSqlId?: (string|null); + /** ListPrivateConnectionsResponse unreachable */ + unreachable?: (string[]|null); } - /** Represents a MySqlConnectionProfile. */ - class MySqlConnectionProfile implements IMySqlConnectionProfile { + /** Represents a ListPrivateConnectionsResponse. */ + class ListPrivateConnectionsResponse implements IListPrivateConnectionsResponse { /** - * Constructs a new MySqlConnectionProfile. + * Constructs a new ListPrivateConnectionsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.IMySqlConnectionProfile); - - /** MySqlConnectionProfile host. */ - public host: string; - - /** MySqlConnectionProfile port. */ - public port: number; - - /** MySqlConnectionProfile username. */ - public username: string; - - /** MySqlConnectionProfile password. */ - public password: string; + constructor(properties?: google.cloud.clouddms.v1.IListPrivateConnectionsResponse); - /** MySqlConnectionProfile passwordSet. */ - public passwordSet: boolean; + /** ListPrivateConnectionsResponse privateConnections. */ + public privateConnections: google.cloud.clouddms.v1.IPrivateConnection[]; - /** MySqlConnectionProfile ssl. */ - public ssl?: (google.cloud.clouddms.v1.ISslConfig|null); + /** ListPrivateConnectionsResponse nextPageToken. */ + public nextPageToken: string; - /** MySqlConnectionProfile cloudSqlId. */ - public cloudSqlId: string; + /** ListPrivateConnectionsResponse unreachable. */ + public unreachable: string[]; /** - * Creates a new MySqlConnectionProfile instance using the specified properties. + * Creates a new ListPrivateConnectionsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns MySqlConnectionProfile instance + * @returns ListPrivateConnectionsResponse instance */ - public static create(properties?: google.cloud.clouddms.v1.IMySqlConnectionProfile): google.cloud.clouddms.v1.MySqlConnectionProfile; + public static create(properties?: google.cloud.clouddms.v1.IListPrivateConnectionsResponse): google.cloud.clouddms.v1.ListPrivateConnectionsResponse; /** - * Encodes the specified MySqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.MySqlConnectionProfile.verify|verify} messages. - * @param message MySqlConnectionProfile message or plain object to encode + * Encodes the specified ListPrivateConnectionsResponse message. Does not implicitly {@link google.cloud.clouddms.v1.ListPrivateConnectionsResponse.verify|verify} messages. + * @param message ListPrivateConnectionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.IMySqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.IListPrivateConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MySqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MySqlConnectionProfile.verify|verify} messages. - * @param message MySqlConnectionProfile message or plain object to encode + * Encodes the specified ListPrivateConnectionsResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListPrivateConnectionsResponse.verify|verify} messages. + * @param message ListPrivateConnectionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.IMySqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.IListPrivateConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MySqlConnectionProfile message from the specified reader or buffer. + * Decodes a ListPrivateConnectionsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MySqlConnectionProfile + * @returns ListPrivateConnectionsResponse * @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.clouddms.v1.MySqlConnectionProfile; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.ListPrivateConnectionsResponse; /** - * Decodes a MySqlConnectionProfile message from the specified reader or buffer, length delimited. + * Decodes a ListPrivateConnectionsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MySqlConnectionProfile + * @returns ListPrivateConnectionsResponse * @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.clouddms.v1.MySqlConnectionProfile; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.ListPrivateConnectionsResponse; /** - * Verifies a MySqlConnectionProfile message. + * Verifies a ListPrivateConnectionsResponse 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 MySqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * Creates a ListPrivateConnectionsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MySqlConnectionProfile + * @returns ListPrivateConnectionsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.MySqlConnectionProfile; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ListPrivateConnectionsResponse; /** - * Creates a plain object from a MySqlConnectionProfile message. Also converts values to other types if specified. - * @param message MySqlConnectionProfile + * Creates a plain object from a ListPrivateConnectionsResponse message. Also converts values to other types if specified. + * @param message ListPrivateConnectionsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.MySqlConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.ListPrivateConnectionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MySqlConnectionProfile to JSON. + * Converts this ListPrivateConnectionsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MySqlConnectionProfile + * Gets the default type url for ListPrivateConnectionsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PostgreSqlConnectionProfile. */ - interface IPostgreSqlConnectionProfile { - - /** PostgreSqlConnectionProfile host */ - host?: (string|null); - - /** PostgreSqlConnectionProfile port */ - port?: (number|null); - - /** PostgreSqlConnectionProfile username */ - username?: (string|null); + /** Properties of a DeletePrivateConnectionRequest. */ + interface IDeletePrivateConnectionRequest { - /** PostgreSqlConnectionProfile password */ - password?: (string|null); - - /** PostgreSqlConnectionProfile passwordSet */ - passwordSet?: (boolean|null); - - /** PostgreSqlConnectionProfile ssl */ - ssl?: (google.cloud.clouddms.v1.ISslConfig|null); + /** DeletePrivateConnectionRequest name */ + name?: (string|null); - /** PostgreSqlConnectionProfile cloudSqlId */ - cloudSqlId?: (string|null); + /** DeletePrivateConnectionRequest requestId */ + requestId?: (string|null); } - /** Represents a PostgreSqlConnectionProfile. */ - class PostgreSqlConnectionProfile implements IPostgreSqlConnectionProfile { + /** Represents a DeletePrivateConnectionRequest. */ + class DeletePrivateConnectionRequest implements IDeletePrivateConnectionRequest { /** - * Constructs a new PostgreSqlConnectionProfile. + * Constructs a new DeletePrivateConnectionRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.IPostgreSqlConnectionProfile); - - /** PostgreSqlConnectionProfile host. */ - public host: string; - - /** PostgreSqlConnectionProfile port. */ - public port: number; - - /** PostgreSqlConnectionProfile username. */ - public username: string; - - /** PostgreSqlConnectionProfile password. */ - public password: string; + constructor(properties?: google.cloud.clouddms.v1.IDeletePrivateConnectionRequest); - /** PostgreSqlConnectionProfile passwordSet. */ - public passwordSet: boolean; - - /** PostgreSqlConnectionProfile ssl. */ - public ssl?: (google.cloud.clouddms.v1.ISslConfig|null); + /** DeletePrivateConnectionRequest name. */ + public name: string; - /** PostgreSqlConnectionProfile cloudSqlId. */ - public cloudSqlId: string; + /** DeletePrivateConnectionRequest requestId. */ + public requestId: string; /** - * Creates a new PostgreSqlConnectionProfile instance using the specified properties. + * Creates a new DeletePrivateConnectionRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PostgreSqlConnectionProfile instance + * @returns DeletePrivateConnectionRequest instance */ - public static create(properties?: google.cloud.clouddms.v1.IPostgreSqlConnectionProfile): google.cloud.clouddms.v1.PostgreSqlConnectionProfile; + public static create(properties?: google.cloud.clouddms.v1.IDeletePrivateConnectionRequest): google.cloud.clouddms.v1.DeletePrivateConnectionRequest; /** - * Encodes the specified PostgreSqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify|verify} messages. - * @param message PostgreSqlConnectionProfile message or plain object to encode + * Encodes the specified DeletePrivateConnectionRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DeletePrivateConnectionRequest.verify|verify} messages. + * @param message DeletePrivateConnectionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.IPostgreSqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PostgreSqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify|verify} messages. - * @param message PostgreSqlConnectionProfile message or plain object to encode + * Encodes the specified DeletePrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DeletePrivateConnectionRequest.verify|verify} messages. + * @param message DeletePrivateConnectionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.IPostgreSqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PostgreSqlConnectionProfile message from the specified reader or buffer. + * Decodes a DeletePrivateConnectionRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PostgreSqlConnectionProfile + * @returns DeletePrivateConnectionRequest * @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.clouddms.v1.PostgreSqlConnectionProfile; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.DeletePrivateConnectionRequest; /** - * Decodes a PostgreSqlConnectionProfile message from the specified reader or buffer, length delimited. + * Decodes a DeletePrivateConnectionRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PostgreSqlConnectionProfile + * @returns DeletePrivateConnectionRequest * @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.clouddms.v1.PostgreSqlConnectionProfile; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.DeletePrivateConnectionRequest; /** - * Verifies a PostgreSqlConnectionProfile message. + * Verifies a DeletePrivateConnectionRequest 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 PostgreSqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * Creates a DeletePrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PostgreSqlConnectionProfile + * @returns DeletePrivateConnectionRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.PostgreSqlConnectionProfile; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DeletePrivateConnectionRequest; /** - * Creates a plain object from a PostgreSqlConnectionProfile message. Also converts values to other types if specified. - * @param message PostgreSqlConnectionProfile + * Creates a plain object from a DeletePrivateConnectionRequest message. Also converts values to other types if specified. + * @param message DeletePrivateConnectionRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.PostgreSqlConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.DeletePrivateConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PostgreSqlConnectionProfile to JSON. + * Converts this DeletePrivateConnectionRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PostgreSqlConnectionProfile + * Gets the default type url for DeletePrivateConnectionRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CloudSqlConnectionProfile. */ - interface ICloudSqlConnectionProfile { - - /** CloudSqlConnectionProfile cloudSqlId */ - cloudSqlId?: (string|null); - - /** CloudSqlConnectionProfile settings */ - settings?: (google.cloud.clouddms.v1.ICloudSqlSettings|null); - - /** CloudSqlConnectionProfile privateIp */ - privateIp?: (string|null); + /** Properties of a GetPrivateConnectionRequest. */ + interface IGetPrivateConnectionRequest { - /** CloudSqlConnectionProfile publicIp */ - publicIp?: (string|null); + /** GetPrivateConnectionRequest name */ + name?: (string|null); } - /** Represents a CloudSqlConnectionProfile. */ - class CloudSqlConnectionProfile implements ICloudSqlConnectionProfile { + /** Represents a GetPrivateConnectionRequest. */ + class GetPrivateConnectionRequest implements IGetPrivateConnectionRequest { /** - * Constructs a new CloudSqlConnectionProfile. + * Constructs a new GetPrivateConnectionRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.ICloudSqlConnectionProfile); - - /** CloudSqlConnectionProfile cloudSqlId. */ - public cloudSqlId: string; - - /** CloudSqlConnectionProfile settings. */ - public settings?: (google.cloud.clouddms.v1.ICloudSqlSettings|null); - - /** CloudSqlConnectionProfile privateIp. */ - public privateIp: string; + constructor(properties?: google.cloud.clouddms.v1.IGetPrivateConnectionRequest); - /** CloudSqlConnectionProfile publicIp. */ - public publicIp: string; + /** GetPrivateConnectionRequest name. */ + public name: string; /** - * Creates a new CloudSqlConnectionProfile instance using the specified properties. + * Creates a new GetPrivateConnectionRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CloudSqlConnectionProfile instance + * @returns GetPrivateConnectionRequest instance */ - public static create(properties?: google.cloud.clouddms.v1.ICloudSqlConnectionProfile): google.cloud.clouddms.v1.CloudSqlConnectionProfile; + public static create(properties?: google.cloud.clouddms.v1.IGetPrivateConnectionRequest): google.cloud.clouddms.v1.GetPrivateConnectionRequest; /** - * Encodes the specified CloudSqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify|verify} messages. - * @param message CloudSqlConnectionProfile message or plain object to encode + * Encodes the specified GetPrivateConnectionRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GetPrivateConnectionRequest.verify|verify} messages. + * @param message GetPrivateConnectionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.ICloudSqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.IGetPrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CloudSqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify|verify} messages. - * @param message CloudSqlConnectionProfile message or plain object to encode + * Encodes the specified GetPrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GetPrivateConnectionRequest.verify|verify} messages. + * @param message GetPrivateConnectionRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.ICloudSqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.IGetPrivateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CloudSqlConnectionProfile message from the specified reader or buffer. + * Decodes a GetPrivateConnectionRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CloudSqlConnectionProfile + * @returns GetPrivateConnectionRequest * @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.clouddms.v1.CloudSqlConnectionProfile; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.GetPrivateConnectionRequest; /** - * Decodes a CloudSqlConnectionProfile message from the specified reader or buffer, length delimited. + * Decodes a GetPrivateConnectionRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CloudSqlConnectionProfile + * @returns GetPrivateConnectionRequest * @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.clouddms.v1.CloudSqlConnectionProfile; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.GetPrivateConnectionRequest; /** - * Verifies a CloudSqlConnectionProfile message. + * Verifies a GetPrivateConnectionRequest 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 CloudSqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * Creates a GetPrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CloudSqlConnectionProfile + * @returns GetPrivateConnectionRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.CloudSqlConnectionProfile; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.GetPrivateConnectionRequest; /** - * Creates a plain object from a CloudSqlConnectionProfile message. Also converts values to other types if specified. - * @param message CloudSqlConnectionProfile + * Creates a plain object from a GetPrivateConnectionRequest message. Also converts values to other types if specified. + * @param message GetPrivateConnectionRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.CloudSqlConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.GetPrivateConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CloudSqlConnectionProfile to JSON. + * Converts this GetPrivateConnectionRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CloudSqlConnectionProfile + * Gets the default type url for GetPrivateConnectionRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SqlAclEntry. */ - interface ISqlAclEntry { + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { - /** SqlAclEntry value */ - value?: (string|null); + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** SqlAclEntry expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); - /** SqlAclEntry ttl */ - ttl?: (google.protobuf.IDuration|null); + /** OperationMetadata target */ + target?: (string|null); - /** SqlAclEntry label */ - label?: (string|null); + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); } - /** Represents a SqlAclEntry. */ - class SqlAclEntry implements ISqlAclEntry { + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { /** - * Constructs a new SqlAclEntry. + * Constructs a new OperationMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.ISqlAclEntry); + constructor(properties?: google.cloud.clouddms.v1.IOperationMetadata); - /** SqlAclEntry value. */ - public value: string; + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** SqlAclEntry expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); - /** SqlAclEntry ttl. */ - public ttl?: (google.protobuf.IDuration|null); + /** OperationMetadata target. */ + public target: string; - /** SqlAclEntry label. */ - public label: string; + /** OperationMetadata verb. */ + public verb: string; - /** SqlAclEntry expiration. */ - public expiration?: ("expireTime"|"ttl"); + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; /** - * Creates a new SqlAclEntry instance using the specified properties. + * Creates a new OperationMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns SqlAclEntry instance + * @returns OperationMetadata instance */ - public static create(properties?: google.cloud.clouddms.v1.ISqlAclEntry): google.cloud.clouddms.v1.SqlAclEntry; + public static create(properties?: google.cloud.clouddms.v1.IOperationMetadata): google.cloud.clouddms.v1.OperationMetadata; /** - * Encodes the specified SqlAclEntry message. Does not implicitly {@link google.cloud.clouddms.v1.SqlAclEntry.verify|verify} messages. - * @param message SqlAclEntry message or plain object to encode + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.clouddms.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.clouddms.v1.ISqlAclEntry, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SqlAclEntry message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SqlAclEntry.verify|verify} messages. - * @param message SqlAclEntry message or plain object to encode + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.clouddms.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.clouddms.v1.ISqlAclEntry, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SqlAclEntry 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 SqlAclEntry + * @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.clouddms.v1.SqlAclEntry; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.OperationMetadata; /** - * Decodes a SqlAclEntry 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 SqlAclEntry + * @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.clouddms.v1.SqlAclEntry; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.OperationMetadata; /** - * Verifies a SqlAclEntry 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 SqlAclEntry 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 SqlAclEntry + * @returns OperationMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SqlAclEntry; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.OperationMetadata; /** - * Creates a plain object from a SqlAclEntry message. Also converts values to other types if specified. - * @param message SqlAclEntry + * 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.clouddms.v1.SqlAclEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SqlAclEntry to JSON. + * Converts this OperationMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SqlAclEntry + * 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 a SqlIpConfig. */ - interface ISqlIpConfig { + /** Properties of a ListConversionWorkspacesRequest. */ + interface IListConversionWorkspacesRequest { - /** SqlIpConfig enableIpv4 */ - enableIpv4?: (google.protobuf.IBoolValue|null); + /** ListConversionWorkspacesRequest parent */ + parent?: (string|null); - /** SqlIpConfig privateNetwork */ - privateNetwork?: (string|null); + /** ListConversionWorkspacesRequest pageSize */ + pageSize?: (number|null); - /** SqlIpConfig requireSsl */ - requireSsl?: (google.protobuf.IBoolValue|null); + /** ListConversionWorkspacesRequest pageToken */ + pageToken?: (string|null); - /** SqlIpConfig authorizedNetworks */ - authorizedNetworks?: (google.cloud.clouddms.v1.ISqlAclEntry[]|null); + /** ListConversionWorkspacesRequest filter */ + filter?: (string|null); } - /** Represents a SqlIpConfig. */ - class SqlIpConfig implements ISqlIpConfig { + /** Represents a ListConversionWorkspacesRequest. */ + class ListConversionWorkspacesRequest implements IListConversionWorkspacesRequest { /** - * Constructs a new SqlIpConfig. + * Constructs a new ListConversionWorkspacesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.ISqlIpConfig); + constructor(properties?: google.cloud.clouddms.v1.IListConversionWorkspacesRequest); - /** SqlIpConfig enableIpv4. */ - public enableIpv4?: (google.protobuf.IBoolValue|null); + /** ListConversionWorkspacesRequest parent. */ + public parent: string; - /** SqlIpConfig privateNetwork. */ - public privateNetwork: string; + /** ListConversionWorkspacesRequest pageSize. */ + public pageSize: number; - /** SqlIpConfig requireSsl. */ - public requireSsl?: (google.protobuf.IBoolValue|null); + /** ListConversionWorkspacesRequest pageToken. */ + public pageToken: string; - /** SqlIpConfig authorizedNetworks. */ - public authorizedNetworks: google.cloud.clouddms.v1.ISqlAclEntry[]; + /** ListConversionWorkspacesRequest filter. */ + public filter: string; /** - * Creates a new SqlIpConfig instance using the specified properties. + * Creates a new ListConversionWorkspacesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SqlIpConfig instance + * @returns ListConversionWorkspacesRequest instance */ - public static create(properties?: google.cloud.clouddms.v1.ISqlIpConfig): google.cloud.clouddms.v1.SqlIpConfig; + public static create(properties?: google.cloud.clouddms.v1.IListConversionWorkspacesRequest): google.cloud.clouddms.v1.ListConversionWorkspacesRequest; /** - * Encodes the specified SqlIpConfig message. Does not implicitly {@link google.cloud.clouddms.v1.SqlIpConfig.verify|verify} messages. - * @param message SqlIpConfig message or plain object to encode + * Encodes the specified ListConversionWorkspacesRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ListConversionWorkspacesRequest.verify|verify} messages. + * @param message ListConversionWorkspacesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.ISqlIpConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.IListConversionWorkspacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SqlIpConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SqlIpConfig.verify|verify} messages. - * @param message SqlIpConfig message or plain object to encode + * Encodes the specified ListConversionWorkspacesRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListConversionWorkspacesRequest.verify|verify} messages. + * @param message ListConversionWorkspacesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.ISqlIpConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.IListConversionWorkspacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SqlIpConfig message from the specified reader or buffer. + * Decodes a ListConversionWorkspacesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SqlIpConfig + * @returns ListConversionWorkspacesRequest * @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.clouddms.v1.SqlIpConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.ListConversionWorkspacesRequest; /** - * Decodes a SqlIpConfig message from the specified reader or buffer, length delimited. + * Decodes a ListConversionWorkspacesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SqlIpConfig + * @returns ListConversionWorkspacesRequest * @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.clouddms.v1.SqlIpConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.ListConversionWorkspacesRequest; /** - * Verifies a SqlIpConfig message. + * Verifies a ListConversionWorkspacesRequest 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 SqlIpConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListConversionWorkspacesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SqlIpConfig + * @returns ListConversionWorkspacesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SqlIpConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ListConversionWorkspacesRequest; /** - * Creates a plain object from a SqlIpConfig message. Also converts values to other types if specified. - * @param message SqlIpConfig + * Creates a plain object from a ListConversionWorkspacesRequest message. Also converts values to other types if specified. + * @param message ListConversionWorkspacesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.SqlIpConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.ListConversionWorkspacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SqlIpConfig to JSON. + * Converts this ListConversionWorkspacesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SqlIpConfig + * Gets the default type url for ListConversionWorkspacesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CloudSqlSettings. */ - interface ICloudSqlSettings { + /** Properties of a ListConversionWorkspacesResponse. */ + interface IListConversionWorkspacesResponse { - /** CloudSqlSettings databaseVersion */ - databaseVersion?: (google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion|null); + /** ListConversionWorkspacesResponse conversionWorkspaces */ + conversionWorkspaces?: (google.cloud.clouddms.v1.IConversionWorkspace[]|null); - /** CloudSqlSettings userLabels */ - userLabels?: ({ [k: string]: string }|null); + /** ListConversionWorkspacesResponse nextPageToken */ + nextPageToken?: (string|null); - /** CloudSqlSettings tier */ - tier?: (string|null); + /** ListConversionWorkspacesResponse unreachable */ + unreachable?: (string[]|null); + } - /** CloudSqlSettings storageAutoResizeLimit */ - storageAutoResizeLimit?: (google.protobuf.IInt64Value|null); + /** Represents a ListConversionWorkspacesResponse. */ + class ListConversionWorkspacesResponse implements IListConversionWorkspacesResponse { - /** CloudSqlSettings activationPolicy */ - activationPolicy?: (google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy|null); + /** + * Constructs a new ListConversionWorkspacesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IListConversionWorkspacesResponse); - /** CloudSqlSettings ipConfig */ - ipConfig?: (google.cloud.clouddms.v1.ISqlIpConfig|null); + /** ListConversionWorkspacesResponse conversionWorkspaces. */ + public conversionWorkspaces: google.cloud.clouddms.v1.IConversionWorkspace[]; - /** CloudSqlSettings autoStorageIncrease */ - autoStorageIncrease?: (google.protobuf.IBoolValue|null); + /** ListConversionWorkspacesResponse nextPageToken. */ + public nextPageToken: string; - /** CloudSqlSettings databaseFlags */ - databaseFlags?: ({ [k: string]: string }|null); + /** ListConversionWorkspacesResponse unreachable. */ + public unreachable: string[]; - /** CloudSqlSettings dataDiskType */ - dataDiskType?: (google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType|null); - - /** CloudSqlSettings dataDiskSizeGb */ - dataDiskSizeGb?: (google.protobuf.IInt64Value|null); - - /** CloudSqlSettings zone */ - zone?: (string|null); - - /** CloudSqlSettings sourceId */ - sourceId?: (string|null); - - /** CloudSqlSettings rootPassword */ - rootPassword?: (string|null); - - /** CloudSqlSettings rootPasswordSet */ - rootPasswordSet?: (boolean|null); - - /** CloudSqlSettings collation */ - collation?: (string|null); - } - - /** Represents a CloudSqlSettings. */ - class CloudSqlSettings implements ICloudSqlSettings { - - /** - * Constructs a new CloudSqlSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.clouddms.v1.ICloudSqlSettings); - - /** CloudSqlSettings databaseVersion. */ - public databaseVersion: (google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion); - - /** CloudSqlSettings userLabels. */ - public userLabels: { [k: string]: string }; - - /** CloudSqlSettings tier. */ - public tier: string; - - /** CloudSqlSettings storageAutoResizeLimit. */ - public storageAutoResizeLimit?: (google.protobuf.IInt64Value|null); - - /** CloudSqlSettings activationPolicy. */ - public activationPolicy: (google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy); - - /** CloudSqlSettings ipConfig. */ - public ipConfig?: (google.cloud.clouddms.v1.ISqlIpConfig|null); - - /** CloudSqlSettings autoStorageIncrease. */ - public autoStorageIncrease?: (google.protobuf.IBoolValue|null); - - /** CloudSqlSettings databaseFlags. */ - public databaseFlags: { [k: string]: string }; - - /** CloudSqlSettings dataDiskType. */ - public dataDiskType: (google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType); - - /** CloudSqlSettings dataDiskSizeGb. */ - public dataDiskSizeGb?: (google.protobuf.IInt64Value|null); - - /** CloudSqlSettings zone. */ - public zone: string; - - /** CloudSqlSettings sourceId. */ - public sourceId: string; - - /** CloudSqlSettings rootPassword. */ - public rootPassword: string; - - /** CloudSqlSettings rootPasswordSet. */ - public rootPasswordSet: boolean; - - /** CloudSqlSettings collation. */ - public collation: string; + /** + * Creates a new ListConversionWorkspacesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversionWorkspacesResponse instance + */ + public static create(properties?: google.cloud.clouddms.v1.IListConversionWorkspacesResponse): google.cloud.clouddms.v1.ListConversionWorkspacesResponse; /** - * Creates a new CloudSqlSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudSqlSettings instance - */ - public static create(properties?: google.cloud.clouddms.v1.ICloudSqlSettings): google.cloud.clouddms.v1.CloudSqlSettings; - - /** - * Encodes the specified CloudSqlSettings message. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlSettings.verify|verify} messages. - * @param message CloudSqlSettings message or plain object to encode + * Encodes the specified ListConversionWorkspacesResponse message. Does not implicitly {@link google.cloud.clouddms.v1.ListConversionWorkspacesResponse.verify|verify} messages. + * @param message ListConversionWorkspacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.ICloudSqlSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.IListConversionWorkspacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CloudSqlSettings message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlSettings.verify|verify} messages. - * @param message CloudSqlSettings message or plain object to encode + * Encodes the specified ListConversionWorkspacesResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListConversionWorkspacesResponse.verify|verify} messages. + * @param message ListConversionWorkspacesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.ICloudSqlSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.IListConversionWorkspacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CloudSqlSettings message from the specified reader or buffer. + * Decodes a ListConversionWorkspacesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CloudSqlSettings + * @returns ListConversionWorkspacesResponse * @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.clouddms.v1.CloudSqlSettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.ListConversionWorkspacesResponse; /** - * Decodes a CloudSqlSettings message from the specified reader or buffer, length delimited. + * Decodes a ListConversionWorkspacesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CloudSqlSettings + * @returns ListConversionWorkspacesResponse * @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.clouddms.v1.CloudSqlSettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.ListConversionWorkspacesResponse; /** - * Verifies a CloudSqlSettings message. + * Verifies a ListConversionWorkspacesResponse 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 CloudSqlSettings message from a plain object. Also converts values to their respective internal types. + * Creates a ListConversionWorkspacesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CloudSqlSettings + * @returns ListConversionWorkspacesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.CloudSqlSettings; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ListConversionWorkspacesResponse; /** - * Creates a plain object from a CloudSqlSettings message. Also converts values to other types if specified. - * @param message CloudSqlSettings + * Creates a plain object from a ListConversionWorkspacesResponse message. Also converts values to other types if specified. + * @param message ListConversionWorkspacesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.CloudSqlSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.ListConversionWorkspacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CloudSqlSettings to JSON. + * Converts this ListConversionWorkspacesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CloudSqlSettings + * Gets the default type url for ListConversionWorkspacesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace CloudSqlSettings { - - /** SqlActivationPolicy enum. */ - enum SqlActivationPolicy { - SQL_ACTIVATION_POLICY_UNSPECIFIED = 0, - ALWAYS = 1, - NEVER = 2 - } - - /** SqlDataDiskType enum. */ - enum SqlDataDiskType { - SQL_DATA_DISK_TYPE_UNSPECIFIED = 0, - PD_SSD = 1, - PD_HDD = 2 - } - - /** SqlDatabaseVersion enum. */ - enum SqlDatabaseVersion { - SQL_DATABASE_VERSION_UNSPECIFIED = 0, - MYSQL_5_6 = 1, - MYSQL_5_7 = 2, - POSTGRES_9_6 = 3, - POSTGRES_11 = 4, - POSTGRES_10 = 5, - MYSQL_8_0 = 6, - POSTGRES_12 = 7, - POSTGRES_13 = 8 - } - } + /** Properties of a GetConversionWorkspaceRequest. */ + interface IGetConversionWorkspaceRequest { - /** Properties of a StaticIpConnectivity. */ - interface IStaticIpConnectivity { + /** GetConversionWorkspaceRequest name */ + name?: (string|null); } - /** Represents a StaticIpConnectivity. */ - class StaticIpConnectivity implements IStaticIpConnectivity { + /** Represents a GetConversionWorkspaceRequest. */ + class GetConversionWorkspaceRequest implements IGetConversionWorkspaceRequest { /** - * Constructs a new StaticIpConnectivity. + * Constructs a new GetConversionWorkspaceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.IStaticIpConnectivity); + constructor(properties?: google.cloud.clouddms.v1.IGetConversionWorkspaceRequest); + + /** GetConversionWorkspaceRequest name. */ + public name: string; /** - * Creates a new StaticIpConnectivity instance using the specified properties. + * Creates a new GetConversionWorkspaceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns StaticIpConnectivity instance + * @returns GetConversionWorkspaceRequest instance */ - public static create(properties?: google.cloud.clouddms.v1.IStaticIpConnectivity): google.cloud.clouddms.v1.StaticIpConnectivity; + public static create(properties?: google.cloud.clouddms.v1.IGetConversionWorkspaceRequest): google.cloud.clouddms.v1.GetConversionWorkspaceRequest; /** - * Encodes the specified StaticIpConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.StaticIpConnectivity.verify|verify} messages. - * @param message StaticIpConnectivity message or plain object to encode + * Encodes the specified GetConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GetConversionWorkspaceRequest.verify|verify} messages. + * @param message GetConversionWorkspaceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.IStaticIpConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StaticIpConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StaticIpConnectivity.verify|verify} messages. - * @param message StaticIpConnectivity message or plain object to encode + * Encodes the specified GetConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GetConversionWorkspaceRequest.verify|verify} messages. + * @param message GetConversionWorkspaceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.IStaticIpConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StaticIpConnectivity message from the specified reader or buffer. + * Decodes a GetConversionWorkspaceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StaticIpConnectivity + * @returns GetConversionWorkspaceRequest * @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.clouddms.v1.StaticIpConnectivity; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.GetConversionWorkspaceRequest; /** - * Decodes a StaticIpConnectivity message from the specified reader or buffer, length delimited. + * Decodes a GetConversionWorkspaceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StaticIpConnectivity + * @returns GetConversionWorkspaceRequest * @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.clouddms.v1.StaticIpConnectivity; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.GetConversionWorkspaceRequest; /** - * Verifies a StaticIpConnectivity message. + * Verifies a GetConversionWorkspaceRequest 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 StaticIpConnectivity message from a plain object. Also converts values to their respective internal types. + * Creates a GetConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StaticIpConnectivity + * @returns GetConversionWorkspaceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.StaticIpConnectivity; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.GetConversionWorkspaceRequest; /** - * Creates a plain object from a StaticIpConnectivity message. Also converts values to other types if specified. - * @param message StaticIpConnectivity + * Creates a plain object from a GetConversionWorkspaceRequest message. Also converts values to other types if specified. + * @param message GetConversionWorkspaceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.StaticIpConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.GetConversionWorkspaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StaticIpConnectivity to JSON. + * Converts this GetConversionWorkspaceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for StaticIpConnectivity + * Gets the default type url for GetConversionWorkspaceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ReverseSshConnectivity. */ - interface IReverseSshConnectivity { + /** Properties of a CreateConversionWorkspaceRequest. */ + interface ICreateConversionWorkspaceRequest { - /** ReverseSshConnectivity vmIp */ - vmIp?: (string|null); + /** CreateConversionWorkspaceRequest parent */ + parent?: (string|null); - /** ReverseSshConnectivity vmPort */ - vmPort?: (number|null); + /** CreateConversionWorkspaceRequest conversionWorkspaceId */ + conversionWorkspaceId?: (string|null); - /** ReverseSshConnectivity vm */ - vm?: (string|null); + /** CreateConversionWorkspaceRequest conversionWorkspace */ + conversionWorkspace?: (google.cloud.clouddms.v1.IConversionWorkspace|null); - /** ReverseSshConnectivity vpc */ - vpc?: (string|null); + /** CreateConversionWorkspaceRequest requestId */ + requestId?: (string|null); } - /** Represents a ReverseSshConnectivity. */ - class ReverseSshConnectivity implements IReverseSshConnectivity { + /** Represents a CreateConversionWorkspaceRequest. */ + class CreateConversionWorkspaceRequest implements ICreateConversionWorkspaceRequest { /** - * Constructs a new ReverseSshConnectivity. + * Constructs a new CreateConversionWorkspaceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.IReverseSshConnectivity); + constructor(properties?: google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest); - /** ReverseSshConnectivity vmIp. */ - public vmIp: string; + /** CreateConversionWorkspaceRequest parent. */ + public parent: string; - /** ReverseSshConnectivity vmPort. */ - public vmPort: number; + /** CreateConversionWorkspaceRequest conversionWorkspaceId. */ + public conversionWorkspaceId: string; - /** ReverseSshConnectivity vm. */ - public vm: string; + /** CreateConversionWorkspaceRequest conversionWorkspace. */ + public conversionWorkspace?: (google.cloud.clouddms.v1.IConversionWorkspace|null); - /** ReverseSshConnectivity vpc. */ - public vpc: string; + /** CreateConversionWorkspaceRequest requestId. */ + public requestId: string; /** - * Creates a new ReverseSshConnectivity instance using the specified properties. + * Creates a new CreateConversionWorkspaceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ReverseSshConnectivity instance + * @returns CreateConversionWorkspaceRequest instance */ - public static create(properties?: google.cloud.clouddms.v1.IReverseSshConnectivity): google.cloud.clouddms.v1.ReverseSshConnectivity; + public static create(properties?: google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest): google.cloud.clouddms.v1.CreateConversionWorkspaceRequest; /** - * Encodes the specified ReverseSshConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.ReverseSshConnectivity.verify|verify} messages. - * @param message ReverseSshConnectivity message or plain object to encode + * Encodes the specified CreateConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CreateConversionWorkspaceRequest.verify|verify} messages. + * @param message CreateConversionWorkspaceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.IReverseSshConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReverseSshConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ReverseSshConnectivity.verify|verify} messages. - * @param message ReverseSshConnectivity message or plain object to encode + * Encodes the specified CreateConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CreateConversionWorkspaceRequest.verify|verify} messages. + * @param message CreateConversionWorkspaceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.IReverseSshConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReverseSshConnectivity message from the specified reader or buffer. + * Decodes a CreateConversionWorkspaceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReverseSshConnectivity + * @returns CreateConversionWorkspaceRequest * @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.clouddms.v1.ReverseSshConnectivity; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.CreateConversionWorkspaceRequest; /** - * Decodes a ReverseSshConnectivity message from the specified reader or buffer, length delimited. + * Decodes a CreateConversionWorkspaceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReverseSshConnectivity + * @returns CreateConversionWorkspaceRequest * @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.clouddms.v1.ReverseSshConnectivity; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.CreateConversionWorkspaceRequest; /** - * Verifies a ReverseSshConnectivity message. + * Verifies a CreateConversionWorkspaceRequest 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 ReverseSshConnectivity message from a plain object. Also converts values to their respective internal types. + * Creates a CreateConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReverseSshConnectivity + * @returns CreateConversionWorkspaceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ReverseSshConnectivity; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.CreateConversionWorkspaceRequest; /** - * Creates a plain object from a ReverseSshConnectivity message. Also converts values to other types if specified. - * @param message ReverseSshConnectivity + * Creates a plain object from a CreateConversionWorkspaceRequest message. Also converts values to other types if specified. + * @param message CreateConversionWorkspaceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.ReverseSshConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.CreateConversionWorkspaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReverseSshConnectivity to JSON. + * Converts this CreateConversionWorkspaceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReverseSshConnectivity + * Gets the default type url for CreateConversionWorkspaceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a VpcPeeringConnectivity. */ - interface IVpcPeeringConnectivity { + /** Properties of an UpdateConversionWorkspaceRequest. */ + interface IUpdateConversionWorkspaceRequest { - /** VpcPeeringConnectivity vpc */ - vpc?: (string|null); + /** UpdateConversionWorkspaceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateConversionWorkspaceRequest conversionWorkspace */ + conversionWorkspace?: (google.cloud.clouddms.v1.IConversionWorkspace|null); + + /** UpdateConversionWorkspaceRequest requestId */ + requestId?: (string|null); } - /** Represents a VpcPeeringConnectivity. */ - class VpcPeeringConnectivity implements IVpcPeeringConnectivity { + /** Represents an UpdateConversionWorkspaceRequest. */ + class UpdateConversionWorkspaceRequest implements IUpdateConversionWorkspaceRequest { /** - * Constructs a new VpcPeeringConnectivity. + * Constructs a new UpdateConversionWorkspaceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.IVpcPeeringConnectivity); + constructor(properties?: google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest); - /** VpcPeeringConnectivity vpc. */ - public vpc: string; + /** UpdateConversionWorkspaceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateConversionWorkspaceRequest conversionWorkspace. */ + public conversionWorkspace?: (google.cloud.clouddms.v1.IConversionWorkspace|null); + + /** UpdateConversionWorkspaceRequest requestId. */ + public requestId: string; /** - * Creates a new VpcPeeringConnectivity instance using the specified properties. + * Creates a new UpdateConversionWorkspaceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns VpcPeeringConnectivity instance + * @returns UpdateConversionWorkspaceRequest instance */ - public static create(properties?: google.cloud.clouddms.v1.IVpcPeeringConnectivity): google.cloud.clouddms.v1.VpcPeeringConnectivity; + public static create(properties?: google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest): google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest; /** - * Encodes the specified VpcPeeringConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConnectivity.verify|verify} messages. - * @param message VpcPeeringConnectivity message or plain object to encode + * Encodes the specified UpdateConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest.verify|verify} messages. + * @param message UpdateConversionWorkspaceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.IVpcPeeringConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VpcPeeringConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConnectivity.verify|verify} messages. - * @param message VpcPeeringConnectivity message or plain object to encode + * Encodes the specified UpdateConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest.verify|verify} messages. + * @param message UpdateConversionWorkspaceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.IVpcPeeringConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VpcPeeringConnectivity message from the specified reader or buffer. + * Decodes an UpdateConversionWorkspaceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VpcPeeringConnectivity + * @returns UpdateConversionWorkspaceRequest * @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.clouddms.v1.VpcPeeringConnectivity; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest; /** - * Decodes a VpcPeeringConnectivity message from the specified reader or buffer, length delimited. + * Decodes an UpdateConversionWorkspaceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VpcPeeringConnectivity + * @returns UpdateConversionWorkspaceRequest * @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.clouddms.v1.VpcPeeringConnectivity; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest; /** - * Verifies a VpcPeeringConnectivity message. + * Verifies an UpdateConversionWorkspaceRequest 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 VpcPeeringConnectivity message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VpcPeeringConnectivity + * @returns UpdateConversionWorkspaceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.VpcPeeringConnectivity; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest; /** - * Creates a plain object from a VpcPeeringConnectivity message. Also converts values to other types if specified. - * @param message VpcPeeringConnectivity + * Creates a plain object from an UpdateConversionWorkspaceRequest message. Also converts values to other types if specified. + * @param message UpdateConversionWorkspaceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.VpcPeeringConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VpcPeeringConnectivity to JSON. + * Converts this UpdateConversionWorkspaceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for VpcPeeringConnectivity + * Gets the default type url for UpdateConversionWorkspaceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DatabaseType. */ - interface IDatabaseType { + /** Properties of a DeleteConversionWorkspaceRequest. */ + interface IDeleteConversionWorkspaceRequest { - /** DatabaseType provider */ - provider?: (google.cloud.clouddms.v1.DatabaseProvider|keyof typeof google.cloud.clouddms.v1.DatabaseProvider|null); + /** DeleteConversionWorkspaceRequest name */ + name?: (string|null); - /** DatabaseType engine */ - engine?: (google.cloud.clouddms.v1.DatabaseEngine|keyof typeof google.cloud.clouddms.v1.DatabaseEngine|null); + /** DeleteConversionWorkspaceRequest requestId */ + requestId?: (string|null); } - /** Represents a DatabaseType. */ - class DatabaseType implements IDatabaseType { + /** Represents a DeleteConversionWorkspaceRequest. */ + class DeleteConversionWorkspaceRequest implements IDeleteConversionWorkspaceRequest { /** - * Constructs a new DatabaseType. + * Constructs a new DeleteConversionWorkspaceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.IDatabaseType); + constructor(properties?: google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest); - /** DatabaseType provider. */ - public provider: (google.cloud.clouddms.v1.DatabaseProvider|keyof typeof google.cloud.clouddms.v1.DatabaseProvider); + /** DeleteConversionWorkspaceRequest name. */ + public name: string; - /** DatabaseType engine. */ - public engine: (google.cloud.clouddms.v1.DatabaseEngine|keyof typeof google.cloud.clouddms.v1.DatabaseEngine); + /** DeleteConversionWorkspaceRequest requestId. */ + public requestId: string; /** - * Creates a new DatabaseType instance using the specified properties. + * Creates a new DeleteConversionWorkspaceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DatabaseType instance + * @returns DeleteConversionWorkspaceRequest instance */ - public static create(properties?: google.cloud.clouddms.v1.IDatabaseType): google.cloud.clouddms.v1.DatabaseType; + public static create(properties?: google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest): google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest; /** - * Encodes the specified DatabaseType message. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseType.verify|verify} messages. - * @param message DatabaseType message or plain object to encode + * Encodes the specified DeleteConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest.verify|verify} messages. + * @param message DeleteConversionWorkspaceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.IDatabaseType, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DatabaseType message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseType.verify|verify} messages. - * @param message DatabaseType message or plain object to encode + * Encodes the specified DeleteConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest.verify|verify} messages. + * @param message DeleteConversionWorkspaceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.IDatabaseType, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DatabaseType message from the specified reader or buffer. + * Decodes a DeleteConversionWorkspaceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DatabaseType + * @returns DeleteConversionWorkspaceRequest * @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.clouddms.v1.DatabaseType; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest; /** - * Decodes a DatabaseType message from the specified reader or buffer, length delimited. + * Decodes a DeleteConversionWorkspaceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DatabaseType + * @returns DeleteConversionWorkspaceRequest * @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.clouddms.v1.DatabaseType; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest; /** - * Verifies a DatabaseType message. + * Verifies a DeleteConversionWorkspaceRequest 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 DatabaseType message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DatabaseType + * @returns DeleteConversionWorkspaceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DatabaseType; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest; /** - * Creates a plain object from a DatabaseType message. Also converts values to other types if specified. - * @param message DatabaseType + * Creates a plain object from a DeleteConversionWorkspaceRequest message. Also converts values to other types if specified. + * @param message DeleteConversionWorkspaceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.DatabaseType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DatabaseType to JSON. + * Converts this DeleteConversionWorkspaceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DatabaseType + * Gets the default type url for DeleteConversionWorkspaceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a MigrationJob. */ - interface IMigrationJob { + /** Properties of a CommitConversionWorkspaceRequest. */ + interface ICommitConversionWorkspaceRequest { - /** MigrationJob name */ + /** CommitConversionWorkspaceRequest name */ name?: (string|null); - /** MigrationJob createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** CommitConversionWorkspaceRequest commitName */ + commitName?: (string|null); + } - /** MigrationJob updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** Represents a CommitConversionWorkspaceRequest. */ + class CommitConversionWorkspaceRequest implements ICommitConversionWorkspaceRequest { - /** MigrationJob labels */ - labels?: ({ [k: string]: string }|null); + /** + * Constructs a new CommitConversionWorkspaceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest); - /** MigrationJob displayName */ - displayName?: (string|null); + /** CommitConversionWorkspaceRequest name. */ + public name: string; - /** MigrationJob state */ - state?: (google.cloud.clouddms.v1.MigrationJob.State|keyof typeof google.cloud.clouddms.v1.MigrationJob.State|null); + /** CommitConversionWorkspaceRequest commitName. */ + public commitName: string; - /** MigrationJob phase */ - phase?: (google.cloud.clouddms.v1.MigrationJob.Phase|keyof typeof google.cloud.clouddms.v1.MigrationJob.Phase|null); + /** + * Creates a new CommitConversionWorkspaceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitConversionWorkspaceRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest): google.cloud.clouddms.v1.CommitConversionWorkspaceRequest; - /** MigrationJob type */ - type?: (google.cloud.clouddms.v1.MigrationJob.Type|keyof typeof google.cloud.clouddms.v1.MigrationJob.Type|null); + /** + * Encodes the specified CommitConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CommitConversionWorkspaceRequest.verify|verify} messages. + * @param message CommitConversionWorkspaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** MigrationJob dumpPath */ - dumpPath?: (string|null); + /** + * Encodes the specified CommitConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CommitConversionWorkspaceRequest.verify|verify} messages. + * @param message CommitConversionWorkspaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** MigrationJob source */ - source?: (string|null); + /** + * Decodes a CommitConversionWorkspaceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitConversionWorkspaceRequest + * @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.clouddms.v1.CommitConversionWorkspaceRequest; - /** MigrationJob destination */ - destination?: (string|null); + /** + * Decodes a CommitConversionWorkspaceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitConversionWorkspaceRequest + * @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.clouddms.v1.CommitConversionWorkspaceRequest; - /** MigrationJob reverseSshConnectivity */ - reverseSshConnectivity?: (google.cloud.clouddms.v1.IReverseSshConnectivity|null); + /** + * Verifies a CommitConversionWorkspaceRequest 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); - /** MigrationJob vpcPeeringConnectivity */ - vpcPeeringConnectivity?: (google.cloud.clouddms.v1.IVpcPeeringConnectivity|null); + /** + * Creates a CommitConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitConversionWorkspaceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.CommitConversionWorkspaceRequest; - /** MigrationJob staticIpConnectivity */ - staticIpConnectivity?: (google.cloud.clouddms.v1.IStaticIpConnectivity|null); + /** + * Creates a plain object from a CommitConversionWorkspaceRequest message. Also converts values to other types if specified. + * @param message CommitConversionWorkspaceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.CommitConversionWorkspaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** MigrationJob duration */ - duration?: (google.protobuf.IDuration|null); + /** + * Converts this CommitConversionWorkspaceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** MigrationJob error */ - error?: (google.rpc.IStatus|null); + /** + * Gets the default type url for CommitConversionWorkspaceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** MigrationJob sourceDatabase */ - sourceDatabase?: (google.cloud.clouddms.v1.IDatabaseType|null); + /** Properties of a RollbackConversionWorkspaceRequest. */ + interface IRollbackConversionWorkspaceRequest { - /** MigrationJob destinationDatabase */ - destinationDatabase?: (google.cloud.clouddms.v1.IDatabaseType|null); + /** RollbackConversionWorkspaceRequest name */ + name?: (string|null); + } - /** MigrationJob endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** Represents a RollbackConversionWorkspaceRequest. */ + class RollbackConversionWorkspaceRequest implements IRollbackConversionWorkspaceRequest { + + /** + * Constructs a new RollbackConversionWorkspaceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest); + + /** RollbackConversionWorkspaceRequest name. */ + public name: string; + + /** + * Creates a new RollbackConversionWorkspaceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackConversionWorkspaceRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest): google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest; + + /** + * Encodes the specified RollbackConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest.verify|verify} messages. + * @param message RollbackConversionWorkspaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RollbackConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest.verify|verify} messages. + * @param message RollbackConversionWorkspaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RollbackConversionWorkspaceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollbackConversionWorkspaceRequest + * @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.clouddms.v1.RollbackConversionWorkspaceRequest; + + /** + * Decodes a RollbackConversionWorkspaceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollbackConversionWorkspaceRequest + * @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.clouddms.v1.RollbackConversionWorkspaceRequest; + + /** + * Verifies a RollbackConversionWorkspaceRequest 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 RollbackConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollbackConversionWorkspaceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest; + + /** + * Creates a plain object from a RollbackConversionWorkspaceRequest message. Also converts values to other types if specified. + * @param message RollbackConversionWorkspaceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RollbackConversionWorkspaceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RollbackConversionWorkspaceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a MigrationJob. */ - class MigrationJob implements IMigrationJob { + /** Properties of an ApplyConversionWorkspaceRequest. */ + interface IApplyConversionWorkspaceRequest { + + /** ApplyConversionWorkspaceRequest name */ + name?: (string|null); + + /** ApplyConversionWorkspaceRequest filter */ + filter?: (string|null); + + /** ApplyConversionWorkspaceRequest connectionProfile */ + connectionProfile?: (string|null); + } + + /** Represents an ApplyConversionWorkspaceRequest. */ + class ApplyConversionWorkspaceRequest implements IApplyConversionWorkspaceRequest { /** - * Constructs a new MigrationJob. + * Constructs a new ApplyConversionWorkspaceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.IMigrationJob); + constructor(properties?: google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest); - /** MigrationJob name. */ + /** ApplyConversionWorkspaceRequest name. */ public name: string; - /** MigrationJob createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** ApplyConversionWorkspaceRequest filter. */ + public filter: string; - /** MigrationJob updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** ApplyConversionWorkspaceRequest connectionProfile. */ + public connectionProfile?: (string|null); - /** MigrationJob labels. */ - public labels: { [k: string]: string }; + /** ApplyConversionWorkspaceRequest destination. */ + public destination?: "connectionProfile"; - /** MigrationJob displayName. */ - public displayName: string; + /** + * Creates a new ApplyConversionWorkspaceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplyConversionWorkspaceRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest): google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest; - /** MigrationJob state. */ - public state: (google.cloud.clouddms.v1.MigrationJob.State|keyof typeof google.cloud.clouddms.v1.MigrationJob.State); + /** + * Encodes the specified ApplyConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest.verify|verify} messages. + * @param message ApplyConversionWorkspaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** MigrationJob phase. */ - public phase: (google.cloud.clouddms.v1.MigrationJob.Phase|keyof typeof google.cloud.clouddms.v1.MigrationJob.Phase); + /** + * Encodes the specified ApplyConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest.verify|verify} messages. + * @param message ApplyConversionWorkspaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** MigrationJob type. */ - public type: (google.cloud.clouddms.v1.MigrationJob.Type|keyof typeof google.cloud.clouddms.v1.MigrationJob.Type); + /** + * Decodes an ApplyConversionWorkspaceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplyConversionWorkspaceRequest + * @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.clouddms.v1.ApplyConversionWorkspaceRequest; - /** MigrationJob dumpPath. */ - public dumpPath: string; + /** + * Decodes an ApplyConversionWorkspaceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplyConversionWorkspaceRequest + * @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.clouddms.v1.ApplyConversionWorkspaceRequest; - /** MigrationJob source. */ - public source: string; + /** + * Verifies an ApplyConversionWorkspaceRequest 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 ApplyConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplyConversionWorkspaceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest; + + /** + * Creates a plain object from an ApplyConversionWorkspaceRequest message. Also converts values to other types if specified. + * @param message ApplyConversionWorkspaceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplyConversionWorkspaceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplyConversionWorkspaceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SeedConversionWorkspaceRequest. */ + interface ISeedConversionWorkspaceRequest { + + /** SeedConversionWorkspaceRequest name */ + name?: (string|null); + + /** SeedConversionWorkspaceRequest autoCommit */ + autoCommit?: (boolean|null); + + /** SeedConversionWorkspaceRequest sourceConnectionProfile */ + sourceConnectionProfile?: (string|null); + + /** SeedConversionWorkspaceRequest destinationConnectionProfile */ + destinationConnectionProfile?: (string|null); + } + + /** Represents a SeedConversionWorkspaceRequest. */ + class SeedConversionWorkspaceRequest implements ISeedConversionWorkspaceRequest { + + /** + * Constructs a new SeedConversionWorkspaceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest); + + /** SeedConversionWorkspaceRequest name. */ + public name: string; + + /** SeedConversionWorkspaceRequest autoCommit. */ + public autoCommit: boolean; + + /** SeedConversionWorkspaceRequest sourceConnectionProfile. */ + public sourceConnectionProfile?: (string|null); + + /** SeedConversionWorkspaceRequest destinationConnectionProfile. */ + public destinationConnectionProfile?: (string|null); + + /** SeedConversionWorkspaceRequest seedFrom. */ + public seedFrom?: ("sourceConnectionProfile"|"destinationConnectionProfile"); + + /** + * Creates a new SeedConversionWorkspaceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SeedConversionWorkspaceRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest): google.cloud.clouddms.v1.SeedConversionWorkspaceRequest; + + /** + * Encodes the specified SeedConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.SeedConversionWorkspaceRequest.verify|verify} messages. + * @param message SeedConversionWorkspaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SeedConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SeedConversionWorkspaceRequest.verify|verify} messages. + * @param message SeedConversionWorkspaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SeedConversionWorkspaceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SeedConversionWorkspaceRequest + * @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.clouddms.v1.SeedConversionWorkspaceRequest; + + /** + * Decodes a SeedConversionWorkspaceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SeedConversionWorkspaceRequest + * @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.clouddms.v1.SeedConversionWorkspaceRequest; + + /** + * Verifies a SeedConversionWorkspaceRequest 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 SeedConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SeedConversionWorkspaceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SeedConversionWorkspaceRequest; + + /** + * Creates a plain object from a SeedConversionWorkspaceRequest message. Also converts values to other types if specified. + * @param message SeedConversionWorkspaceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.SeedConversionWorkspaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SeedConversionWorkspaceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SeedConversionWorkspaceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConvertConversionWorkspaceRequest. */ + interface IConvertConversionWorkspaceRequest { + + /** ConvertConversionWorkspaceRequest name */ + name?: (string|null); + + /** ConvertConversionWorkspaceRequest autoCommit */ + autoCommit?: (boolean|null); + + /** ConvertConversionWorkspaceRequest filter */ + filter?: (string|null); + } + + /** Represents a ConvertConversionWorkspaceRequest. */ + class ConvertConversionWorkspaceRequest implements IConvertConversionWorkspaceRequest { + + /** + * Constructs a new ConvertConversionWorkspaceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest); + + /** ConvertConversionWorkspaceRequest name. */ + public name: string; + + /** ConvertConversionWorkspaceRequest autoCommit. */ + public autoCommit: boolean; + + /** ConvertConversionWorkspaceRequest filter. */ + public filter: string; + + /** + * Creates a new ConvertConversionWorkspaceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ConvertConversionWorkspaceRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest): google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest; + + /** + * Encodes the specified ConvertConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest.verify|verify} messages. + * @param message ConvertConversionWorkspaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConvertConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest.verify|verify} messages. + * @param message ConvertConversionWorkspaceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConvertConversionWorkspaceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConvertConversionWorkspaceRequest + * @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.clouddms.v1.ConvertConversionWorkspaceRequest; + + /** + * Decodes a ConvertConversionWorkspaceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConvertConversionWorkspaceRequest + * @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.clouddms.v1.ConvertConversionWorkspaceRequest; + + /** + * Verifies a ConvertConversionWorkspaceRequest 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 ConvertConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConvertConversionWorkspaceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest; + + /** + * Creates a plain object from a ConvertConversionWorkspaceRequest message. Also converts values to other types if specified. + * @param message ConvertConversionWorkspaceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConvertConversionWorkspaceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConvertConversionWorkspaceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportMappingRulesRequest. */ + interface IImportMappingRulesRequest { + + /** ImportMappingRulesRequest parent */ + parent?: (string|null); + + /** ImportMappingRulesRequest rulesFormat */ + rulesFormat?: (google.cloud.clouddms.v1.ImportRulesFileFormat|keyof typeof google.cloud.clouddms.v1.ImportRulesFileFormat|null); + + /** ImportMappingRulesRequest rulesFiles */ + rulesFiles?: (google.cloud.clouddms.v1.ImportMappingRulesRequest.IRulesFile[]|null); + + /** ImportMappingRulesRequest autoCommit */ + autoCommit?: (boolean|null); + } + + /** Represents an ImportMappingRulesRequest. */ + class ImportMappingRulesRequest implements IImportMappingRulesRequest { + + /** + * Constructs a new ImportMappingRulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IImportMappingRulesRequest); + + /** ImportMappingRulesRequest parent. */ + public parent: string; + + /** ImportMappingRulesRequest rulesFormat. */ + public rulesFormat: (google.cloud.clouddms.v1.ImportRulesFileFormat|keyof typeof google.cloud.clouddms.v1.ImportRulesFileFormat); + + /** ImportMappingRulesRequest rulesFiles. */ + public rulesFiles: google.cloud.clouddms.v1.ImportMappingRulesRequest.IRulesFile[]; + + /** ImportMappingRulesRequest autoCommit. */ + public autoCommit: boolean; + + /** + * Creates a new ImportMappingRulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportMappingRulesRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IImportMappingRulesRequest): google.cloud.clouddms.v1.ImportMappingRulesRequest; + + /** + * Encodes the specified ImportMappingRulesRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ImportMappingRulesRequest.verify|verify} messages. + * @param message ImportMappingRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IImportMappingRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportMappingRulesRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ImportMappingRulesRequest.verify|verify} messages. + * @param message ImportMappingRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IImportMappingRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportMappingRulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportMappingRulesRequest + * @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.clouddms.v1.ImportMappingRulesRequest; + + /** + * Decodes an ImportMappingRulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportMappingRulesRequest + * @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.clouddms.v1.ImportMappingRulesRequest; + + /** + * Verifies an ImportMappingRulesRequest 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 ImportMappingRulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportMappingRulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ImportMappingRulesRequest; + + /** + * Creates a plain object from an ImportMappingRulesRequest message. Also converts values to other types if specified. + * @param message ImportMappingRulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ImportMappingRulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportMappingRulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportMappingRulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportMappingRulesRequest { + + /** Properties of a RulesFile. */ + interface IRulesFile { + + /** RulesFile rulesSourceFilename */ + rulesSourceFilename?: (string|null); + + /** RulesFile rulesContent */ + rulesContent?: (string|null); + } + + /** Represents a RulesFile. */ + class RulesFile implements IRulesFile { + + /** + * Constructs a new RulesFile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ImportMappingRulesRequest.IRulesFile); + + /** RulesFile rulesSourceFilename. */ + public rulesSourceFilename: string; + + /** RulesFile rulesContent. */ + public rulesContent: string; + + /** + * Creates a new RulesFile instance using the specified properties. + * @param [properties] Properties to set + * @returns RulesFile instance + */ + public static create(properties?: google.cloud.clouddms.v1.ImportMappingRulesRequest.IRulesFile): google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile; + + /** + * Encodes the specified RulesFile message. Does not implicitly {@link google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile.verify|verify} messages. + * @param message RulesFile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ImportMappingRulesRequest.IRulesFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RulesFile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile.verify|verify} messages. + * @param message RulesFile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ImportMappingRulesRequest.IRulesFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RulesFile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RulesFile + * @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.clouddms.v1.ImportMappingRulesRequest.RulesFile; + + /** + * Decodes a RulesFile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RulesFile + * @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.clouddms.v1.ImportMappingRulesRequest.RulesFile; + + /** + * Verifies a RulesFile 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 RulesFile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RulesFile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile; + + /** + * Creates a plain object from a RulesFile message. Also converts values to other types if specified. + * @param message RulesFile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RulesFile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RulesFile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DescribeDatabaseEntitiesRequest. */ + interface IDescribeDatabaseEntitiesRequest { + + /** DescribeDatabaseEntitiesRequest conversionWorkspace */ + conversionWorkspace?: (string|null); + + /** DescribeDatabaseEntitiesRequest pageSize */ + pageSize?: (number|null); + + /** DescribeDatabaseEntitiesRequest pageToken */ + pageToken?: (string|null); + + /** DescribeDatabaseEntitiesRequest tree */ + tree?: (google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType|keyof typeof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType|null); + + /** DescribeDatabaseEntitiesRequest uncommitted */ + uncommitted?: (boolean|null); + + /** DescribeDatabaseEntitiesRequest commitId */ + commitId?: (string|null); + + /** DescribeDatabaseEntitiesRequest filter */ + filter?: (string|null); + } + + /** Represents a DescribeDatabaseEntitiesRequest. */ + class DescribeDatabaseEntitiesRequest implements IDescribeDatabaseEntitiesRequest { + + /** + * Constructs a new DescribeDatabaseEntitiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest); + + /** DescribeDatabaseEntitiesRequest conversionWorkspace. */ + public conversionWorkspace: string; + + /** DescribeDatabaseEntitiesRequest pageSize. */ + public pageSize: number; + + /** DescribeDatabaseEntitiesRequest pageToken. */ + public pageToken: string; + + /** DescribeDatabaseEntitiesRequest tree. */ + public tree: (google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType|keyof typeof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType); + + /** DescribeDatabaseEntitiesRequest uncommitted. */ + public uncommitted: boolean; + + /** DescribeDatabaseEntitiesRequest commitId. */ + public commitId: string; + + /** DescribeDatabaseEntitiesRequest filter. */ + public filter: string; + + /** + * Creates a new DescribeDatabaseEntitiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DescribeDatabaseEntitiesRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest): google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest; + + /** + * Encodes the specified DescribeDatabaseEntitiesRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.verify|verify} messages. + * @param message DescribeDatabaseEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescribeDatabaseEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.verify|verify} messages. + * @param message DescribeDatabaseEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescribeDatabaseEntitiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescribeDatabaseEntitiesRequest + * @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.clouddms.v1.DescribeDatabaseEntitiesRequest; + + /** + * Decodes a DescribeDatabaseEntitiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescribeDatabaseEntitiesRequest + * @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.clouddms.v1.DescribeDatabaseEntitiesRequest; + + /** + * Verifies a DescribeDatabaseEntitiesRequest 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 DescribeDatabaseEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescribeDatabaseEntitiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest; + + /** + * Creates a plain object from a DescribeDatabaseEntitiesRequest message. Also converts values to other types if specified. + * @param message DescribeDatabaseEntitiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescribeDatabaseEntitiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescribeDatabaseEntitiesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescribeDatabaseEntitiesRequest { + + /** DBTreeType enum. */ + enum DBTreeType { + DB_TREE_TYPE_UNSPECIFIED = 0, + SOURCE_TREE = 1, + DRAFT_TREE = 2, + DESTINATION_TREE = 3 + } + } + + /** Properties of a DescribeDatabaseEntitiesResponse. */ + interface IDescribeDatabaseEntitiesResponse { + + /** DescribeDatabaseEntitiesResponse databaseEntities */ + databaseEntities?: (google.cloud.clouddms.v1.IDatabaseEntity[]|null); + + /** DescribeDatabaseEntitiesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a DescribeDatabaseEntitiesResponse. */ + class DescribeDatabaseEntitiesResponse implements IDescribeDatabaseEntitiesResponse { + + /** + * Constructs a new DescribeDatabaseEntitiesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse); + + /** DescribeDatabaseEntitiesResponse databaseEntities. */ + public databaseEntities: google.cloud.clouddms.v1.IDatabaseEntity[]; + + /** DescribeDatabaseEntitiesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new DescribeDatabaseEntitiesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DescribeDatabaseEntitiesResponse instance + */ + public static create(properties?: google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse): google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse; + + /** + * Encodes the specified DescribeDatabaseEntitiesResponse message. Does not implicitly {@link google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse.verify|verify} messages. + * @param message DescribeDatabaseEntitiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescribeDatabaseEntitiesResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse.verify|verify} messages. + * @param message DescribeDatabaseEntitiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescribeDatabaseEntitiesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescribeDatabaseEntitiesResponse + * @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.clouddms.v1.DescribeDatabaseEntitiesResponse; + + /** + * Decodes a DescribeDatabaseEntitiesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescribeDatabaseEntitiesResponse + * @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.clouddms.v1.DescribeDatabaseEntitiesResponse; + + /** + * Verifies a DescribeDatabaseEntitiesResponse 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 DescribeDatabaseEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescribeDatabaseEntitiesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse; + + /** + * Creates a plain object from a DescribeDatabaseEntitiesResponse message. Also converts values to other types if specified. + * @param message DescribeDatabaseEntitiesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescribeDatabaseEntitiesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescribeDatabaseEntitiesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchBackgroundJobsRequest. */ + interface ISearchBackgroundJobsRequest { + + /** SearchBackgroundJobsRequest conversionWorkspace */ + conversionWorkspace?: (string|null); + + /** SearchBackgroundJobsRequest returnMostRecentPerJobType */ + returnMostRecentPerJobType?: (boolean|null); + + /** SearchBackgroundJobsRequest maxSize */ + maxSize?: (number|null); + + /** SearchBackgroundJobsRequest completedUntilTime */ + completedUntilTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SearchBackgroundJobsRequest. */ + class SearchBackgroundJobsRequest implements ISearchBackgroundJobsRequest { + + /** + * Constructs a new SearchBackgroundJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISearchBackgroundJobsRequest); + + /** SearchBackgroundJobsRequest conversionWorkspace. */ + public conversionWorkspace: string; + + /** SearchBackgroundJobsRequest returnMostRecentPerJobType. */ + public returnMostRecentPerJobType: boolean; + + /** SearchBackgroundJobsRequest maxSize. */ + public maxSize: number; + + /** SearchBackgroundJobsRequest completedUntilTime. */ + public completedUntilTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SearchBackgroundJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchBackgroundJobsRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.ISearchBackgroundJobsRequest): google.cloud.clouddms.v1.SearchBackgroundJobsRequest; + + /** + * Encodes the specified SearchBackgroundJobsRequest message. Does not implicitly {@link google.cloud.clouddms.v1.SearchBackgroundJobsRequest.verify|verify} messages. + * @param message SearchBackgroundJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchBackgroundJobsRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SearchBackgroundJobsRequest.verify|verify} messages. + * @param message SearchBackgroundJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchBackgroundJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchBackgroundJobsRequest + * @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.clouddms.v1.SearchBackgroundJobsRequest; + + /** + * Decodes a SearchBackgroundJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchBackgroundJobsRequest + * @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.clouddms.v1.SearchBackgroundJobsRequest; + + /** + * Verifies a SearchBackgroundJobsRequest 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 SearchBackgroundJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchBackgroundJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SearchBackgroundJobsRequest; + + /** + * Creates a plain object from a SearchBackgroundJobsRequest message. Also converts values to other types if specified. + * @param message SearchBackgroundJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.SearchBackgroundJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchBackgroundJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchBackgroundJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchBackgroundJobsResponse. */ + interface ISearchBackgroundJobsResponse { + + /** SearchBackgroundJobsResponse jobs */ + jobs?: (google.cloud.clouddms.v1.IBackgroundJobLogEntry[]|null); + } + + /** Represents a SearchBackgroundJobsResponse. */ + class SearchBackgroundJobsResponse implements ISearchBackgroundJobsResponse { + + /** + * Constructs a new SearchBackgroundJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISearchBackgroundJobsResponse); + + /** SearchBackgroundJobsResponse jobs. */ + public jobs: google.cloud.clouddms.v1.IBackgroundJobLogEntry[]; + + /** + * Creates a new SearchBackgroundJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchBackgroundJobsResponse instance + */ + public static create(properties?: google.cloud.clouddms.v1.ISearchBackgroundJobsResponse): google.cloud.clouddms.v1.SearchBackgroundJobsResponse; + + /** + * Encodes the specified SearchBackgroundJobsResponse message. Does not implicitly {@link google.cloud.clouddms.v1.SearchBackgroundJobsResponse.verify|verify} messages. + * @param message SearchBackgroundJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchBackgroundJobsResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SearchBackgroundJobsResponse.verify|verify} messages. + * @param message SearchBackgroundJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchBackgroundJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchBackgroundJobsResponse + * @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.clouddms.v1.SearchBackgroundJobsResponse; + + /** + * Decodes a SearchBackgroundJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchBackgroundJobsResponse + * @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.clouddms.v1.SearchBackgroundJobsResponse; + + /** + * Verifies a SearchBackgroundJobsResponse 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 SearchBackgroundJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchBackgroundJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SearchBackgroundJobsResponse; + + /** + * Creates a plain object from a SearchBackgroundJobsResponse message. Also converts values to other types if specified. + * @param message SearchBackgroundJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.SearchBackgroundJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchBackgroundJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchBackgroundJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescribeConversionWorkspaceRevisionsRequest. */ + interface IDescribeConversionWorkspaceRevisionsRequest { + + /** DescribeConversionWorkspaceRevisionsRequest conversionWorkspace */ + conversionWorkspace?: (string|null); + + /** DescribeConversionWorkspaceRevisionsRequest commitId */ + commitId?: (string|null); + } + + /** Represents a DescribeConversionWorkspaceRevisionsRequest. */ + class DescribeConversionWorkspaceRevisionsRequest implements IDescribeConversionWorkspaceRevisionsRequest { + + /** + * Constructs a new DescribeConversionWorkspaceRevisionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest); + + /** DescribeConversionWorkspaceRevisionsRequest conversionWorkspace. */ + public conversionWorkspace: string; + + /** DescribeConversionWorkspaceRevisionsRequest commitId. */ + public commitId: string; + + /** + * Creates a new DescribeConversionWorkspaceRevisionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DescribeConversionWorkspaceRevisionsRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest): google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest; + + /** + * Encodes the specified DescribeConversionWorkspaceRevisionsRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest.verify|verify} messages. + * @param message DescribeConversionWorkspaceRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescribeConversionWorkspaceRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest.verify|verify} messages. + * @param message DescribeConversionWorkspaceRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescribeConversionWorkspaceRevisionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescribeConversionWorkspaceRevisionsRequest + * @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.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest; + + /** + * Decodes a DescribeConversionWorkspaceRevisionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescribeConversionWorkspaceRevisionsRequest + * @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.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest; + + /** + * Verifies a DescribeConversionWorkspaceRevisionsRequest 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 DescribeConversionWorkspaceRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescribeConversionWorkspaceRevisionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest; + + /** + * Creates a plain object from a DescribeConversionWorkspaceRevisionsRequest message. Also converts values to other types if specified. + * @param message DescribeConversionWorkspaceRevisionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescribeConversionWorkspaceRevisionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescribeConversionWorkspaceRevisionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescribeConversionWorkspaceRevisionsResponse. */ + interface IDescribeConversionWorkspaceRevisionsResponse { + + /** DescribeConversionWorkspaceRevisionsResponse revisions */ + revisions?: (google.cloud.clouddms.v1.IConversionWorkspace[]|null); + } + + /** Represents a DescribeConversionWorkspaceRevisionsResponse. */ + class DescribeConversionWorkspaceRevisionsResponse implements IDescribeConversionWorkspaceRevisionsResponse { + + /** + * Constructs a new DescribeConversionWorkspaceRevisionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse); + + /** DescribeConversionWorkspaceRevisionsResponse revisions. */ + public revisions: google.cloud.clouddms.v1.IConversionWorkspace[]; + + /** + * Creates a new DescribeConversionWorkspaceRevisionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DescribeConversionWorkspaceRevisionsResponse instance + */ + public static create(properties?: google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse): google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse; + + /** + * Encodes the specified DescribeConversionWorkspaceRevisionsResponse message. Does not implicitly {@link google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse.verify|verify} messages. + * @param message DescribeConversionWorkspaceRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescribeConversionWorkspaceRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse.verify|verify} messages. + * @param message DescribeConversionWorkspaceRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescribeConversionWorkspaceRevisionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescribeConversionWorkspaceRevisionsResponse + * @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.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse; + + /** + * Decodes a DescribeConversionWorkspaceRevisionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescribeConversionWorkspaceRevisionsResponse + * @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.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse; + + /** + * Verifies a DescribeConversionWorkspaceRevisionsResponse 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 DescribeConversionWorkspaceRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescribeConversionWorkspaceRevisionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse; + + /** + * Creates a plain object from a DescribeConversionWorkspaceRevisionsResponse message. Also converts values to other types if specified. + * @param message DescribeConversionWorkspaceRevisionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescribeConversionWorkspaceRevisionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescribeConversionWorkspaceRevisionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchStaticIpsRequest. */ + interface IFetchStaticIpsRequest { + + /** FetchStaticIpsRequest name */ + name?: (string|null); + + /** FetchStaticIpsRequest pageSize */ + pageSize?: (number|null); + + /** FetchStaticIpsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a FetchStaticIpsRequest. */ + class FetchStaticIpsRequest implements IFetchStaticIpsRequest { + + /** + * Constructs a new FetchStaticIpsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IFetchStaticIpsRequest); + + /** FetchStaticIpsRequest name. */ + public name: string; + + /** FetchStaticIpsRequest pageSize. */ + public pageSize: number; + + /** FetchStaticIpsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new FetchStaticIpsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchStaticIpsRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IFetchStaticIpsRequest): google.cloud.clouddms.v1.FetchStaticIpsRequest; + + /** + * Encodes the specified FetchStaticIpsRequest message. Does not implicitly {@link google.cloud.clouddms.v1.FetchStaticIpsRequest.verify|verify} messages. + * @param message FetchStaticIpsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IFetchStaticIpsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchStaticIpsRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.FetchStaticIpsRequest.verify|verify} messages. + * @param message FetchStaticIpsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IFetchStaticIpsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchStaticIpsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchStaticIpsRequest + * @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.clouddms.v1.FetchStaticIpsRequest; + + /** + * Decodes a FetchStaticIpsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchStaticIpsRequest + * @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.clouddms.v1.FetchStaticIpsRequest; + + /** + * Verifies a FetchStaticIpsRequest 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 FetchStaticIpsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchStaticIpsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.FetchStaticIpsRequest; + + /** + * Creates a plain object from a FetchStaticIpsRequest message. Also converts values to other types if specified. + * @param message FetchStaticIpsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.FetchStaticIpsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchStaticIpsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchStaticIpsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchStaticIpsResponse. */ + interface IFetchStaticIpsResponse { + + /** FetchStaticIpsResponse staticIps */ + staticIps?: (string[]|null); + + /** FetchStaticIpsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a FetchStaticIpsResponse. */ + class FetchStaticIpsResponse implements IFetchStaticIpsResponse { + + /** + * Constructs a new FetchStaticIpsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IFetchStaticIpsResponse); + + /** FetchStaticIpsResponse staticIps. */ + public staticIps: string[]; + + /** FetchStaticIpsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new FetchStaticIpsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchStaticIpsResponse instance + */ + public static create(properties?: google.cloud.clouddms.v1.IFetchStaticIpsResponse): google.cloud.clouddms.v1.FetchStaticIpsResponse; + + /** + * Encodes the specified FetchStaticIpsResponse message. Does not implicitly {@link google.cloud.clouddms.v1.FetchStaticIpsResponse.verify|verify} messages. + * @param message FetchStaticIpsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IFetchStaticIpsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchStaticIpsResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.FetchStaticIpsResponse.verify|verify} messages. + * @param message FetchStaticIpsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IFetchStaticIpsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchStaticIpsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchStaticIpsResponse + * @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.clouddms.v1.FetchStaticIpsResponse; + + /** + * Decodes a FetchStaticIpsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchStaticIpsResponse + * @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.clouddms.v1.FetchStaticIpsResponse; + + /** + * Verifies a FetchStaticIpsResponse 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 FetchStaticIpsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchStaticIpsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.FetchStaticIpsResponse; + + /** + * Creates a plain object from a FetchStaticIpsResponse message. Also converts values to other types if specified. + * @param message FetchStaticIpsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.FetchStaticIpsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchStaticIpsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchStaticIpsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SslConfig. */ + interface ISslConfig { + + /** SslConfig type */ + type?: (google.cloud.clouddms.v1.SslConfig.SslType|keyof typeof google.cloud.clouddms.v1.SslConfig.SslType|null); + + /** SslConfig clientKey */ + clientKey?: (string|null); + + /** SslConfig clientCertificate */ + clientCertificate?: (string|null); + + /** SslConfig caCertificate */ + caCertificate?: (string|null); + } + + /** Represents a SslConfig. */ + class SslConfig implements ISslConfig { + + /** + * Constructs a new SslConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISslConfig); + + /** SslConfig type. */ + public type: (google.cloud.clouddms.v1.SslConfig.SslType|keyof typeof google.cloud.clouddms.v1.SslConfig.SslType); + + /** SslConfig clientKey. */ + public clientKey: string; + + /** SslConfig clientCertificate. */ + public clientCertificate: string; + + /** SslConfig caCertificate. */ + public caCertificate: string; + + /** + * Creates a new SslConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SslConfig instance + */ + public static create(properties?: google.cloud.clouddms.v1.ISslConfig): google.cloud.clouddms.v1.SslConfig; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.clouddms.v1.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslConfig + * @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.clouddms.v1.SslConfig; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslConfig + * @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.clouddms.v1.SslConfig; + + /** + * Verifies a SslConfig 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 SslConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SslConfig; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @param message SslConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SslConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SslConfig { + + /** SslType enum. */ + enum SslType { + SSL_TYPE_UNSPECIFIED = 0, + SERVER_ONLY = 1, + SERVER_CLIENT = 2 + } + } + + /** Properties of a MySqlConnectionProfile. */ + interface IMySqlConnectionProfile { + + /** MySqlConnectionProfile host */ + host?: (string|null); + + /** MySqlConnectionProfile port */ + port?: (number|null); + + /** MySqlConnectionProfile username */ + username?: (string|null); + + /** MySqlConnectionProfile password */ + password?: (string|null); + + /** MySqlConnectionProfile passwordSet */ + passwordSet?: (boolean|null); + + /** MySqlConnectionProfile ssl */ + ssl?: (google.cloud.clouddms.v1.ISslConfig|null); + + /** MySqlConnectionProfile cloudSqlId */ + cloudSqlId?: (string|null); + } + + /** Represents a MySqlConnectionProfile. */ + class MySqlConnectionProfile implements IMySqlConnectionProfile { + + /** + * Constructs a new MySqlConnectionProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IMySqlConnectionProfile); + + /** MySqlConnectionProfile host. */ + public host: string; + + /** MySqlConnectionProfile port. */ + public port: number; + + /** MySqlConnectionProfile username. */ + public username: string; + + /** MySqlConnectionProfile password. */ + public password: string; + + /** MySqlConnectionProfile passwordSet. */ + public passwordSet: boolean; + + /** MySqlConnectionProfile ssl. */ + public ssl?: (google.cloud.clouddms.v1.ISslConfig|null); + + /** MySqlConnectionProfile cloudSqlId. */ + public cloudSqlId: string; + + /** + * Creates a new MySqlConnectionProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns MySqlConnectionProfile instance + */ + public static create(properties?: google.cloud.clouddms.v1.IMySqlConnectionProfile): google.cloud.clouddms.v1.MySqlConnectionProfile; + + /** + * Encodes the specified MySqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.MySqlConnectionProfile.verify|verify} messages. + * @param message MySqlConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IMySqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MySqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MySqlConnectionProfile.verify|verify} messages. + * @param message MySqlConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IMySqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MySqlConnectionProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MySqlConnectionProfile + * @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.clouddms.v1.MySqlConnectionProfile; + + /** + * Decodes a MySqlConnectionProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MySqlConnectionProfile + * @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.clouddms.v1.MySqlConnectionProfile; + + /** + * Verifies a MySqlConnectionProfile 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 MySqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MySqlConnectionProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.MySqlConnectionProfile; + + /** + * Creates a plain object from a MySqlConnectionProfile message. Also converts values to other types if specified. + * @param message MySqlConnectionProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.MySqlConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MySqlConnectionProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MySqlConnectionProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NetworkArchitecture enum. */ + enum NetworkArchitecture { + NETWORK_ARCHITECTURE_UNSPECIFIED = 0, + NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER = 1, + NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER = 2 + } + + /** Properties of a PostgreSqlConnectionProfile. */ + interface IPostgreSqlConnectionProfile { + + /** PostgreSqlConnectionProfile host */ + host?: (string|null); + + /** PostgreSqlConnectionProfile port */ + port?: (number|null); + + /** PostgreSqlConnectionProfile username */ + username?: (string|null); + + /** PostgreSqlConnectionProfile password */ + password?: (string|null); + + /** PostgreSqlConnectionProfile passwordSet */ + passwordSet?: (boolean|null); + + /** PostgreSqlConnectionProfile ssl */ + ssl?: (google.cloud.clouddms.v1.ISslConfig|null); + + /** PostgreSqlConnectionProfile cloudSqlId */ + cloudSqlId?: (string|null); + + /** PostgreSqlConnectionProfile networkArchitecture */ + networkArchitecture?: (google.cloud.clouddms.v1.NetworkArchitecture|keyof typeof google.cloud.clouddms.v1.NetworkArchitecture|null); + + /** PostgreSqlConnectionProfile staticIpConnectivity */ + staticIpConnectivity?: (google.cloud.clouddms.v1.IStaticIpConnectivity|null); + + /** PostgreSqlConnectionProfile privateServiceConnectConnectivity */ + privateServiceConnectConnectivity?: (google.cloud.clouddms.v1.IPrivateServiceConnectConnectivity|null); + } + + /** Represents a PostgreSqlConnectionProfile. */ + class PostgreSqlConnectionProfile implements IPostgreSqlConnectionProfile { + + /** + * Constructs a new PostgreSqlConnectionProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IPostgreSqlConnectionProfile); + + /** PostgreSqlConnectionProfile host. */ + public host: string; + + /** PostgreSqlConnectionProfile port. */ + public port: number; + + /** PostgreSqlConnectionProfile username. */ + public username: string; + + /** PostgreSqlConnectionProfile password. */ + public password: string; + + /** PostgreSqlConnectionProfile passwordSet. */ + public passwordSet: boolean; + + /** PostgreSqlConnectionProfile ssl. */ + public ssl?: (google.cloud.clouddms.v1.ISslConfig|null); + + /** PostgreSqlConnectionProfile cloudSqlId. */ + public cloudSqlId: string; + + /** PostgreSqlConnectionProfile networkArchitecture. */ + public networkArchitecture: (google.cloud.clouddms.v1.NetworkArchitecture|keyof typeof google.cloud.clouddms.v1.NetworkArchitecture); + + /** PostgreSqlConnectionProfile staticIpConnectivity. */ + public staticIpConnectivity?: (google.cloud.clouddms.v1.IStaticIpConnectivity|null); + + /** PostgreSqlConnectionProfile privateServiceConnectConnectivity. */ + public privateServiceConnectConnectivity?: (google.cloud.clouddms.v1.IPrivateServiceConnectConnectivity|null); + + /** PostgreSqlConnectionProfile connectivity. */ + public connectivity?: ("staticIpConnectivity"|"privateServiceConnectConnectivity"); + + /** + * Creates a new PostgreSqlConnectionProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns PostgreSqlConnectionProfile instance + */ + public static create(properties?: google.cloud.clouddms.v1.IPostgreSqlConnectionProfile): google.cloud.clouddms.v1.PostgreSqlConnectionProfile; + + /** + * Encodes the specified PostgreSqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify|verify} messages. + * @param message PostgreSqlConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IPostgreSqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PostgreSqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify|verify} messages. + * @param message PostgreSqlConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IPostgreSqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PostgreSqlConnectionProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PostgreSqlConnectionProfile + * @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.clouddms.v1.PostgreSqlConnectionProfile; + + /** + * Decodes a PostgreSqlConnectionProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PostgreSqlConnectionProfile + * @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.clouddms.v1.PostgreSqlConnectionProfile; + + /** + * Verifies a PostgreSqlConnectionProfile 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 PostgreSqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PostgreSqlConnectionProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.PostgreSqlConnectionProfile; + + /** + * Creates a plain object from a PostgreSqlConnectionProfile message. Also converts values to other types if specified. + * @param message PostgreSqlConnectionProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.PostgreSqlConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PostgreSqlConnectionProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PostgreSqlConnectionProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OracleConnectionProfile. */ + interface IOracleConnectionProfile { + + /** OracleConnectionProfile host */ + host?: (string|null); + + /** OracleConnectionProfile port */ + port?: (number|null); + + /** OracleConnectionProfile username */ + username?: (string|null); + + /** OracleConnectionProfile password */ + password?: (string|null); + + /** OracleConnectionProfile passwordSet */ + passwordSet?: (boolean|null); + + /** OracleConnectionProfile databaseService */ + databaseService?: (string|null); + + /** OracleConnectionProfile staticServiceIpConnectivity */ + staticServiceIpConnectivity?: (google.cloud.clouddms.v1.IStaticServiceIpConnectivity|null); + + /** OracleConnectionProfile forwardSshConnectivity */ + forwardSshConnectivity?: (google.cloud.clouddms.v1.IForwardSshTunnelConnectivity|null); + + /** OracleConnectionProfile privateConnectivity */ + privateConnectivity?: (google.cloud.clouddms.v1.IPrivateConnectivity|null); + } + + /** Represents an OracleConnectionProfile. */ + class OracleConnectionProfile implements IOracleConnectionProfile { + + /** + * Constructs a new OracleConnectionProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IOracleConnectionProfile); + + /** OracleConnectionProfile host. */ + public host: string; + + /** OracleConnectionProfile port. */ + public port: number; + + /** OracleConnectionProfile username. */ + public username: string; + + /** OracleConnectionProfile password. */ + public password: string; + + /** OracleConnectionProfile passwordSet. */ + public passwordSet: boolean; + + /** OracleConnectionProfile databaseService. */ + public databaseService: string; + + /** OracleConnectionProfile staticServiceIpConnectivity. */ + public staticServiceIpConnectivity?: (google.cloud.clouddms.v1.IStaticServiceIpConnectivity|null); + + /** OracleConnectionProfile forwardSshConnectivity. */ + public forwardSshConnectivity?: (google.cloud.clouddms.v1.IForwardSshTunnelConnectivity|null); + + /** OracleConnectionProfile privateConnectivity. */ + public privateConnectivity?: (google.cloud.clouddms.v1.IPrivateConnectivity|null); + + /** OracleConnectionProfile connectivity. */ + public connectivity?: ("staticServiceIpConnectivity"|"forwardSshConnectivity"|"privateConnectivity"); + + /** + * Creates a new OracleConnectionProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns OracleConnectionProfile instance + */ + public static create(properties?: google.cloud.clouddms.v1.IOracleConnectionProfile): google.cloud.clouddms.v1.OracleConnectionProfile; + + /** + * Encodes the specified OracleConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.OracleConnectionProfile.verify|verify} messages. + * @param message OracleConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IOracleConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OracleConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.OracleConnectionProfile.verify|verify} messages. + * @param message OracleConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IOracleConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OracleConnectionProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OracleConnectionProfile + * @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.clouddms.v1.OracleConnectionProfile; + + /** + * Decodes an OracleConnectionProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OracleConnectionProfile + * @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.clouddms.v1.OracleConnectionProfile; + + /** + * Verifies an OracleConnectionProfile 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 OracleConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OracleConnectionProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.OracleConnectionProfile; + + /** + * Creates a plain object from an OracleConnectionProfile message. Also converts values to other types if specified. + * @param message OracleConnectionProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.OracleConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OracleConnectionProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OracleConnectionProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudSqlConnectionProfile. */ + interface ICloudSqlConnectionProfile { + + /** CloudSqlConnectionProfile cloudSqlId */ + cloudSqlId?: (string|null); + + /** CloudSqlConnectionProfile settings */ + settings?: (google.cloud.clouddms.v1.ICloudSqlSettings|null); + + /** CloudSqlConnectionProfile privateIp */ + privateIp?: (string|null); + + /** CloudSqlConnectionProfile publicIp */ + publicIp?: (string|null); + + /** CloudSqlConnectionProfile additionalPublicIp */ + additionalPublicIp?: (string|null); + } + + /** Represents a CloudSqlConnectionProfile. */ + class CloudSqlConnectionProfile implements ICloudSqlConnectionProfile { + + /** + * Constructs a new CloudSqlConnectionProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ICloudSqlConnectionProfile); + + /** CloudSqlConnectionProfile cloudSqlId. */ + public cloudSqlId: string; + + /** CloudSqlConnectionProfile settings. */ + public settings?: (google.cloud.clouddms.v1.ICloudSqlSettings|null); + + /** CloudSqlConnectionProfile privateIp. */ + public privateIp: string; + + /** CloudSqlConnectionProfile publicIp. */ + public publicIp: string; + + /** CloudSqlConnectionProfile additionalPublicIp. */ + public additionalPublicIp: string; + + /** + * Creates a new CloudSqlConnectionProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSqlConnectionProfile instance + */ + public static create(properties?: google.cloud.clouddms.v1.ICloudSqlConnectionProfile): google.cloud.clouddms.v1.CloudSqlConnectionProfile; + + /** + * Encodes the specified CloudSqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify|verify} messages. + * @param message CloudSqlConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ICloudSqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify|verify} messages. + * @param message CloudSqlConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ICloudSqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSqlConnectionProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSqlConnectionProfile + * @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.clouddms.v1.CloudSqlConnectionProfile; + + /** + * Decodes a CloudSqlConnectionProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSqlConnectionProfile + * @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.clouddms.v1.CloudSqlConnectionProfile; + + /** + * Verifies a CloudSqlConnectionProfile 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 CloudSqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSqlConnectionProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.CloudSqlConnectionProfile; + + /** + * Creates a plain object from a CloudSqlConnectionProfile message. Also converts values to other types if specified. + * @param message CloudSqlConnectionProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.CloudSqlConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSqlConnectionProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSqlConnectionProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AlloyDbConnectionProfile. */ + interface IAlloyDbConnectionProfile { + + /** AlloyDbConnectionProfile clusterId */ + clusterId?: (string|null); + + /** AlloyDbConnectionProfile settings */ + settings?: (google.cloud.clouddms.v1.IAlloyDbSettings|null); + } + + /** Represents an AlloyDbConnectionProfile. */ + class AlloyDbConnectionProfile implements IAlloyDbConnectionProfile { + + /** + * Constructs a new AlloyDbConnectionProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IAlloyDbConnectionProfile); + + /** AlloyDbConnectionProfile clusterId. */ + public clusterId: string; + + /** AlloyDbConnectionProfile settings. */ + public settings?: (google.cloud.clouddms.v1.IAlloyDbSettings|null); + + /** + * Creates a new AlloyDbConnectionProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns AlloyDbConnectionProfile instance + */ + public static create(properties?: google.cloud.clouddms.v1.IAlloyDbConnectionProfile): google.cloud.clouddms.v1.AlloyDbConnectionProfile; + + /** + * Encodes the specified AlloyDbConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbConnectionProfile.verify|verify} messages. + * @param message AlloyDbConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IAlloyDbConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AlloyDbConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbConnectionProfile.verify|verify} messages. + * @param message AlloyDbConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IAlloyDbConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AlloyDbConnectionProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AlloyDbConnectionProfile + * @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.clouddms.v1.AlloyDbConnectionProfile; + + /** + * Decodes an AlloyDbConnectionProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AlloyDbConnectionProfile + * @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.clouddms.v1.AlloyDbConnectionProfile; + + /** + * Verifies an AlloyDbConnectionProfile 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 AlloyDbConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AlloyDbConnectionProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.AlloyDbConnectionProfile; + + /** + * Creates a plain object from an AlloyDbConnectionProfile message. Also converts values to other types if specified. + * @param message AlloyDbConnectionProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.AlloyDbConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AlloyDbConnectionProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AlloyDbConnectionProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlAclEntry. */ + interface ISqlAclEntry { + + /** SqlAclEntry value */ + value?: (string|null); + + /** SqlAclEntry expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** SqlAclEntry ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** SqlAclEntry label */ + label?: (string|null); + } + + /** Represents a SqlAclEntry. */ + class SqlAclEntry implements ISqlAclEntry { + + /** + * Constructs a new SqlAclEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISqlAclEntry); + + /** SqlAclEntry value. */ + public value: string; + + /** SqlAclEntry expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** SqlAclEntry ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** SqlAclEntry label. */ + public label: string; + + /** SqlAclEntry expiration. */ + public expiration?: ("expireTime"|"ttl"); + + /** + * Creates a new SqlAclEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlAclEntry instance + */ + public static create(properties?: google.cloud.clouddms.v1.ISqlAclEntry): google.cloud.clouddms.v1.SqlAclEntry; + + /** + * Encodes the specified SqlAclEntry message. Does not implicitly {@link google.cloud.clouddms.v1.SqlAclEntry.verify|verify} messages. + * @param message SqlAclEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ISqlAclEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlAclEntry message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SqlAclEntry.verify|verify} messages. + * @param message SqlAclEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ISqlAclEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlAclEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlAclEntry + * @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.clouddms.v1.SqlAclEntry; + + /** + * Decodes a SqlAclEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlAclEntry + * @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.clouddms.v1.SqlAclEntry; + + /** + * Verifies a SqlAclEntry 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 SqlAclEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlAclEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SqlAclEntry; + + /** + * Creates a plain object from a SqlAclEntry message. Also converts values to other types if specified. + * @param message SqlAclEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.SqlAclEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlAclEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlAclEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlIpConfig. */ + interface ISqlIpConfig { + + /** SqlIpConfig enableIpv4 */ + enableIpv4?: (google.protobuf.IBoolValue|null); + + /** SqlIpConfig privateNetwork */ + privateNetwork?: (string|null); + + /** SqlIpConfig allocatedIpRange */ + allocatedIpRange?: (string|null); + + /** SqlIpConfig requireSsl */ + requireSsl?: (google.protobuf.IBoolValue|null); + + /** SqlIpConfig authorizedNetworks */ + authorizedNetworks?: (google.cloud.clouddms.v1.ISqlAclEntry[]|null); + } + + /** Represents a SqlIpConfig. */ + class SqlIpConfig implements ISqlIpConfig { + + /** + * Constructs a new SqlIpConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISqlIpConfig); + + /** SqlIpConfig enableIpv4. */ + public enableIpv4?: (google.protobuf.IBoolValue|null); + + /** SqlIpConfig privateNetwork. */ + public privateNetwork: string; + + /** SqlIpConfig allocatedIpRange. */ + public allocatedIpRange: string; + + /** SqlIpConfig requireSsl. */ + public requireSsl?: (google.protobuf.IBoolValue|null); + + /** SqlIpConfig authorizedNetworks. */ + public authorizedNetworks: google.cloud.clouddms.v1.ISqlAclEntry[]; + + /** + * Creates a new SqlIpConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlIpConfig instance + */ + public static create(properties?: google.cloud.clouddms.v1.ISqlIpConfig): google.cloud.clouddms.v1.SqlIpConfig; + + /** + * Encodes the specified SqlIpConfig message. Does not implicitly {@link google.cloud.clouddms.v1.SqlIpConfig.verify|verify} messages. + * @param message SqlIpConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ISqlIpConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlIpConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SqlIpConfig.verify|verify} messages. + * @param message SqlIpConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ISqlIpConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlIpConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlIpConfig + * @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.clouddms.v1.SqlIpConfig; + + /** + * Decodes a SqlIpConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlIpConfig + * @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.clouddms.v1.SqlIpConfig; + + /** + * Verifies a SqlIpConfig 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 SqlIpConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlIpConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SqlIpConfig; + + /** + * Creates a plain object from a SqlIpConfig message. Also converts values to other types if specified. + * @param message SqlIpConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.SqlIpConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlIpConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlIpConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudSqlSettings. */ + interface ICloudSqlSettings { + + /** CloudSqlSettings databaseVersion */ + databaseVersion?: (google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion|null); + + /** CloudSqlSettings userLabels */ + userLabels?: ({ [k: string]: string }|null); + + /** CloudSqlSettings tier */ + tier?: (string|null); + + /** CloudSqlSettings storageAutoResizeLimit */ + storageAutoResizeLimit?: (google.protobuf.IInt64Value|null); + + /** CloudSqlSettings activationPolicy */ + activationPolicy?: (google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy|null); + + /** CloudSqlSettings ipConfig */ + ipConfig?: (google.cloud.clouddms.v1.ISqlIpConfig|null); + + /** CloudSqlSettings autoStorageIncrease */ + autoStorageIncrease?: (google.protobuf.IBoolValue|null); + + /** CloudSqlSettings databaseFlags */ + databaseFlags?: ({ [k: string]: string }|null); + + /** CloudSqlSettings dataDiskType */ + dataDiskType?: (google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType|null); + + /** CloudSqlSettings dataDiskSizeGb */ + dataDiskSizeGb?: (google.protobuf.IInt64Value|null); + + /** CloudSqlSettings zone */ + zone?: (string|null); + + /** CloudSqlSettings secondaryZone */ + secondaryZone?: (string|null); + + /** CloudSqlSettings sourceId */ + sourceId?: (string|null); + + /** CloudSqlSettings rootPassword */ + rootPassword?: (string|null); + + /** CloudSqlSettings rootPasswordSet */ + rootPasswordSet?: (boolean|null); + + /** CloudSqlSettings collation */ + collation?: (string|null); + + /** CloudSqlSettings cmekKeyName */ + cmekKeyName?: (string|null); + + /** CloudSqlSettings availabilityType */ + availabilityType?: (google.cloud.clouddms.v1.CloudSqlSettings.SqlAvailabilityType|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlAvailabilityType|null); + } + + /** Represents a CloudSqlSettings. */ + class CloudSqlSettings implements ICloudSqlSettings { + + /** + * Constructs a new CloudSqlSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ICloudSqlSettings); + + /** CloudSqlSettings databaseVersion. */ + public databaseVersion: (google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion); + + /** CloudSqlSettings userLabels. */ + public userLabels: { [k: string]: string }; + + /** CloudSqlSettings tier. */ + public tier: string; + + /** CloudSqlSettings storageAutoResizeLimit. */ + public storageAutoResizeLimit?: (google.protobuf.IInt64Value|null); + + /** CloudSqlSettings activationPolicy. */ + public activationPolicy: (google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy); + + /** CloudSqlSettings ipConfig. */ + public ipConfig?: (google.cloud.clouddms.v1.ISqlIpConfig|null); + + /** CloudSqlSettings autoStorageIncrease. */ + public autoStorageIncrease?: (google.protobuf.IBoolValue|null); + + /** CloudSqlSettings databaseFlags. */ + public databaseFlags: { [k: string]: string }; + + /** CloudSqlSettings dataDiskType. */ + public dataDiskType: (google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType); + + /** CloudSqlSettings dataDiskSizeGb. */ + public dataDiskSizeGb?: (google.protobuf.IInt64Value|null); + + /** CloudSqlSettings zone. */ + public zone: string; + + /** CloudSqlSettings secondaryZone. */ + public secondaryZone: string; + + /** CloudSqlSettings sourceId. */ + public sourceId: string; + + /** CloudSqlSettings rootPassword. */ + public rootPassword: string; + + /** CloudSqlSettings rootPasswordSet. */ + public rootPasswordSet: boolean; + + /** CloudSqlSettings collation. */ + public collation: string; + + /** CloudSqlSettings cmekKeyName. */ + public cmekKeyName: string; + + /** CloudSqlSettings availabilityType. */ + public availabilityType: (google.cloud.clouddms.v1.CloudSqlSettings.SqlAvailabilityType|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlAvailabilityType); + + /** + * Creates a new CloudSqlSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSqlSettings instance + */ + public static create(properties?: google.cloud.clouddms.v1.ICloudSqlSettings): google.cloud.clouddms.v1.CloudSqlSettings; + + /** + * Encodes the specified CloudSqlSettings message. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlSettings.verify|verify} messages. + * @param message CloudSqlSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ICloudSqlSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSqlSettings message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlSettings.verify|verify} messages. + * @param message CloudSqlSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ICloudSqlSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSqlSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSqlSettings + * @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.clouddms.v1.CloudSqlSettings; + + /** + * Decodes a CloudSqlSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSqlSettings + * @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.clouddms.v1.CloudSqlSettings; + + /** + * Verifies a CloudSqlSettings 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 CloudSqlSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSqlSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.CloudSqlSettings; + + /** + * Creates a plain object from a CloudSqlSettings message. Also converts values to other types if specified. + * @param message CloudSqlSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.CloudSqlSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSqlSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSqlSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloudSqlSettings { + + /** SqlActivationPolicy enum. */ + enum SqlActivationPolicy { + SQL_ACTIVATION_POLICY_UNSPECIFIED = 0, + ALWAYS = 1, + NEVER = 2 + } + + /** SqlDataDiskType enum. */ + enum SqlDataDiskType { + SQL_DATA_DISK_TYPE_UNSPECIFIED = 0, + PD_SSD = 1, + PD_HDD = 2 + } + + /** SqlDatabaseVersion enum. */ + enum SqlDatabaseVersion { + SQL_DATABASE_VERSION_UNSPECIFIED = 0, + MYSQL_5_6 = 1, + MYSQL_5_7 = 2, + POSTGRES_9_6 = 3, + POSTGRES_11 = 4, + POSTGRES_10 = 5, + MYSQL_8_0 = 6, + POSTGRES_12 = 7, + POSTGRES_13 = 8, + POSTGRES_14 = 17 + } + + /** SqlAvailabilityType enum. */ + enum SqlAvailabilityType { + SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0, + ZONAL = 1, + REGIONAL = 2 + } + } + + /** Properties of an AlloyDbSettings. */ + interface IAlloyDbSettings { + + /** AlloyDbSettings initialUser */ + initialUser?: (google.cloud.clouddms.v1.AlloyDbSettings.IUserPassword|null); + + /** AlloyDbSettings vpcNetwork */ + vpcNetwork?: (string|null); + + /** AlloyDbSettings labels */ + labels?: ({ [k: string]: string }|null); + + /** AlloyDbSettings primaryInstanceSettings */ + primaryInstanceSettings?: (google.cloud.clouddms.v1.AlloyDbSettings.IPrimaryInstanceSettings|null); + + /** AlloyDbSettings encryptionConfig */ + encryptionConfig?: (google.cloud.clouddms.v1.AlloyDbSettings.IEncryptionConfig|null); + } + + /** Represents an AlloyDbSettings. */ + class AlloyDbSettings implements IAlloyDbSettings { + + /** + * Constructs a new AlloyDbSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IAlloyDbSettings); + + /** AlloyDbSettings initialUser. */ + public initialUser?: (google.cloud.clouddms.v1.AlloyDbSettings.IUserPassword|null); + + /** AlloyDbSettings vpcNetwork. */ + public vpcNetwork: string; + + /** AlloyDbSettings labels. */ + public labels: { [k: string]: string }; + + /** AlloyDbSettings primaryInstanceSettings. */ + public primaryInstanceSettings?: (google.cloud.clouddms.v1.AlloyDbSettings.IPrimaryInstanceSettings|null); + + /** AlloyDbSettings encryptionConfig. */ + public encryptionConfig?: (google.cloud.clouddms.v1.AlloyDbSettings.IEncryptionConfig|null); + + /** + * Creates a new AlloyDbSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AlloyDbSettings instance + */ + public static create(properties?: google.cloud.clouddms.v1.IAlloyDbSettings): google.cloud.clouddms.v1.AlloyDbSettings; + + /** + * Encodes the specified AlloyDbSettings message. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.verify|verify} messages. + * @param message AlloyDbSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IAlloyDbSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AlloyDbSettings message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.verify|verify} messages. + * @param message AlloyDbSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IAlloyDbSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AlloyDbSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AlloyDbSettings + * @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.clouddms.v1.AlloyDbSettings; + + /** + * Decodes an AlloyDbSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AlloyDbSettings + * @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.clouddms.v1.AlloyDbSettings; + + /** + * Verifies an AlloyDbSettings 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 AlloyDbSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AlloyDbSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.AlloyDbSettings; + + /** + * Creates a plain object from an AlloyDbSettings message. Also converts values to other types if specified. + * @param message AlloyDbSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.AlloyDbSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AlloyDbSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AlloyDbSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AlloyDbSettings { + + /** Properties of a UserPassword. */ + interface IUserPassword { + + /** UserPassword user */ + user?: (string|null); + + /** UserPassword password */ + password?: (string|null); + + /** UserPassword passwordSet */ + passwordSet?: (boolean|null); + } + + /** Represents a UserPassword. */ + class UserPassword implements IUserPassword { + + /** + * Constructs a new UserPassword. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.AlloyDbSettings.IUserPassword); + + /** UserPassword user. */ + public user: string; + + /** UserPassword password. */ + public password: string; + + /** UserPassword passwordSet. */ + public passwordSet: boolean; + + /** + * Creates a new UserPassword instance using the specified properties. + * @param [properties] Properties to set + * @returns UserPassword instance + */ + public static create(properties?: google.cloud.clouddms.v1.AlloyDbSettings.IUserPassword): google.cloud.clouddms.v1.AlloyDbSettings.UserPassword; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.AlloyDbSettings.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.AlloyDbSettings.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserPassword + * @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.clouddms.v1.AlloyDbSettings.UserPassword; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserPassword + * @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.clouddms.v1.AlloyDbSettings.UserPassword; + + /** + * Verifies a UserPassword 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 UserPassword message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserPassword + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.AlloyDbSettings.UserPassword; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @param message UserPassword + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.AlloyDbSettings.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserPassword to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserPassword + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrimaryInstanceSettings. */ + interface IPrimaryInstanceSettings { + + /** PrimaryInstanceSettings id */ + id?: (string|null); + + /** PrimaryInstanceSettings machineConfig */ + machineConfig?: (google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.IMachineConfig|null); + + /** PrimaryInstanceSettings databaseFlags */ + databaseFlags?: ({ [k: string]: string }|null); + + /** PrimaryInstanceSettings labels */ + labels?: ({ [k: string]: string }|null); + + /** PrimaryInstanceSettings privateIp */ + privateIp?: (string|null); + } + + /** Represents a PrimaryInstanceSettings. */ + class PrimaryInstanceSettings implements IPrimaryInstanceSettings { + + /** + * Constructs a new PrimaryInstanceSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.AlloyDbSettings.IPrimaryInstanceSettings); + + /** PrimaryInstanceSettings id. */ + public id: string; + + /** PrimaryInstanceSettings machineConfig. */ + public machineConfig?: (google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.IMachineConfig|null); + + /** PrimaryInstanceSettings databaseFlags. */ + public databaseFlags: { [k: string]: string }; + + /** PrimaryInstanceSettings labels. */ + public labels: { [k: string]: string }; + + /** PrimaryInstanceSettings privateIp. */ + public privateIp: string; + + /** + * Creates a new PrimaryInstanceSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PrimaryInstanceSettings instance + */ + public static create(properties?: google.cloud.clouddms.v1.AlloyDbSettings.IPrimaryInstanceSettings): google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings; + + /** + * Encodes the specified PrimaryInstanceSettings message. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.verify|verify} messages. + * @param message PrimaryInstanceSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.AlloyDbSettings.IPrimaryInstanceSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrimaryInstanceSettings message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.verify|verify} messages. + * @param message PrimaryInstanceSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.AlloyDbSettings.IPrimaryInstanceSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrimaryInstanceSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrimaryInstanceSettings + * @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.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings; + + /** + * Decodes a PrimaryInstanceSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrimaryInstanceSettings + * @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.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings; + + /** + * Verifies a PrimaryInstanceSettings 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 PrimaryInstanceSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrimaryInstanceSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings; + + /** + * Creates a plain object from a PrimaryInstanceSettings message. Also converts values to other types if specified. + * @param message PrimaryInstanceSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrimaryInstanceSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrimaryInstanceSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PrimaryInstanceSettings { + + /** Properties of a MachineConfig. */ + interface IMachineConfig { + + /** MachineConfig cpuCount */ + cpuCount?: (number|null); + } + + /** Represents a MachineConfig. */ + class MachineConfig implements IMachineConfig { + + /** + * Constructs a new MachineConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.IMachineConfig); + + /** MachineConfig cpuCount. */ + public cpuCount: number; + + /** + * Creates a new MachineConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MachineConfig instance + */ + public static create(properties?: google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.IMachineConfig): google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig; + + /** + * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig.verify|verify} messages. + * @param message MachineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig.verify|verify} messages. + * @param message MachineConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.IMachineConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MachineConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MachineConfig + * @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.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig; + + /** + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MachineConfig + * @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.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig; + + /** + * Verifies a MachineConfig 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 MachineConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MachineConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig; + + /** + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * @param message MachineConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MachineConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MachineConfig + * @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.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.IEncryptionConfig): google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.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 StaticIpConnectivity. */ + interface IStaticIpConnectivity { + } + + /** Represents a StaticIpConnectivity. */ + class StaticIpConnectivity implements IStaticIpConnectivity { + + /** + * Constructs a new StaticIpConnectivity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IStaticIpConnectivity); + + /** + * Creates a new StaticIpConnectivity instance using the specified properties. + * @param [properties] Properties to set + * @returns StaticIpConnectivity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IStaticIpConnectivity): google.cloud.clouddms.v1.StaticIpConnectivity; + + /** + * Encodes the specified StaticIpConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.StaticIpConnectivity.verify|verify} messages. + * @param message StaticIpConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IStaticIpConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StaticIpConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StaticIpConnectivity.verify|verify} messages. + * @param message StaticIpConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IStaticIpConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StaticIpConnectivity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StaticIpConnectivity + * @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.clouddms.v1.StaticIpConnectivity; + + /** + * Decodes a StaticIpConnectivity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StaticIpConnectivity + * @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.clouddms.v1.StaticIpConnectivity; + + /** + * Verifies a StaticIpConnectivity 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 StaticIpConnectivity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StaticIpConnectivity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.StaticIpConnectivity; + + /** + * Creates a plain object from a StaticIpConnectivity message. Also converts values to other types if specified. + * @param message StaticIpConnectivity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.StaticIpConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StaticIpConnectivity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StaticIpConnectivity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrivateServiceConnectConnectivity. */ + interface IPrivateServiceConnectConnectivity { + + /** PrivateServiceConnectConnectivity serviceAttachment */ + serviceAttachment?: (string|null); + } + + /** Represents a PrivateServiceConnectConnectivity. */ + class PrivateServiceConnectConnectivity implements IPrivateServiceConnectConnectivity { + + /** + * Constructs a new PrivateServiceConnectConnectivity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IPrivateServiceConnectConnectivity); + + /** PrivateServiceConnectConnectivity serviceAttachment. */ + public serviceAttachment: string; + + /** + * Creates a new PrivateServiceConnectConnectivity instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivateServiceConnectConnectivity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IPrivateServiceConnectConnectivity): google.cloud.clouddms.v1.PrivateServiceConnectConnectivity; + + /** + * Encodes the specified PrivateServiceConnectConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.PrivateServiceConnectConnectivity.verify|verify} messages. + * @param message PrivateServiceConnectConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IPrivateServiceConnectConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivateServiceConnectConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PrivateServiceConnectConnectivity.verify|verify} messages. + * @param message PrivateServiceConnectConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IPrivateServiceConnectConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivateServiceConnectConnectivity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivateServiceConnectConnectivity + * @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.clouddms.v1.PrivateServiceConnectConnectivity; + + /** + * Decodes a PrivateServiceConnectConnectivity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivateServiceConnectConnectivity + * @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.clouddms.v1.PrivateServiceConnectConnectivity; + + /** + * Verifies a PrivateServiceConnectConnectivity 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 PrivateServiceConnectConnectivity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivateServiceConnectConnectivity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.PrivateServiceConnectConnectivity; + + /** + * Creates a plain object from a PrivateServiceConnectConnectivity message. Also converts values to other types if specified. + * @param message PrivateServiceConnectConnectivity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.PrivateServiceConnectConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivateServiceConnectConnectivity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivateServiceConnectConnectivity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReverseSshConnectivity. */ + interface IReverseSshConnectivity { + + /** ReverseSshConnectivity vmIp */ + vmIp?: (string|null); + + /** ReverseSshConnectivity vmPort */ + vmPort?: (number|null); + + /** ReverseSshConnectivity vm */ + vm?: (string|null); + + /** ReverseSshConnectivity vpc */ + vpc?: (string|null); + } + + /** Represents a ReverseSshConnectivity. */ + class ReverseSshConnectivity implements IReverseSshConnectivity { + + /** + * Constructs a new ReverseSshConnectivity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IReverseSshConnectivity); + + /** ReverseSshConnectivity vmIp. */ + public vmIp: string; + + /** ReverseSshConnectivity vmPort. */ + public vmPort: number; + + /** ReverseSshConnectivity vm. */ + public vm: string; + + /** ReverseSshConnectivity vpc. */ + public vpc: string; + + /** + * Creates a new ReverseSshConnectivity instance using the specified properties. + * @param [properties] Properties to set + * @returns ReverseSshConnectivity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IReverseSshConnectivity): google.cloud.clouddms.v1.ReverseSshConnectivity; + + /** + * Encodes the specified ReverseSshConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.ReverseSshConnectivity.verify|verify} messages. + * @param message ReverseSshConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IReverseSshConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReverseSshConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ReverseSshConnectivity.verify|verify} messages. + * @param message ReverseSshConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IReverseSshConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReverseSshConnectivity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReverseSshConnectivity + * @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.clouddms.v1.ReverseSshConnectivity; + + /** + * Decodes a ReverseSshConnectivity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReverseSshConnectivity + * @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.clouddms.v1.ReverseSshConnectivity; + + /** + * Verifies a ReverseSshConnectivity 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 ReverseSshConnectivity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReverseSshConnectivity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ReverseSshConnectivity; + + /** + * Creates a plain object from a ReverseSshConnectivity message. Also converts values to other types if specified. + * @param message ReverseSshConnectivity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ReverseSshConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReverseSshConnectivity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReverseSshConnectivity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VpcPeeringConnectivity. */ + interface IVpcPeeringConnectivity { + + /** VpcPeeringConnectivity vpc */ + vpc?: (string|null); + } + + /** Represents a VpcPeeringConnectivity. */ + class VpcPeeringConnectivity implements IVpcPeeringConnectivity { + + /** + * Constructs a new VpcPeeringConnectivity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IVpcPeeringConnectivity); + + /** VpcPeeringConnectivity vpc. */ + public vpc: string; + + /** + * Creates a new VpcPeeringConnectivity instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcPeeringConnectivity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IVpcPeeringConnectivity): google.cloud.clouddms.v1.VpcPeeringConnectivity; + + /** + * Encodes the specified VpcPeeringConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConnectivity.verify|verify} messages. + * @param message VpcPeeringConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IVpcPeeringConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcPeeringConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConnectivity.verify|verify} messages. + * @param message VpcPeeringConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IVpcPeeringConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcPeeringConnectivity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcPeeringConnectivity + * @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.clouddms.v1.VpcPeeringConnectivity; + + /** + * Decodes a VpcPeeringConnectivity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcPeeringConnectivity + * @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.clouddms.v1.VpcPeeringConnectivity; + + /** + * Verifies a VpcPeeringConnectivity 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 VpcPeeringConnectivity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcPeeringConnectivity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.VpcPeeringConnectivity; + + /** + * Creates a plain object from a VpcPeeringConnectivity message. Also converts values to other types if specified. + * @param message VpcPeeringConnectivity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.VpcPeeringConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcPeeringConnectivity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcPeeringConnectivity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ForwardSshTunnelConnectivity. */ + interface IForwardSshTunnelConnectivity { + + /** ForwardSshTunnelConnectivity hostname */ + hostname?: (string|null); + + /** ForwardSshTunnelConnectivity username */ + username?: (string|null); + + /** ForwardSshTunnelConnectivity port */ + port?: (number|null); + + /** ForwardSshTunnelConnectivity password */ + password?: (string|null); + + /** ForwardSshTunnelConnectivity privateKey */ + privateKey?: (string|null); + } + + /** Represents a ForwardSshTunnelConnectivity. */ + class ForwardSshTunnelConnectivity implements IForwardSshTunnelConnectivity { + + /** + * Constructs a new ForwardSshTunnelConnectivity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IForwardSshTunnelConnectivity); + + /** ForwardSshTunnelConnectivity hostname. */ + public hostname: string; + + /** ForwardSshTunnelConnectivity username. */ + public username: string; + + /** ForwardSshTunnelConnectivity port. */ + public port: number; + + /** ForwardSshTunnelConnectivity password. */ + public password?: (string|null); + + /** ForwardSshTunnelConnectivity privateKey. */ + public privateKey?: (string|null); + + /** ForwardSshTunnelConnectivity authenticationMethod. */ + public authenticationMethod?: ("password"|"privateKey"); + + /** + * Creates a new ForwardSshTunnelConnectivity instance using the specified properties. + * @param [properties] Properties to set + * @returns ForwardSshTunnelConnectivity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IForwardSshTunnelConnectivity): google.cloud.clouddms.v1.ForwardSshTunnelConnectivity; + + /** + * Encodes the specified ForwardSshTunnelConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.ForwardSshTunnelConnectivity.verify|verify} messages. + * @param message ForwardSshTunnelConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IForwardSshTunnelConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForwardSshTunnelConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ForwardSshTunnelConnectivity.verify|verify} messages. + * @param message ForwardSshTunnelConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IForwardSshTunnelConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForwardSshTunnelConnectivity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForwardSshTunnelConnectivity + * @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.clouddms.v1.ForwardSshTunnelConnectivity; + + /** + * Decodes a ForwardSshTunnelConnectivity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForwardSshTunnelConnectivity + * @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.clouddms.v1.ForwardSshTunnelConnectivity; + + /** + * Verifies a ForwardSshTunnelConnectivity 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 ForwardSshTunnelConnectivity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForwardSshTunnelConnectivity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ForwardSshTunnelConnectivity; + + /** + * Creates a plain object from a ForwardSshTunnelConnectivity message. Also converts values to other types if specified. + * @param message ForwardSshTunnelConnectivity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ForwardSshTunnelConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForwardSshTunnelConnectivity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForwardSshTunnelConnectivity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StaticServiceIpConnectivity. */ + interface IStaticServiceIpConnectivity { + } + + /** Represents a StaticServiceIpConnectivity. */ + class StaticServiceIpConnectivity implements IStaticServiceIpConnectivity { + + /** + * Constructs a new StaticServiceIpConnectivity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IStaticServiceIpConnectivity); + + /** + * Creates a new StaticServiceIpConnectivity instance using the specified properties. + * @param [properties] Properties to set + * @returns StaticServiceIpConnectivity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IStaticServiceIpConnectivity): google.cloud.clouddms.v1.StaticServiceIpConnectivity; + + /** + * Encodes the specified StaticServiceIpConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.StaticServiceIpConnectivity.verify|verify} messages. + * @param message StaticServiceIpConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IStaticServiceIpConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StaticServiceIpConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StaticServiceIpConnectivity.verify|verify} messages. + * @param message StaticServiceIpConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IStaticServiceIpConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StaticServiceIpConnectivity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StaticServiceIpConnectivity + * @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.clouddms.v1.StaticServiceIpConnectivity; + + /** + * Decodes a StaticServiceIpConnectivity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StaticServiceIpConnectivity + * @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.clouddms.v1.StaticServiceIpConnectivity; + + /** + * Verifies a StaticServiceIpConnectivity 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 StaticServiceIpConnectivity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StaticServiceIpConnectivity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.StaticServiceIpConnectivity; + + /** + * Creates a plain object from a StaticServiceIpConnectivity message. Also converts values to other types if specified. + * @param message StaticServiceIpConnectivity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.StaticServiceIpConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StaticServiceIpConnectivity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StaticServiceIpConnectivity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrivateConnectivity. */ + interface IPrivateConnectivity { + + /** PrivateConnectivity privateConnection */ + privateConnection?: (string|null); + } + + /** Represents a PrivateConnectivity. */ + class PrivateConnectivity implements IPrivateConnectivity { + + /** + * Constructs a new PrivateConnectivity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IPrivateConnectivity); + + /** PrivateConnectivity privateConnection. */ + public privateConnection: string; + + /** + * Creates a new PrivateConnectivity instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivateConnectivity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IPrivateConnectivity): google.cloud.clouddms.v1.PrivateConnectivity; + + /** + * Encodes the specified PrivateConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.PrivateConnectivity.verify|verify} messages. + * @param message PrivateConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IPrivateConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivateConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PrivateConnectivity.verify|verify} messages. + * @param message PrivateConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IPrivateConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivateConnectivity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivateConnectivity + * @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.clouddms.v1.PrivateConnectivity; + + /** + * Decodes a PrivateConnectivity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivateConnectivity + * @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.clouddms.v1.PrivateConnectivity; + + /** + * Verifies a PrivateConnectivity 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 PrivateConnectivity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivateConnectivity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.PrivateConnectivity; + + /** + * Creates a plain object from a PrivateConnectivity message. Also converts values to other types if specified. + * @param message PrivateConnectivity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.PrivateConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivateConnectivity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivateConnectivity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DatabaseType. */ + interface IDatabaseType { + + /** DatabaseType provider */ + provider?: (google.cloud.clouddms.v1.DatabaseProvider|keyof typeof google.cloud.clouddms.v1.DatabaseProvider|null); + + /** DatabaseType engine */ + engine?: (google.cloud.clouddms.v1.DatabaseEngine|keyof typeof google.cloud.clouddms.v1.DatabaseEngine|null); + } + + /** Represents a DatabaseType. */ + class DatabaseType implements IDatabaseType { + + /** + * Constructs a new DatabaseType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IDatabaseType); + + /** DatabaseType provider. */ + public provider: (google.cloud.clouddms.v1.DatabaseProvider|keyof typeof google.cloud.clouddms.v1.DatabaseProvider); + + /** DatabaseType engine. */ + public engine: (google.cloud.clouddms.v1.DatabaseEngine|keyof typeof google.cloud.clouddms.v1.DatabaseEngine); + + /** + * Creates a new DatabaseType instance using the specified properties. + * @param [properties] Properties to set + * @returns DatabaseType instance + */ + public static create(properties?: google.cloud.clouddms.v1.IDatabaseType): google.cloud.clouddms.v1.DatabaseType; + + /** + * Encodes the specified DatabaseType message. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseType.verify|verify} messages. + * @param message DatabaseType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IDatabaseType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatabaseType message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseType.verify|verify} messages. + * @param message DatabaseType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IDatabaseType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatabaseType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatabaseType + * @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.clouddms.v1.DatabaseType; + + /** + * Decodes a DatabaseType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatabaseType + * @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.clouddms.v1.DatabaseType; + + /** + * Verifies a DatabaseType 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 DatabaseType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatabaseType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DatabaseType; + + /** + * Creates a plain object from a DatabaseType message. Also converts values to other types if specified. + * @param message DatabaseType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.DatabaseType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatabaseType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatabaseType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MigrationJob. */ + interface IMigrationJob { + + /** MigrationJob name */ + name?: (string|null); + + /** MigrationJob createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** MigrationJob updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** MigrationJob labels */ + labels?: ({ [k: string]: string }|null); + + /** MigrationJob displayName */ + displayName?: (string|null); + + /** MigrationJob state */ + state?: (google.cloud.clouddms.v1.MigrationJob.State|keyof typeof google.cloud.clouddms.v1.MigrationJob.State|null); + + /** MigrationJob phase */ + phase?: (google.cloud.clouddms.v1.MigrationJob.Phase|keyof typeof google.cloud.clouddms.v1.MigrationJob.Phase|null); + + /** MigrationJob type */ + type?: (google.cloud.clouddms.v1.MigrationJob.Type|keyof typeof google.cloud.clouddms.v1.MigrationJob.Type|null); + + /** MigrationJob dumpPath */ + dumpPath?: (string|null); + + /** MigrationJob dumpFlags */ + dumpFlags?: (google.cloud.clouddms.v1.MigrationJob.IDumpFlags|null); + + /** MigrationJob source */ + source?: (string|null); + + /** MigrationJob destination */ + destination?: (string|null); + + /** MigrationJob reverseSshConnectivity */ + reverseSshConnectivity?: (google.cloud.clouddms.v1.IReverseSshConnectivity|null); + + /** MigrationJob vpcPeeringConnectivity */ + vpcPeeringConnectivity?: (google.cloud.clouddms.v1.IVpcPeeringConnectivity|null); + + /** MigrationJob staticIpConnectivity */ + staticIpConnectivity?: (google.cloud.clouddms.v1.IStaticIpConnectivity|null); + + /** MigrationJob duration */ + duration?: (google.protobuf.IDuration|null); + + /** MigrationJob error */ + error?: (google.rpc.IStatus|null); + + /** MigrationJob sourceDatabase */ + sourceDatabase?: (google.cloud.clouddms.v1.IDatabaseType|null); + + /** MigrationJob destinationDatabase */ + destinationDatabase?: (google.cloud.clouddms.v1.IDatabaseType|null); + + /** MigrationJob endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** MigrationJob conversionWorkspace */ + conversionWorkspace?: (google.cloud.clouddms.v1.IConversionWorkspaceInfo|null); + + /** MigrationJob filter */ + filter?: (string|null); + + /** MigrationJob cmekKeyName */ + cmekKeyName?: (string|null); + } + + /** Represents a MigrationJob. */ + class MigrationJob implements IMigrationJob { + + /** + * Constructs a new MigrationJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IMigrationJob); + + /** MigrationJob name. */ + public name: string; + + /** MigrationJob createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** MigrationJob updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** MigrationJob labels. */ + public labels: { [k: string]: string }; + + /** MigrationJob displayName. */ + public displayName: string; + + /** MigrationJob state. */ + public state: (google.cloud.clouddms.v1.MigrationJob.State|keyof typeof google.cloud.clouddms.v1.MigrationJob.State); + + /** MigrationJob phase. */ + public phase: (google.cloud.clouddms.v1.MigrationJob.Phase|keyof typeof google.cloud.clouddms.v1.MigrationJob.Phase); + + /** MigrationJob type. */ + public type: (google.cloud.clouddms.v1.MigrationJob.Type|keyof typeof google.cloud.clouddms.v1.MigrationJob.Type); + + /** MigrationJob dumpPath. */ + public dumpPath: string; + + /** MigrationJob dumpFlags. */ + public dumpFlags?: (google.cloud.clouddms.v1.MigrationJob.IDumpFlags|null); + + /** MigrationJob source. */ + public source: string; + + /** MigrationJob destination. */ + public destination: string; + + /** MigrationJob reverseSshConnectivity. */ + public reverseSshConnectivity?: (google.cloud.clouddms.v1.IReverseSshConnectivity|null); + + /** MigrationJob vpcPeeringConnectivity. */ + public vpcPeeringConnectivity?: (google.cloud.clouddms.v1.IVpcPeeringConnectivity|null); + + /** MigrationJob staticIpConnectivity. */ + public staticIpConnectivity?: (google.cloud.clouddms.v1.IStaticIpConnectivity|null); + + /** MigrationJob duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** MigrationJob error. */ + public error?: (google.rpc.IStatus|null); + + /** MigrationJob sourceDatabase. */ + public sourceDatabase?: (google.cloud.clouddms.v1.IDatabaseType|null); + + /** MigrationJob destinationDatabase. */ + public destinationDatabase?: (google.cloud.clouddms.v1.IDatabaseType|null); + + /** MigrationJob endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** MigrationJob conversionWorkspace. */ + public conversionWorkspace?: (google.cloud.clouddms.v1.IConversionWorkspaceInfo|null); + + /** MigrationJob filter. */ + public filter: string; + + /** MigrationJob cmekKeyName. */ + public cmekKeyName: string; + + /** MigrationJob connectivity. */ + public connectivity?: ("reverseSshConnectivity"|"vpcPeeringConnectivity"|"staticIpConnectivity"); + + /** + * Creates a new MigrationJob instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationJob instance + */ + public static create(properties?: google.cloud.clouddms.v1.IMigrationJob): google.cloud.clouddms.v1.MigrationJob; + + /** + * Encodes the specified MigrationJob message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.verify|verify} messages. + * @param message MigrationJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IMigrationJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MigrationJob message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.verify|verify} messages. + * @param message MigrationJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IMigrationJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MigrationJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrationJob + * @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.clouddms.v1.MigrationJob; + + /** + * Decodes a MigrationJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrationJob + * @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.clouddms.v1.MigrationJob; + + /** + * Verifies a MigrationJob 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 MigrationJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrationJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.MigrationJob; + + /** + * Creates a plain object from a MigrationJob message. Also converts values to other types if specified. + * @param message MigrationJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.MigrationJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MigrationJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MigrationJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MigrationJob { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + MAINTENANCE = 1, + DRAFT = 2, + CREATING = 3, + NOT_STARTED = 4, + RUNNING = 5, + FAILED = 6, + COMPLETED = 7, + DELETING = 8, + STOPPING = 9, + STOPPED = 10, + DELETED = 11, + UPDATING = 12, + STARTING = 13, + RESTARTING = 14, + RESUMING = 15 + } + + /** Phase enum. */ + enum Phase { + PHASE_UNSPECIFIED = 0, + FULL_DUMP = 1, + CDC = 2, + PROMOTE_IN_PROGRESS = 3, + WAITING_FOR_SOURCE_WRITES_TO_STOP = 4, + PREPARING_THE_DUMP = 5 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ONE_TIME = 1, + CONTINUOUS = 2 + } + + /** Properties of a DumpFlag. */ + interface IDumpFlag { + + /** DumpFlag name */ + name?: (string|null); + + /** DumpFlag value */ + value?: (string|null); + } + + /** Represents a DumpFlag. */ + class DumpFlag implements IDumpFlag { + + /** + * Constructs a new DumpFlag. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.MigrationJob.IDumpFlag); + + /** DumpFlag name. */ + public name: string; + + /** DumpFlag value. */ + public value: string; + + /** + * Creates a new DumpFlag instance using the specified properties. + * @param [properties] Properties to set + * @returns DumpFlag instance + */ + public static create(properties?: google.cloud.clouddms.v1.MigrationJob.IDumpFlag): google.cloud.clouddms.v1.MigrationJob.DumpFlag; + + /** + * Encodes the specified DumpFlag message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.DumpFlag.verify|verify} messages. + * @param message DumpFlag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.MigrationJob.IDumpFlag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DumpFlag message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.DumpFlag.verify|verify} messages. + * @param message DumpFlag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.MigrationJob.IDumpFlag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DumpFlag message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DumpFlag + * @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.clouddms.v1.MigrationJob.DumpFlag; + + /** + * Decodes a DumpFlag message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DumpFlag + * @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.clouddms.v1.MigrationJob.DumpFlag; + + /** + * Verifies a DumpFlag 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 DumpFlag message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DumpFlag + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.MigrationJob.DumpFlag; + + /** + * Creates a plain object from a DumpFlag message. Also converts values to other types if specified. + * @param message DumpFlag + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.MigrationJob.DumpFlag, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DumpFlag to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DumpFlag + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DumpFlags. */ + interface IDumpFlags { + + /** DumpFlags dumpFlags */ + dumpFlags?: (google.cloud.clouddms.v1.MigrationJob.IDumpFlag[]|null); + } + + /** Represents a DumpFlags. */ + class DumpFlags implements IDumpFlags { + + /** + * Constructs a new DumpFlags. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.MigrationJob.IDumpFlags); + + /** DumpFlags dumpFlags. */ + public dumpFlags: google.cloud.clouddms.v1.MigrationJob.IDumpFlag[]; + + /** + * Creates a new DumpFlags instance using the specified properties. + * @param [properties] Properties to set + * @returns DumpFlags instance + */ + public static create(properties?: google.cloud.clouddms.v1.MigrationJob.IDumpFlags): google.cloud.clouddms.v1.MigrationJob.DumpFlags; + + /** + * Encodes the specified DumpFlags message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.DumpFlags.verify|verify} messages. + * @param message DumpFlags message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.MigrationJob.IDumpFlags, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DumpFlags message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.DumpFlags.verify|verify} messages. + * @param message DumpFlags message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.MigrationJob.IDumpFlags, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DumpFlags message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DumpFlags + * @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.clouddms.v1.MigrationJob.DumpFlags; + + /** + * Decodes a DumpFlags message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DumpFlags + * @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.clouddms.v1.MigrationJob.DumpFlags; + + /** + * Verifies a DumpFlags 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 DumpFlags message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DumpFlags + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.MigrationJob.DumpFlags; + + /** + * Creates a plain object from a DumpFlags message. Also converts values to other types if specified. + * @param message DumpFlags + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.MigrationJob.DumpFlags, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DumpFlags to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DumpFlags + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ConversionWorkspaceInfo. */ + interface IConversionWorkspaceInfo { + + /** ConversionWorkspaceInfo name */ + name?: (string|null); + + /** ConversionWorkspaceInfo commitId */ + commitId?: (string|null); + } + + /** Represents a ConversionWorkspaceInfo. */ + class ConversionWorkspaceInfo implements IConversionWorkspaceInfo { + + /** + * Constructs a new ConversionWorkspaceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IConversionWorkspaceInfo); + + /** ConversionWorkspaceInfo name. */ + public name: string; + + /** ConversionWorkspaceInfo commitId. */ + public commitId: string; + + /** + * Creates a new ConversionWorkspaceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversionWorkspaceInfo instance + */ + public static create(properties?: google.cloud.clouddms.v1.IConversionWorkspaceInfo): google.cloud.clouddms.v1.ConversionWorkspaceInfo; + + /** + * Encodes the specified ConversionWorkspaceInfo message. Does not implicitly {@link google.cloud.clouddms.v1.ConversionWorkspaceInfo.verify|verify} messages. + * @param message ConversionWorkspaceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IConversionWorkspaceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversionWorkspaceInfo message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConversionWorkspaceInfo.verify|verify} messages. + * @param message ConversionWorkspaceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IConversionWorkspaceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversionWorkspaceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversionWorkspaceInfo + * @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.clouddms.v1.ConversionWorkspaceInfo; + + /** + * Decodes a ConversionWorkspaceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversionWorkspaceInfo + * @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.clouddms.v1.ConversionWorkspaceInfo; + + /** + * Verifies a ConversionWorkspaceInfo 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 ConversionWorkspaceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversionWorkspaceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ConversionWorkspaceInfo; + + /** + * Creates a plain object from a ConversionWorkspaceInfo message. Also converts values to other types if specified. + * @param message ConversionWorkspaceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ConversionWorkspaceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversionWorkspaceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConversionWorkspaceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectionProfile. */ + interface IConnectionProfile { + + /** ConnectionProfile name */ + name?: (string|null); + + /** ConnectionProfile createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionProfile updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionProfile labels */ + labels?: ({ [k: string]: string }|null); + + /** ConnectionProfile state */ + state?: (google.cloud.clouddms.v1.ConnectionProfile.State|keyof typeof google.cloud.clouddms.v1.ConnectionProfile.State|null); + + /** ConnectionProfile displayName */ + displayName?: (string|null); + + /** ConnectionProfile mysql */ + mysql?: (google.cloud.clouddms.v1.IMySqlConnectionProfile|null); + + /** ConnectionProfile postgresql */ + postgresql?: (google.cloud.clouddms.v1.IPostgreSqlConnectionProfile|null); + + /** ConnectionProfile oracle */ + oracle?: (google.cloud.clouddms.v1.IOracleConnectionProfile|null); + + /** ConnectionProfile cloudsql */ + cloudsql?: (google.cloud.clouddms.v1.ICloudSqlConnectionProfile|null); + + /** ConnectionProfile alloydb */ + alloydb?: (google.cloud.clouddms.v1.IAlloyDbConnectionProfile|null); + + /** ConnectionProfile error */ + error?: (google.rpc.IStatus|null); + + /** ConnectionProfile provider */ + provider?: (google.cloud.clouddms.v1.DatabaseProvider|keyof typeof google.cloud.clouddms.v1.DatabaseProvider|null); + } + + /** Represents a ConnectionProfile. */ + class ConnectionProfile implements IConnectionProfile { + + /** + * Constructs a new ConnectionProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IConnectionProfile); + + /** ConnectionProfile name. */ + public name: string; + + /** ConnectionProfile createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionProfile updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionProfile labels. */ + public labels: { [k: string]: string }; + + /** ConnectionProfile state. */ + public state: (google.cloud.clouddms.v1.ConnectionProfile.State|keyof typeof google.cloud.clouddms.v1.ConnectionProfile.State); + + /** ConnectionProfile displayName. */ + public displayName: string; + + /** ConnectionProfile mysql. */ + public mysql?: (google.cloud.clouddms.v1.IMySqlConnectionProfile|null); + + /** ConnectionProfile postgresql. */ + public postgresql?: (google.cloud.clouddms.v1.IPostgreSqlConnectionProfile|null); + + /** ConnectionProfile oracle. */ + public oracle?: (google.cloud.clouddms.v1.IOracleConnectionProfile|null); + + /** ConnectionProfile cloudsql. */ + public cloudsql?: (google.cloud.clouddms.v1.ICloudSqlConnectionProfile|null); + + /** ConnectionProfile alloydb. */ + public alloydb?: (google.cloud.clouddms.v1.IAlloyDbConnectionProfile|null); + + /** ConnectionProfile error. */ + public error?: (google.rpc.IStatus|null); + + /** ConnectionProfile provider. */ + public provider: (google.cloud.clouddms.v1.DatabaseProvider|keyof typeof google.cloud.clouddms.v1.DatabaseProvider); + + /** ConnectionProfile connectionProfile. */ + public connectionProfile?: ("mysql"|"postgresql"|"oracle"|"cloudsql"|"alloydb"); + + /** + * Creates a new ConnectionProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionProfile instance + */ + public static create(properties?: google.cloud.clouddms.v1.IConnectionProfile): google.cloud.clouddms.v1.ConnectionProfile; + + /** + * Encodes the specified ConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.ConnectionProfile.verify|verify} messages. + * @param message ConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConnectionProfile.verify|verify} messages. + * @param message ConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionProfile + * @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.clouddms.v1.ConnectionProfile; + + /** + * Decodes a ConnectionProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionProfile + * @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.clouddms.v1.ConnectionProfile; + + /** + * Verifies a ConnectionProfile 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 ConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ConnectionProfile; + + /** + * Creates a plain object from a ConnectionProfile message. Also converts values to other types if specified. + * @param message ConnectionProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConnectionProfile { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + DRAFT = 1, + CREATING = 2, + READY = 3, + UPDATING = 4, + DELETING = 5, + DELETED = 6, + FAILED = 7 + } + } + + /** Properties of a MigrationJobVerificationError. */ + interface IMigrationJobVerificationError { + + /** MigrationJobVerificationError errorCode */ + errorCode?: (google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode|keyof typeof google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode|null); + + /** MigrationJobVerificationError errorMessage */ + errorMessage?: (string|null); + + /** MigrationJobVerificationError errorDetailMessage */ + errorDetailMessage?: (string|null); + } + + /** Represents a MigrationJobVerificationError. */ + class MigrationJobVerificationError implements IMigrationJobVerificationError { + + /** + * Constructs a new MigrationJobVerificationError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IMigrationJobVerificationError); + + /** MigrationJobVerificationError errorCode. */ + public errorCode: (google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode|keyof typeof google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode); + + /** MigrationJobVerificationError errorMessage. */ + public errorMessage: string; + + /** MigrationJobVerificationError errorDetailMessage. */ + public errorDetailMessage: string; + + /** + * Creates a new MigrationJobVerificationError instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationJobVerificationError instance + */ + public static create(properties?: google.cloud.clouddms.v1.IMigrationJobVerificationError): google.cloud.clouddms.v1.MigrationJobVerificationError; + + /** + * Encodes the specified MigrationJobVerificationError message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJobVerificationError.verify|verify} messages. + * @param message MigrationJobVerificationError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IMigrationJobVerificationError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MigrationJobVerificationError message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJobVerificationError.verify|verify} messages. + * @param message MigrationJobVerificationError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IMigrationJobVerificationError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MigrationJobVerificationError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrationJobVerificationError + * @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.clouddms.v1.MigrationJobVerificationError; + + /** + * Decodes a MigrationJobVerificationError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrationJobVerificationError + * @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.clouddms.v1.MigrationJobVerificationError; + + /** + * Verifies a MigrationJobVerificationError 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 MigrationJobVerificationError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrationJobVerificationError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.MigrationJobVerificationError; + + /** + * Creates a plain object from a MigrationJobVerificationError message. Also converts values to other types if specified. + * @param message MigrationJobVerificationError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.MigrationJobVerificationError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MigrationJobVerificationError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MigrationJobVerificationError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MigrationJobVerificationError { + + /** ErrorCode enum. */ + enum ErrorCode { + ERROR_CODE_UNSPECIFIED = 0, + CONNECTION_FAILURE = 1, + AUTHENTICATION_FAILURE = 2, + INVALID_CONNECTION_PROFILE_CONFIG = 3, + VERSION_INCOMPATIBILITY = 4, + CONNECTION_PROFILE_TYPES_INCOMPATIBILITY = 5, + NO_PGLOGICAL_INSTALLED = 7, + PGLOGICAL_NODE_ALREADY_EXISTS = 8, + INVALID_WAL_LEVEL = 9, + INVALID_SHARED_PRELOAD_LIBRARY = 10, + INSUFFICIENT_MAX_REPLICATION_SLOTS = 11, + INSUFFICIENT_MAX_WAL_SENDERS = 12, + INSUFFICIENT_MAX_WORKER_PROCESSES = 13, + UNSUPPORTED_EXTENSIONS = 14, + UNSUPPORTED_MIGRATION_TYPE = 15, + INVALID_RDS_LOGICAL_REPLICATION = 16, + UNSUPPORTED_GTID_MODE = 17, + UNSUPPORTED_TABLE_DEFINITION = 18, + UNSUPPORTED_DEFINER = 19, + CANT_RESTART_RUNNING_MIGRATION = 21, + TABLES_WITH_LIMITED_SUPPORT = 24, + UNSUPPORTED_DATABASE_LOCALE = 25, + UNSUPPORTED_DATABASE_FDW_CONFIG = 26, + ERROR_RDBMS = 27, + SOURCE_SIZE_EXCEEDS_THRESHOLD = 28 + } + } + + /** DatabaseEngine enum. */ + enum DatabaseEngine { + DATABASE_ENGINE_UNSPECIFIED = 0, + MYSQL = 1, + POSTGRESQL = 2, + ORACLE = 4 + } + + /** DatabaseProvider enum. */ + enum DatabaseProvider { + DATABASE_PROVIDER_UNSPECIFIED = 0, + CLOUDSQL = 1, + RDS = 2, + AURORA = 3, + ALLOYDB = 4 + } + + /** Properties of a PrivateConnection. */ + interface IPrivateConnection { + + /** PrivateConnection name */ + name?: (string|null); + + /** PrivateConnection createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** PrivateConnection updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** PrivateConnection labels */ + labels?: ({ [k: string]: string }|null); + + /** PrivateConnection displayName */ + displayName?: (string|null); + + /** PrivateConnection state */ + state?: (google.cloud.clouddms.v1.PrivateConnection.State|keyof typeof google.cloud.clouddms.v1.PrivateConnection.State|null); + + /** PrivateConnection error */ + error?: (google.rpc.IStatus|null); + + /** PrivateConnection vpcPeeringConfig */ + vpcPeeringConfig?: (google.cloud.clouddms.v1.IVpcPeeringConfig|null); + } + + /** Represents a PrivateConnection. */ + class PrivateConnection implements IPrivateConnection { + + /** + * Constructs a new PrivateConnection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IPrivateConnection); + + /** PrivateConnection name. */ + public name: string; + + /** PrivateConnection createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** PrivateConnection updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** PrivateConnection labels. */ + public labels: { [k: string]: string }; + + /** PrivateConnection displayName. */ + public displayName: string; + + /** PrivateConnection state. */ + public state: (google.cloud.clouddms.v1.PrivateConnection.State|keyof typeof google.cloud.clouddms.v1.PrivateConnection.State); + + /** PrivateConnection error. */ + public error?: (google.rpc.IStatus|null); + + /** PrivateConnection vpcPeeringConfig. */ + public vpcPeeringConfig?: (google.cloud.clouddms.v1.IVpcPeeringConfig|null); + + /** PrivateConnection connectivity. */ + public connectivity?: "vpcPeeringConfig"; + + /** + * Creates a new PrivateConnection instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivateConnection instance + */ + public static create(properties?: google.cloud.clouddms.v1.IPrivateConnection): google.cloud.clouddms.v1.PrivateConnection; + + /** + * Encodes the specified PrivateConnection message. Does not implicitly {@link google.cloud.clouddms.v1.PrivateConnection.verify|verify} messages. + * @param message PrivateConnection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IPrivateConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivateConnection message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PrivateConnection.verify|verify} messages. + * @param message PrivateConnection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IPrivateConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivateConnection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivateConnection + * @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.clouddms.v1.PrivateConnection; + + /** + * Decodes a PrivateConnection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivateConnection + * @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.clouddms.v1.PrivateConnection; + + /** + * Verifies a PrivateConnection 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 PrivateConnection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivateConnection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.PrivateConnection; + + /** + * Creates a plain object from a PrivateConnection message. Also converts values to other types if specified. + * @param message PrivateConnection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.PrivateConnection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivateConnection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivateConnection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PrivateConnection { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + CREATED = 2, + FAILED = 3, + DELETING = 4, + FAILED_TO_DELETE = 5, + DELETED = 6 + } + } + + /** Properties of a VpcPeeringConfig. */ + interface IVpcPeeringConfig { + + /** VpcPeeringConfig vpcName */ + vpcName?: (string|null); + + /** VpcPeeringConfig subnet */ + subnet?: (string|null); + } + + /** Represents a VpcPeeringConfig. */ + class VpcPeeringConfig implements IVpcPeeringConfig { + + /** + * Constructs a new VpcPeeringConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IVpcPeeringConfig); + + /** VpcPeeringConfig vpcName. */ + public vpcName: string; + + /** VpcPeeringConfig subnet. */ + public subnet: string; + + /** + * Creates a new VpcPeeringConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcPeeringConfig instance + */ + public static create(properties?: google.cloud.clouddms.v1.IVpcPeeringConfig): google.cloud.clouddms.v1.VpcPeeringConfig; + + /** + * Encodes the specified VpcPeeringConfig message. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConfig.verify|verify} messages. + * @param message VpcPeeringConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IVpcPeeringConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcPeeringConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConfig.verify|verify} messages. + * @param message VpcPeeringConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IVpcPeeringConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcPeeringConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcPeeringConfig + * @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.clouddms.v1.VpcPeeringConfig; + + /** + * Decodes a VpcPeeringConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcPeeringConfig + * @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.clouddms.v1.VpcPeeringConfig; + + /** + * Verifies a VpcPeeringConfig 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 VpcPeeringConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcPeeringConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.VpcPeeringConfig; + + /** + * Creates a plain object from a VpcPeeringConfig message. Also converts values to other types if specified. + * @param message VpcPeeringConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.VpcPeeringConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcPeeringConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcPeeringConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DatabaseEngineInfo. */ + interface IDatabaseEngineInfo { + + /** DatabaseEngineInfo engine */ + engine?: (google.cloud.clouddms.v1.DatabaseEngine|keyof typeof google.cloud.clouddms.v1.DatabaseEngine|null); + + /** DatabaseEngineInfo version */ + version?: (string|null); + } + + /** Represents a DatabaseEngineInfo. */ + class DatabaseEngineInfo implements IDatabaseEngineInfo { + + /** + * Constructs a new DatabaseEngineInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IDatabaseEngineInfo); + + /** DatabaseEngineInfo engine. */ + public engine: (google.cloud.clouddms.v1.DatabaseEngine|keyof typeof google.cloud.clouddms.v1.DatabaseEngine); + + /** DatabaseEngineInfo version. */ + public version: string; + + /** + * Creates a new DatabaseEngineInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DatabaseEngineInfo instance + */ + public static create(properties?: google.cloud.clouddms.v1.IDatabaseEngineInfo): google.cloud.clouddms.v1.DatabaseEngineInfo; + + /** + * Encodes the specified DatabaseEngineInfo message. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseEngineInfo.verify|verify} messages. + * @param message DatabaseEngineInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IDatabaseEngineInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatabaseEngineInfo message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseEngineInfo.verify|verify} messages. + * @param message DatabaseEngineInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IDatabaseEngineInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatabaseEngineInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatabaseEngineInfo + * @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.clouddms.v1.DatabaseEngineInfo; + + /** + * Decodes a DatabaseEngineInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatabaseEngineInfo + * @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.clouddms.v1.DatabaseEngineInfo; + + /** + * Verifies a DatabaseEngineInfo 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 DatabaseEngineInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatabaseEngineInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DatabaseEngineInfo; + + /** + * Creates a plain object from a DatabaseEngineInfo message. Also converts values to other types if specified. + * @param message DatabaseEngineInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.DatabaseEngineInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatabaseEngineInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatabaseEngineInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConversionWorkspace. */ + interface IConversionWorkspace { + + /** ConversionWorkspace name */ + name?: (string|null); + + /** ConversionWorkspace source */ + source?: (google.cloud.clouddms.v1.IDatabaseEngineInfo|null); + + /** ConversionWorkspace destination */ + destination?: (google.cloud.clouddms.v1.IDatabaseEngineInfo|null); + + /** ConversionWorkspace globalSettings */ + globalSettings?: ({ [k: string]: string }|null); + + /** ConversionWorkspace hasUncommittedChanges */ + hasUncommittedChanges?: (boolean|null); + + /** ConversionWorkspace latestCommitId */ + latestCommitId?: (string|null); + + /** ConversionWorkspace latestCommitTime */ + latestCommitTime?: (google.protobuf.ITimestamp|null); + + /** ConversionWorkspace createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ConversionWorkspace updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ConversionWorkspace displayName */ + displayName?: (string|null); + } + + /** Represents a ConversionWorkspace. */ + class ConversionWorkspace implements IConversionWorkspace { + + /** + * Constructs a new ConversionWorkspace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IConversionWorkspace); + + /** ConversionWorkspace name. */ + public name: string; + + /** ConversionWorkspace source. */ + public source?: (google.cloud.clouddms.v1.IDatabaseEngineInfo|null); + + /** ConversionWorkspace destination. */ + public destination?: (google.cloud.clouddms.v1.IDatabaseEngineInfo|null); + + /** ConversionWorkspace globalSettings. */ + public globalSettings: { [k: string]: string }; + + /** ConversionWorkspace hasUncommittedChanges. */ + public hasUncommittedChanges: boolean; + + /** ConversionWorkspace latestCommitId. */ + public latestCommitId: string; + + /** ConversionWorkspace latestCommitTime. */ + public latestCommitTime?: (google.protobuf.ITimestamp|null); + + /** ConversionWorkspace createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ConversionWorkspace updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ConversionWorkspace displayName. */ + public displayName: string; + + /** + * Creates a new ConversionWorkspace instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversionWorkspace instance + */ + public static create(properties?: google.cloud.clouddms.v1.IConversionWorkspace): google.cloud.clouddms.v1.ConversionWorkspace; + + /** + * Encodes the specified ConversionWorkspace message. Does not implicitly {@link google.cloud.clouddms.v1.ConversionWorkspace.verify|verify} messages. + * @param message ConversionWorkspace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IConversionWorkspace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversionWorkspace message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConversionWorkspace.verify|verify} messages. + * @param message ConversionWorkspace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IConversionWorkspace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversionWorkspace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversionWorkspace + * @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.clouddms.v1.ConversionWorkspace; + + /** + * Decodes a ConversionWorkspace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversionWorkspace + * @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.clouddms.v1.ConversionWorkspace; + + /** + * Verifies a ConversionWorkspace 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 ConversionWorkspace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversionWorkspace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ConversionWorkspace; + + /** + * Creates a plain object from a ConversionWorkspace message. Also converts values to other types if specified. + * @param message ConversionWorkspace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ConversionWorkspace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversionWorkspace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConversionWorkspace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackgroundJobLogEntry. */ + interface IBackgroundJobLogEntry { + + /** BackgroundJobLogEntry id */ + id?: (string|null); + + /** BackgroundJobLogEntry jobType */ + jobType?: (google.cloud.clouddms.v1.BackgroundJobType|keyof typeof google.cloud.clouddms.v1.BackgroundJobType|null); + + /** BackgroundJobLogEntry startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** BackgroundJobLogEntry finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + + /** BackgroundJobLogEntry completionState */ + completionState?: (google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState|keyof typeof google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState|null); + + /** BackgroundJobLogEntry completionComment */ + completionComment?: (string|null); + + /** BackgroundJobLogEntry requestAutocommit */ + requestAutocommit?: (boolean|null); + + /** BackgroundJobLogEntry seedJobDetails */ + seedJobDetails?: (google.cloud.clouddms.v1.BackgroundJobLogEntry.ISeedJobDetails|null); + + /** BackgroundJobLogEntry importRulesJobDetails */ + importRulesJobDetails?: (google.cloud.clouddms.v1.BackgroundJobLogEntry.IImportRulesJobDetails|null); + + /** BackgroundJobLogEntry convertJobDetails */ + convertJobDetails?: (google.cloud.clouddms.v1.BackgroundJobLogEntry.IConvertJobDetails|null); + + /** BackgroundJobLogEntry applyJobDetails */ + applyJobDetails?: (google.cloud.clouddms.v1.BackgroundJobLogEntry.IApplyJobDetails|null); + } + + /** Represents a BackgroundJobLogEntry. */ + class BackgroundJobLogEntry implements IBackgroundJobLogEntry { + + /** + * Constructs a new BackgroundJobLogEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IBackgroundJobLogEntry); + + /** BackgroundJobLogEntry id. */ + public id: string; + + /** BackgroundJobLogEntry jobType. */ + public jobType: (google.cloud.clouddms.v1.BackgroundJobType|keyof typeof google.cloud.clouddms.v1.BackgroundJobType); + + /** BackgroundJobLogEntry startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** BackgroundJobLogEntry finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** BackgroundJobLogEntry completionState. */ + public completionState: (google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState|keyof typeof google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState); + + /** BackgroundJobLogEntry completionComment. */ + public completionComment: string; + + /** BackgroundJobLogEntry requestAutocommit. */ + public requestAutocommit: boolean; + + /** BackgroundJobLogEntry seedJobDetails. */ + public seedJobDetails?: (google.cloud.clouddms.v1.BackgroundJobLogEntry.ISeedJobDetails|null); + + /** BackgroundJobLogEntry importRulesJobDetails. */ + public importRulesJobDetails?: (google.cloud.clouddms.v1.BackgroundJobLogEntry.IImportRulesJobDetails|null); + + /** BackgroundJobLogEntry convertJobDetails. */ + public convertJobDetails?: (google.cloud.clouddms.v1.BackgroundJobLogEntry.IConvertJobDetails|null); + + /** BackgroundJobLogEntry applyJobDetails. */ + public applyJobDetails?: (google.cloud.clouddms.v1.BackgroundJobLogEntry.IApplyJobDetails|null); + + /** BackgroundJobLogEntry jobDetails. */ + public jobDetails?: ("seedJobDetails"|"importRulesJobDetails"|"convertJobDetails"|"applyJobDetails"); + + /** + * Creates a new BackgroundJobLogEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns BackgroundJobLogEntry instance + */ + public static create(properties?: google.cloud.clouddms.v1.IBackgroundJobLogEntry): google.cloud.clouddms.v1.BackgroundJobLogEntry; + + /** + * Encodes the specified BackgroundJobLogEntry message. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.verify|verify} messages. + * @param message BackgroundJobLogEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IBackgroundJobLogEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackgroundJobLogEntry message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.verify|verify} messages. + * @param message BackgroundJobLogEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IBackgroundJobLogEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackgroundJobLogEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackgroundJobLogEntry + * @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.clouddms.v1.BackgroundJobLogEntry; + + /** + * Decodes a BackgroundJobLogEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackgroundJobLogEntry + * @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.clouddms.v1.BackgroundJobLogEntry; + + /** + * Verifies a BackgroundJobLogEntry 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 BackgroundJobLogEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackgroundJobLogEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.BackgroundJobLogEntry; + + /** + * Creates a plain object from a BackgroundJobLogEntry message. Also converts values to other types if specified. + * @param message BackgroundJobLogEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.BackgroundJobLogEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackgroundJobLogEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackgroundJobLogEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackgroundJobLogEntry { + + /** JobCompletionState enum. */ + enum JobCompletionState { + JOB_COMPLETION_STATE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2 + } + + /** Properties of a SeedJobDetails. */ + interface ISeedJobDetails { + + /** SeedJobDetails connectionProfile */ + connectionProfile?: (string|null); + } + + /** Represents a SeedJobDetails. */ + class SeedJobDetails implements ISeedJobDetails { + + /** + * Constructs a new SeedJobDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.BackgroundJobLogEntry.ISeedJobDetails); + + /** SeedJobDetails connectionProfile. */ + public connectionProfile: string; + + /** + * Creates a new SeedJobDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns SeedJobDetails instance + */ + public static create(properties?: google.cloud.clouddms.v1.BackgroundJobLogEntry.ISeedJobDetails): google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails; + + /** + * Encodes the specified SeedJobDetails message. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails.verify|verify} messages. + * @param message SeedJobDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.BackgroundJobLogEntry.ISeedJobDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SeedJobDetails message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails.verify|verify} messages. + * @param message SeedJobDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.BackgroundJobLogEntry.ISeedJobDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SeedJobDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SeedJobDetails + * @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.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails; + + /** + * Decodes a SeedJobDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SeedJobDetails + * @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.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails; + + /** + * Verifies a SeedJobDetails 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 SeedJobDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SeedJobDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails; + + /** + * Creates a plain object from a SeedJobDetails message. Also converts values to other types if specified. + * @param message SeedJobDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SeedJobDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SeedJobDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportRulesJobDetails. */ + interface IImportRulesJobDetails { + + /** ImportRulesJobDetails files */ + files?: (string[]|null); + + /** ImportRulesJobDetails fileFormat */ + fileFormat?: (google.cloud.clouddms.v1.ImportRulesFileFormat|keyof typeof google.cloud.clouddms.v1.ImportRulesFileFormat|null); + } + + /** Represents an ImportRulesJobDetails. */ + class ImportRulesJobDetails implements IImportRulesJobDetails { + + /** + * Constructs a new ImportRulesJobDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.BackgroundJobLogEntry.IImportRulesJobDetails); + + /** ImportRulesJobDetails files. */ + public files: string[]; + + /** ImportRulesJobDetails fileFormat. */ + public fileFormat: (google.cloud.clouddms.v1.ImportRulesFileFormat|keyof typeof google.cloud.clouddms.v1.ImportRulesFileFormat); + + /** + * Creates a new ImportRulesJobDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportRulesJobDetails instance + */ + public static create(properties?: google.cloud.clouddms.v1.BackgroundJobLogEntry.IImportRulesJobDetails): google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails; + + /** + * Encodes the specified ImportRulesJobDetails message. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails.verify|verify} messages. + * @param message ImportRulesJobDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.BackgroundJobLogEntry.IImportRulesJobDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportRulesJobDetails message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails.verify|verify} messages. + * @param message ImportRulesJobDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.BackgroundJobLogEntry.IImportRulesJobDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportRulesJobDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportRulesJobDetails + * @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.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails; + + /** + * Decodes an ImportRulesJobDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportRulesJobDetails + * @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.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails; + + /** + * Verifies an ImportRulesJobDetails 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 ImportRulesJobDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportRulesJobDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails; + + /** + * Creates a plain object from an ImportRulesJobDetails message. Also converts values to other types if specified. + * @param message ImportRulesJobDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportRulesJobDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportRulesJobDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConvertJobDetails. */ + interface IConvertJobDetails { + + /** ConvertJobDetails filter */ + filter?: (string|null); + } + + /** Represents a ConvertJobDetails. */ + class ConvertJobDetails implements IConvertJobDetails { + + /** + * Constructs a new ConvertJobDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.BackgroundJobLogEntry.IConvertJobDetails); + + /** ConvertJobDetails filter. */ + public filter: string; + + /** + * Creates a new ConvertJobDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns ConvertJobDetails instance + */ + public static create(properties?: google.cloud.clouddms.v1.BackgroundJobLogEntry.IConvertJobDetails): google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails; + + /** + * Encodes the specified ConvertJobDetails message. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails.verify|verify} messages. + * @param message ConvertJobDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.BackgroundJobLogEntry.IConvertJobDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConvertJobDetails message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails.verify|verify} messages. + * @param message ConvertJobDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.BackgroundJobLogEntry.IConvertJobDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConvertJobDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConvertJobDetails + * @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.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails; + + /** + * Decodes a ConvertJobDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConvertJobDetails + * @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.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails; + + /** + * Verifies a ConvertJobDetails 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 ConvertJobDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConvertJobDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails; + + /** + * Creates a plain object from a ConvertJobDetails message. Also converts values to other types if specified. + * @param message ConvertJobDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConvertJobDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConvertJobDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApplyJobDetails. */ + interface IApplyJobDetails { + + /** ApplyJobDetails connectionProfile */ + connectionProfile?: (string|null); + + /** ApplyJobDetails filter */ + filter?: (string|null); + } + + /** Represents an ApplyJobDetails. */ + class ApplyJobDetails implements IApplyJobDetails { + + /** + * Constructs a new ApplyJobDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.BackgroundJobLogEntry.IApplyJobDetails); + + /** ApplyJobDetails connectionProfile. */ + public connectionProfile: string; + + /** ApplyJobDetails filter. */ + public filter: string; + + /** + * Creates a new ApplyJobDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplyJobDetails instance + */ + public static create(properties?: google.cloud.clouddms.v1.BackgroundJobLogEntry.IApplyJobDetails): google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails; + + /** + * Encodes the specified ApplyJobDetails message. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails.verify|verify} messages. + * @param message ApplyJobDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.BackgroundJobLogEntry.IApplyJobDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplyJobDetails message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails.verify|verify} messages. + * @param message ApplyJobDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.BackgroundJobLogEntry.IApplyJobDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplyJobDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplyJobDetails + * @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.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails; + + /** + * Decodes an ApplyJobDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplyJobDetails + * @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.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails; + + /** + * Verifies an ApplyJobDetails 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 ApplyJobDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplyJobDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails; + + /** + * Creates a plain object from an ApplyJobDetails message. Also converts values to other types if specified. + * @param message ApplyJobDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplyJobDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplyJobDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DatabaseEntity. */ + interface IDatabaseEntity { + + /** DatabaseEntity shortName */ + shortName?: (string|null); + + /** DatabaseEntity parentEntity */ + parentEntity?: (string|null); + + /** DatabaseEntity tree */ + tree?: (google.cloud.clouddms.v1.DatabaseEntity.TreeType|keyof typeof google.cloud.clouddms.v1.DatabaseEntity.TreeType|null); + + /** DatabaseEntity entityType */ + entityType?: (google.cloud.clouddms.v1.DatabaseEntityType|keyof typeof google.cloud.clouddms.v1.DatabaseEntityType|null); + + /** DatabaseEntity mappings */ + mappings?: (google.cloud.clouddms.v1.IEntityMapping[]|null); + + /** DatabaseEntity schema */ + schema?: (google.cloud.clouddms.v1.ISchemaEntity|null); + + /** DatabaseEntity table */ + table?: (google.cloud.clouddms.v1.ITableEntity|null); + + /** DatabaseEntity view */ + view?: (google.cloud.clouddms.v1.IViewEntity|null); + + /** DatabaseEntity sequence */ + sequence?: (google.cloud.clouddms.v1.ISequenceEntity|null); + + /** DatabaseEntity storedProcedure */ + storedProcedure?: (google.cloud.clouddms.v1.IStoredProcedureEntity|null); + + /** DatabaseEntity databaseFunction */ + databaseFunction?: (google.cloud.clouddms.v1.IFunctionEntity|null); + + /** DatabaseEntity synonym */ + synonym?: (google.cloud.clouddms.v1.ISynonymEntity|null); + + /** DatabaseEntity databasePackage */ + databasePackage?: (google.cloud.clouddms.v1.IPackageEntity|null); + } + + /** Represents a DatabaseEntity. */ + class DatabaseEntity implements IDatabaseEntity { + + /** + * Constructs a new DatabaseEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IDatabaseEntity); + + /** DatabaseEntity shortName. */ + public shortName: string; + + /** DatabaseEntity parentEntity. */ + public parentEntity: string; + + /** DatabaseEntity tree. */ + public tree: (google.cloud.clouddms.v1.DatabaseEntity.TreeType|keyof typeof google.cloud.clouddms.v1.DatabaseEntity.TreeType); + + /** DatabaseEntity entityType. */ + public entityType: (google.cloud.clouddms.v1.DatabaseEntityType|keyof typeof google.cloud.clouddms.v1.DatabaseEntityType); + + /** DatabaseEntity mappings. */ + public mappings: google.cloud.clouddms.v1.IEntityMapping[]; + + /** DatabaseEntity schema. */ + public schema?: (google.cloud.clouddms.v1.ISchemaEntity|null); + + /** DatabaseEntity table. */ + public table?: (google.cloud.clouddms.v1.ITableEntity|null); + + /** DatabaseEntity view. */ + public view?: (google.cloud.clouddms.v1.IViewEntity|null); + + /** DatabaseEntity sequence. */ + public sequence?: (google.cloud.clouddms.v1.ISequenceEntity|null); + + /** DatabaseEntity storedProcedure. */ + public storedProcedure?: (google.cloud.clouddms.v1.IStoredProcedureEntity|null); + + /** DatabaseEntity databaseFunction. */ + public databaseFunction?: (google.cloud.clouddms.v1.IFunctionEntity|null); + + /** DatabaseEntity synonym. */ + public synonym?: (google.cloud.clouddms.v1.ISynonymEntity|null); + + /** DatabaseEntity databasePackage. */ + public databasePackage?: (google.cloud.clouddms.v1.IPackageEntity|null); + + /** DatabaseEntity entityBody. */ + public entityBody?: ("schema"|"table"|"view"|"sequence"|"storedProcedure"|"databaseFunction"|"synonym"|"databasePackage"); + + /** + * Creates a new DatabaseEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns DatabaseEntity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IDatabaseEntity): google.cloud.clouddms.v1.DatabaseEntity; + + /** + * Encodes the specified DatabaseEntity message. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseEntity.verify|verify} messages. + * @param message DatabaseEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IDatabaseEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatabaseEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseEntity.verify|verify} messages. + * @param message DatabaseEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IDatabaseEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatabaseEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatabaseEntity + * @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.clouddms.v1.DatabaseEntity; + + /** + * Decodes a DatabaseEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatabaseEntity + * @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.clouddms.v1.DatabaseEntity; + + /** + * Verifies a DatabaseEntity 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 DatabaseEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatabaseEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DatabaseEntity; + + /** + * Creates a plain object from a DatabaseEntity message. Also converts values to other types if specified. + * @param message DatabaseEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.DatabaseEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatabaseEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatabaseEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DatabaseEntity { + + /** TreeType enum. */ + enum TreeType { + TREE_TYPE_UNSPECIFIED = 0, + SOURCE = 1, + DRAFT = 2, + DESTINATION = 3 + } + } + + /** Properties of a SchemaEntity. */ + interface ISchemaEntity { + + /** SchemaEntity customFeatures */ + customFeatures?: (google.protobuf.IStruct|null); + } + + /** Represents a SchemaEntity. */ + class SchemaEntity implements ISchemaEntity { + + /** + * Constructs a new SchemaEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISchemaEntity); + + /** SchemaEntity customFeatures. */ + public customFeatures?: (google.protobuf.IStruct|null); + + /** + * Creates a new SchemaEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns SchemaEntity instance + */ + public static create(properties?: google.cloud.clouddms.v1.ISchemaEntity): google.cloud.clouddms.v1.SchemaEntity; + + /** + * Encodes the specified SchemaEntity message. Does not implicitly {@link google.cloud.clouddms.v1.SchemaEntity.verify|verify} messages. + * @param message SchemaEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ISchemaEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchemaEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SchemaEntity.verify|verify} messages. + * @param message SchemaEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ISchemaEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchemaEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchemaEntity + * @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.clouddms.v1.SchemaEntity; + + /** + * Decodes a SchemaEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchemaEntity + * @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.clouddms.v1.SchemaEntity; + + /** + * Verifies a SchemaEntity 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 SchemaEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchemaEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SchemaEntity; + + /** + * Creates a plain object from a SchemaEntity message. Also converts values to other types if specified. + * @param message SchemaEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.SchemaEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchemaEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchemaEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableEntity. */ + interface ITableEntity { + + /** TableEntity columns */ + columns?: (google.cloud.clouddms.v1.IColumnEntity[]|null); + + /** TableEntity constraints */ + constraints?: (google.cloud.clouddms.v1.IConstraintEntity[]|null); + + /** TableEntity indices */ + indices?: (google.cloud.clouddms.v1.IIndexEntity[]|null); + + /** TableEntity triggers */ + triggers?: (google.cloud.clouddms.v1.ITriggerEntity[]|null); + + /** TableEntity customFeatures */ + customFeatures?: (google.protobuf.IStruct|null); + + /** TableEntity comment */ + comment?: (string|null); + } + + /** Represents a TableEntity. */ + class TableEntity implements ITableEntity { + + /** + * Constructs a new TableEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ITableEntity); + + /** TableEntity columns. */ + public columns: google.cloud.clouddms.v1.IColumnEntity[]; + + /** TableEntity constraints. */ + public constraints: google.cloud.clouddms.v1.IConstraintEntity[]; + + /** TableEntity indices. */ + public indices: google.cloud.clouddms.v1.IIndexEntity[]; + + /** TableEntity triggers. */ + public triggers: google.cloud.clouddms.v1.ITriggerEntity[]; + + /** TableEntity customFeatures. */ + public customFeatures?: (google.protobuf.IStruct|null); + + /** TableEntity comment. */ + public comment: string; + + /** + * Creates a new TableEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns TableEntity instance + */ + public static create(properties?: google.cloud.clouddms.v1.ITableEntity): google.cloud.clouddms.v1.TableEntity; + + /** + * Encodes the specified TableEntity message. Does not implicitly {@link google.cloud.clouddms.v1.TableEntity.verify|verify} messages. + * @param message TableEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ITableEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.TableEntity.verify|verify} messages. + * @param message TableEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ITableEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableEntity + * @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.clouddms.v1.TableEntity; + + /** + * Decodes a TableEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableEntity + * @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.clouddms.v1.TableEntity; + + /** + * Verifies a TableEntity 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 TableEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.TableEntity; + + /** + * Creates a plain object from a TableEntity message. Also converts values to other types if specified. + * @param message TableEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.TableEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ColumnEntity. */ + interface IColumnEntity { + + /** ColumnEntity name */ + name?: (string|null); + + /** ColumnEntity dataType */ + dataType?: (string|null); + + /** ColumnEntity charset */ + charset?: (string|null); + + /** ColumnEntity collation */ + collation?: (string|null); + + /** ColumnEntity length */ + length?: (number|Long|string|null); + + /** ColumnEntity precision */ + precision?: (number|null); + + /** ColumnEntity scale */ + scale?: (number|null); + + /** ColumnEntity fractionalSecondsPrecision */ + fractionalSecondsPrecision?: (number|null); + + /** ColumnEntity array */ + array?: (boolean|null); + + /** ColumnEntity arrayLength */ + arrayLength?: (number|null); + + /** ColumnEntity nullable */ + nullable?: (boolean|null); + + /** ColumnEntity autoGenerated */ + autoGenerated?: (boolean|null); + + /** ColumnEntity udt */ + udt?: (boolean|null); + + /** ColumnEntity customFeatures */ + customFeatures?: (google.protobuf.IStruct|null); + + /** ColumnEntity setValues */ + setValues?: (string[]|null); + + /** ColumnEntity comment */ + comment?: (string|null); + + /** ColumnEntity ordinalPosition */ + ordinalPosition?: (number|null); + + /** ColumnEntity defaultValue */ + defaultValue?: (string|null); + } + + /** Represents a ColumnEntity. */ + class ColumnEntity implements IColumnEntity { + + /** + * Constructs a new ColumnEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IColumnEntity); + + /** ColumnEntity name. */ + public name: string; + + /** ColumnEntity dataType. */ + public dataType: string; + + /** ColumnEntity charset. */ + public charset: string; + + /** ColumnEntity collation. */ + public collation: string; + + /** ColumnEntity length. */ + public length: (number|Long|string); + + /** ColumnEntity precision. */ + public precision: number; + + /** ColumnEntity scale. */ + public scale: number; + + /** ColumnEntity fractionalSecondsPrecision. */ + public fractionalSecondsPrecision: number; + + /** ColumnEntity array. */ + public array: boolean; + + /** ColumnEntity arrayLength. */ + public arrayLength: number; + + /** ColumnEntity nullable. */ + public nullable: boolean; + + /** ColumnEntity autoGenerated. */ + public autoGenerated: boolean; + + /** ColumnEntity udt. */ + public udt: boolean; + + /** ColumnEntity customFeatures. */ + public customFeatures?: (google.protobuf.IStruct|null); + + /** ColumnEntity setValues. */ + public setValues: string[]; + + /** ColumnEntity comment. */ + public comment: string; + + /** ColumnEntity ordinalPosition. */ + public ordinalPosition: number; + + /** ColumnEntity defaultValue. */ + public defaultValue: string; + + /** + * Creates a new ColumnEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnEntity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IColumnEntity): google.cloud.clouddms.v1.ColumnEntity; + + /** + * Encodes the specified ColumnEntity message. Does not implicitly {@link google.cloud.clouddms.v1.ColumnEntity.verify|verify} messages. + * @param message ColumnEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IColumnEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ColumnEntity.verify|verify} messages. + * @param message ColumnEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IColumnEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnEntity + * @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.clouddms.v1.ColumnEntity; + + /** + * Decodes a ColumnEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnEntity + * @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.clouddms.v1.ColumnEntity; + + /** + * Verifies a ColumnEntity 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 ColumnEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ColumnEntity; + + /** + * Creates a plain object from a ColumnEntity message. Also converts values to other types if specified. + * @param message ColumnEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ColumnEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConstraintEntity. */ + interface IConstraintEntity { + + /** ConstraintEntity name */ + name?: (string|null); + + /** ConstraintEntity type */ + type?: (string|null); + + /** ConstraintEntity tableColumns */ + tableColumns?: (string[]|null); + + /** ConstraintEntity customFeatures */ + customFeatures?: (google.protobuf.IStruct|null); + + /** ConstraintEntity referenceColumns */ + referenceColumns?: (string[]|null); + + /** ConstraintEntity referenceTable */ + referenceTable?: (string|null); + + /** ConstraintEntity tableName */ + tableName?: (string|null); + } + + /** Represents a ConstraintEntity. */ + class ConstraintEntity implements IConstraintEntity { + + /** + * Constructs a new ConstraintEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IConstraintEntity); + + /** ConstraintEntity name. */ + public name: string; + + /** ConstraintEntity type. */ + public type: string; + + /** ConstraintEntity tableColumns. */ + public tableColumns: string[]; + + /** ConstraintEntity customFeatures. */ + public customFeatures?: (google.protobuf.IStruct|null); + + /** ConstraintEntity referenceColumns. */ + public referenceColumns: string[]; + + /** ConstraintEntity referenceTable. */ + public referenceTable: string; + + /** ConstraintEntity tableName. */ + public tableName: string; + + /** + * Creates a new ConstraintEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns ConstraintEntity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IConstraintEntity): google.cloud.clouddms.v1.ConstraintEntity; + + /** + * Encodes the specified ConstraintEntity message. Does not implicitly {@link google.cloud.clouddms.v1.ConstraintEntity.verify|verify} messages. + * @param message ConstraintEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IConstraintEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConstraintEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConstraintEntity.verify|verify} messages. + * @param message ConstraintEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IConstraintEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConstraintEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConstraintEntity + * @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.clouddms.v1.ConstraintEntity; + + /** + * Decodes a ConstraintEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConstraintEntity + * @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.clouddms.v1.ConstraintEntity; + + /** + * Verifies a ConstraintEntity 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 ConstraintEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConstraintEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ConstraintEntity; + + /** + * Creates a plain object from a ConstraintEntity message. Also converts values to other types if specified. + * @param message ConstraintEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ConstraintEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConstraintEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConstraintEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IndexEntity. */ + interface IIndexEntity { + + /** IndexEntity name */ + name?: (string|null); + + /** IndexEntity type */ + type?: (string|null); + + /** IndexEntity tableColumns */ + tableColumns?: (string[]|null); + + /** IndexEntity unique */ + unique?: (boolean|null); + + /** IndexEntity customFeatures */ + customFeatures?: (google.protobuf.IStruct|null); + } + + /** Represents an IndexEntity. */ + class IndexEntity implements IIndexEntity { + + /** + * Constructs a new IndexEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IIndexEntity); + + /** IndexEntity name. */ + public name: string; + + /** IndexEntity type. */ + public type: string; + + /** IndexEntity tableColumns. */ + public tableColumns: string[]; + + /** IndexEntity unique. */ + public unique: boolean; + + /** IndexEntity customFeatures. */ + public customFeatures?: (google.protobuf.IStruct|null); + + /** + * Creates a new IndexEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns IndexEntity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IIndexEntity): google.cloud.clouddms.v1.IndexEntity; + + /** + * Encodes the specified IndexEntity message. Does not implicitly {@link google.cloud.clouddms.v1.IndexEntity.verify|verify} messages. + * @param message IndexEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IIndexEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndexEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.IndexEntity.verify|verify} messages. + * @param message IndexEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IIndexEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndexEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndexEntity + * @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.clouddms.v1.IndexEntity; + + /** + * Decodes an IndexEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndexEntity + * @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.clouddms.v1.IndexEntity; + + /** + * Verifies an IndexEntity 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 IndexEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndexEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.IndexEntity; + + /** + * Creates a plain object from an IndexEntity message. Also converts values to other types if specified. + * @param message IndexEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.IndexEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndexEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndexEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TriggerEntity. */ + interface ITriggerEntity { + + /** TriggerEntity name */ + name?: (string|null); + + /** TriggerEntity triggeringEvents */ + triggeringEvents?: (string[]|null); + + /** TriggerEntity triggerType */ + triggerType?: (string|null); + + /** TriggerEntity sqlCode */ + sqlCode?: (string|null); + + /** TriggerEntity customFeatures */ + customFeatures?: (google.protobuf.IStruct|null); + } + + /** Represents a TriggerEntity. */ + class TriggerEntity implements ITriggerEntity { + + /** + * Constructs a new TriggerEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ITriggerEntity); + + /** TriggerEntity name. */ + public name: string; + + /** TriggerEntity triggeringEvents. */ + public triggeringEvents: string[]; + + /** TriggerEntity triggerType. */ + public triggerType: string; + + /** TriggerEntity sqlCode. */ + public sqlCode: string; + + /** TriggerEntity customFeatures. */ + public customFeatures?: (google.protobuf.IStruct|null); + + /** + * Creates a new TriggerEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns TriggerEntity instance + */ + public static create(properties?: google.cloud.clouddms.v1.ITriggerEntity): google.cloud.clouddms.v1.TriggerEntity; + + /** + * Encodes the specified TriggerEntity message. Does not implicitly {@link google.cloud.clouddms.v1.TriggerEntity.verify|verify} messages. + * @param message TriggerEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ITriggerEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TriggerEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.TriggerEntity.verify|verify} messages. + * @param message TriggerEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ITriggerEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TriggerEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TriggerEntity + * @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.clouddms.v1.TriggerEntity; + + /** + * Decodes a TriggerEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TriggerEntity + * @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.clouddms.v1.TriggerEntity; + + /** + * Verifies a TriggerEntity 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 TriggerEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TriggerEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.TriggerEntity; + + /** + * Creates a plain object from a TriggerEntity message. Also converts values to other types if specified. + * @param message TriggerEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.TriggerEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TriggerEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TriggerEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ViewEntity. */ + interface IViewEntity { + + /** ViewEntity sqlCode */ + sqlCode?: (string|null); + + /** ViewEntity customFeatures */ + customFeatures?: (google.protobuf.IStruct|null); + + /** ViewEntity constraints */ + constraints?: (google.cloud.clouddms.v1.IConstraintEntity[]|null); + } + + /** Represents a ViewEntity. */ + class ViewEntity implements IViewEntity { + + /** + * Constructs a new ViewEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IViewEntity); + + /** ViewEntity sqlCode. */ + public sqlCode: string; + + /** ViewEntity customFeatures. */ + public customFeatures?: (google.protobuf.IStruct|null); + + /** ViewEntity constraints. */ + public constraints: google.cloud.clouddms.v1.IConstraintEntity[]; + + /** + * Creates a new ViewEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns ViewEntity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IViewEntity): google.cloud.clouddms.v1.ViewEntity; + + /** + * Encodes the specified ViewEntity message. Does not implicitly {@link google.cloud.clouddms.v1.ViewEntity.verify|verify} messages. + * @param message ViewEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IViewEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ViewEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ViewEntity.verify|verify} messages. + * @param message ViewEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IViewEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ViewEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ViewEntity + * @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.clouddms.v1.ViewEntity; + + /** + * Decodes a ViewEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ViewEntity + * @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.clouddms.v1.ViewEntity; + + /** + * Verifies a ViewEntity 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 ViewEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ViewEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ViewEntity; + + /** + * Creates a plain object from a ViewEntity message. Also converts values to other types if specified. + * @param message ViewEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ViewEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ViewEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ViewEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SequenceEntity. */ + interface ISequenceEntity { + + /** SequenceEntity increment */ + increment?: (number|Long|string|null); + + /** SequenceEntity startValue */ + startValue?: (Uint8Array|string|null); + + /** SequenceEntity maxValue */ + maxValue?: (Uint8Array|string|null); + + /** SequenceEntity minValue */ + minValue?: (Uint8Array|string|null); + + /** SequenceEntity cycle */ + cycle?: (boolean|null); + + /** SequenceEntity cache */ + cache?: (number|Long|string|null); + + /** SequenceEntity customFeatures */ + customFeatures?: (google.protobuf.IStruct|null); + } + + /** Represents a SequenceEntity. */ + class SequenceEntity implements ISequenceEntity { + + /** + * Constructs a new SequenceEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISequenceEntity); + + /** SequenceEntity increment. */ + public increment: (number|Long|string); + + /** SequenceEntity startValue. */ + public startValue: (Uint8Array|string); + + /** SequenceEntity maxValue. */ + public maxValue: (Uint8Array|string); + + /** SequenceEntity minValue. */ + public minValue: (Uint8Array|string); + + /** SequenceEntity cycle. */ + public cycle: boolean; + + /** SequenceEntity cache. */ + public cache: (number|Long|string); + + /** SequenceEntity customFeatures. */ + public customFeatures?: (google.protobuf.IStruct|null); + + /** + * Creates a new SequenceEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns SequenceEntity instance + */ + public static create(properties?: google.cloud.clouddms.v1.ISequenceEntity): google.cloud.clouddms.v1.SequenceEntity; + + /** + * Encodes the specified SequenceEntity message. Does not implicitly {@link google.cloud.clouddms.v1.SequenceEntity.verify|verify} messages. + * @param message SequenceEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ISequenceEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SequenceEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SequenceEntity.verify|verify} messages. + * @param message SequenceEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ISequenceEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SequenceEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SequenceEntity + * @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.clouddms.v1.SequenceEntity; + + /** + * Decodes a SequenceEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SequenceEntity + * @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.clouddms.v1.SequenceEntity; + + /** + * Verifies a SequenceEntity 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 SequenceEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SequenceEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SequenceEntity; + + /** + * Creates a plain object from a SequenceEntity message. Also converts values to other types if specified. + * @param message SequenceEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.SequenceEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SequenceEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SequenceEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StoredProcedureEntity. */ + interface IStoredProcedureEntity { + + /** StoredProcedureEntity sqlCode */ + sqlCode?: (string|null); + + /** StoredProcedureEntity customFeatures */ + customFeatures?: (google.protobuf.IStruct|null); + } + + /** Represents a StoredProcedureEntity. */ + class StoredProcedureEntity implements IStoredProcedureEntity { + + /** + * Constructs a new StoredProcedureEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IStoredProcedureEntity); + + /** StoredProcedureEntity sqlCode. */ + public sqlCode: string; + + /** StoredProcedureEntity customFeatures. */ + public customFeatures?: (google.protobuf.IStruct|null); + + /** + * Creates a new StoredProcedureEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns StoredProcedureEntity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IStoredProcedureEntity): google.cloud.clouddms.v1.StoredProcedureEntity; + + /** + * Encodes the specified StoredProcedureEntity message. Does not implicitly {@link google.cloud.clouddms.v1.StoredProcedureEntity.verify|verify} messages. + * @param message StoredProcedureEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IStoredProcedureEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StoredProcedureEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StoredProcedureEntity.verify|verify} messages. + * @param message StoredProcedureEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IStoredProcedureEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StoredProcedureEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StoredProcedureEntity + * @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.clouddms.v1.StoredProcedureEntity; + + /** + * Decodes a StoredProcedureEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StoredProcedureEntity + * @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.clouddms.v1.StoredProcedureEntity; + + /** + * Verifies a StoredProcedureEntity 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 StoredProcedureEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StoredProcedureEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.StoredProcedureEntity; + + /** + * Creates a plain object from a StoredProcedureEntity message. Also converts values to other types if specified. + * @param message StoredProcedureEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.StoredProcedureEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StoredProcedureEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StoredProcedureEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunctionEntity. */ + interface IFunctionEntity { + + /** FunctionEntity sqlCode */ + sqlCode?: (string|null); + + /** FunctionEntity customFeatures */ + customFeatures?: (google.protobuf.IStruct|null); + } + + /** Represents a FunctionEntity. */ + class FunctionEntity implements IFunctionEntity { + + /** + * Constructs a new FunctionEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IFunctionEntity); + + /** FunctionEntity sqlCode. */ + public sqlCode: string; + + /** FunctionEntity customFeatures. */ + public customFeatures?: (google.protobuf.IStruct|null); + + /** + * Creates a new FunctionEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns FunctionEntity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IFunctionEntity): google.cloud.clouddms.v1.FunctionEntity; + + /** + * Encodes the specified FunctionEntity message. Does not implicitly {@link google.cloud.clouddms.v1.FunctionEntity.verify|verify} messages. + * @param message FunctionEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IFunctionEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunctionEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.FunctionEntity.verify|verify} messages. + * @param message FunctionEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IFunctionEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunctionEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunctionEntity + * @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.clouddms.v1.FunctionEntity; + + /** + * Decodes a FunctionEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunctionEntity + * @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.clouddms.v1.FunctionEntity; + + /** + * Verifies a FunctionEntity 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 FunctionEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunctionEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.FunctionEntity; + + /** + * Creates a plain object from a FunctionEntity message. Also converts values to other types if specified. + * @param message FunctionEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.FunctionEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunctionEntity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** MigrationJob destination. */ - public destination: string; + /** + * Gets the default type url for FunctionEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** MigrationJob reverseSshConnectivity. */ - public reverseSshConnectivity?: (google.cloud.clouddms.v1.IReverseSshConnectivity|null); + /** Properties of a SynonymEntity. */ + interface ISynonymEntity { - /** MigrationJob vpcPeeringConnectivity. */ - public vpcPeeringConnectivity?: (google.cloud.clouddms.v1.IVpcPeeringConnectivity|null); + /** SynonymEntity sourceEntity */ + sourceEntity?: (string|null); - /** MigrationJob staticIpConnectivity. */ - public staticIpConnectivity?: (google.cloud.clouddms.v1.IStaticIpConnectivity|null); + /** SynonymEntity sourceType */ + sourceType?: (google.cloud.clouddms.v1.DatabaseEntityType|keyof typeof google.cloud.clouddms.v1.DatabaseEntityType|null); - /** MigrationJob duration. */ - public duration?: (google.protobuf.IDuration|null); + /** SynonymEntity customFeatures */ + customFeatures?: (google.protobuf.IStruct|null); + } - /** MigrationJob error. */ - public error?: (google.rpc.IStatus|null); + /** Represents a SynonymEntity. */ + class SynonymEntity implements ISynonymEntity { - /** MigrationJob sourceDatabase. */ - public sourceDatabase?: (google.cloud.clouddms.v1.IDatabaseType|null); + /** + * Constructs a new SynonymEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISynonymEntity); - /** MigrationJob destinationDatabase. */ - public destinationDatabase?: (google.cloud.clouddms.v1.IDatabaseType|null); + /** SynonymEntity sourceEntity. */ + public sourceEntity: string; - /** MigrationJob endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** SynonymEntity sourceType. */ + public sourceType: (google.cloud.clouddms.v1.DatabaseEntityType|keyof typeof google.cloud.clouddms.v1.DatabaseEntityType); - /** MigrationJob connectivity. */ - public connectivity?: ("reverseSshConnectivity"|"vpcPeeringConnectivity"|"staticIpConnectivity"); + /** SynonymEntity customFeatures. */ + public customFeatures?: (google.protobuf.IStruct|null); /** - * Creates a new MigrationJob instance using the specified properties. + * Creates a new SynonymEntity instance using the specified properties. * @param [properties] Properties to set - * @returns MigrationJob instance + * @returns SynonymEntity instance */ - public static create(properties?: google.cloud.clouddms.v1.IMigrationJob): google.cloud.clouddms.v1.MigrationJob; + public static create(properties?: google.cloud.clouddms.v1.ISynonymEntity): google.cloud.clouddms.v1.SynonymEntity; /** - * Encodes the specified MigrationJob message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.verify|verify} messages. - * @param message MigrationJob message or plain object to encode + * Encodes the specified SynonymEntity message. Does not implicitly {@link google.cloud.clouddms.v1.SynonymEntity.verify|verify} messages. + * @param message SynonymEntity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.IMigrationJob, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.ISynonymEntity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MigrationJob message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.verify|verify} messages. - * @param message MigrationJob message or plain object to encode + * Encodes the specified SynonymEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SynonymEntity.verify|verify} messages. + * @param message SynonymEntity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.IMigrationJob, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.ISynonymEntity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MigrationJob message from the specified reader or buffer. + * Decodes a SynonymEntity message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MigrationJob + * @returns SynonymEntity * @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.clouddms.v1.MigrationJob; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.SynonymEntity; /** - * Decodes a MigrationJob message from the specified reader or buffer, length delimited. + * Decodes a SynonymEntity message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MigrationJob + * @returns SynonymEntity * @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.clouddms.v1.MigrationJob; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.SynonymEntity; /** - * Verifies a MigrationJob message. + * Verifies a SynonymEntity 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 MigrationJob message from a plain object. Also converts values to their respective internal types. + * Creates a SynonymEntity message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MigrationJob + * @returns SynonymEntity */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.MigrationJob; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SynonymEntity; /** - * Creates a plain object from a MigrationJob message. Also converts values to other types if specified. - * @param message MigrationJob + * Creates a plain object from a SynonymEntity message. Also converts values to other types if specified. + * @param message SynonymEntity * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.MigrationJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.SynonymEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MigrationJob to JSON. + * Converts this SynonymEntity to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MigrationJob + * Gets the default type url for SynonymEntity * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace MigrationJob { + /** Properties of a PackageEntity. */ + interface IPackageEntity { - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - MAINTENANCE = 1, - DRAFT = 2, - CREATING = 3, - NOT_STARTED = 4, - RUNNING = 5, - FAILED = 6, - COMPLETED = 7, - DELETING = 8, - STOPPING = 9, - STOPPED = 10, - DELETED = 11, - UPDATING = 12, - STARTING = 13, - RESTARTING = 14, - RESUMING = 15 - } + /** PackageEntity packageSqlCode */ + packageSqlCode?: (string|null); - /** Phase enum. */ - enum Phase { - PHASE_UNSPECIFIED = 0, - FULL_DUMP = 1, - CDC = 2, - PROMOTE_IN_PROGRESS = 3, - WAITING_FOR_SOURCE_WRITES_TO_STOP = 4, - PREPARING_THE_DUMP = 5 - } + /** PackageEntity packageBody */ + packageBody?: (string|null); - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - ONE_TIME = 1, - CONTINUOUS = 2 - } + /** PackageEntity customFeatures */ + customFeatures?: (google.protobuf.IStruct|null); } - /** Properties of a ConnectionProfile. */ - interface IConnectionProfile { + /** Represents a PackageEntity. */ + class PackageEntity implements IPackageEntity { - /** ConnectionProfile name */ - name?: (string|null); + /** + * Constructs a new PackageEntity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IPackageEntity); - /** ConnectionProfile createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** PackageEntity packageSqlCode. */ + public packageSqlCode: string; - /** ConnectionProfile updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** PackageEntity packageBody. */ + public packageBody: string; - /** ConnectionProfile labels */ - labels?: ({ [k: string]: string }|null); + /** PackageEntity customFeatures. */ + public customFeatures?: (google.protobuf.IStruct|null); - /** ConnectionProfile state */ - state?: (google.cloud.clouddms.v1.ConnectionProfile.State|keyof typeof google.cloud.clouddms.v1.ConnectionProfile.State|null); + /** + * Creates a new PackageEntity instance using the specified properties. + * @param [properties] Properties to set + * @returns PackageEntity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IPackageEntity): google.cloud.clouddms.v1.PackageEntity; - /** ConnectionProfile displayName */ - displayName?: (string|null); + /** + * Encodes the specified PackageEntity message. Does not implicitly {@link google.cloud.clouddms.v1.PackageEntity.verify|verify} messages. + * @param message PackageEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IPackageEntity, writer?: $protobuf.Writer): $protobuf.Writer; - /** ConnectionProfile mysql */ - mysql?: (google.cloud.clouddms.v1.IMySqlConnectionProfile|null); + /** + * Encodes the specified PackageEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PackageEntity.verify|verify} messages. + * @param message PackageEntity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IPackageEntity, writer?: $protobuf.Writer): $protobuf.Writer; - /** ConnectionProfile postgresql */ - postgresql?: (google.cloud.clouddms.v1.IPostgreSqlConnectionProfile|null); + /** + * Decodes a PackageEntity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PackageEntity + * @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.clouddms.v1.PackageEntity; - /** ConnectionProfile cloudsql */ - cloudsql?: (google.cloud.clouddms.v1.ICloudSqlConnectionProfile|null); + /** + * Decodes a PackageEntity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PackageEntity + * @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.clouddms.v1.PackageEntity; - /** ConnectionProfile error */ - error?: (google.rpc.IStatus|null); + /** + * Verifies a PackageEntity 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); - /** ConnectionProfile provider */ - provider?: (google.cloud.clouddms.v1.DatabaseProvider|keyof typeof google.cloud.clouddms.v1.DatabaseProvider|null); - } + /** + * Creates a PackageEntity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PackageEntity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.PackageEntity; - /** Represents a ConnectionProfile. */ - class ConnectionProfile implements IConnectionProfile { + /** + * Creates a plain object from a PackageEntity message. Also converts values to other types if specified. + * @param message PackageEntity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.PackageEntity, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Constructs a new ConnectionProfile. - * @param [properties] Properties to set + * Converts this PackageEntity to JSON. + * @returns JSON object */ - constructor(properties?: google.cloud.clouddms.v1.IConnectionProfile); + public toJSON(): { [k: string]: any }; - /** ConnectionProfile name. */ - public name: string; + /** + * Gets the default type url for PackageEntity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** ConnectionProfile createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** Properties of an EntityMapping. */ + interface IEntityMapping { - /** ConnectionProfile updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** EntityMapping sourceEntity */ + sourceEntity?: (string|null); - /** ConnectionProfile labels. */ - public labels: { [k: string]: string }; + /** EntityMapping draftEntity */ + draftEntity?: (string|null); - /** ConnectionProfile state. */ - public state: (google.cloud.clouddms.v1.ConnectionProfile.State|keyof typeof google.cloud.clouddms.v1.ConnectionProfile.State); + /** EntityMapping sourceType */ + sourceType?: (google.cloud.clouddms.v1.DatabaseEntityType|keyof typeof google.cloud.clouddms.v1.DatabaseEntityType|null); - /** ConnectionProfile displayName. */ - public displayName: string; + /** EntityMapping draftType */ + draftType?: (google.cloud.clouddms.v1.DatabaseEntityType|keyof typeof google.cloud.clouddms.v1.DatabaseEntityType|null); - /** ConnectionProfile mysql. */ - public mysql?: (google.cloud.clouddms.v1.IMySqlConnectionProfile|null); + /** EntityMapping mappingLog */ + mappingLog?: (google.cloud.clouddms.v1.IEntityMappingLogEntry[]|null); + } - /** ConnectionProfile postgresql. */ - public postgresql?: (google.cloud.clouddms.v1.IPostgreSqlConnectionProfile|null); + /** Represents an EntityMapping. */ + class EntityMapping implements IEntityMapping { - /** ConnectionProfile cloudsql. */ - public cloudsql?: (google.cloud.clouddms.v1.ICloudSqlConnectionProfile|null); + /** + * Constructs a new EntityMapping. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IEntityMapping); - /** ConnectionProfile error. */ - public error?: (google.rpc.IStatus|null); + /** EntityMapping sourceEntity. */ + public sourceEntity: string; - /** ConnectionProfile provider. */ - public provider: (google.cloud.clouddms.v1.DatabaseProvider|keyof typeof google.cloud.clouddms.v1.DatabaseProvider); + /** EntityMapping draftEntity. */ + public draftEntity: string; - /** ConnectionProfile connectionProfile. */ - public connectionProfile?: ("mysql"|"postgresql"|"cloudsql"); + /** EntityMapping sourceType. */ + public sourceType: (google.cloud.clouddms.v1.DatabaseEntityType|keyof typeof google.cloud.clouddms.v1.DatabaseEntityType); + + /** EntityMapping draftType. */ + public draftType: (google.cloud.clouddms.v1.DatabaseEntityType|keyof typeof google.cloud.clouddms.v1.DatabaseEntityType); + + /** EntityMapping mappingLog. */ + public mappingLog: google.cloud.clouddms.v1.IEntityMappingLogEntry[]; /** - * Creates a new ConnectionProfile instance using the specified properties. + * Creates a new EntityMapping instance using the specified properties. * @param [properties] Properties to set - * @returns ConnectionProfile instance + * @returns EntityMapping instance */ - public static create(properties?: google.cloud.clouddms.v1.IConnectionProfile): google.cloud.clouddms.v1.ConnectionProfile; + public static create(properties?: google.cloud.clouddms.v1.IEntityMapping): google.cloud.clouddms.v1.EntityMapping; /** - * Encodes the specified ConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.ConnectionProfile.verify|verify} messages. - * @param message ConnectionProfile message or plain object to encode + * Encodes the specified EntityMapping message. Does not implicitly {@link google.cloud.clouddms.v1.EntityMapping.verify|verify} messages. + * @param message EntityMapping message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.IConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.IEntityMapping, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConnectionProfile.verify|verify} messages. - * @param message ConnectionProfile message or plain object to encode + * Encodes the specified EntityMapping message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.EntityMapping.verify|verify} messages. + * @param message EntityMapping message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.IConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.IEntityMapping, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ConnectionProfile message from the specified reader or buffer. + * Decodes an EntityMapping message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ConnectionProfile + * @returns EntityMapping * @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.clouddms.v1.ConnectionProfile; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.EntityMapping; /** - * Decodes a ConnectionProfile message from the specified reader or buffer, length delimited. + * Decodes an EntityMapping message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ConnectionProfile + * @returns EntityMapping * @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.clouddms.v1.ConnectionProfile; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.EntityMapping; /** - * Verifies a ConnectionProfile message. + * Verifies an EntityMapping 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 ConnectionProfile message from a plain object. Also converts values to their respective internal types. + * Creates an EntityMapping message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ConnectionProfile + * @returns EntityMapping */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ConnectionProfile; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.EntityMapping; /** - * Creates a plain object from a ConnectionProfile message. Also converts values to other types if specified. - * @param message ConnectionProfile + * Creates a plain object from an EntityMapping message. Also converts values to other types if specified. + * @param message EntityMapping * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.ConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.EntityMapping, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ConnectionProfile to JSON. + * Converts this EntityMapping to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ConnectionProfile + * Gets the default type url for EntityMapping * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ConnectionProfile { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - DRAFT = 1, - CREATING = 2, - READY = 3, - UPDATING = 4, - DELETING = 5, - DELETED = 6, - FAILED = 7 - } - } - - /** Properties of a MigrationJobVerificationError. */ - interface IMigrationJobVerificationError { + /** Properties of an EntityMappingLogEntry. */ + interface IEntityMappingLogEntry { - /** MigrationJobVerificationError errorCode */ - errorCode?: (google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode|keyof typeof google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode|null); + /** EntityMappingLogEntry ruleId */ + ruleId?: (string|null); - /** MigrationJobVerificationError errorMessage */ - errorMessage?: (string|null); + /** EntityMappingLogEntry ruleRevisionId */ + ruleRevisionId?: (string|null); - /** MigrationJobVerificationError errorDetailMessage */ - errorDetailMessage?: (string|null); + /** EntityMappingLogEntry mappingComment */ + mappingComment?: (string|null); } - /** Represents a MigrationJobVerificationError. */ - class MigrationJobVerificationError implements IMigrationJobVerificationError { + /** Represents an EntityMappingLogEntry. */ + class EntityMappingLogEntry implements IEntityMappingLogEntry { /** - * Constructs a new MigrationJobVerificationError. + * Constructs a new EntityMappingLogEntry. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.clouddms.v1.IMigrationJobVerificationError); + constructor(properties?: google.cloud.clouddms.v1.IEntityMappingLogEntry); - /** MigrationJobVerificationError errorCode. */ - public errorCode: (google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode|keyof typeof google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode); + /** EntityMappingLogEntry ruleId. */ + public ruleId: string; - /** MigrationJobVerificationError errorMessage. */ - public errorMessage: string; + /** EntityMappingLogEntry ruleRevisionId. */ + public ruleRevisionId: string; - /** MigrationJobVerificationError errorDetailMessage. */ - public errorDetailMessage: string; + /** EntityMappingLogEntry mappingComment. */ + public mappingComment: string; /** - * Creates a new MigrationJobVerificationError instance using the specified properties. + * Creates a new EntityMappingLogEntry instance using the specified properties. * @param [properties] Properties to set - * @returns MigrationJobVerificationError instance + * @returns EntityMappingLogEntry instance */ - public static create(properties?: google.cloud.clouddms.v1.IMigrationJobVerificationError): google.cloud.clouddms.v1.MigrationJobVerificationError; + public static create(properties?: google.cloud.clouddms.v1.IEntityMappingLogEntry): google.cloud.clouddms.v1.EntityMappingLogEntry; /** - * Encodes the specified MigrationJobVerificationError message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJobVerificationError.verify|verify} messages. - * @param message MigrationJobVerificationError message or plain object to encode + * Encodes the specified EntityMappingLogEntry message. Does not implicitly {@link google.cloud.clouddms.v1.EntityMappingLogEntry.verify|verify} messages. + * @param message EntityMappingLogEntry message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.clouddms.v1.IMigrationJobVerificationError, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.clouddms.v1.IEntityMappingLogEntry, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MigrationJobVerificationError message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJobVerificationError.verify|verify} messages. - * @param message MigrationJobVerificationError message or plain object to encode + * Encodes the specified EntityMappingLogEntry message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.EntityMappingLogEntry.verify|verify} messages. + * @param message EntityMappingLogEntry message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.clouddms.v1.IMigrationJobVerificationError, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.clouddms.v1.IEntityMappingLogEntry, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MigrationJobVerificationError message from the specified reader or buffer. + * Decodes an EntityMappingLogEntry message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MigrationJobVerificationError + * @returns EntityMappingLogEntry * @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.clouddms.v1.MigrationJobVerificationError; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.EntityMappingLogEntry; /** - * Decodes a MigrationJobVerificationError message from the specified reader or buffer, length delimited. + * Decodes an EntityMappingLogEntry message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MigrationJobVerificationError + * @returns EntityMappingLogEntry * @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.clouddms.v1.MigrationJobVerificationError; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.EntityMappingLogEntry; /** - * Verifies a MigrationJobVerificationError message. + * Verifies an EntityMappingLogEntry 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 MigrationJobVerificationError message from a plain object. Also converts values to their respective internal types. + * Creates an EntityMappingLogEntry message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MigrationJobVerificationError + * @returns EntityMappingLogEntry */ - public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.MigrationJobVerificationError; + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.EntityMappingLogEntry; /** - * Creates a plain object from a MigrationJobVerificationError message. Also converts values to other types if specified. - * @param message MigrationJobVerificationError + * Creates a plain object from an EntityMappingLogEntry message. Also converts values to other types if specified. + * @param message EntityMappingLogEntry * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.clouddms.v1.MigrationJobVerificationError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.clouddms.v1.EntityMappingLogEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MigrationJobVerificationError to JSON. + * Converts this EntityMappingLogEntry to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MigrationJobVerificationError + * Gets the default type url for EntityMappingLogEntry * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace MigrationJobVerificationError { - - /** ErrorCode enum. */ - enum ErrorCode { - ERROR_CODE_UNSPECIFIED = 0, - CONNECTION_FAILURE = 1, - AUTHENTICATION_FAILURE = 2, - INVALID_CONNECTION_PROFILE_CONFIG = 3, - VERSION_INCOMPATIBILITY = 4, - CONNECTION_PROFILE_TYPES_INCOMPATIBILITY = 5, - NO_PGLOGICAL_INSTALLED = 7, - PGLOGICAL_NODE_ALREADY_EXISTS = 8, - INVALID_WAL_LEVEL = 9, - INVALID_SHARED_PRELOAD_LIBRARY = 10, - INSUFFICIENT_MAX_REPLICATION_SLOTS = 11, - INSUFFICIENT_MAX_WAL_SENDERS = 12, - INSUFFICIENT_MAX_WORKER_PROCESSES = 13, - UNSUPPORTED_EXTENSIONS = 14, - UNSUPPORTED_MIGRATION_TYPE = 15, - INVALID_RDS_LOGICAL_REPLICATION = 16, - UNSUPPORTED_GTID_MODE = 17, - UNSUPPORTED_TABLE_DEFINITION = 18, - UNSUPPORTED_DEFINER = 19, - CANT_RESTART_RUNNING_MIGRATION = 21 - } + /** DatabaseEntityType enum. */ + enum DatabaseEntityType { + DATABASE_ENTITY_TYPE_UNSPECIFIED = 0, + DATABASE_ENTITY_TYPE_SCHEMA = 1, + DATABASE_ENTITY_TYPE_TABLE = 2, + DATABASE_ENTITY_TYPE_COLUMN = 3, + DATABASE_ENTITY_TYPE_CONSTRAINT = 4, + DATABASE_ENTITY_TYPE_INDEX = 5, + DATABASE_ENTITY_TYPE_TRIGGER = 6, + DATABASE_ENTITY_TYPE_VIEW = 7, + DATABASE_ENTITY_TYPE_SEQUENCE = 8, + DATABASE_ENTITY_TYPE_STORED_PROCEDURE = 9, + DATABASE_ENTITY_TYPE_FUNCTION = 10, + DATABASE_ENTITY_TYPE_SYNONYM = 11, + DATABASE_ENTITY_TYPE_DATABASE_PACKAGE = 12, + DATABASE_ENTITY_TYPE_UDT = 13, + DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW = 14, + DATABASE_ENTITY_TYPE_DATABASE = 15 } - /** DatabaseEngine enum. */ - enum DatabaseEngine { - DATABASE_ENGINE_UNSPECIFIED = 0, - MYSQL = 1, - POSTGRESQL = 2 + /** BackgroundJobType enum. */ + enum BackgroundJobType { + BACKGROUND_JOB_TYPE_UNSPECIFIED = 0, + BACKGROUND_JOB_TYPE_SOURCE_SEED = 1, + BACKGROUND_JOB_TYPE_CONVERT = 2, + BACKGROUND_JOB_TYPE_APPLY_DESTINATION = 3, + BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE = 5 } - /** DatabaseProvider enum. */ - enum DatabaseProvider { - DATABASE_PROVIDER_UNSPECIFIED = 0, - CLOUDSQL = 1, - RDS = 2 + /** ImportRulesFileFormat enum. */ + enum ImportRulesFileFormat { + IMPORT_RULES_FILE_FORMAT_UNSPECIFIED = 0, + IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE = 1, + IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE = 2 } } } @@ -9960,6 +17833,335 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct 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 Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value 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 Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue 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 ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an Empty. */ interface IEmpty { } diff --git a/packages/google-cloud-clouddms/protos/protos.js b/packages/google-cloud-clouddms/protos/protos.js index 54fdb3463ba..cba805a8493 100644 --- a/packages/google-cloud-clouddms/protos/protos.js +++ b/packages/google-cloud-clouddms/protos/protos.js @@ -659,817 +659,658 @@ * @variation 2 */ - return DataMigrationService; - })(); + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|createPrivateConnection}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef CreatePrivateConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - v1.ListMigrationJobsRequest = (function() { + /** + * Calls CreatePrivateConnection. + * @function createPrivateConnection + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ICreatePrivateConnectionRequest} request CreatePrivateConnectionRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.CreatePrivateConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.createPrivateConnection = function createPrivateConnection(request, callback) { + return this.rpcCall(createPrivateConnection, $root.google.cloud.clouddms.v1.CreatePrivateConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreatePrivateConnection" }); /** - * Properties of a ListMigrationJobsRequest. - * @memberof google.cloud.clouddms.v1 - * @interface IListMigrationJobsRequest - * @property {string|null} [parent] ListMigrationJobsRequest parent - * @property {number|null} [pageSize] ListMigrationJobsRequest pageSize - * @property {string|null} [pageToken] ListMigrationJobsRequest pageToken - * @property {string|null} [filter] ListMigrationJobsRequest filter - * @property {string|null} [orderBy] ListMigrationJobsRequest orderBy + * Calls CreatePrivateConnection. + * @function createPrivateConnection + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ICreatePrivateConnectionRequest} request CreatePrivateConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new ListMigrationJobsRequest. - * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a ListMigrationJobsRequest. - * @implements IListMigrationJobsRequest - * @constructor - * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest=} [properties] Properties to set + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|getPrivateConnection}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef GetPrivateConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.PrivateConnection} [response] PrivateConnection */ - function ListMigrationJobsRequest(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]]; - } /** - * ListMigrationJobsRequest parent. - * @member {string} parent - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * Calls GetPrivateConnection. + * @function getPrivateConnection + * @memberof google.cloud.clouddms.v1.DataMigrationService * @instance + * @param {google.cloud.clouddms.v1.IGetPrivateConnectionRequest} request GetPrivateConnectionRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.GetPrivateConnectionCallback} callback Node-style callback called with the error, if any, and PrivateConnection + * @returns {undefined} + * @variation 1 */ - ListMigrationJobsRequest.prototype.parent = ""; + Object.defineProperty(DataMigrationService.prototype.getPrivateConnection = function getPrivateConnection(request, callback) { + return this.rpcCall(getPrivateConnection, $root.google.cloud.clouddms.v1.GetPrivateConnectionRequest, $root.google.cloud.clouddms.v1.PrivateConnection, request, callback); + }, "name", { value: "GetPrivateConnection" }); /** - * ListMigrationJobsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * Calls GetPrivateConnection. + * @function getPrivateConnection + * @memberof google.cloud.clouddms.v1.DataMigrationService * @instance + * @param {google.cloud.clouddms.v1.IGetPrivateConnectionRequest} request GetPrivateConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMigrationJobsRequest.prototype.pageSize = 0; /** - * ListMigrationJobsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest - * @instance + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|listPrivateConnections}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef ListPrivateConnectionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.ListPrivateConnectionsResponse} [response] ListPrivateConnectionsResponse */ - ListMigrationJobsRequest.prototype.pageToken = ""; /** - * ListMigrationJobsRequest filter. - * @member {string} filter - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * Calls ListPrivateConnections. + * @function listPrivateConnections + * @memberof google.cloud.clouddms.v1.DataMigrationService * @instance + * @param {google.cloud.clouddms.v1.IListPrivateConnectionsRequest} request ListPrivateConnectionsRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.ListPrivateConnectionsCallback} callback Node-style callback called with the error, if any, and ListPrivateConnectionsResponse + * @returns {undefined} + * @variation 1 */ - ListMigrationJobsRequest.prototype.filter = ""; + Object.defineProperty(DataMigrationService.prototype.listPrivateConnections = function listPrivateConnections(request, callback) { + return this.rpcCall(listPrivateConnections, $root.google.cloud.clouddms.v1.ListPrivateConnectionsRequest, $root.google.cloud.clouddms.v1.ListPrivateConnectionsResponse, request, callback); + }, "name", { value: "ListPrivateConnections" }); /** - * ListMigrationJobsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * Calls ListPrivateConnections. + * @function listPrivateConnections + * @memberof google.cloud.clouddms.v1.DataMigrationService * @instance + * @param {google.cloud.clouddms.v1.IListPrivateConnectionsRequest} request ListPrivateConnectionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMigrationJobsRequest.prototype.orderBy = ""; /** - * Creates a new ListMigrationJobsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest - * @static - * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.ListMigrationJobsRequest} ListMigrationJobsRequest instance + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|deletePrivateConnection}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef DeletePrivateConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListMigrationJobsRequest.create = function create(properties) { - return new ListMigrationJobsRequest(properties); - }; /** - * Encodes the specified ListMigrationJobsRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest - * @static - * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest} message ListMigrationJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeletePrivateConnection. + * @function deletePrivateConnection + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IDeletePrivateConnectionRequest} request DeletePrivateConnectionRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.DeletePrivateConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListMigrationJobsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; + Object.defineProperty(DataMigrationService.prototype.deletePrivateConnection = function deletePrivateConnection(request, callback) { + return this.rpcCall(deletePrivateConnection, $root.google.cloud.clouddms.v1.DeletePrivateConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeletePrivateConnection" }); /** - * Encodes the specified ListMigrationJobsRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest - * @static - * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest} message ListMigrationJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeletePrivateConnection. + * @function deletePrivateConnection + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IDeletePrivateConnectionRequest} request DeletePrivateConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMigrationJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListMigrationJobsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.ListMigrationJobsRequest} ListMigrationJobsRequest - * @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.clouddms.v1.DataMigrationService|getConversionWorkspace}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef GetConversionWorkspaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.ConversionWorkspace} [response] ConversionWorkspace */ - ListMigrationJobsRequest.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.clouddms.v1.ListMigrationJobsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListMigrationJobsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.ListMigrationJobsRequest} ListMigrationJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetConversionWorkspace. + * @function getConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IGetConversionWorkspaceRequest} request GetConversionWorkspaceRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.GetConversionWorkspaceCallback} callback Node-style callback called with the error, if any, and ConversionWorkspace + * @returns {undefined} + * @variation 1 */ - ListMigrationJobsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(DataMigrationService.prototype.getConversionWorkspace = function getConversionWorkspace(request, callback) { + return this.rpcCall(getConversionWorkspace, $root.google.cloud.clouddms.v1.GetConversionWorkspaceRequest, $root.google.cloud.clouddms.v1.ConversionWorkspace, request, callback); + }, "name", { value: "GetConversionWorkspace" }); /** - * Verifies a ListMigrationJobsRequest message. - * @function verify - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls GetConversionWorkspace. + * @function getConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IGetConversionWorkspaceRequest} request GetConversionWorkspaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMigrationJobsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; /** - * Creates a ListMigrationJobsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.ListMigrationJobsRequest} ListMigrationJobsRequest + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|listConversionWorkspaces}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef ListConversionWorkspacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.ListConversionWorkspacesResponse} [response] ListConversionWorkspacesResponse */ - ListMigrationJobsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.ListMigrationJobsRequest) - return object; - var message = new $root.google.cloud.clouddms.v1.ListMigrationJobsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; /** - * Creates a plain object from a ListMigrationJobsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest - * @static - * @param {google.cloud.clouddms.v1.ListMigrationJobsRequest} message ListMigrationJobsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListMigrationJobsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; + * Calls ListConversionWorkspaces. + * @function listConversionWorkspaces + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IListConversionWorkspacesRequest} request ListConversionWorkspacesRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.ListConversionWorkspacesCallback} callback Node-style callback called with the error, if any, and ListConversionWorkspacesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.listConversionWorkspaces = function listConversionWorkspaces(request, callback) { + return this.rpcCall(listConversionWorkspaces, $root.google.cloud.clouddms.v1.ListConversionWorkspacesRequest, $root.google.cloud.clouddms.v1.ListConversionWorkspacesResponse, request, callback); + }, "name", { value: "ListConversionWorkspaces" }); /** - * Converts this ListMigrationJobsRequest to JSON. - * @function toJSON - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * Calls ListConversionWorkspaces. + * @function listConversionWorkspaces + * @memberof google.cloud.clouddms.v1.DataMigrationService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.clouddms.v1.IListConversionWorkspacesRequest} request ListConversionWorkspacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMigrationJobsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for ListMigrationJobsRequest - * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|createConversionWorkspace}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef CreateConversionWorkspaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListMigrationJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.clouddms.v1.ListMigrationJobsRequest"; - }; - return ListMigrationJobsRequest; - })(); + /** + * Calls CreateConversionWorkspace. + * @function createConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest} request CreateConversionWorkspaceRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.CreateConversionWorkspaceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.createConversionWorkspace = function createConversionWorkspace(request, callback) { + return this.rpcCall(createConversionWorkspace, $root.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateConversionWorkspace" }); - v1.ListMigrationJobsResponse = (function() { + /** + * Calls CreateConversionWorkspace. + * @function createConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest} request CreateConversionWorkspaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ /** - * Properties of a ListMigrationJobsResponse. - * @memberof google.cloud.clouddms.v1 - * @interface IListMigrationJobsResponse - * @property {Array.|null} [migrationJobs] ListMigrationJobsResponse migrationJobs - * @property {string|null} [nextPageToken] ListMigrationJobsResponse nextPageToken - * @property {Array.|null} [unreachable] ListMigrationJobsResponse unreachable + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|updateConversionWorkspace}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef UpdateConversionWorkspaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ /** - * Constructs a new ListMigrationJobsResponse. - * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a ListMigrationJobsResponse. - * @implements IListMigrationJobsResponse - * @constructor - * @param {google.cloud.clouddms.v1.IListMigrationJobsResponse=} [properties] Properties to set + * Calls UpdateConversionWorkspace. + * @function updateConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest} request UpdateConversionWorkspaceRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.UpdateConversionWorkspaceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - function ListMigrationJobsResponse(properties) { - this.migrationJobs = []; - this.unreachable = []; - 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]]; - } + Object.defineProperty(DataMigrationService.prototype.updateConversionWorkspace = function updateConversionWorkspace(request, callback) { + return this.rpcCall(updateConversionWorkspace, $root.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateConversionWorkspace" }); /** - * ListMigrationJobsResponse migrationJobs. - * @member {Array.} migrationJobs - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * Calls UpdateConversionWorkspace. + * @function updateConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService * @instance + * @param {google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest} request UpdateConversionWorkspaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMigrationJobsResponse.prototype.migrationJobs = $util.emptyArray; /** - * ListMigrationJobsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|deleteConversionWorkspace}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef DeleteConversionWorkspaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteConversionWorkspace. + * @function deleteConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService * @instance + * @param {google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest} request DeleteConversionWorkspaceRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.DeleteConversionWorkspaceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListMigrationJobsResponse.prototype.nextPageToken = ""; + Object.defineProperty(DataMigrationService.prototype.deleteConversionWorkspace = function deleteConversionWorkspace(request, callback) { + return this.rpcCall(deleteConversionWorkspace, $root.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteConversionWorkspace" }); /** - * ListMigrationJobsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * Calls DeleteConversionWorkspace. + * @function deleteConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService * @instance + * @param {google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest} request DeleteConversionWorkspaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMigrationJobsResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new ListMigrationJobsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse - * @static - * @param {google.cloud.clouddms.v1.IListMigrationJobsResponse=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.ListMigrationJobsResponse} ListMigrationJobsResponse instance + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|seedConversionWorkspace}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef SeedConversionWorkspaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListMigrationJobsResponse.create = function create(properties) { - return new ListMigrationJobsResponse(properties); - }; /** - * Encodes the specified ListMigrationJobsResponse message. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse - * @static - * @param {google.cloud.clouddms.v1.IListMigrationJobsResponse} message ListMigrationJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls SeedConversionWorkspace. + * @function seedConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest} request SeedConversionWorkspaceRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.SeedConversionWorkspaceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListMigrationJobsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.migrationJobs != null && message.migrationJobs.length) - for (var i = 0; i < message.migrationJobs.length; ++i) - $root.google.cloud.clouddms.v1.MigrationJob.encode(message.migrationJobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; + Object.defineProperty(DataMigrationService.prototype.seedConversionWorkspace = function seedConversionWorkspace(request, callback) { + return this.rpcCall(seedConversionWorkspace, $root.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SeedConversionWorkspace" }); /** - * Encodes the specified ListMigrationJobsResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse - * @static - * @param {google.cloud.clouddms.v1.IListMigrationJobsResponse} message ListMigrationJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls SeedConversionWorkspace. + * @function seedConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest} request SeedConversionWorkspaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMigrationJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListMigrationJobsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.ListMigrationJobsResponse} ListMigrationJobsResponse - * @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.clouddms.v1.DataMigrationService|importMappingRules}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef ImportMappingRulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListMigrationJobsResponse.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.clouddms.v1.ListMigrationJobsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.migrationJobs && message.migrationJobs.length)) - message.migrationJobs = []; - message.migrationJobs.push($root.google.cloud.clouddms.v1.MigrationJob.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListMigrationJobsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.ListMigrationJobsResponse} ListMigrationJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ImportMappingRules. + * @function importMappingRules + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IImportMappingRulesRequest} request ImportMappingRulesRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.ImportMappingRulesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListMigrationJobsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(DataMigrationService.prototype.importMappingRules = function importMappingRules(request, callback) { + return this.rpcCall(importMappingRules, $root.google.cloud.clouddms.v1.ImportMappingRulesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportMappingRules" }); /** - * Verifies a ListMigrationJobsResponse message. - * @function verify - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ImportMappingRules. + * @function importMappingRules + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IImportMappingRulesRequest} request ImportMappingRulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMigrationJobsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.migrationJobs != null && message.hasOwnProperty("migrationJobs")) { - if (!Array.isArray(message.migrationJobs)) - return "migrationJobs: array expected"; - for (var i = 0; i < message.migrationJobs.length; ++i) { - var error = $root.google.cloud.clouddms.v1.MigrationJob.verify(message.migrationJobs[i]); - if (error) - return "migrationJobs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; /** - * Creates a ListMigrationJobsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.ListMigrationJobsResponse} ListMigrationJobsResponse + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|convertConversionWorkspace}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef ConvertConversionWorkspaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListMigrationJobsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.ListMigrationJobsResponse) - return object; - var message = new $root.google.cloud.clouddms.v1.ListMigrationJobsResponse(); - if (object.migrationJobs) { - if (!Array.isArray(object.migrationJobs)) - throw TypeError(".google.cloud.clouddms.v1.ListMigrationJobsResponse.migrationJobs: array expected"); - message.migrationJobs = []; - for (var i = 0; i < object.migrationJobs.length; ++i) { - if (typeof object.migrationJobs[i] !== "object") - throw TypeError(".google.cloud.clouddms.v1.ListMigrationJobsResponse.migrationJobs: object expected"); - message.migrationJobs[i] = $root.google.cloud.clouddms.v1.MigrationJob.fromObject(object.migrationJobs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.clouddms.v1.ListMigrationJobsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; /** - * Creates a plain object from a ListMigrationJobsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse - * @static - * @param {google.cloud.clouddms.v1.ListMigrationJobsResponse} message ListMigrationJobsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls ConvertConversionWorkspace. + * @function convertConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest} request ConvertConversionWorkspaceRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.ConvertConversionWorkspaceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListMigrationJobsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.migrationJobs = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.migrationJobs && message.migrationJobs.length) { - object.migrationJobs = []; - for (var j = 0; j < message.migrationJobs.length; ++j) - object.migrationJobs[j] = $root.google.cloud.clouddms.v1.MigrationJob.toObject(message.migrationJobs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; + Object.defineProperty(DataMigrationService.prototype.convertConversionWorkspace = function convertConversionWorkspace(request, callback) { + return this.rpcCall(convertConversionWorkspace, $root.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ConvertConversionWorkspace" }); /** - * Converts this ListMigrationJobsResponse to JSON. - * @function toJSON - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * Calls ConvertConversionWorkspace. + * @function convertConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest} request ConvertConversionWorkspaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMigrationJobsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for ListMigrationJobsResponse - * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|commitConversionWorkspace}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef CommitConversionWorkspaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListMigrationJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.clouddms.v1.ListMigrationJobsResponse"; - }; - return ListMigrationJobsResponse; - })(); + /** + * Calls CommitConversionWorkspace. + * @function commitConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest} request CommitConversionWorkspaceRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.CommitConversionWorkspaceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.commitConversionWorkspace = function commitConversionWorkspace(request, callback) { + return this.rpcCall(commitConversionWorkspace, $root.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CommitConversionWorkspace" }); - v1.GetMigrationJobRequest = (function() { + /** + * Calls CommitConversionWorkspace. + * @function commitConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest} request CommitConversionWorkspaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ /** - * Properties of a GetMigrationJobRequest. - * @memberof google.cloud.clouddms.v1 - * @interface IGetMigrationJobRequest - * @property {string|null} [name] GetMigrationJobRequest name + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|rollbackConversionWorkspace}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef RollbackConversionWorkspaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ /** - * Constructs a new GetMigrationJobRequest. - * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a GetMigrationJobRequest. - * @implements IGetMigrationJobRequest - * @constructor - * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest=} [properties] Properties to set + * Calls RollbackConversionWorkspace. + * @function rollbackConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest} request RollbackConversionWorkspaceRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.RollbackConversionWorkspaceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - function GetMigrationJobRequest(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]]; - } + Object.defineProperty(DataMigrationService.prototype.rollbackConversionWorkspace = function rollbackConversionWorkspace(request, callback) { + return this.rpcCall(rollbackConversionWorkspace, $root.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RollbackConversionWorkspace" }); /** - * GetMigrationJobRequest name. - * @member {string} name - * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * Calls RollbackConversionWorkspace. + * @function rollbackConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService * @instance + * @param {google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest} request RollbackConversionWorkspaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMigrationJobRequest.prototype.name = ""; /** - * Creates a new GetMigrationJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest - * @static - * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.GetMigrationJobRequest} GetMigrationJobRequest instance + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|applyConversionWorkspace}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef ApplyConversionWorkspaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - GetMigrationJobRequest.create = function create(properties) { - return new GetMigrationJobRequest(properties); - }; /** - * Encodes the specified GetMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GetMigrationJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest - * @static - * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest} message GetMigrationJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ApplyConversionWorkspace. + * @function applyConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest} request ApplyConversionWorkspaceRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.ApplyConversionWorkspaceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - GetMigrationJobRequest.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; - }; + Object.defineProperty(DataMigrationService.prototype.applyConversionWorkspace = function applyConversionWorkspace(request, callback) { + return this.rpcCall(applyConversionWorkspace, $root.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ApplyConversionWorkspace" }); /** - * Encodes the specified GetMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GetMigrationJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest - * @static - * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest} message GetMigrationJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ApplyConversionWorkspace. + * @function applyConversionWorkspace + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest} request ApplyConversionWorkspaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a GetMigrationJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.GetMigrationJobRequest} GetMigrationJobRequest - * @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.clouddms.v1.DataMigrationService|describeDatabaseEntities}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef DescribeDatabaseEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse} [response] DescribeDatabaseEntitiesResponse */ - GetMigrationJobRequest.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.clouddms.v1.GetMigrationJobRequest(); - 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 GetMigrationJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.GetMigrationJobRequest} GetMigrationJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls DescribeDatabaseEntities. + * @function describeDatabaseEntities + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest} request DescribeDatabaseEntitiesRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.DescribeDatabaseEntitiesCallback} callback Node-style callback called with the error, if any, and DescribeDatabaseEntitiesResponse + * @returns {undefined} + * @variation 1 */ - GetMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(DataMigrationService.prototype.describeDatabaseEntities = function describeDatabaseEntities(request, callback) { + return this.rpcCall(describeDatabaseEntities, $root.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest, $root.google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse, request, callback); + }, "name", { value: "DescribeDatabaseEntities" }); /** - * Verifies a GetMigrationJobRequest message. - * @function verify - * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls DescribeDatabaseEntities. + * @function describeDatabaseEntities + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest} request DescribeDatabaseEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMigrationJobRequest.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 GetMigrationJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.GetMigrationJobRequest} GetMigrationJobRequest + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|searchBackgroundJobs}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef SearchBackgroundJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.SearchBackgroundJobsResponse} [response] SearchBackgroundJobsResponse */ - GetMigrationJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.GetMigrationJobRequest) - return object; - var message = new $root.google.cloud.clouddms.v1.GetMigrationJobRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; /** - * Creates a plain object from a GetMigrationJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest - * @static - * @param {google.cloud.clouddms.v1.GetMigrationJobRequest} message GetMigrationJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls SearchBackgroundJobs. + * @function searchBackgroundJobs + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ISearchBackgroundJobsRequest} request SearchBackgroundJobsRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.SearchBackgroundJobsCallback} callback Node-style callback called with the error, if any, and SearchBackgroundJobsResponse + * @returns {undefined} + * @variation 1 */ - GetMigrationJobRequest.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; - }; + Object.defineProperty(DataMigrationService.prototype.searchBackgroundJobs = function searchBackgroundJobs(request, callback) { + return this.rpcCall(searchBackgroundJobs, $root.google.cloud.clouddms.v1.SearchBackgroundJobsRequest, $root.google.cloud.clouddms.v1.SearchBackgroundJobsResponse, request, callback); + }, "name", { value: "SearchBackgroundJobs" }); /** - * Converts this GetMigrationJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * Calls SearchBackgroundJobs. + * @function searchBackgroundJobs + * @memberof google.cloud.clouddms.v1.DataMigrationService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.clouddms.v1.ISearchBackgroundJobsRequest} request SearchBackgroundJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMigrationJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for GetMigrationJobRequest - * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|describeConversionWorkspaceRevisions}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef DescribeConversionWorkspaceRevisionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse} [response] DescribeConversionWorkspaceRevisionsResponse */ - GetMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.clouddms.v1.GetMigrationJobRequest"; - }; - return GetMigrationJobRequest; + /** + * Calls DescribeConversionWorkspaceRevisions. + * @function describeConversionWorkspaceRevisions + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest} request DescribeConversionWorkspaceRevisionsRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.DescribeConversionWorkspaceRevisionsCallback} callback Node-style callback called with the error, if any, and DescribeConversionWorkspaceRevisionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.describeConversionWorkspaceRevisions = function describeConversionWorkspaceRevisions(request, callback) { + return this.rpcCall(describeConversionWorkspaceRevisions, $root.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest, $root.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse, request, callback); + }, "name", { value: "DescribeConversionWorkspaceRevisions" }); + + /** + * Calls DescribeConversionWorkspaceRevisions. + * @function describeConversionWorkspaceRevisions + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest} request DescribeConversionWorkspaceRevisionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|fetchStaticIps}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef FetchStaticIpsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.FetchStaticIpsResponse} [response] FetchStaticIpsResponse + */ + + /** + * Calls FetchStaticIps. + * @function fetchStaticIps + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IFetchStaticIpsRequest} request FetchStaticIpsRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.FetchStaticIpsCallback} callback Node-style callback called with the error, if any, and FetchStaticIpsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.fetchStaticIps = function fetchStaticIps(request, callback) { + return this.rpcCall(fetchStaticIps, $root.google.cloud.clouddms.v1.FetchStaticIpsRequest, $root.google.cloud.clouddms.v1.FetchStaticIpsResponse, request, callback); + }, "name", { value: "FetchStaticIps" }); + + /** + * Calls FetchStaticIps. + * @function fetchStaticIps + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IFetchStaticIpsRequest} request FetchStaticIpsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DataMigrationService; })(); - v1.CreateMigrationJobRequest = (function() { + v1.ListMigrationJobsRequest = (function() { /** - * Properties of a CreateMigrationJobRequest. + * Properties of a ListMigrationJobsRequest. * @memberof google.cloud.clouddms.v1 - * @interface ICreateMigrationJobRequest - * @property {string|null} [parent] CreateMigrationJobRequest parent - * @property {string|null} [migrationJobId] CreateMigrationJobRequest migrationJobId - * @property {google.cloud.clouddms.v1.IMigrationJob|null} [migrationJob] CreateMigrationJobRequest migrationJob - * @property {string|null} [requestId] CreateMigrationJobRequest requestId + * @interface IListMigrationJobsRequest + * @property {string|null} [parent] ListMigrationJobsRequest parent + * @property {number|null} [pageSize] ListMigrationJobsRequest pageSize + * @property {string|null} [pageToken] ListMigrationJobsRequest pageToken + * @property {string|null} [filter] ListMigrationJobsRequest filter + * @property {string|null} [orderBy] ListMigrationJobsRequest orderBy */ /** - * Constructs a new CreateMigrationJobRequest. + * Constructs a new ListMigrationJobsRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a CreateMigrationJobRequest. - * @implements ICreateMigrationJobRequest + * @classdesc Represents a ListMigrationJobsRequest. + * @implements IListMigrationJobsRequest * @constructor - * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest=} [properties] Properties to set */ - function CreateMigrationJobRequest(properties) { + function ListMigrationJobsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1477,100 +1318,110 @@ } /** - * CreateMigrationJobRequest parent. + * ListMigrationJobsRequest parent. * @member {string} parent - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @instance */ - CreateMigrationJobRequest.prototype.parent = ""; + ListMigrationJobsRequest.prototype.parent = ""; /** - * CreateMigrationJobRequest migrationJobId. - * @member {string} migrationJobId - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * ListMigrationJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @instance */ - CreateMigrationJobRequest.prototype.migrationJobId = ""; + ListMigrationJobsRequest.prototype.pageSize = 0; /** - * CreateMigrationJobRequest migrationJob. - * @member {google.cloud.clouddms.v1.IMigrationJob|null|undefined} migrationJob - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * ListMigrationJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @instance */ - CreateMigrationJobRequest.prototype.migrationJob = null; + ListMigrationJobsRequest.prototype.pageToken = ""; /** - * CreateMigrationJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * ListMigrationJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @instance */ - CreateMigrationJobRequest.prototype.requestId = ""; + ListMigrationJobsRequest.prototype.filter = ""; /** - * Creates a new CreateMigrationJobRequest instance using the specified properties. + * ListMigrationJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @instance + */ + ListMigrationJobsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListMigrationJobsRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @static - * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.CreateMigrationJobRequest} CreateMigrationJobRequest instance + * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ListMigrationJobsRequest} ListMigrationJobsRequest instance */ - CreateMigrationJobRequest.create = function create(properties) { - return new CreateMigrationJobRequest(properties); + ListMigrationJobsRequest.create = function create(properties) { + return new ListMigrationJobsRequest(properties); }; /** - * Encodes the specified CreateMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CreateMigrationJobRequest.verify|verify} messages. + * Encodes the specified ListMigrationJobsRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @static - * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest} message CreateMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest} message ListMigrationJobsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateMigrationJobRequest.encode = function encode(message, writer) { + ListMigrationJobsRequest.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.migrationJobId != null && Object.hasOwnProperty.call(message, "migrationJobId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.migrationJobId); - if (message.migrationJob != null && Object.hasOwnProperty.call(message, "migrationJob")) - $root.google.cloud.clouddms.v1.MigrationJob.encode(message.migrationJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified CreateMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CreateMigrationJobRequest.verify|verify} messages. + * Encodes the specified ListMigrationJobsRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @static - * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest} message CreateMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest} message ListMigrationJobsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListMigrationJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateMigrationJobRequest message from the specified reader or buffer. + * Decodes a ListMigrationJobsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.CreateMigrationJobRequest} CreateMigrationJobRequest + * @returns {google.cloud.clouddms.v1.ListMigrationJobsRequest} ListMigrationJobsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateMigrationJobRequest.decode = function decode(reader, length) { + ListMigrationJobsRequest.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.clouddms.v1.CreateMigrationJobRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ListMigrationJobsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1579,15 +1430,19 @@ break; } case 2: { - message.migrationJobId = reader.string(); + message.pageSize = reader.int32(); break; } case 3: { - message.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; } case 4: { - message.requestId = reader.string(); + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -1599,154 +1454,159 @@ }; /** - * Decodes a CreateMigrationJobRequest message from the specified reader or buffer, length delimited. + * Decodes a ListMigrationJobsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.CreateMigrationJobRequest} CreateMigrationJobRequest + * @returns {google.cloud.clouddms.v1.ListMigrationJobsRequest} ListMigrationJobsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + ListMigrationJobsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateMigrationJobRequest message. + * Verifies a ListMigrationJobsRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateMigrationJobRequest.verify = function verify(message) { + ListMigrationJobsRequest.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.migrationJobId != null && message.hasOwnProperty("migrationJobId")) - if (!$util.isString(message.migrationJobId)) - return "migrationJobId: string expected"; - if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) { - var error = $root.google.cloud.clouddms.v1.MigrationJob.verify(message.migrationJob); - if (error) - return "migrationJob." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListMigrationJobsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.CreateMigrationJobRequest} CreateMigrationJobRequest + * @returns {google.cloud.clouddms.v1.ListMigrationJobsRequest} ListMigrationJobsRequest */ - CreateMigrationJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.CreateMigrationJobRequest) + ListMigrationJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ListMigrationJobsRequest) return object; - var message = new $root.google.cloud.clouddms.v1.CreateMigrationJobRequest(); + var message = new $root.google.cloud.clouddms.v1.ListMigrationJobsRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.migrationJobId != null) - message.migrationJobId = String(object.migrationJobId); - if (object.migrationJob != null) { - if (typeof object.migrationJob !== "object") - throw TypeError(".google.cloud.clouddms.v1.CreateMigrationJobRequest.migrationJob: object expected"); - message.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.fromObject(object.migrationJob); - } - if (object.requestId != null) - message.requestId = String(object.requestId); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a CreateMigrationJobRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListMigrationJobsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @static - * @param {google.cloud.clouddms.v1.CreateMigrationJobRequest} message CreateMigrationJobRequest + * @param {google.cloud.clouddms.v1.ListMigrationJobsRequest} message ListMigrationJobsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateMigrationJobRequest.toObject = function toObject(message, options) { + ListMigrationJobsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.migrationJobId = ""; - object.migrationJob = null; - object.requestId = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.migrationJobId != null && message.hasOwnProperty("migrationJobId")) - object.migrationJobId = message.migrationJobId; - if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) - object.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.toObject(message.migrationJob, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this CreateMigrationJobRequest to JSON. + * Converts this ListMigrationJobsRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @instance * @returns {Object.} JSON object */ - CreateMigrationJobRequest.prototype.toJSON = function toJSON() { + ListMigrationJobsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateMigrationJobRequest + * Gets the default type url for ListMigrationJobsRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListMigrationJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.CreateMigrationJobRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.ListMigrationJobsRequest"; }; - return CreateMigrationJobRequest; + return ListMigrationJobsRequest; })(); - v1.UpdateMigrationJobRequest = (function() { + v1.ListMigrationJobsResponse = (function() { /** - * Properties of an UpdateMigrationJobRequest. + * Properties of a ListMigrationJobsResponse. * @memberof google.cloud.clouddms.v1 - * @interface IUpdateMigrationJobRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMigrationJobRequest updateMask - * @property {google.cloud.clouddms.v1.IMigrationJob|null} [migrationJob] UpdateMigrationJobRequest migrationJob - * @property {string|null} [requestId] UpdateMigrationJobRequest requestId + * @interface IListMigrationJobsResponse + * @property {Array.|null} [migrationJobs] ListMigrationJobsResponse migrationJobs + * @property {string|null} [nextPageToken] ListMigrationJobsResponse nextPageToken + * @property {Array.|null} [unreachable] ListMigrationJobsResponse unreachable */ /** - * Constructs a new UpdateMigrationJobRequest. + * Constructs a new ListMigrationJobsResponse. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents an UpdateMigrationJobRequest. - * @implements IUpdateMigrationJobRequest + * @classdesc Represents a ListMigrationJobsResponse. + * @implements IListMigrationJobsResponse * @constructor - * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IListMigrationJobsResponse=} [properties] Properties to set */ - function UpdateMigrationJobRequest(properties) { + function ListMigrationJobsResponse(properties) { + this.migrationJobs = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1754,103 +1614,109 @@ } /** - * UpdateMigrationJobRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * ListMigrationJobsResponse migrationJobs. + * @member {Array.} migrationJobs + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @instance */ - UpdateMigrationJobRequest.prototype.updateMask = null; + ListMigrationJobsResponse.prototype.migrationJobs = $util.emptyArray; /** - * UpdateMigrationJobRequest migrationJob. - * @member {google.cloud.clouddms.v1.IMigrationJob|null|undefined} migrationJob - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * ListMigrationJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @instance */ - UpdateMigrationJobRequest.prototype.migrationJob = null; + ListMigrationJobsResponse.prototype.nextPageToken = ""; /** - * UpdateMigrationJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * ListMigrationJobsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @instance */ - UpdateMigrationJobRequest.prototype.requestId = ""; + ListMigrationJobsResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new UpdateMigrationJobRequest instance using the specified properties. + * Creates a new ListMigrationJobsResponse instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @static - * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.UpdateMigrationJobRequest} UpdateMigrationJobRequest instance + * @param {google.cloud.clouddms.v1.IListMigrationJobsResponse=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ListMigrationJobsResponse} ListMigrationJobsResponse instance */ - UpdateMigrationJobRequest.create = function create(properties) { - return new UpdateMigrationJobRequest(properties); + ListMigrationJobsResponse.create = function create(properties) { + return new ListMigrationJobsResponse(properties); }; /** - * Encodes the specified UpdateMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.UpdateMigrationJobRequest.verify|verify} messages. + * Encodes the specified ListMigrationJobsResponse message. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @static - * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest} message UpdateMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IListMigrationJobsResponse} message ListMigrationJobsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateMigrationJobRequest.encode = function encode(message, writer) { + ListMigrationJobsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.migrationJob != null && Object.hasOwnProperty.call(message, "migrationJob")) - $root.google.cloud.clouddms.v1.MigrationJob.encode(message.migrationJob, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.migrationJobs != null && message.migrationJobs.length) + for (var i = 0; i < message.migrationJobs.length; ++i) + $root.google.cloud.clouddms.v1.MigrationJob.encode(message.migrationJobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified UpdateMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.UpdateMigrationJobRequest.verify|verify} messages. + * Encodes the specified ListMigrationJobsResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @static - * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest} message UpdateMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IListMigrationJobsResponse} message ListMigrationJobsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListMigrationJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateMigrationJobRequest message from the specified reader or buffer. + * Decodes a ListMigrationJobsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.UpdateMigrationJobRequest} UpdateMigrationJobRequest + * @returns {google.cloud.clouddms.v1.ListMigrationJobsResponse} ListMigrationJobsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateMigrationJobRequest.decode = function decode(reader, length) { + ListMigrationJobsResponse.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.clouddms.v1.UpdateMigrationJobRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ListMigrationJobsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + if (!(message.migrationJobs && message.migrationJobs.length)) + message.migrationJobs = []; + message.migrationJobs.push($root.google.cloud.clouddms.v1.MigrationJob.decode(reader, reader.uint32())); break; } case 2: { - message.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } case 3: { - message.requestId = reader.string(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -1862,151 +1728,169 @@ }; /** - * Decodes an UpdateMigrationJobRequest message from the specified reader or buffer, length delimited. + * Decodes a ListMigrationJobsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.UpdateMigrationJobRequest} UpdateMigrationJobRequest + * @returns {google.cloud.clouddms.v1.ListMigrationJobsResponse} ListMigrationJobsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + ListMigrationJobsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateMigrationJobRequest message. + * Verifies a ListMigrationJobsResponse message. * @function verify - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateMigrationJobRequest.verify = function verify(message) { + ListMigrationJobsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.migrationJobs != null && message.hasOwnProperty("migrationJobs")) { + if (!Array.isArray(message.migrationJobs)) + return "migrationJobs: array expected"; + for (var i = 0; i < message.migrationJobs.length; ++i) { + var error = $root.google.cloud.clouddms.v1.MigrationJob.verify(message.migrationJobs[i]); + if (error) + return "migrationJobs." + error; + } } - if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) { - var error = $root.google.cloud.clouddms.v1.MigrationJob.verify(message.migrationJob); - if (error) - return "migrationJob." + error; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; return null; }; /** - * Creates an UpdateMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListMigrationJobsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.UpdateMigrationJobRequest} UpdateMigrationJobRequest + * @returns {google.cloud.clouddms.v1.ListMigrationJobsResponse} ListMigrationJobsResponse */ - UpdateMigrationJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.UpdateMigrationJobRequest) + ListMigrationJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ListMigrationJobsResponse) return object; - var message = new $root.google.cloud.clouddms.v1.UpdateMigrationJobRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.clouddms.v1.UpdateMigrationJobRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.clouddms.v1.ListMigrationJobsResponse(); + if (object.migrationJobs) { + if (!Array.isArray(object.migrationJobs)) + throw TypeError(".google.cloud.clouddms.v1.ListMigrationJobsResponse.migrationJobs: array expected"); + message.migrationJobs = []; + for (var i = 0; i < object.migrationJobs.length; ++i) { + if (typeof object.migrationJobs[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.ListMigrationJobsResponse.migrationJobs: object expected"); + message.migrationJobs[i] = $root.google.cloud.clouddms.v1.MigrationJob.fromObject(object.migrationJobs[i]); + } } - if (object.migrationJob != null) { - if (typeof object.migrationJob !== "object") - throw TypeError(".google.cloud.clouddms.v1.UpdateMigrationJobRequest.migrationJob: object expected"); - message.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.fromObject(object.migrationJob); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.clouddms.v1.ListMigrationJobsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); } - if (object.requestId != null) - message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from an UpdateMigrationJobRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListMigrationJobsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @static - * @param {google.cloud.clouddms.v1.UpdateMigrationJobRequest} message UpdateMigrationJobRequest + * @param {google.cloud.clouddms.v1.ListMigrationJobsResponse} message ListMigrationJobsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateMigrationJobRequest.toObject = function toObject(message, options) { + ListMigrationJobsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.updateMask = null; - object.migrationJob = null; - object.requestId = ""; + if (options.arrays || options.defaults) { + object.migrationJobs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.migrationJobs && message.migrationJobs.length) { + object.migrationJobs = []; + for (var j = 0; j < message.migrationJobs.length; ++j) + object.migrationJobs[j] = $root.google.cloud.clouddms.v1.MigrationJob.toObject(message.migrationJobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) - object.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.toObject(message.migrationJob, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; return object; }; /** - * Converts this UpdateMigrationJobRequest to JSON. + * Converts this ListMigrationJobsResponse to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @instance * @returns {Object.} JSON object */ - UpdateMigrationJobRequest.prototype.toJSON = function toJSON() { + ListMigrationJobsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateMigrationJobRequest + * Gets the default type url for ListMigrationJobsResponse * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListMigrationJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.UpdateMigrationJobRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.ListMigrationJobsResponse"; }; - return UpdateMigrationJobRequest; + return ListMigrationJobsResponse; })(); - v1.DeleteMigrationJobRequest = (function() { + v1.GetMigrationJobRequest = (function() { /** - * Properties of a DeleteMigrationJobRequest. + * Properties of a GetMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @interface IDeleteMigrationJobRequest - * @property {string|null} [name] DeleteMigrationJobRequest name - * @property {string|null} [requestId] DeleteMigrationJobRequest requestId - * @property {boolean|null} [force] DeleteMigrationJobRequest force + * @interface IGetMigrationJobRequest + * @property {string|null} [name] GetMigrationJobRequest name */ /** - * Constructs a new DeleteMigrationJobRequest. + * Constructs a new GetMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a DeleteMigrationJobRequest. - * @implements IDeleteMigrationJobRequest + * @classdesc Represents a GetMigrationJobRequest. + * @implements IGetMigrationJobRequest * @constructor - * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest=} [properties] Properties to set */ - function DeleteMigrationJobRequest(properties) { + function GetMigrationJobRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2014,90 +1898,70 @@ } /** - * DeleteMigrationJobRequest name. + * GetMigrationJobRequest name. * @member {string} name - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest - * @instance - */ - DeleteMigrationJobRequest.prototype.name = ""; - - /** - * DeleteMigrationJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest - * @instance - */ - DeleteMigrationJobRequest.prototype.requestId = ""; - - /** - * DeleteMigrationJobRequest force. - * @member {boolean} force - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest * @instance */ - DeleteMigrationJobRequest.prototype.force = false; + GetMigrationJobRequest.prototype.name = ""; /** - * Creates a new DeleteMigrationJobRequest instance using the specified properties. + * Creates a new GetMigrationJobRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.DeleteMigrationJobRequest} DeleteMigrationJobRequest instance + * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.GetMigrationJobRequest} GetMigrationJobRequest instance */ - DeleteMigrationJobRequest.create = function create(properties) { - return new DeleteMigrationJobRequest(properties); + GetMigrationJobRequest.create = function create(properties) { + return new GetMigrationJobRequest(properties); }; /** - * Encodes the specified DeleteMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DeleteMigrationJobRequest.verify|verify} messages. + * Encodes the specified GetMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GetMigrationJobRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest} message DeleteMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest} message GetMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteMigrationJobRequest.encode = function encode(message, writer) { + GetMigrationJobRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; /** - * Encodes the specified DeleteMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DeleteMigrationJobRequest.verify|verify} messages. + * Encodes the specified GetMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GetMigrationJobRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest} message DeleteMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest} message GetMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteMigrationJobRequest message from the specified reader or buffer. + * Decodes a GetMigrationJobRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.DeleteMigrationJobRequest} DeleteMigrationJobRequest + * @returns {google.cloud.clouddms.v1.GetMigrationJobRequest} GetMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteMigrationJobRequest.decode = function decode(reader, length) { + GetMigrationJobRequest.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.clouddms.v1.DeleteMigrationJobRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.GetMigrationJobRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -2105,14 +1969,6 @@ message.name = reader.string(); break; } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.force = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -2122,139 +1978,125 @@ }; /** - * Decodes a DeleteMigrationJobRequest message from the specified reader or buffer, length delimited. + * Decodes a GetMigrationJobRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.DeleteMigrationJobRequest} DeleteMigrationJobRequest + * @returns {google.cloud.clouddms.v1.GetMigrationJobRequest} GetMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + GetMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteMigrationJobRequest message. + * Verifies a GetMigrationJobRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteMigrationJobRequest.verify = function verify(message) { + GetMigrationJobRequest.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; return null; }; /** - * Creates a DeleteMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetMigrationJobRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.DeleteMigrationJobRequest} DeleteMigrationJobRequest + * @returns {google.cloud.clouddms.v1.GetMigrationJobRequest} GetMigrationJobRequest */ - DeleteMigrationJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.DeleteMigrationJobRequest) + GetMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.GetMigrationJobRequest) return object; - var message = new $root.google.cloud.clouddms.v1.DeleteMigrationJobRequest(); + var message = new $root.google.cloud.clouddms.v1.GetMigrationJobRequest(); if (object.name != null) message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.force != null) - message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a DeleteMigrationJobRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetMigrationJobRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.DeleteMigrationJobRequest} message DeleteMigrationJobRequest + * @param {google.cloud.clouddms.v1.GetMigrationJobRequest} message GetMigrationJobRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteMigrationJobRequest.toObject = function toObject(message, options) { + GetMigrationJobRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.requestId = ""; - object.force = false; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; return object; }; /** - * Converts this DeleteMigrationJobRequest to JSON. + * Converts this GetMigrationJobRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest * @instance * @returns {Object.} JSON object */ - DeleteMigrationJobRequest.prototype.toJSON = function toJSON() { + GetMigrationJobRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteMigrationJobRequest + * Gets the default type url for GetMigrationJobRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.DeleteMigrationJobRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.GetMigrationJobRequest"; }; - return DeleteMigrationJobRequest; + return GetMigrationJobRequest; })(); - v1.StartMigrationJobRequest = (function() { + v1.CreateMigrationJobRequest = (function() { /** - * Properties of a StartMigrationJobRequest. + * Properties of a CreateMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @interface IStartMigrationJobRequest - * @property {string|null} [name] StartMigrationJobRequest name + * @interface ICreateMigrationJobRequest + * @property {string|null} [parent] CreateMigrationJobRequest parent + * @property {string|null} [migrationJobId] CreateMigrationJobRequest migrationJobId + * @property {google.cloud.clouddms.v1.IMigrationJob|null} [migrationJob] CreateMigrationJobRequest migrationJob + * @property {string|null} [requestId] CreateMigrationJobRequest requestId */ /** - * Constructs a new StartMigrationJobRequest. + * Constructs a new CreateMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a StartMigrationJobRequest. - * @implements IStartMigrationJobRequest + * @classdesc Represents a CreateMigrationJobRequest. + * @implements ICreateMigrationJobRequest * @constructor - * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest=} [properties] Properties to set */ - function StartMigrationJobRequest(properties) { + function CreateMigrationJobRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2262,75 +2104,117 @@ } /** - * StartMigrationJobRequest name. - * @member {string} name - * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * CreateMigrationJobRequest parent. + * @member {string} parent + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest * @instance */ - StartMigrationJobRequest.prototype.name = ""; + CreateMigrationJobRequest.prototype.parent = ""; /** - * Creates a new StartMigrationJobRequest instance using the specified properties. + * CreateMigrationJobRequest migrationJobId. + * @member {string} migrationJobId + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @instance + */ + CreateMigrationJobRequest.prototype.migrationJobId = ""; + + /** + * CreateMigrationJobRequest migrationJob. + * @member {google.cloud.clouddms.v1.IMigrationJob|null|undefined} migrationJob + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @instance + */ + CreateMigrationJobRequest.prototype.migrationJob = null; + + /** + * CreateMigrationJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @instance + */ + CreateMigrationJobRequest.prototype.requestId = ""; + + /** + * Creates a new CreateMigrationJobRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.StartMigrationJobRequest} StartMigrationJobRequest instance + * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.CreateMigrationJobRequest} CreateMigrationJobRequest instance */ - StartMigrationJobRequest.create = function create(properties) { - return new StartMigrationJobRequest(properties); + CreateMigrationJobRequest.create = function create(properties) { + return new CreateMigrationJobRequest(properties); }; /** - * Encodes the specified StartMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.StartMigrationJobRequest.verify|verify} messages. + * Encodes the specified CreateMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CreateMigrationJobRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest} message StartMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest} message CreateMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StartMigrationJobRequest.encode = function encode(message, writer) { + CreateMigrationJobRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.migrationJobId != null && Object.hasOwnProperty.call(message, "migrationJobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.migrationJobId); + if (message.migrationJob != null && Object.hasOwnProperty.call(message, "migrationJob")) + $root.google.cloud.clouddms.v1.MigrationJob.encode(message.migrationJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); return writer; }; /** - * Encodes the specified StartMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StartMigrationJobRequest.verify|verify} messages. + * Encodes the specified CreateMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CreateMigrationJobRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest} message StartMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest} message CreateMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StartMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StartMigrationJobRequest message from the specified reader or buffer. + * Decodes a CreateMigrationJobRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.StartMigrationJobRequest} StartMigrationJobRequest + * @returns {google.cloud.clouddms.v1.CreateMigrationJobRequest} CreateMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StartMigrationJobRequest.decode = function decode(reader, length) { + CreateMigrationJobRequest.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.clouddms.v1.StartMigrationJobRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.CreateMigrationJobRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.migrationJobId = reader.string(); + break; + } + case 3: { + message.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); break; } default: @@ -2342,122 +2226,154 @@ }; /** - * Decodes a StartMigrationJobRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateMigrationJobRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.StartMigrationJobRequest} StartMigrationJobRequest + * @returns {google.cloud.clouddms.v1.CreateMigrationJobRequest} CreateMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StartMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + CreateMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StartMigrationJobRequest message. + * Verifies a CreateMigrationJobRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StartMigrationJobRequest.verify = function verify(message) { + CreateMigrationJobRequest.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.migrationJobId != null && message.hasOwnProperty("migrationJobId")) + if (!$util.isString(message.migrationJobId)) + return "migrationJobId: string expected"; + if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) { + var error = $root.google.cloud.clouddms.v1.MigrationJob.verify(message.migrationJob); + if (error) + return "migrationJob." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a StartMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateMigrationJobRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.StartMigrationJobRequest} StartMigrationJobRequest + * @returns {google.cloud.clouddms.v1.CreateMigrationJobRequest} CreateMigrationJobRequest */ - StartMigrationJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.StartMigrationJobRequest) + CreateMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.CreateMigrationJobRequest) return object; - var message = new $root.google.cloud.clouddms.v1.StartMigrationJobRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.clouddms.v1.CreateMigrationJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.migrationJobId != null) + message.migrationJobId = String(object.migrationJobId); + if (object.migrationJob != null) { + if (typeof object.migrationJob !== "object") + throw TypeError(".google.cloud.clouddms.v1.CreateMigrationJobRequest.migrationJob: object expected"); + message.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.fromObject(object.migrationJob); + } + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a StartMigrationJobRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateMigrationJobRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.StartMigrationJobRequest} message StartMigrationJobRequest + * @param {google.cloud.clouddms.v1.CreateMigrationJobRequest} message CreateMigrationJobRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StartMigrationJobRequest.toObject = function toObject(message, options) { + CreateMigrationJobRequest.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; + if (options.defaults) { + object.parent = ""; + object.migrationJobId = ""; + object.migrationJob = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.migrationJobId != null && message.hasOwnProperty("migrationJobId")) + object.migrationJobId = message.migrationJobId; + if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) + object.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.toObject(message.migrationJob, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this StartMigrationJobRequest to JSON. + * Converts this CreateMigrationJobRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest * @instance * @returns {Object.} JSON object */ - StartMigrationJobRequest.prototype.toJSON = function toJSON() { + CreateMigrationJobRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for StartMigrationJobRequest + * Gets the default type url for CreateMigrationJobRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - StartMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.StartMigrationJobRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.CreateMigrationJobRequest"; }; - return StartMigrationJobRequest; + return CreateMigrationJobRequest; })(); - v1.StopMigrationJobRequest = (function() { + v1.UpdateMigrationJobRequest = (function() { /** - * Properties of a StopMigrationJobRequest. + * Properties of an UpdateMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @interface IStopMigrationJobRequest - * @property {string|null} [name] StopMigrationJobRequest name + * @interface IUpdateMigrationJobRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMigrationJobRequest updateMask + * @property {google.cloud.clouddms.v1.IMigrationJob|null} [migrationJob] UpdateMigrationJobRequest migrationJob + * @property {string|null} [requestId] UpdateMigrationJobRequest requestId */ /** - * Constructs a new StopMigrationJobRequest. + * Constructs a new UpdateMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a StopMigrationJobRequest. - * @implements IStopMigrationJobRequest + * @classdesc Represents an UpdateMigrationJobRequest. + * @implements IUpdateMigrationJobRequest * @constructor - * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest=} [properties] Properties to set */ - function StopMigrationJobRequest(properties) { + function UpdateMigrationJobRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2465,75 +2381,103 @@ } /** - * StopMigrationJobRequest name. - * @member {string} name - * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * UpdateMigrationJobRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest * @instance */ - StopMigrationJobRequest.prototype.name = ""; + UpdateMigrationJobRequest.prototype.updateMask = null; /** - * Creates a new StopMigrationJobRequest instance using the specified properties. + * UpdateMigrationJobRequest migrationJob. + * @member {google.cloud.clouddms.v1.IMigrationJob|null|undefined} migrationJob + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @instance + */ + UpdateMigrationJobRequest.prototype.migrationJob = null; + + /** + * UpdateMigrationJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @instance + */ + UpdateMigrationJobRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateMigrationJobRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.StopMigrationJobRequest} StopMigrationJobRequest instance + * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.UpdateMigrationJobRequest} UpdateMigrationJobRequest instance */ - StopMigrationJobRequest.create = function create(properties) { - return new StopMigrationJobRequest(properties); + UpdateMigrationJobRequest.create = function create(properties) { + return new UpdateMigrationJobRequest(properties); }; /** - * Encodes the specified StopMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.StopMigrationJobRequest.verify|verify} messages. + * Encodes the specified UpdateMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.UpdateMigrationJobRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest} message StopMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest} message UpdateMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StopMigrationJobRequest.encode = function encode(message, writer) { + UpdateMigrationJobRequest.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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.migrationJob != null && Object.hasOwnProperty.call(message, "migrationJob")) + $root.google.cloud.clouddms.v1.MigrationJob.encode(message.migrationJob, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); return writer; }; /** - * Encodes the specified StopMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StopMigrationJobRequest.verify|verify} messages. + * Encodes the specified UpdateMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.UpdateMigrationJobRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest} message StopMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest} message UpdateMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StopMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StopMigrationJobRequest message from the specified reader or buffer. + * Decodes an UpdateMigrationJobRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.StopMigrationJobRequest} StopMigrationJobRequest + * @returns {google.cloud.clouddms.v1.UpdateMigrationJobRequest} UpdateMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StopMigrationJobRequest.decode = function decode(reader, length) { + UpdateMigrationJobRequest.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.clouddms.v1.StopMigrationJobRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.UpdateMigrationJobRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); break; } default: @@ -2545,122 +2489,151 @@ }; /** - * Decodes a StopMigrationJobRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateMigrationJobRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.StopMigrationJobRequest} StopMigrationJobRequest + * @returns {google.cloud.clouddms.v1.UpdateMigrationJobRequest} UpdateMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StopMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StopMigrationJobRequest message. + * Verifies an UpdateMigrationJobRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StopMigrationJobRequest.verify = function verify(message) { + UpdateMigrationJobRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) { + var error = $root.google.cloud.clouddms.v1.MigrationJob.verify(message.migrationJob); + if (error) + return "migrationJob." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a StopMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateMigrationJobRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.StopMigrationJobRequest} StopMigrationJobRequest + * @returns {google.cloud.clouddms.v1.UpdateMigrationJobRequest} UpdateMigrationJobRequest */ - StopMigrationJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.StopMigrationJobRequest) + UpdateMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.UpdateMigrationJobRequest) return object; - var message = new $root.google.cloud.clouddms.v1.StopMigrationJobRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.clouddms.v1.UpdateMigrationJobRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.clouddms.v1.UpdateMigrationJobRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.migrationJob != null) { + if (typeof object.migrationJob !== "object") + throw TypeError(".google.cloud.clouddms.v1.UpdateMigrationJobRequest.migrationJob: object expected"); + message.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.fromObject(object.migrationJob); + } + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a StopMigrationJobRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateMigrationJobRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.StopMigrationJobRequest} message StopMigrationJobRequest + * @param {google.cloud.clouddms.v1.UpdateMigrationJobRequest} message UpdateMigrationJobRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StopMigrationJobRequest.toObject = function toObject(message, options) { + UpdateMigrationJobRequest.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; + if (options.defaults) { + object.updateMask = null; + object.migrationJob = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) + object.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.toObject(message.migrationJob, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this StopMigrationJobRequest to JSON. + * Converts this UpdateMigrationJobRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest * @instance * @returns {Object.} JSON object */ - StopMigrationJobRequest.prototype.toJSON = function toJSON() { + UpdateMigrationJobRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for StopMigrationJobRequest + * Gets the default type url for UpdateMigrationJobRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - StopMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.StopMigrationJobRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.UpdateMigrationJobRequest"; }; - return StopMigrationJobRequest; + return UpdateMigrationJobRequest; })(); - v1.ResumeMigrationJobRequest = (function() { + v1.DeleteMigrationJobRequest = (function() { /** - * Properties of a ResumeMigrationJobRequest. + * Properties of a DeleteMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @interface IResumeMigrationJobRequest - * @property {string|null} [name] ResumeMigrationJobRequest name + * @interface IDeleteMigrationJobRequest + * @property {string|null} [name] DeleteMigrationJobRequest name + * @property {string|null} [requestId] DeleteMigrationJobRequest requestId + * @property {boolean|null} [force] DeleteMigrationJobRequest force */ /** - * Constructs a new ResumeMigrationJobRequest. + * Constructs a new DeleteMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a ResumeMigrationJobRequest. - * @implements IResumeMigrationJobRequest + * @classdesc Represents a DeleteMigrationJobRequest. + * @implements IDeleteMigrationJobRequest * @constructor - * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest=} [properties] Properties to set */ - function ResumeMigrationJobRequest(properties) { + function DeleteMigrationJobRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2668,70 +2641,90 @@ } /** - * ResumeMigrationJobRequest name. + * DeleteMigrationJobRequest name. * @member {string} name - * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest * @instance */ - ResumeMigrationJobRequest.prototype.name = ""; + DeleteMigrationJobRequest.prototype.name = ""; /** - * Creates a new ResumeMigrationJobRequest instance using the specified properties. + * DeleteMigrationJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @instance + */ + DeleteMigrationJobRequest.prototype.requestId = ""; + + /** + * DeleteMigrationJobRequest force. + * @member {boolean} force + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @instance + */ + DeleteMigrationJobRequest.prototype.force = false; + + /** + * Creates a new DeleteMigrationJobRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.ResumeMigrationJobRequest} ResumeMigrationJobRequest instance + * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DeleteMigrationJobRequest} DeleteMigrationJobRequest instance */ - ResumeMigrationJobRequest.create = function create(properties) { - return new ResumeMigrationJobRequest(properties); + DeleteMigrationJobRequest.create = function create(properties) { + return new DeleteMigrationJobRequest(properties); }; /** - * Encodes the specified ResumeMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ResumeMigrationJobRequest.verify|verify} messages. + * Encodes the specified DeleteMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DeleteMigrationJobRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest} message ResumeMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest} message DeleteMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResumeMigrationJobRequest.encode = function encode(message, writer) { + DeleteMigrationJobRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; /** - * Encodes the specified ResumeMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ResumeMigrationJobRequest.verify|verify} messages. + * Encodes the specified DeleteMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DeleteMigrationJobRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest} message ResumeMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest} message DeleteMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResumeMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResumeMigrationJobRequest message from the specified reader or buffer. + * Decodes a DeleteMigrationJobRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.ResumeMigrationJobRequest} ResumeMigrationJobRequest + * @returns {google.cloud.clouddms.v1.DeleteMigrationJobRequest} DeleteMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResumeMigrationJobRequest.decode = function decode(reader, length) { + DeleteMigrationJobRequest.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.clouddms.v1.ResumeMigrationJobRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.DeleteMigrationJobRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -2739,6 +2732,14 @@ message.name = reader.string(); break; } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -2748,122 +2749,139 @@ }; /** - * Decodes a ResumeMigrationJobRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteMigrationJobRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.ResumeMigrationJobRequest} ResumeMigrationJobRequest + * @returns {google.cloud.clouddms.v1.DeleteMigrationJobRequest} DeleteMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResumeMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResumeMigrationJobRequest message. + * Verifies a DeleteMigrationJobRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResumeMigrationJobRequest.verify = function verify(message) { + DeleteMigrationJobRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates a ResumeMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteMigrationJobRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.ResumeMigrationJobRequest} ResumeMigrationJobRequest + * @returns {google.cloud.clouddms.v1.DeleteMigrationJobRequest} DeleteMigrationJobRequest */ - ResumeMigrationJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.ResumeMigrationJobRequest) + DeleteMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DeleteMigrationJobRequest) return object; - var message = new $root.google.cloud.clouddms.v1.ResumeMigrationJobRequest(); + var message = new $root.google.cloud.clouddms.v1.DeleteMigrationJobRequest(); if (object.name != null) message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a ResumeMigrationJobRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteMigrationJobRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.ResumeMigrationJobRequest} message ResumeMigrationJobRequest + * @param {google.cloud.clouddms.v1.DeleteMigrationJobRequest} message DeleteMigrationJobRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResumeMigrationJobRequest.toObject = function toObject(message, options) { + DeleteMigrationJobRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.requestId = ""; + object.force = false; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this ResumeMigrationJobRequest to JSON. + * Converts this DeleteMigrationJobRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest * @instance * @returns {Object.} JSON object */ - ResumeMigrationJobRequest.prototype.toJSON = function toJSON() { + DeleteMigrationJobRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ResumeMigrationJobRequest + * Gets the default type url for DeleteMigrationJobRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ResumeMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.ResumeMigrationJobRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.DeleteMigrationJobRequest"; }; - return ResumeMigrationJobRequest; + return DeleteMigrationJobRequest; })(); - v1.PromoteMigrationJobRequest = (function() { + v1.StartMigrationJobRequest = (function() { /** - * Properties of a PromoteMigrationJobRequest. + * Properties of a StartMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @interface IPromoteMigrationJobRequest - * @property {string|null} [name] PromoteMigrationJobRequest name + * @interface IStartMigrationJobRequest + * @property {string|null} [name] StartMigrationJobRequest name */ /** - * Constructs a new PromoteMigrationJobRequest. + * Constructs a new StartMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a PromoteMigrationJobRequest. - * @implements IPromoteMigrationJobRequest + * @classdesc Represents a StartMigrationJobRequest. + * @implements IStartMigrationJobRequest * @constructor - * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest=} [properties] Properties to set */ - function PromoteMigrationJobRequest(properties) { + function StartMigrationJobRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2871,35 +2889,35 @@ } /** - * PromoteMigrationJobRequest name. + * StartMigrationJobRequest name. * @member {string} name - * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest * @instance */ - PromoteMigrationJobRequest.prototype.name = ""; + StartMigrationJobRequest.prototype.name = ""; /** - * Creates a new PromoteMigrationJobRequest instance using the specified properties. + * Creates a new StartMigrationJobRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.PromoteMigrationJobRequest} PromoteMigrationJobRequest instance + * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.StartMigrationJobRequest} StartMigrationJobRequest instance */ - PromoteMigrationJobRequest.create = function create(properties) { - return new PromoteMigrationJobRequest(properties); + StartMigrationJobRequest.create = function create(properties) { + return new StartMigrationJobRequest(properties); }; /** - * Encodes the specified PromoteMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.PromoteMigrationJobRequest.verify|verify} messages. + * Encodes the specified StartMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.StartMigrationJobRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest} message PromoteMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest} message StartMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PromoteMigrationJobRequest.encode = function encode(message, writer) { + StartMigrationJobRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -2908,33 +2926,33 @@ }; /** - * Encodes the specified PromoteMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PromoteMigrationJobRequest.verify|verify} messages. + * Encodes the specified StartMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StartMigrationJobRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest} message PromoteMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest} message StartMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PromoteMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + StartMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PromoteMigrationJobRequest message from the specified reader or buffer. + * Decodes a StartMigrationJobRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.PromoteMigrationJobRequest} PromoteMigrationJobRequest + * @returns {google.cloud.clouddms.v1.StartMigrationJobRequest} StartMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PromoteMigrationJobRequest.decode = function decode(reader, length) { + StartMigrationJobRequest.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.clouddms.v1.PromoteMigrationJobRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.StartMigrationJobRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -2951,30 +2969,30 @@ }; /** - * Decodes a PromoteMigrationJobRequest message from the specified reader or buffer, length delimited. + * Decodes a StartMigrationJobRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.PromoteMigrationJobRequest} PromoteMigrationJobRequest + * @returns {google.cloud.clouddms.v1.StartMigrationJobRequest} StartMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PromoteMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + StartMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PromoteMigrationJobRequest message. + * Verifies a StartMigrationJobRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PromoteMigrationJobRequest.verify = function verify(message) { + StartMigrationJobRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -2984,32 +3002,32 @@ }; /** - * Creates a PromoteMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StartMigrationJobRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.PromoteMigrationJobRequest} PromoteMigrationJobRequest + * @returns {google.cloud.clouddms.v1.StartMigrationJobRequest} StartMigrationJobRequest */ - PromoteMigrationJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.PromoteMigrationJobRequest) + StartMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.StartMigrationJobRequest) return object; - var message = new $root.google.cloud.clouddms.v1.PromoteMigrationJobRequest(); + var message = new $root.google.cloud.clouddms.v1.StartMigrationJobRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a PromoteMigrationJobRequest message. Also converts values to other types if specified. + * Creates a plain object from a StartMigrationJobRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.PromoteMigrationJobRequest} message PromoteMigrationJobRequest + * @param {google.cloud.clouddms.v1.StartMigrationJobRequest} message StartMigrationJobRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PromoteMigrationJobRequest.toObject = function toObject(message, options) { + StartMigrationJobRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -3021,52 +3039,52 @@ }; /** - * Converts this PromoteMigrationJobRequest to JSON. + * Converts this StartMigrationJobRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest * @instance * @returns {Object.} JSON object */ - PromoteMigrationJobRequest.prototype.toJSON = function toJSON() { + StartMigrationJobRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PromoteMigrationJobRequest + * Gets the default type url for StartMigrationJobRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PromoteMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StartMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.PromoteMigrationJobRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.StartMigrationJobRequest"; }; - return PromoteMigrationJobRequest; + return StartMigrationJobRequest; })(); - v1.VerifyMigrationJobRequest = (function() { + v1.StopMigrationJobRequest = (function() { /** - * Properties of a VerifyMigrationJobRequest. + * Properties of a StopMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @interface IVerifyMigrationJobRequest - * @property {string|null} [name] VerifyMigrationJobRequest name + * @interface IStopMigrationJobRequest + * @property {string|null} [name] StopMigrationJobRequest name */ /** - * Constructs a new VerifyMigrationJobRequest. + * Constructs a new StopMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a VerifyMigrationJobRequest. - * @implements IVerifyMigrationJobRequest + * @classdesc Represents a StopMigrationJobRequest. + * @implements IStopMigrationJobRequest * @constructor - * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest=} [properties] Properties to set */ - function VerifyMigrationJobRequest(properties) { + function StopMigrationJobRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3074,35 +3092,35 @@ } /** - * VerifyMigrationJobRequest name. + * StopMigrationJobRequest name. * @member {string} name - * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest * @instance */ - VerifyMigrationJobRequest.prototype.name = ""; + StopMigrationJobRequest.prototype.name = ""; /** - * Creates a new VerifyMigrationJobRequest instance using the specified properties. + * Creates a new StopMigrationJobRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.VerifyMigrationJobRequest} VerifyMigrationJobRequest instance + * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.StopMigrationJobRequest} StopMigrationJobRequest instance */ - VerifyMigrationJobRequest.create = function create(properties) { - return new VerifyMigrationJobRequest(properties); + StopMigrationJobRequest.create = function create(properties) { + return new StopMigrationJobRequest(properties); }; /** - * Encodes the specified VerifyMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.VerifyMigrationJobRequest.verify|verify} messages. + * Encodes the specified StopMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.StopMigrationJobRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest} message VerifyMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest} message StopMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VerifyMigrationJobRequest.encode = function encode(message, writer) { + StopMigrationJobRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -3111,33 +3129,33 @@ }; /** - * Encodes the specified VerifyMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VerifyMigrationJobRequest.verify|verify} messages. + * Encodes the specified StopMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StopMigrationJobRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest} message VerifyMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest} message StopMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VerifyMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + StopMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VerifyMigrationJobRequest message from the specified reader or buffer. + * Decodes a StopMigrationJobRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.VerifyMigrationJobRequest} VerifyMigrationJobRequest + * @returns {google.cloud.clouddms.v1.StopMigrationJobRequest} StopMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VerifyMigrationJobRequest.decode = function decode(reader, length) { + StopMigrationJobRequest.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.clouddms.v1.VerifyMigrationJobRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.StopMigrationJobRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3154,30 +3172,30 @@ }; /** - * Decodes a VerifyMigrationJobRequest message from the specified reader or buffer, length delimited. + * Decodes a StopMigrationJobRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.VerifyMigrationJobRequest} VerifyMigrationJobRequest + * @returns {google.cloud.clouddms.v1.StopMigrationJobRequest} StopMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VerifyMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + StopMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VerifyMigrationJobRequest message. + * Verifies a StopMigrationJobRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VerifyMigrationJobRequest.verify = function verify(message) { + StopMigrationJobRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -3187,32 +3205,32 @@ }; /** - * Creates a VerifyMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StopMigrationJobRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.VerifyMigrationJobRequest} VerifyMigrationJobRequest + * @returns {google.cloud.clouddms.v1.StopMigrationJobRequest} StopMigrationJobRequest */ - VerifyMigrationJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.VerifyMigrationJobRequest) + StopMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.StopMigrationJobRequest) return object; - var message = new $root.google.cloud.clouddms.v1.VerifyMigrationJobRequest(); + var message = new $root.google.cloud.clouddms.v1.StopMigrationJobRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a VerifyMigrationJobRequest message. Also converts values to other types if specified. + * Creates a plain object from a StopMigrationJobRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.VerifyMigrationJobRequest} message VerifyMigrationJobRequest + * @param {google.cloud.clouddms.v1.StopMigrationJobRequest} message StopMigrationJobRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VerifyMigrationJobRequest.toObject = function toObject(message, options) { + StopMigrationJobRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -3224,52 +3242,52 @@ }; /** - * Converts this VerifyMigrationJobRequest to JSON. + * Converts this StopMigrationJobRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest * @instance * @returns {Object.} JSON object */ - VerifyMigrationJobRequest.prototype.toJSON = function toJSON() { + StopMigrationJobRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VerifyMigrationJobRequest + * Gets the default type url for StopMigrationJobRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VerifyMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StopMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.VerifyMigrationJobRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.StopMigrationJobRequest"; }; - return VerifyMigrationJobRequest; + return StopMigrationJobRequest; })(); - v1.RestartMigrationJobRequest = (function() { + v1.ResumeMigrationJobRequest = (function() { /** - * Properties of a RestartMigrationJobRequest. + * Properties of a ResumeMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @interface IRestartMigrationJobRequest - * @property {string|null} [name] RestartMigrationJobRequest name + * @interface IResumeMigrationJobRequest + * @property {string|null} [name] ResumeMigrationJobRequest name */ /** - * Constructs a new RestartMigrationJobRequest. + * Constructs a new ResumeMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a RestartMigrationJobRequest. - * @implements IRestartMigrationJobRequest + * @classdesc Represents a ResumeMigrationJobRequest. + * @implements IResumeMigrationJobRequest * @constructor - * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest=} [properties] Properties to set */ - function RestartMigrationJobRequest(properties) { + function ResumeMigrationJobRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3277,35 +3295,35 @@ } /** - * RestartMigrationJobRequest name. + * ResumeMigrationJobRequest name. * @member {string} name - * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest * @instance */ - RestartMigrationJobRequest.prototype.name = ""; + ResumeMigrationJobRequest.prototype.name = ""; /** - * Creates a new RestartMigrationJobRequest instance using the specified properties. + * Creates a new ResumeMigrationJobRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.RestartMigrationJobRequest} RestartMigrationJobRequest instance + * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ResumeMigrationJobRequest} ResumeMigrationJobRequest instance */ - RestartMigrationJobRequest.create = function create(properties) { - return new RestartMigrationJobRequest(properties); + ResumeMigrationJobRequest.create = function create(properties) { + return new ResumeMigrationJobRequest(properties); }; /** - * Encodes the specified RestartMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.RestartMigrationJobRequest.verify|verify} messages. + * Encodes the specified ResumeMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ResumeMigrationJobRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest} message RestartMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest} message ResumeMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestartMigrationJobRequest.encode = function encode(message, writer) { + ResumeMigrationJobRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -3314,33 +3332,33 @@ }; /** - * Encodes the specified RestartMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.RestartMigrationJobRequest.verify|verify} messages. + * Encodes the specified ResumeMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ResumeMigrationJobRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest} message RestartMigrationJobRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest} message ResumeMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestartMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + ResumeMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RestartMigrationJobRequest message from the specified reader or buffer. + * Decodes a ResumeMigrationJobRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.RestartMigrationJobRequest} RestartMigrationJobRequest + * @returns {google.cloud.clouddms.v1.ResumeMigrationJobRequest} ResumeMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestartMigrationJobRequest.decode = function decode(reader, length) { + ResumeMigrationJobRequest.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.clouddms.v1.RestartMigrationJobRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ResumeMigrationJobRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3357,30 +3375,30 @@ }; /** - * Decodes a RestartMigrationJobRequest message from the specified reader or buffer, length delimited. + * Decodes a ResumeMigrationJobRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.RestartMigrationJobRequest} RestartMigrationJobRequest + * @returns {google.cloud.clouddms.v1.ResumeMigrationJobRequest} ResumeMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestartMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + ResumeMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RestartMigrationJobRequest message. + * Verifies a ResumeMigrationJobRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RestartMigrationJobRequest.verify = function verify(message) { + ResumeMigrationJobRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -3390,32 +3408,32 @@ }; /** - * Creates a RestartMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ResumeMigrationJobRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.RestartMigrationJobRequest} RestartMigrationJobRequest + * @returns {google.cloud.clouddms.v1.ResumeMigrationJobRequest} ResumeMigrationJobRequest */ - RestartMigrationJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.RestartMigrationJobRequest) + ResumeMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ResumeMigrationJobRequest) return object; - var message = new $root.google.cloud.clouddms.v1.RestartMigrationJobRequest(); + var message = new $root.google.cloud.clouddms.v1.ResumeMigrationJobRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a RestartMigrationJobRequest message. Also converts values to other types if specified. + * Creates a plain object from a ResumeMigrationJobRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.RestartMigrationJobRequest} message RestartMigrationJobRequest + * @param {google.cloud.clouddms.v1.ResumeMigrationJobRequest} message ResumeMigrationJobRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestartMigrationJobRequest.toObject = function toObject(message, options) { + ResumeMigrationJobRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -3427,56 +3445,52 @@ }; /** - * Converts this RestartMigrationJobRequest to JSON. + * Converts this ResumeMigrationJobRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest * @instance * @returns {Object.} JSON object */ - RestartMigrationJobRequest.prototype.toJSON = function toJSON() { + ResumeMigrationJobRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RestartMigrationJobRequest + * Gets the default type url for ResumeMigrationJobRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RestartMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ResumeMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.RestartMigrationJobRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.ResumeMigrationJobRequest"; }; - return RestartMigrationJobRequest; + return ResumeMigrationJobRequest; })(); - v1.GenerateSshScriptRequest = (function() { + v1.PromoteMigrationJobRequest = (function() { /** - * Properties of a GenerateSshScriptRequest. + * Properties of a PromoteMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @interface IGenerateSshScriptRequest - * @property {string|null} [migrationJob] GenerateSshScriptRequest migrationJob - * @property {string|null} [vm] GenerateSshScriptRequest vm - * @property {google.cloud.clouddms.v1.IVmCreationConfig|null} [vmCreationConfig] GenerateSshScriptRequest vmCreationConfig - * @property {google.cloud.clouddms.v1.IVmSelectionConfig|null} [vmSelectionConfig] GenerateSshScriptRequest vmSelectionConfig - * @property {number|null} [vmPort] GenerateSshScriptRequest vmPort + * @interface IPromoteMigrationJobRequest + * @property {string|null} [name] PromoteMigrationJobRequest name */ /** - * Constructs a new GenerateSshScriptRequest. + * Constructs a new PromoteMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a GenerateSshScriptRequest. - * @implements IGenerateSshScriptRequest + * @classdesc Represents a PromoteMigrationJobRequest. + * @implements IPromoteMigrationJobRequest * @constructor - * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest=} [properties] Properties to set */ - function GenerateSshScriptRequest(properties) { + function PromoteMigrationJobRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3484,145 +3498,75 @@ } /** - * GenerateSshScriptRequest migrationJob. - * @member {string} migrationJob - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest - * @instance - */ - GenerateSshScriptRequest.prototype.migrationJob = ""; - - /** - * GenerateSshScriptRequest vm. - * @member {string} vm - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest - * @instance - */ - GenerateSshScriptRequest.prototype.vm = ""; - - /** - * GenerateSshScriptRequest vmCreationConfig. - * @member {google.cloud.clouddms.v1.IVmCreationConfig|null|undefined} vmCreationConfig - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest - * @instance - */ - GenerateSshScriptRequest.prototype.vmCreationConfig = null; - - /** - * GenerateSshScriptRequest vmSelectionConfig. - * @member {google.cloud.clouddms.v1.IVmSelectionConfig|null|undefined} vmSelectionConfig - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest - * @instance - */ - GenerateSshScriptRequest.prototype.vmSelectionConfig = null; - - /** - * GenerateSshScriptRequest vmPort. - * @member {number} vmPort - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest - * @instance - */ - GenerateSshScriptRequest.prototype.vmPort = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GenerateSshScriptRequest vmConfig. - * @member {"vmCreationConfig"|"vmSelectionConfig"|undefined} vmConfig - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * PromoteMigrationJobRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest * @instance */ - Object.defineProperty(GenerateSshScriptRequest.prototype, "vmConfig", { - get: $util.oneOfGetter($oneOfFields = ["vmCreationConfig", "vmSelectionConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); + PromoteMigrationJobRequest.prototype.name = ""; /** - * Creates a new GenerateSshScriptRequest instance using the specified properties. + * Creates a new PromoteMigrationJobRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.GenerateSshScriptRequest} GenerateSshScriptRequest instance + * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.PromoteMigrationJobRequest} PromoteMigrationJobRequest instance */ - GenerateSshScriptRequest.create = function create(properties) { - return new GenerateSshScriptRequest(properties); + PromoteMigrationJobRequest.create = function create(properties) { + return new PromoteMigrationJobRequest(properties); }; /** - * Encodes the specified GenerateSshScriptRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GenerateSshScriptRequest.verify|verify} messages. + * Encodes the specified PromoteMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.PromoteMigrationJobRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest} message GenerateSshScriptRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest} message PromoteMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateSshScriptRequest.encode = function encode(message, writer) { + PromoteMigrationJobRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.migrationJob != null && Object.hasOwnProperty.call(message, "migrationJob")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.migrationJob); - if (message.vm != null && Object.hasOwnProperty.call(message, "vm")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.vm); - if (message.vmPort != null && Object.hasOwnProperty.call(message, "vmPort")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.vmPort); - if (message.vmCreationConfig != null && Object.hasOwnProperty.call(message, "vmCreationConfig")) - $root.google.cloud.clouddms.v1.VmCreationConfig.encode(message.vmCreationConfig, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); - if (message.vmSelectionConfig != null && Object.hasOwnProperty.call(message, "vmSelectionConfig")) - $root.google.cloud.clouddms.v1.VmSelectionConfig.encode(message.vmSelectionConfig, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified GenerateSshScriptRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GenerateSshScriptRequest.verify|verify} messages. + * Encodes the specified PromoteMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PromoteMigrationJobRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest} message GenerateSshScriptRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest} message PromoteMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateSshScriptRequest.encodeDelimited = function encodeDelimited(message, writer) { + PromoteMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GenerateSshScriptRequest message from the specified reader or buffer. + * Decodes a PromoteMigrationJobRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.GenerateSshScriptRequest} GenerateSshScriptRequest + * @returns {google.cloud.clouddms.v1.PromoteMigrationJobRequest} PromoteMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GenerateSshScriptRequest.decode = function decode(reader, length) { + PromoteMigrationJobRequest.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.clouddms.v1.GenerateSshScriptRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.PromoteMigrationJobRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.migrationJob = reader.string(); - break; - } - case 2: { - message.vm = reader.string(); - break; - } - case 100: { - message.vmCreationConfig = $root.google.cloud.clouddms.v1.VmCreationConfig.decode(reader, reader.uint32()); - break; - } - case 101: { - message.vmSelectionConfig = $root.google.cloud.clouddms.v1.VmSelectionConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.vmPort = reader.int32(); + message.name = reader.string(); break; } default: @@ -3634,180 +3578,122 @@ }; /** - * Decodes a GenerateSshScriptRequest message from the specified reader or buffer, length delimited. + * Decodes a PromoteMigrationJobRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.GenerateSshScriptRequest} GenerateSshScriptRequest + * @returns {google.cloud.clouddms.v1.PromoteMigrationJobRequest} PromoteMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GenerateSshScriptRequest.decodeDelimited = function decodeDelimited(reader) { + PromoteMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GenerateSshScriptRequest message. + * Verifies a PromoteMigrationJobRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GenerateSshScriptRequest.verify = function verify(message) { + PromoteMigrationJobRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) - if (!$util.isString(message.migrationJob)) - return "migrationJob: string expected"; - if (message.vm != null && message.hasOwnProperty("vm")) - if (!$util.isString(message.vm)) - return "vm: string expected"; - if (message.vmCreationConfig != null && message.hasOwnProperty("vmCreationConfig")) { - properties.vmConfig = 1; - { - var error = $root.google.cloud.clouddms.v1.VmCreationConfig.verify(message.vmCreationConfig); - if (error) - return "vmCreationConfig." + error; - } - } - if (message.vmSelectionConfig != null && message.hasOwnProperty("vmSelectionConfig")) { - if (properties.vmConfig === 1) - return "vmConfig: multiple values"; - properties.vmConfig = 1; - { - var error = $root.google.cloud.clouddms.v1.VmSelectionConfig.verify(message.vmSelectionConfig); - if (error) - return "vmSelectionConfig." + error; - } - } - if (message.vmPort != null && message.hasOwnProperty("vmPort")) - if (!$util.isInteger(message.vmPort)) - return "vmPort: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a GenerateSshScriptRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PromoteMigrationJobRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.GenerateSshScriptRequest} GenerateSshScriptRequest + * @returns {google.cloud.clouddms.v1.PromoteMigrationJobRequest} PromoteMigrationJobRequest */ - GenerateSshScriptRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.GenerateSshScriptRequest) + PromoteMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.PromoteMigrationJobRequest) return object; - var message = new $root.google.cloud.clouddms.v1.GenerateSshScriptRequest(); - if (object.migrationJob != null) - message.migrationJob = String(object.migrationJob); - if (object.vm != null) - message.vm = String(object.vm); - if (object.vmCreationConfig != null) { - if (typeof object.vmCreationConfig !== "object") - throw TypeError(".google.cloud.clouddms.v1.GenerateSshScriptRequest.vmCreationConfig: object expected"); - message.vmCreationConfig = $root.google.cloud.clouddms.v1.VmCreationConfig.fromObject(object.vmCreationConfig); - } - if (object.vmSelectionConfig != null) { - if (typeof object.vmSelectionConfig !== "object") - throw TypeError(".google.cloud.clouddms.v1.GenerateSshScriptRequest.vmSelectionConfig: object expected"); - message.vmSelectionConfig = $root.google.cloud.clouddms.v1.VmSelectionConfig.fromObject(object.vmSelectionConfig); - } - if (object.vmPort != null) - message.vmPort = object.vmPort | 0; + var message = new $root.google.cloud.clouddms.v1.PromoteMigrationJobRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a GenerateSshScriptRequest message. Also converts values to other types if specified. + * Creates a plain object from a PromoteMigrationJobRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.GenerateSshScriptRequest} message GenerateSshScriptRequest + * @param {google.cloud.clouddms.v1.PromoteMigrationJobRequest} message PromoteMigrationJobRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateSshScriptRequest.toObject = function toObject(message, options) { + PromoteMigrationJobRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.migrationJob = ""; - object.vm = ""; - object.vmPort = 0; - } - if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) - object.migrationJob = message.migrationJob; - if (message.vm != null && message.hasOwnProperty("vm")) - object.vm = message.vm; - if (message.vmPort != null && message.hasOwnProperty("vmPort")) - object.vmPort = message.vmPort; - if (message.vmCreationConfig != null && message.hasOwnProperty("vmCreationConfig")) { - object.vmCreationConfig = $root.google.cloud.clouddms.v1.VmCreationConfig.toObject(message.vmCreationConfig, options); - if (options.oneofs) - object.vmConfig = "vmCreationConfig"; - } - if (message.vmSelectionConfig != null && message.hasOwnProperty("vmSelectionConfig")) { - object.vmSelectionConfig = $root.google.cloud.clouddms.v1.VmSelectionConfig.toObject(message.vmSelectionConfig, options); - if (options.oneofs) - object.vmConfig = "vmSelectionConfig"; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this GenerateSshScriptRequest to JSON. + * Converts this PromoteMigrationJobRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest * @instance * @returns {Object.} JSON object */ - GenerateSshScriptRequest.prototype.toJSON = function toJSON() { + PromoteMigrationJobRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GenerateSshScriptRequest + * Gets the default type url for PromoteMigrationJobRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GenerateSshScriptRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PromoteMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.GenerateSshScriptRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.PromoteMigrationJobRequest"; }; - return GenerateSshScriptRequest; + return PromoteMigrationJobRequest; })(); - v1.VmCreationConfig = (function() { + v1.VerifyMigrationJobRequest = (function() { /** - * Properties of a VmCreationConfig. + * Properties of a VerifyMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @interface IVmCreationConfig - * @property {string|null} [vmMachineType] VmCreationConfig vmMachineType - * @property {string|null} [vmZone] VmCreationConfig vmZone - * @property {string|null} [subnet] VmCreationConfig subnet + * @interface IVerifyMigrationJobRequest + * @property {string|null} [name] VerifyMigrationJobRequest name */ /** - * Constructs a new VmCreationConfig. + * Constructs a new VerifyMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a VmCreationConfig. - * @implements IVmCreationConfig + * @classdesc Represents a VerifyMigrationJobRequest. + * @implements IVerifyMigrationJobRequest * @constructor - * @param {google.cloud.clouddms.v1.IVmCreationConfig=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest=} [properties] Properties to set */ - function VmCreationConfig(properties) { + function VerifyMigrationJobRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3815,103 +3701,75 @@ } /** - * VmCreationConfig vmMachineType. - * @member {string} vmMachineType - * @memberof google.cloud.clouddms.v1.VmCreationConfig - * @instance - */ - VmCreationConfig.prototype.vmMachineType = ""; - - /** - * VmCreationConfig vmZone. - * @member {string} vmZone - * @memberof google.cloud.clouddms.v1.VmCreationConfig - * @instance - */ - VmCreationConfig.prototype.vmZone = ""; - - /** - * VmCreationConfig subnet. - * @member {string} subnet - * @memberof google.cloud.clouddms.v1.VmCreationConfig + * VerifyMigrationJobRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest * @instance */ - VmCreationConfig.prototype.subnet = ""; + VerifyMigrationJobRequest.prototype.name = ""; /** - * Creates a new VmCreationConfig instance using the specified properties. + * Creates a new VerifyMigrationJobRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IVmCreationConfig=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.VmCreationConfig} VmCreationConfig instance + * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.VerifyMigrationJobRequest} VerifyMigrationJobRequest instance */ - VmCreationConfig.create = function create(properties) { - return new VmCreationConfig(properties); + VerifyMigrationJobRequest.create = function create(properties) { + return new VerifyMigrationJobRequest(properties); }; /** - * Encodes the specified VmCreationConfig message. Does not implicitly {@link google.cloud.clouddms.v1.VmCreationConfig.verify|verify} messages. + * Encodes the specified VerifyMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.VerifyMigrationJobRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IVmCreationConfig} message VmCreationConfig message or plain object to encode + * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest} message VerifyMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VmCreationConfig.encode = function encode(message, writer) { + VerifyMigrationJobRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.vmMachineType != null && Object.hasOwnProperty.call(message, "vmMachineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmMachineType); - if (message.vmZone != null && Object.hasOwnProperty.call(message, "vmZone")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.vmZone); - if (message.subnet != null && Object.hasOwnProperty.call(message, "subnet")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.subnet); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified VmCreationConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VmCreationConfig.verify|verify} messages. + * Encodes the specified VerifyMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VerifyMigrationJobRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IVmCreationConfig} message VmCreationConfig message or plain object to encode + * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest} message VerifyMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VmCreationConfig.encodeDelimited = function encodeDelimited(message, writer) { + VerifyMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VmCreationConfig message from the specified reader or buffer. + * Decodes a VerifyMigrationJobRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.VmCreationConfig} VmCreationConfig + * @returns {google.cloud.clouddms.v1.VerifyMigrationJobRequest} VerifyMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VmCreationConfig.decode = function decode(reader, length) { + VerifyMigrationJobRequest.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.clouddms.v1.VmCreationConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.VerifyMigrationJobRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.vmMachineType = reader.string(); - break; - } - case 2: { - message.vmZone = reader.string(); - break; - } - case 3: { - message.subnet = reader.string(); + message.name = reader.string(); break; } default: @@ -3923,139 +3781,122 @@ }; /** - * Decodes a VmCreationConfig message from the specified reader or buffer, length delimited. + * Decodes a VerifyMigrationJobRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.VmCreationConfig} VmCreationConfig + * @returns {google.cloud.clouddms.v1.VerifyMigrationJobRequest} VerifyMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VmCreationConfig.decodeDelimited = function decodeDelimited(reader) { + VerifyMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VmCreationConfig message. + * Verifies a VerifyMigrationJobRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VmCreationConfig.verify = function verify(message) { + VerifyMigrationJobRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.vmMachineType != null && message.hasOwnProperty("vmMachineType")) - if (!$util.isString(message.vmMachineType)) - return "vmMachineType: string expected"; - if (message.vmZone != null && message.hasOwnProperty("vmZone")) - if (!$util.isString(message.vmZone)) - return "vmZone: string expected"; - if (message.subnet != null && message.hasOwnProperty("subnet")) - if (!$util.isString(message.subnet)) - return "subnet: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a VmCreationConfig message from a plain object. Also converts values to their respective internal types. + * Creates a VerifyMigrationJobRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.VmCreationConfig} VmCreationConfig + * @returns {google.cloud.clouddms.v1.VerifyMigrationJobRequest} VerifyMigrationJobRequest */ - VmCreationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.VmCreationConfig) + VerifyMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.VerifyMigrationJobRequest) return object; - var message = new $root.google.cloud.clouddms.v1.VmCreationConfig(); - if (object.vmMachineType != null) - message.vmMachineType = String(object.vmMachineType); - if (object.vmZone != null) - message.vmZone = String(object.vmZone); - if (object.subnet != null) - message.subnet = String(object.subnet); + var message = new $root.google.cloud.clouddms.v1.VerifyMigrationJobRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a VmCreationConfig message. Also converts values to other types if specified. + * Creates a plain object from a VerifyMigrationJobRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.VmCreationConfig} message VmCreationConfig + * @param {google.cloud.clouddms.v1.VerifyMigrationJobRequest} message VerifyMigrationJobRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VmCreationConfig.toObject = function toObject(message, options) { + VerifyMigrationJobRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.vmMachineType = ""; - object.vmZone = ""; - object.subnet = ""; - } - if (message.vmMachineType != null && message.hasOwnProperty("vmMachineType")) - object.vmMachineType = message.vmMachineType; - if (message.vmZone != null && message.hasOwnProperty("vmZone")) - object.vmZone = message.vmZone; - if (message.subnet != null && message.hasOwnProperty("subnet")) - object.subnet = message.subnet; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this VmCreationConfig to JSON. + * Converts this VerifyMigrationJobRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest * @instance * @returns {Object.} JSON object */ - VmCreationConfig.prototype.toJSON = function toJSON() { + VerifyMigrationJobRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VmCreationConfig + * Gets the default type url for VerifyMigrationJobRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VmCreationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VerifyMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.VmCreationConfig"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.VerifyMigrationJobRequest"; }; - return VmCreationConfig; + return VerifyMigrationJobRequest; })(); - v1.VmSelectionConfig = (function() { + v1.RestartMigrationJobRequest = (function() { /** - * Properties of a VmSelectionConfig. + * Properties of a RestartMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @interface IVmSelectionConfig - * @property {string|null} [vmZone] VmSelectionConfig vmZone + * @interface IRestartMigrationJobRequest + * @property {string|null} [name] RestartMigrationJobRequest name */ /** - * Constructs a new VmSelectionConfig. + * Constructs a new RestartMigrationJobRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a VmSelectionConfig. - * @implements IVmSelectionConfig + * @classdesc Represents a RestartMigrationJobRequest. + * @implements IRestartMigrationJobRequest * @constructor - * @param {google.cloud.clouddms.v1.IVmSelectionConfig=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest=} [properties] Properties to set */ - function VmSelectionConfig(properties) { + function RestartMigrationJobRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4063,75 +3904,75 @@ } /** - * VmSelectionConfig vmZone. - * @member {string} vmZone - * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * RestartMigrationJobRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest * @instance */ - VmSelectionConfig.prototype.vmZone = ""; + RestartMigrationJobRequest.prototype.name = ""; /** - * Creates a new VmSelectionConfig instance using the specified properties. + * Creates a new RestartMigrationJobRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IVmSelectionConfig=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.VmSelectionConfig} VmSelectionConfig instance + * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.RestartMigrationJobRequest} RestartMigrationJobRequest instance */ - VmSelectionConfig.create = function create(properties) { - return new VmSelectionConfig(properties); + RestartMigrationJobRequest.create = function create(properties) { + return new RestartMigrationJobRequest(properties); }; /** - * Encodes the specified VmSelectionConfig message. Does not implicitly {@link google.cloud.clouddms.v1.VmSelectionConfig.verify|verify} messages. + * Encodes the specified RestartMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.RestartMigrationJobRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IVmSelectionConfig} message VmSelectionConfig message or plain object to encode + * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest} message RestartMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VmSelectionConfig.encode = function encode(message, writer) { + RestartMigrationJobRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.vmZone != null && Object.hasOwnProperty.call(message, "vmZone")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmZone); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified VmSelectionConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VmSelectionConfig.verify|verify} messages. + * Encodes the specified RestartMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.RestartMigrationJobRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.IVmSelectionConfig} message VmSelectionConfig message or plain object to encode + * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest} message RestartMigrationJobRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VmSelectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + RestartMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VmSelectionConfig message from the specified reader or buffer. + * Decodes a RestartMigrationJobRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.VmSelectionConfig} VmSelectionConfig + * @returns {google.cloud.clouddms.v1.RestartMigrationJobRequest} RestartMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VmSelectionConfig.decode = function decode(reader, length) { + RestartMigrationJobRequest.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.clouddms.v1.VmSelectionConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.RestartMigrationJobRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.vmZone = reader.string(); + message.name = reader.string(); break; } default: @@ -4143,122 +3984,126 @@ }; /** - * Decodes a VmSelectionConfig message from the specified reader or buffer, length delimited. + * Decodes a RestartMigrationJobRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.VmSelectionConfig} VmSelectionConfig + * @returns {google.cloud.clouddms.v1.RestartMigrationJobRequest} RestartMigrationJobRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VmSelectionConfig.decodeDelimited = function decodeDelimited(reader) { + RestartMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VmSelectionConfig message. + * Verifies a RestartMigrationJobRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VmSelectionConfig.verify = function verify(message) { + RestartMigrationJobRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.vmZone != null && message.hasOwnProperty("vmZone")) - if (!$util.isString(message.vmZone)) - return "vmZone: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a VmSelectionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a RestartMigrationJobRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.VmSelectionConfig} VmSelectionConfig + * @returns {google.cloud.clouddms.v1.RestartMigrationJobRequest} RestartMigrationJobRequest */ - VmSelectionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.VmSelectionConfig) + RestartMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.RestartMigrationJobRequest) return object; - var message = new $root.google.cloud.clouddms.v1.VmSelectionConfig(); - if (object.vmZone != null) - message.vmZone = String(object.vmZone); + var message = new $root.google.cloud.clouddms.v1.RestartMigrationJobRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a VmSelectionConfig message. Also converts values to other types if specified. + * Creates a plain object from a RestartMigrationJobRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest * @static - * @param {google.cloud.clouddms.v1.VmSelectionConfig} message VmSelectionConfig + * @param {google.cloud.clouddms.v1.RestartMigrationJobRequest} message RestartMigrationJobRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VmSelectionConfig.toObject = function toObject(message, options) { + RestartMigrationJobRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.vmZone = ""; - if (message.vmZone != null && message.hasOwnProperty("vmZone")) - object.vmZone = message.vmZone; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this VmSelectionConfig to JSON. + * Converts this RestartMigrationJobRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest * @instance * @returns {Object.} JSON object */ - VmSelectionConfig.prototype.toJSON = function toJSON() { + RestartMigrationJobRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VmSelectionConfig + * Gets the default type url for RestartMigrationJobRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VmSelectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RestartMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.VmSelectionConfig"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.RestartMigrationJobRequest"; }; - return VmSelectionConfig; + return RestartMigrationJobRequest; })(); - v1.SshScript = (function() { + v1.GenerateSshScriptRequest = (function() { /** - * Properties of a SshScript. + * Properties of a GenerateSshScriptRequest. * @memberof google.cloud.clouddms.v1 - * @interface ISshScript - * @property {string|null} [script] SshScript script + * @interface IGenerateSshScriptRequest + * @property {string|null} [migrationJob] GenerateSshScriptRequest migrationJob + * @property {string|null} [vm] GenerateSshScriptRequest vm + * @property {google.cloud.clouddms.v1.IVmCreationConfig|null} [vmCreationConfig] GenerateSshScriptRequest vmCreationConfig + * @property {google.cloud.clouddms.v1.IVmSelectionConfig|null} [vmSelectionConfig] GenerateSshScriptRequest vmSelectionConfig + * @property {number|null} [vmPort] GenerateSshScriptRequest vmPort */ /** - * Constructs a new SshScript. + * Constructs a new GenerateSshScriptRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a SshScript. - * @implements ISshScript + * @classdesc Represents a GenerateSshScriptRequest. + * @implements IGenerateSshScriptRequest * @constructor - * @param {google.cloud.clouddms.v1.ISshScript=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest=} [properties] Properties to set */ - function SshScript(properties) { + function GenerateSshScriptRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4266,75 +4111,145 @@ } /** - * SshScript script. - * @member {string} script - * @memberof google.cloud.clouddms.v1.SshScript + * GenerateSshScriptRequest migrationJob. + * @member {string} migrationJob + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest * @instance */ - SshScript.prototype.script = ""; + GenerateSshScriptRequest.prototype.migrationJob = ""; /** - * Creates a new SshScript instance using the specified properties. - * @function create - * @memberof google.cloud.clouddms.v1.SshScript - * @static - * @param {google.cloud.clouddms.v1.ISshScript=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.SshScript} SshScript instance + * GenerateSshScriptRequest vm. + * @member {string} vm + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @instance */ - SshScript.create = function create(properties) { - return new SshScript(properties); - }; + GenerateSshScriptRequest.prototype.vm = ""; /** - * Encodes the specified SshScript message. Does not implicitly {@link google.cloud.clouddms.v1.SshScript.verify|verify} messages. - * @function encode - * @memberof google.cloud.clouddms.v1.SshScript - * @static - * @param {google.cloud.clouddms.v1.ISshScript} message SshScript message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * GenerateSshScriptRequest vmCreationConfig. + * @member {google.cloud.clouddms.v1.IVmCreationConfig|null|undefined} vmCreationConfig + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @instance */ - SshScript.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.script != null && Object.hasOwnProperty.call(message, "script")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.script); - return writer; + GenerateSshScriptRequest.prototype.vmCreationConfig = null; + + /** + * GenerateSshScriptRequest vmSelectionConfig. + * @member {google.cloud.clouddms.v1.IVmSelectionConfig|null|undefined} vmSelectionConfig + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @instance + */ + GenerateSshScriptRequest.prototype.vmSelectionConfig = null; + + /** + * GenerateSshScriptRequest vmPort. + * @member {number} vmPort + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @instance + */ + GenerateSshScriptRequest.prototype.vmPort = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenerateSshScriptRequest vmConfig. + * @member {"vmCreationConfig"|"vmSelectionConfig"|undefined} vmConfig + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @instance + */ + Object.defineProperty(GenerateSshScriptRequest.prototype, "vmConfig", { + get: $util.oneOfGetter($oneOfFields = ["vmCreationConfig", "vmSelectionConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateSshScriptRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @static + * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.GenerateSshScriptRequest} GenerateSshScriptRequest instance + */ + GenerateSshScriptRequest.create = function create(properties) { + return new GenerateSshScriptRequest(properties); }; /** - * Encodes the specified SshScript message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SshScript.verify|verify} messages. + * Encodes the specified GenerateSshScriptRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GenerateSshScriptRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @static + * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest} message GenerateSshScriptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateSshScriptRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.migrationJob != null && Object.hasOwnProperty.call(message, "migrationJob")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.migrationJob); + if (message.vm != null && Object.hasOwnProperty.call(message, "vm")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vm); + if (message.vmPort != null && Object.hasOwnProperty.call(message, "vmPort")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.vmPort); + if (message.vmCreationConfig != null && Object.hasOwnProperty.call(message, "vmCreationConfig")) + $root.google.cloud.clouddms.v1.VmCreationConfig.encode(message.vmCreationConfig, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.vmSelectionConfig != null && Object.hasOwnProperty.call(message, "vmSelectionConfig")) + $root.google.cloud.clouddms.v1.VmSelectionConfig.encode(message.vmSelectionConfig, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateSshScriptRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GenerateSshScriptRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.SshScript + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest * @static - * @param {google.cloud.clouddms.v1.ISshScript} message SshScript message or plain object to encode + * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest} message GenerateSshScriptRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SshScript.encodeDelimited = function encodeDelimited(message, writer) { + GenerateSshScriptRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SshScript message from the specified reader or buffer. + * Decodes a GenerateSshScriptRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.SshScript + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.SshScript} SshScript + * @returns {google.cloud.clouddms.v1.GenerateSshScriptRequest} GenerateSshScriptRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SshScript.decode = function decode(reader, length) { + GenerateSshScriptRequest.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.clouddms.v1.SshScript(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.GenerateSshScriptRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.script = reader.string(); + message.migrationJob = reader.string(); + break; + } + case 2: { + message.vm = reader.string(); + break; + } + case 100: { + message.vmCreationConfig = $root.google.cloud.clouddms.v1.VmCreationConfig.decode(reader, reader.uint32()); + break; + } + case 101: { + message.vmSelectionConfig = $root.google.cloud.clouddms.v1.VmSelectionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.vmPort = reader.int32(); break; } default: @@ -4346,126 +4261,180 @@ }; /** - * Decodes a SshScript message from the specified reader or buffer, length delimited. + * Decodes a GenerateSshScriptRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.SshScript + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.SshScript} SshScript + * @returns {google.cloud.clouddms.v1.GenerateSshScriptRequest} GenerateSshScriptRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SshScript.decodeDelimited = function decodeDelimited(reader) { + GenerateSshScriptRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SshScript message. + * Verifies a GenerateSshScriptRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.SshScript + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SshScript.verify = function verify(message) { + GenerateSshScriptRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.script != null && message.hasOwnProperty("script")) - if (!$util.isString(message.script)) - return "script: string expected"; + var properties = {}; + if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) + if (!$util.isString(message.migrationJob)) + return "migrationJob: string expected"; + if (message.vm != null && message.hasOwnProperty("vm")) + if (!$util.isString(message.vm)) + return "vm: string expected"; + if (message.vmCreationConfig != null && message.hasOwnProperty("vmCreationConfig")) { + properties.vmConfig = 1; + { + var error = $root.google.cloud.clouddms.v1.VmCreationConfig.verify(message.vmCreationConfig); + if (error) + return "vmCreationConfig." + error; + } + } + if (message.vmSelectionConfig != null && message.hasOwnProperty("vmSelectionConfig")) { + if (properties.vmConfig === 1) + return "vmConfig: multiple values"; + properties.vmConfig = 1; + { + var error = $root.google.cloud.clouddms.v1.VmSelectionConfig.verify(message.vmSelectionConfig); + if (error) + return "vmSelectionConfig." + error; + } + } + if (message.vmPort != null && message.hasOwnProperty("vmPort")) + if (!$util.isInteger(message.vmPort)) + return "vmPort: integer expected"; return null; }; /** - * Creates a SshScript message from a plain object. Also converts values to their respective internal types. + * Creates a GenerateSshScriptRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.SshScript + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.SshScript} SshScript + * @returns {google.cloud.clouddms.v1.GenerateSshScriptRequest} GenerateSshScriptRequest */ - SshScript.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.SshScript) + GenerateSshScriptRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.GenerateSshScriptRequest) return object; - var message = new $root.google.cloud.clouddms.v1.SshScript(); - if (object.script != null) - message.script = String(object.script); + var message = new $root.google.cloud.clouddms.v1.GenerateSshScriptRequest(); + if (object.migrationJob != null) + message.migrationJob = String(object.migrationJob); + if (object.vm != null) + message.vm = String(object.vm); + if (object.vmCreationConfig != null) { + if (typeof object.vmCreationConfig !== "object") + throw TypeError(".google.cloud.clouddms.v1.GenerateSshScriptRequest.vmCreationConfig: object expected"); + message.vmCreationConfig = $root.google.cloud.clouddms.v1.VmCreationConfig.fromObject(object.vmCreationConfig); + } + if (object.vmSelectionConfig != null) { + if (typeof object.vmSelectionConfig !== "object") + throw TypeError(".google.cloud.clouddms.v1.GenerateSshScriptRequest.vmSelectionConfig: object expected"); + message.vmSelectionConfig = $root.google.cloud.clouddms.v1.VmSelectionConfig.fromObject(object.vmSelectionConfig); + } + if (object.vmPort != null) + message.vmPort = object.vmPort | 0; return message; }; /** - * Creates a plain object from a SshScript message. Also converts values to other types if specified. + * Creates a plain object from a GenerateSshScriptRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.SshScript + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest * @static - * @param {google.cloud.clouddms.v1.SshScript} message SshScript + * @param {google.cloud.clouddms.v1.GenerateSshScriptRequest} message GenerateSshScriptRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SshScript.toObject = function toObject(message, options) { + GenerateSshScriptRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.script = ""; - if (message.script != null && message.hasOwnProperty("script")) - object.script = message.script; + if (options.defaults) { + object.migrationJob = ""; + object.vm = ""; + object.vmPort = 0; + } + if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) + object.migrationJob = message.migrationJob; + if (message.vm != null && message.hasOwnProperty("vm")) + object.vm = message.vm; + if (message.vmPort != null && message.hasOwnProperty("vmPort")) + object.vmPort = message.vmPort; + if (message.vmCreationConfig != null && message.hasOwnProperty("vmCreationConfig")) { + object.vmCreationConfig = $root.google.cloud.clouddms.v1.VmCreationConfig.toObject(message.vmCreationConfig, options); + if (options.oneofs) + object.vmConfig = "vmCreationConfig"; + } + if (message.vmSelectionConfig != null && message.hasOwnProperty("vmSelectionConfig")) { + object.vmSelectionConfig = $root.google.cloud.clouddms.v1.VmSelectionConfig.toObject(message.vmSelectionConfig, options); + if (options.oneofs) + object.vmConfig = "vmSelectionConfig"; + } return object; }; /** - * Converts this SshScript to JSON. + * Converts this GenerateSshScriptRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.SshScript + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest * @instance * @returns {Object.} JSON object */ - SshScript.prototype.toJSON = function toJSON() { + GenerateSshScriptRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SshScript + * Gets the default type url for GenerateSshScriptRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.SshScript + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SshScript.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GenerateSshScriptRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.SshScript"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.GenerateSshScriptRequest"; }; - return SshScript; + return GenerateSshScriptRequest; })(); - v1.ListConnectionProfilesRequest = (function() { + v1.VmCreationConfig = (function() { /** - * Properties of a ListConnectionProfilesRequest. + * Properties of a VmCreationConfig. * @memberof google.cloud.clouddms.v1 - * @interface IListConnectionProfilesRequest - * @property {string|null} [parent] ListConnectionProfilesRequest parent - * @property {number|null} [pageSize] ListConnectionProfilesRequest pageSize - * @property {string|null} [pageToken] ListConnectionProfilesRequest pageToken - * @property {string|null} [filter] ListConnectionProfilesRequest filter - * @property {string|null} [orderBy] ListConnectionProfilesRequest orderBy + * @interface IVmCreationConfig + * @property {string|null} [vmMachineType] VmCreationConfig vmMachineType + * @property {string|null} [vmZone] VmCreationConfig vmZone + * @property {string|null} [subnet] VmCreationConfig subnet */ /** - * Constructs a new ListConnectionProfilesRequest. + * Constructs a new VmCreationConfig. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a ListConnectionProfilesRequest. - * @implements IListConnectionProfilesRequest + * @classdesc Represents a VmCreationConfig. + * @implements IVmCreationConfig * @constructor - * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IVmCreationConfig=} [properties] Properties to set */ - function ListConnectionProfilesRequest(properties) { + function VmCreationConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4473,131 +4442,103 @@ } /** - * ListConnectionProfilesRequest parent. - * @member {string} parent - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest - * @instance - */ - ListConnectionProfilesRequest.prototype.parent = ""; - - /** - * ListConnectionProfilesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest - * @instance - */ - ListConnectionProfilesRequest.prototype.pageSize = 0; - - /** - * ListConnectionProfilesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * VmCreationConfig vmMachineType. + * @member {string} vmMachineType + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @instance */ - ListConnectionProfilesRequest.prototype.pageToken = ""; + VmCreationConfig.prototype.vmMachineType = ""; /** - * ListConnectionProfilesRequest filter. - * @member {string} filter - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * VmCreationConfig vmZone. + * @member {string} vmZone + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @instance */ - ListConnectionProfilesRequest.prototype.filter = ""; + VmCreationConfig.prototype.vmZone = ""; /** - * ListConnectionProfilesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * VmCreationConfig subnet. + * @member {string} subnet + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @instance */ - ListConnectionProfilesRequest.prototype.orderBy = ""; + VmCreationConfig.prototype.subnet = ""; /** - * Creates a new ListConnectionProfilesRequest instance using the specified properties. + * Creates a new VmCreationConfig instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @static - * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.ListConnectionProfilesRequest} ListConnectionProfilesRequest instance + * @param {google.cloud.clouddms.v1.IVmCreationConfig=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.VmCreationConfig} VmCreationConfig instance */ - ListConnectionProfilesRequest.create = function create(properties) { - return new ListConnectionProfilesRequest(properties); + VmCreationConfig.create = function create(properties) { + return new VmCreationConfig(properties); }; /** - * Encodes the specified ListConnectionProfilesRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesRequest.verify|verify} messages. + * Encodes the specified VmCreationConfig message. Does not implicitly {@link google.cloud.clouddms.v1.VmCreationConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @static - * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest} message ListConnectionProfilesRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IVmCreationConfig} message VmCreationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListConnectionProfilesRequest.encode = function encode(message, writer) { + VmCreationConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.vmMachineType != null && Object.hasOwnProperty.call(message, "vmMachineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmMachineType); + if (message.vmZone != null && Object.hasOwnProperty.call(message, "vmZone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vmZone); + if (message.subnet != null && Object.hasOwnProperty.call(message, "subnet")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.subnet); return writer; }; /** - * Encodes the specified ListConnectionProfilesRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesRequest.verify|verify} messages. + * Encodes the specified VmCreationConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VmCreationConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @static - * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest} message ListConnectionProfilesRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IVmCreationConfig} message VmCreationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListConnectionProfilesRequest.encodeDelimited = function encodeDelimited(message, writer) { + VmCreationConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListConnectionProfilesRequest message from the specified reader or buffer. + * Decodes a VmCreationConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.ListConnectionProfilesRequest} ListConnectionProfilesRequest + * @returns {google.cloud.clouddms.v1.VmCreationConfig} VmCreationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListConnectionProfilesRequest.decode = function decode(reader, length) { + VmCreationConfig.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.clouddms.v1.ListConnectionProfilesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.VmCreationConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.vmMachineType = reader.string(); break; } case 2: { - message.pageSize = reader.int32(); + message.vmZone = reader.string(); break; } case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); + message.subnet = reader.string(); break; } default: @@ -4609,159 +4550,139 @@ }; /** - * Decodes a ListConnectionProfilesRequest message from the specified reader or buffer, length delimited. + * Decodes a VmCreationConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.ListConnectionProfilesRequest} ListConnectionProfilesRequest + * @returns {google.cloud.clouddms.v1.VmCreationConfig} VmCreationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListConnectionProfilesRequest.decodeDelimited = function decodeDelimited(reader) { + VmCreationConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListConnectionProfilesRequest message. + * Verifies a VmCreationConfig message. * @function verify - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListConnectionProfilesRequest.verify = function verify(message) { + VmCreationConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.vmMachineType != null && message.hasOwnProperty("vmMachineType")) + if (!$util.isString(message.vmMachineType)) + return "vmMachineType: string expected"; + if (message.vmZone != null && message.hasOwnProperty("vmZone")) + if (!$util.isString(message.vmZone)) + return "vmZone: string expected"; + if (message.subnet != null && message.hasOwnProperty("subnet")) + if (!$util.isString(message.subnet)) + return "subnet: string expected"; return null; }; /** - * Creates a ListConnectionProfilesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a VmCreationConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.ListConnectionProfilesRequest} ListConnectionProfilesRequest + * @returns {google.cloud.clouddms.v1.VmCreationConfig} VmCreationConfig */ - ListConnectionProfilesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.ListConnectionProfilesRequest) + VmCreationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.VmCreationConfig) return object; - var message = new $root.google.cloud.clouddms.v1.ListConnectionProfilesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + var message = new $root.google.cloud.clouddms.v1.VmCreationConfig(); + if (object.vmMachineType != null) + message.vmMachineType = String(object.vmMachineType); + if (object.vmZone != null) + message.vmZone = String(object.vmZone); + if (object.subnet != null) + message.subnet = String(object.subnet); return message; }; /** - * Creates a plain object from a ListConnectionProfilesRequest message. Also converts values to other types if specified. + * Creates a plain object from a VmCreationConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @static - * @param {google.cloud.clouddms.v1.ListConnectionProfilesRequest} message ListConnectionProfilesRequest + * @param {google.cloud.clouddms.v1.VmCreationConfig} message VmCreationConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListConnectionProfilesRequest.toObject = function toObject(message, options) { + VmCreationConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + object.vmMachineType = ""; + object.vmZone = ""; + object.subnet = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + if (message.vmMachineType != null && message.hasOwnProperty("vmMachineType")) + object.vmMachineType = message.vmMachineType; + if (message.vmZone != null && message.hasOwnProperty("vmZone")) + object.vmZone = message.vmZone; + if (message.subnet != null && message.hasOwnProperty("subnet")) + object.subnet = message.subnet; return object; }; /** - * Converts this ListConnectionProfilesRequest to JSON. + * Converts this VmCreationConfig to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @instance * @returns {Object.} JSON object */ - ListConnectionProfilesRequest.prototype.toJSON = function toJSON() { + VmCreationConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListConnectionProfilesRequest + * Gets the default type url for VmCreationConfig * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @memberof google.cloud.clouddms.v1.VmCreationConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListConnectionProfilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VmCreationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.ListConnectionProfilesRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.VmCreationConfig"; }; - return ListConnectionProfilesRequest; + return VmCreationConfig; })(); - v1.ListConnectionProfilesResponse = (function() { + v1.VmSelectionConfig = (function() { /** - * Properties of a ListConnectionProfilesResponse. + * Properties of a VmSelectionConfig. * @memberof google.cloud.clouddms.v1 - * @interface IListConnectionProfilesResponse - * @property {Array.|null} [connectionProfiles] ListConnectionProfilesResponse connectionProfiles - * @property {string|null} [nextPageToken] ListConnectionProfilesResponse nextPageToken - * @property {Array.|null} [unreachable] ListConnectionProfilesResponse unreachable + * @interface IVmSelectionConfig + * @property {string|null} [vmZone] VmSelectionConfig vmZone */ /** - * Constructs a new ListConnectionProfilesResponse. + * Constructs a new VmSelectionConfig. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a ListConnectionProfilesResponse. - * @implements IListConnectionProfilesResponse + * @classdesc Represents a VmSelectionConfig. + * @implements IVmSelectionConfig * @constructor - * @param {google.cloud.clouddms.v1.IListConnectionProfilesResponse=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IVmSelectionConfig=} [properties] Properties to set */ - function ListConnectionProfilesResponse(properties) { - this.connectionProfiles = []; - this.unreachable = []; + function VmSelectionConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4769,109 +4690,75 @@ } /** - * ListConnectionProfilesResponse connectionProfiles. - * @member {Array.} connectionProfiles - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse - * @instance - */ - ListConnectionProfilesResponse.prototype.connectionProfiles = $util.emptyArray; - - /** - * ListConnectionProfilesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * VmSelectionConfig vmZone. + * @member {string} vmZone + * @memberof google.cloud.clouddms.v1.VmSelectionConfig * @instance */ - ListConnectionProfilesResponse.prototype.nextPageToken = ""; + VmSelectionConfig.prototype.vmZone = ""; /** - * ListConnectionProfilesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse - * @instance - */ - ListConnectionProfilesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListConnectionProfilesResponse instance using the specified properties. + * Creates a new VmSelectionConfig instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @memberof google.cloud.clouddms.v1.VmSelectionConfig * @static - * @param {google.cloud.clouddms.v1.IListConnectionProfilesResponse=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.ListConnectionProfilesResponse} ListConnectionProfilesResponse instance + * @param {google.cloud.clouddms.v1.IVmSelectionConfig=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.VmSelectionConfig} VmSelectionConfig instance */ - ListConnectionProfilesResponse.create = function create(properties) { - return new ListConnectionProfilesResponse(properties); + VmSelectionConfig.create = function create(properties) { + return new VmSelectionConfig(properties); }; /** - * Encodes the specified ListConnectionProfilesResponse message. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesResponse.verify|verify} messages. + * Encodes the specified VmSelectionConfig message. Does not implicitly {@link google.cloud.clouddms.v1.VmSelectionConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @memberof google.cloud.clouddms.v1.VmSelectionConfig * @static - * @param {google.cloud.clouddms.v1.IListConnectionProfilesResponse} message ListConnectionProfilesResponse message or plain object to encode + * @param {google.cloud.clouddms.v1.IVmSelectionConfig} message VmSelectionConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListConnectionProfilesResponse.encode = function encode(message, writer) { + VmSelectionConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.connectionProfiles != null && message.connectionProfiles.length) - for (var i = 0; i < message.connectionProfiles.length; ++i) - $root.google.cloud.clouddms.v1.ConnectionProfile.encode(message.connectionProfiles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.vmZone != null && Object.hasOwnProperty.call(message, "vmZone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmZone); return writer; }; /** - * Encodes the specified ListConnectionProfilesResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesResponse.verify|verify} messages. + * Encodes the specified VmSelectionConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VmSelectionConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @memberof google.cloud.clouddms.v1.VmSelectionConfig * @static - * @param {google.cloud.clouddms.v1.IListConnectionProfilesResponse} message ListConnectionProfilesResponse message or plain object to encode + * @param {google.cloud.clouddms.v1.IVmSelectionConfig} message VmSelectionConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListConnectionProfilesResponse.encodeDelimited = function encodeDelimited(message, writer) { + VmSelectionConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListConnectionProfilesResponse message from the specified reader or buffer. + * Decodes a VmSelectionConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @memberof google.cloud.clouddms.v1.VmSelectionConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.ListConnectionProfilesResponse} ListConnectionProfilesResponse + * @returns {google.cloud.clouddms.v1.VmSelectionConfig} VmSelectionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListConnectionProfilesResponse.decode = function decode(reader, length) { + VmSelectionConfig.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.clouddms.v1.ListConnectionProfilesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.VmSelectionConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.connectionProfiles && message.connectionProfiles.length)) - message.connectionProfiles = []; - message.connectionProfiles.push($root.google.cloud.clouddms.v1.ConnectionProfile.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.vmZone = reader.string(); break; } default: @@ -4883,169 +4770,122 @@ }; /** - * Decodes a ListConnectionProfilesResponse message from the specified reader or buffer, length delimited. + * Decodes a VmSelectionConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @memberof google.cloud.clouddms.v1.VmSelectionConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.ListConnectionProfilesResponse} ListConnectionProfilesResponse + * @returns {google.cloud.clouddms.v1.VmSelectionConfig} VmSelectionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListConnectionProfilesResponse.decodeDelimited = function decodeDelimited(reader) { + VmSelectionConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListConnectionProfilesResponse message. + * Verifies a VmSelectionConfig message. * @function verify - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @memberof google.cloud.clouddms.v1.VmSelectionConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListConnectionProfilesResponse.verify = function verify(message) { + VmSelectionConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.connectionProfiles != null && message.hasOwnProperty("connectionProfiles")) { - if (!Array.isArray(message.connectionProfiles)) - return "connectionProfiles: array expected"; - for (var i = 0; i < message.connectionProfiles.length; ++i) { - var error = $root.google.cloud.clouddms.v1.ConnectionProfile.verify(message.connectionProfiles[i]); - if (error) - return "connectionProfiles." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } + if (message.vmZone != null && message.hasOwnProperty("vmZone")) + if (!$util.isString(message.vmZone)) + return "vmZone: string expected"; return null; }; /** - * Creates a ListConnectionProfilesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a VmSelectionConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @memberof google.cloud.clouddms.v1.VmSelectionConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.ListConnectionProfilesResponse} ListConnectionProfilesResponse + * @returns {google.cloud.clouddms.v1.VmSelectionConfig} VmSelectionConfig */ - ListConnectionProfilesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.ListConnectionProfilesResponse) + VmSelectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.VmSelectionConfig) return object; - var message = new $root.google.cloud.clouddms.v1.ListConnectionProfilesResponse(); - if (object.connectionProfiles) { - if (!Array.isArray(object.connectionProfiles)) - throw TypeError(".google.cloud.clouddms.v1.ListConnectionProfilesResponse.connectionProfiles: array expected"); - message.connectionProfiles = []; - for (var i = 0; i < object.connectionProfiles.length; ++i) { - if (typeof object.connectionProfiles[i] !== "object") - throw TypeError(".google.cloud.clouddms.v1.ListConnectionProfilesResponse.connectionProfiles: object expected"); - message.connectionProfiles[i] = $root.google.cloud.clouddms.v1.ConnectionProfile.fromObject(object.connectionProfiles[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.clouddms.v1.ListConnectionProfilesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } + var message = new $root.google.cloud.clouddms.v1.VmSelectionConfig(); + if (object.vmZone != null) + message.vmZone = String(object.vmZone); return message; }; /** - * Creates a plain object from a ListConnectionProfilesResponse message. Also converts values to other types if specified. + * Creates a plain object from a VmSelectionConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @memberof google.cloud.clouddms.v1.VmSelectionConfig * @static - * @param {google.cloud.clouddms.v1.ListConnectionProfilesResponse} message ListConnectionProfilesResponse + * @param {google.cloud.clouddms.v1.VmSelectionConfig} message VmSelectionConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListConnectionProfilesResponse.toObject = function toObject(message, options) { + VmSelectionConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.connectionProfiles = []; - object.unreachable = []; - } if (options.defaults) - object.nextPageToken = ""; - if (message.connectionProfiles && message.connectionProfiles.length) { - object.connectionProfiles = []; - for (var j = 0; j < message.connectionProfiles.length; ++j) - object.connectionProfiles[j] = $root.google.cloud.clouddms.v1.ConnectionProfile.toObject(message.connectionProfiles[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } + object.vmZone = ""; + if (message.vmZone != null && message.hasOwnProperty("vmZone")) + object.vmZone = message.vmZone; return object; }; /** - * Converts this ListConnectionProfilesResponse to JSON. + * Converts this VmSelectionConfig to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @memberof google.cloud.clouddms.v1.VmSelectionConfig * @instance * @returns {Object.} JSON object */ - ListConnectionProfilesResponse.prototype.toJSON = function toJSON() { + VmSelectionConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListConnectionProfilesResponse + * Gets the default type url for VmSelectionConfig * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @memberof google.cloud.clouddms.v1.VmSelectionConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListConnectionProfilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VmSelectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.ListConnectionProfilesResponse"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.VmSelectionConfig"; }; - return ListConnectionProfilesResponse; + return VmSelectionConfig; })(); - v1.GetConnectionProfileRequest = (function() { + v1.SshScript = (function() { /** - * Properties of a GetConnectionProfileRequest. + * Properties of a SshScript. * @memberof google.cloud.clouddms.v1 - * @interface IGetConnectionProfileRequest - * @property {string|null} [name] GetConnectionProfileRequest name + * @interface ISshScript + * @property {string|null} [script] SshScript script */ /** - * Constructs a new GetConnectionProfileRequest. + * Constructs a new SshScript. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a GetConnectionProfileRequest. - * @implements IGetConnectionProfileRequest + * @classdesc Represents a SshScript. + * @implements ISshScript * @constructor - * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.ISshScript=} [properties] Properties to set */ - function GetConnectionProfileRequest(properties) { + function SshScript(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5053,75 +4893,75 @@ } /** - * GetConnectionProfileRequest name. - * @member {string} name - * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * SshScript script. + * @member {string} script + * @memberof google.cloud.clouddms.v1.SshScript * @instance */ - GetConnectionProfileRequest.prototype.name = ""; + SshScript.prototype.script = ""; /** - * Creates a new GetConnectionProfileRequest instance using the specified properties. + * Creates a new SshScript instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.SshScript * @static - * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.GetConnectionProfileRequest} GetConnectionProfileRequest instance + * @param {google.cloud.clouddms.v1.ISshScript=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SshScript} SshScript instance */ - GetConnectionProfileRequest.create = function create(properties) { - return new GetConnectionProfileRequest(properties); + SshScript.create = function create(properties) { + return new SshScript(properties); }; /** - * Encodes the specified GetConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GetConnectionProfileRequest.verify|verify} messages. + * Encodes the specified SshScript message. Does not implicitly {@link google.cloud.clouddms.v1.SshScript.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.SshScript * @static - * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest} message GetConnectionProfileRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.ISshScript} message SshScript message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetConnectionProfileRequest.encode = function encode(message, writer) { + SshScript.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.script != null && Object.hasOwnProperty.call(message, "script")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.script); return writer; }; /** - * Encodes the specified GetConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GetConnectionProfileRequest.verify|verify} messages. + * Encodes the specified SshScript message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SshScript.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.SshScript * @static - * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest} message GetConnectionProfileRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.ISshScript} message SshScript message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetConnectionProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + SshScript.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetConnectionProfileRequest message from the specified reader or buffer. + * Decodes a SshScript message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.SshScript * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.GetConnectionProfileRequest} GetConnectionProfileRequest + * @returns {google.cloud.clouddms.v1.SshScript} SshScript * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetConnectionProfileRequest.decode = function decode(reader, length) { + SshScript.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.clouddms.v1.GetConnectionProfileRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.SshScript(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.script = reader.string(); break; } default: @@ -5133,125 +4973,126 @@ }; /** - * Decodes a GetConnectionProfileRequest message from the specified reader or buffer, length delimited. + * Decodes a SshScript message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.SshScript * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.GetConnectionProfileRequest} GetConnectionProfileRequest + * @returns {google.cloud.clouddms.v1.SshScript} SshScript * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetConnectionProfileRequest.decodeDelimited = function decodeDelimited(reader) { + SshScript.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetConnectionProfileRequest message. + * Verifies a SshScript message. * @function verify - * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.SshScript * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetConnectionProfileRequest.verify = function verify(message) { + SshScript.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.script != null && message.hasOwnProperty("script")) + if (!$util.isString(message.script)) + return "script: string expected"; return null; }; /** - * Creates a GetConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SshScript message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.SshScript * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.GetConnectionProfileRequest} GetConnectionProfileRequest + * @returns {google.cloud.clouddms.v1.SshScript} SshScript */ - GetConnectionProfileRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.GetConnectionProfileRequest) + SshScript.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SshScript) return object; - var message = new $root.google.cloud.clouddms.v1.GetConnectionProfileRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.clouddms.v1.SshScript(); + if (object.script != null) + message.script = String(object.script); return message; }; /** - * Creates a plain object from a GetConnectionProfileRequest message. Also converts values to other types if specified. + * Creates a plain object from a SshScript message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.SshScript * @static - * @param {google.cloud.clouddms.v1.GetConnectionProfileRequest} message GetConnectionProfileRequest + * @param {google.cloud.clouddms.v1.SshScript} message SshScript * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetConnectionProfileRequest.toObject = function toObject(message, options) { + SshScript.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.script = ""; + if (message.script != null && message.hasOwnProperty("script")) + object.script = message.script; return object; }; /** - * Converts this GetConnectionProfileRequest to JSON. + * Converts this SshScript to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.SshScript * @instance * @returns {Object.} JSON object */ - GetConnectionProfileRequest.prototype.toJSON = function toJSON() { + SshScript.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetConnectionProfileRequest + * Gets the default type url for SshScript * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.SshScript * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetConnectionProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SshScript.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.GetConnectionProfileRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.SshScript"; }; - return GetConnectionProfileRequest; + return SshScript; })(); - v1.CreateConnectionProfileRequest = (function() { + v1.ListConnectionProfilesRequest = (function() { /** - * Properties of a CreateConnectionProfileRequest. + * Properties of a ListConnectionProfilesRequest. * @memberof google.cloud.clouddms.v1 - * @interface ICreateConnectionProfileRequest - * @property {string|null} [parent] CreateConnectionProfileRequest parent - * @property {string|null} [connectionProfileId] CreateConnectionProfileRequest connectionProfileId - * @property {google.cloud.clouddms.v1.IConnectionProfile|null} [connectionProfile] CreateConnectionProfileRequest connectionProfile - * @property {string|null} [requestId] CreateConnectionProfileRequest requestId + * @interface IListConnectionProfilesRequest + * @property {string|null} [parent] ListConnectionProfilesRequest parent + * @property {number|null} [pageSize] ListConnectionProfilesRequest pageSize + * @property {string|null} [pageToken] ListConnectionProfilesRequest pageToken + * @property {string|null} [filter] ListConnectionProfilesRequest filter + * @property {string|null} [orderBy] ListConnectionProfilesRequest orderBy */ /** - * Constructs a new CreateConnectionProfileRequest. + * Constructs a new ListConnectionProfilesRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a CreateConnectionProfileRequest. - * @implements ICreateConnectionProfileRequest + * @classdesc Represents a ListConnectionProfilesRequest. + * @implements IListConnectionProfilesRequest * @constructor - * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest=} [properties] Properties to set */ - function CreateConnectionProfileRequest(properties) { + function ListConnectionProfilesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5259,100 +5100,110 @@ } /** - * CreateConnectionProfileRequest parent. + * ListConnectionProfilesRequest parent. * @member {string} parent - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @instance */ - CreateConnectionProfileRequest.prototype.parent = ""; + ListConnectionProfilesRequest.prototype.parent = ""; /** - * CreateConnectionProfileRequest connectionProfileId. - * @member {string} connectionProfileId - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * ListConnectionProfilesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @instance */ - CreateConnectionProfileRequest.prototype.connectionProfileId = ""; + ListConnectionProfilesRequest.prototype.pageSize = 0; /** - * CreateConnectionProfileRequest connectionProfile. - * @member {google.cloud.clouddms.v1.IConnectionProfile|null|undefined} connectionProfile - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * ListConnectionProfilesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @instance */ - CreateConnectionProfileRequest.prototype.connectionProfile = null; + ListConnectionProfilesRequest.prototype.pageToken = ""; /** - * CreateConnectionProfileRequest requestId. - * @member {string} requestId - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * ListConnectionProfilesRequest filter. + * @member {string} filter + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @instance */ - CreateConnectionProfileRequest.prototype.requestId = ""; + ListConnectionProfilesRequest.prototype.filter = ""; /** - * Creates a new CreateConnectionProfileRequest instance using the specified properties. + * ListConnectionProfilesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @instance + */ + ListConnectionProfilesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListConnectionProfilesRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @static - * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.CreateConnectionProfileRequest} CreateConnectionProfileRequest instance + * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesRequest} ListConnectionProfilesRequest instance */ - CreateConnectionProfileRequest.create = function create(properties) { - return new CreateConnectionProfileRequest(properties); + ListConnectionProfilesRequest.create = function create(properties) { + return new ListConnectionProfilesRequest(properties); }; /** - * Encodes the specified CreateConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CreateConnectionProfileRequest.verify|verify} messages. + * Encodes the specified ListConnectionProfilesRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @static - * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest} message CreateConnectionProfileRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest} message ListConnectionProfilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateConnectionProfileRequest.encode = function encode(message, writer) { + ListConnectionProfilesRequest.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.connectionProfileId != null && Object.hasOwnProperty.call(message, "connectionProfileId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.connectionProfileId); - if (message.connectionProfile != null && Object.hasOwnProperty.call(message, "connectionProfile")) - $root.google.cloud.clouddms.v1.ConnectionProfile.encode(message.connectionProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified CreateConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CreateConnectionProfileRequest.verify|verify} messages. + * Encodes the specified ListConnectionProfilesRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @static - * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest} message CreateConnectionProfileRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest} message ListConnectionProfilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateConnectionProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListConnectionProfilesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateConnectionProfileRequest message from the specified reader or buffer. + * Decodes a ListConnectionProfilesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.CreateConnectionProfileRequest} CreateConnectionProfileRequest + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesRequest} ListConnectionProfilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateConnectionProfileRequest.decode = function decode(reader, length) { + ListConnectionProfilesRequest.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.clouddms.v1.CreateConnectionProfileRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ListConnectionProfilesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -5361,15 +5212,19 @@ break; } case 2: { - message.connectionProfileId = reader.string(); + message.pageSize = reader.int32(); break; } case 3: { - message.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; } case 4: { - message.requestId = reader.string(); + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -5381,154 +5236,159 @@ }; /** - * Decodes a CreateConnectionProfileRequest message from the specified reader or buffer, length delimited. + * Decodes a ListConnectionProfilesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.CreateConnectionProfileRequest} CreateConnectionProfileRequest + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesRequest} ListConnectionProfilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateConnectionProfileRequest.decodeDelimited = function decodeDelimited(reader) { + ListConnectionProfilesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateConnectionProfileRequest message. + * Verifies a ListConnectionProfilesRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateConnectionProfileRequest.verify = function verify(message) { + ListConnectionProfilesRequest.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.connectionProfileId != null && message.hasOwnProperty("connectionProfileId")) - if (!$util.isString(message.connectionProfileId)) - return "connectionProfileId: string expected"; - if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) { - var error = $root.google.cloud.clouddms.v1.ConnectionProfile.verify(message.connectionProfile); - if (error) - return "connectionProfile." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a CreateConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListConnectionProfilesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.CreateConnectionProfileRequest} CreateConnectionProfileRequest + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesRequest} ListConnectionProfilesRequest */ - CreateConnectionProfileRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.CreateConnectionProfileRequest) + ListConnectionProfilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ListConnectionProfilesRequest) return object; - var message = new $root.google.cloud.clouddms.v1.CreateConnectionProfileRequest(); + var message = new $root.google.cloud.clouddms.v1.ListConnectionProfilesRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.connectionProfileId != null) - message.connectionProfileId = String(object.connectionProfileId); - if (object.connectionProfile != null) { - if (typeof object.connectionProfile !== "object") - throw TypeError(".google.cloud.clouddms.v1.CreateConnectionProfileRequest.connectionProfile: object expected"); - message.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.fromObject(object.connectionProfile); - } - if (object.requestId != null) - message.requestId = String(object.requestId); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a CreateConnectionProfileRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListConnectionProfilesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @static - * @param {google.cloud.clouddms.v1.CreateConnectionProfileRequest} message CreateConnectionProfileRequest + * @param {google.cloud.clouddms.v1.ListConnectionProfilesRequest} message ListConnectionProfilesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateConnectionProfileRequest.toObject = function toObject(message, options) { + ListConnectionProfilesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.connectionProfileId = ""; - object.connectionProfile = null; - object.requestId = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.connectionProfileId != null && message.hasOwnProperty("connectionProfileId")) - object.connectionProfileId = message.connectionProfileId; - if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) - object.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.toObject(message.connectionProfile, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this CreateConnectionProfileRequest to JSON. + * Converts this ListConnectionProfilesRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @instance * @returns {Object.} JSON object */ - CreateConnectionProfileRequest.prototype.toJSON = function toJSON() { + ListConnectionProfilesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateConnectionProfileRequest + * Gets the default type url for ListConnectionProfilesRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateConnectionProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListConnectionProfilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.CreateConnectionProfileRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.ListConnectionProfilesRequest"; }; - return CreateConnectionProfileRequest; + return ListConnectionProfilesRequest; })(); - v1.UpdateConnectionProfileRequest = (function() { + v1.ListConnectionProfilesResponse = (function() { /** - * Properties of an UpdateConnectionProfileRequest. + * Properties of a ListConnectionProfilesResponse. * @memberof google.cloud.clouddms.v1 - * @interface IUpdateConnectionProfileRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateConnectionProfileRequest updateMask - * @property {google.cloud.clouddms.v1.IConnectionProfile|null} [connectionProfile] UpdateConnectionProfileRequest connectionProfile - * @property {string|null} [requestId] UpdateConnectionProfileRequest requestId + * @interface IListConnectionProfilesResponse + * @property {Array.|null} [connectionProfiles] ListConnectionProfilesResponse connectionProfiles + * @property {string|null} [nextPageToken] ListConnectionProfilesResponse nextPageToken + * @property {Array.|null} [unreachable] ListConnectionProfilesResponse unreachable */ /** - * Constructs a new UpdateConnectionProfileRequest. + * Constructs a new ListConnectionProfilesResponse. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents an UpdateConnectionProfileRequest. - * @implements IUpdateConnectionProfileRequest + * @classdesc Represents a ListConnectionProfilesResponse. + * @implements IListConnectionProfilesResponse * @constructor - * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IListConnectionProfilesResponse=} [properties] Properties to set */ - function UpdateConnectionProfileRequest(properties) { + function ListConnectionProfilesResponse(properties) { + this.connectionProfiles = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5536,103 +5396,109 @@ } /** - * UpdateConnectionProfileRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * ListConnectionProfilesResponse connectionProfiles. + * @member {Array.} connectionProfiles + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @instance */ - UpdateConnectionProfileRequest.prototype.updateMask = null; + ListConnectionProfilesResponse.prototype.connectionProfiles = $util.emptyArray; /** - * UpdateConnectionProfileRequest connectionProfile. - * @member {google.cloud.clouddms.v1.IConnectionProfile|null|undefined} connectionProfile - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * ListConnectionProfilesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @instance */ - UpdateConnectionProfileRequest.prototype.connectionProfile = null; + ListConnectionProfilesResponse.prototype.nextPageToken = ""; /** - * UpdateConnectionProfileRequest requestId. - * @member {string} requestId - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * ListConnectionProfilesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @instance */ - UpdateConnectionProfileRequest.prototype.requestId = ""; + ListConnectionProfilesResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new UpdateConnectionProfileRequest instance using the specified properties. + * Creates a new ListConnectionProfilesResponse instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @static - * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} UpdateConnectionProfileRequest instance + * @param {google.cloud.clouddms.v1.IListConnectionProfilesResponse=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesResponse} ListConnectionProfilesResponse instance */ - UpdateConnectionProfileRequest.create = function create(properties) { - return new UpdateConnectionProfileRequest(properties); + ListConnectionProfilesResponse.create = function create(properties) { + return new ListConnectionProfilesResponse(properties); }; /** - * Encodes the specified UpdateConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.UpdateConnectionProfileRequest.verify|verify} messages. + * Encodes the specified ListConnectionProfilesResponse message. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @static - * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest} message UpdateConnectionProfileRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IListConnectionProfilesResponse} message ListConnectionProfilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateConnectionProfileRequest.encode = function encode(message, writer) { + ListConnectionProfilesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.connectionProfile != null && Object.hasOwnProperty.call(message, "connectionProfile")) - $root.google.cloud.clouddms.v1.ConnectionProfile.encode(message.connectionProfile, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.connectionProfiles != null && message.connectionProfiles.length) + for (var i = 0; i < message.connectionProfiles.length; ++i) + $root.google.cloud.clouddms.v1.ConnectionProfile.encode(message.connectionProfiles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified UpdateConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.UpdateConnectionProfileRequest.verify|verify} messages. + * Encodes the specified ListConnectionProfilesResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @static - * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest} message UpdateConnectionProfileRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IListConnectionProfilesResponse} message ListConnectionProfilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateConnectionProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListConnectionProfilesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateConnectionProfileRequest message from the specified reader or buffer. + * Decodes a ListConnectionProfilesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} UpdateConnectionProfileRequest + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesResponse} ListConnectionProfilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateConnectionProfileRequest.decode = function decode(reader, length) { + ListConnectionProfilesResponse.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.clouddms.v1.UpdateConnectionProfileRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ListConnectionProfilesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + if (!(message.connectionProfiles && message.connectionProfiles.length)) + message.connectionProfiles = []; + message.connectionProfiles.push($root.google.cloud.clouddms.v1.ConnectionProfile.decode(reader, reader.uint32())); break; } case 2: { - message.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } case 3: { - message.requestId = reader.string(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -5644,151 +5510,169 @@ }; /** - * Decodes an UpdateConnectionProfileRequest message from the specified reader or buffer, length delimited. + * Decodes a ListConnectionProfilesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} UpdateConnectionProfileRequest + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesResponse} ListConnectionProfilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateConnectionProfileRequest.decodeDelimited = function decodeDelimited(reader) { + ListConnectionProfilesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateConnectionProfileRequest message. + * Verifies a ListConnectionProfilesResponse message. * @function verify - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateConnectionProfileRequest.verify = function verify(message) { + ListConnectionProfilesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.connectionProfiles != null && message.hasOwnProperty("connectionProfiles")) { + if (!Array.isArray(message.connectionProfiles)) + return "connectionProfiles: array expected"; + for (var i = 0; i < message.connectionProfiles.length; ++i) { + var error = $root.google.cloud.clouddms.v1.ConnectionProfile.verify(message.connectionProfiles[i]); + if (error) + return "connectionProfiles." + error; + } } - if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) { - var error = $root.google.cloud.clouddms.v1.ConnectionProfile.verify(message.connectionProfile); - if (error) - return "connectionProfile." + error; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; return null; }; /** - * Creates an UpdateConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListConnectionProfilesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} UpdateConnectionProfileRequest + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesResponse} ListConnectionProfilesResponse */ - UpdateConnectionProfileRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.UpdateConnectionProfileRequest) + ListConnectionProfilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ListConnectionProfilesResponse) return object; - var message = new $root.google.cloud.clouddms.v1.UpdateConnectionProfileRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.clouddms.v1.UpdateConnectionProfileRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.clouddms.v1.ListConnectionProfilesResponse(); + if (object.connectionProfiles) { + if (!Array.isArray(object.connectionProfiles)) + throw TypeError(".google.cloud.clouddms.v1.ListConnectionProfilesResponse.connectionProfiles: array expected"); + message.connectionProfiles = []; + for (var i = 0; i < object.connectionProfiles.length; ++i) { + if (typeof object.connectionProfiles[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.ListConnectionProfilesResponse.connectionProfiles: object expected"); + message.connectionProfiles[i] = $root.google.cloud.clouddms.v1.ConnectionProfile.fromObject(object.connectionProfiles[i]); + } } - if (object.connectionProfile != null) { - if (typeof object.connectionProfile !== "object") - throw TypeError(".google.cloud.clouddms.v1.UpdateConnectionProfileRequest.connectionProfile: object expected"); - message.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.fromObject(object.connectionProfile); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.clouddms.v1.ListConnectionProfilesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); } - if (object.requestId != null) - message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from an UpdateConnectionProfileRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListConnectionProfilesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @static - * @param {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} message UpdateConnectionProfileRequest + * @param {google.cloud.clouddms.v1.ListConnectionProfilesResponse} message ListConnectionProfilesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateConnectionProfileRequest.toObject = function toObject(message, options) { + ListConnectionProfilesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.updateMask = null; - object.connectionProfile = null; - object.requestId = ""; + if (options.arrays || options.defaults) { + object.connectionProfiles = []; + object.unreachable = []; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) - object.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.toObject(message.connectionProfile, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; + if (options.defaults) + object.nextPageToken = ""; + if (message.connectionProfiles && message.connectionProfiles.length) { + object.connectionProfiles = []; + for (var j = 0; j < message.connectionProfiles.length; ++j) + object.connectionProfiles[j] = $root.google.cloud.clouddms.v1.ConnectionProfile.toObject(message.connectionProfiles[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; /** - * Converts this UpdateConnectionProfileRequest to JSON. + * Converts this ListConnectionProfilesResponse to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @instance * @returns {Object.} JSON object */ - UpdateConnectionProfileRequest.prototype.toJSON = function toJSON() { + ListConnectionProfilesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateConnectionProfileRequest + * Gets the default type url for ListConnectionProfilesResponse * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateConnectionProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListConnectionProfilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.UpdateConnectionProfileRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.ListConnectionProfilesResponse"; }; - return UpdateConnectionProfileRequest; + return ListConnectionProfilesResponse; })(); - v1.DeleteConnectionProfileRequest = (function() { + v1.GetConnectionProfileRequest = (function() { /** - * Properties of a DeleteConnectionProfileRequest. + * Properties of a GetConnectionProfileRequest. * @memberof google.cloud.clouddms.v1 - * @interface IDeleteConnectionProfileRequest - * @property {string|null} [name] DeleteConnectionProfileRequest name - * @property {string|null} [requestId] DeleteConnectionProfileRequest requestId - * @property {boolean|null} [force] DeleteConnectionProfileRequest force + * @interface IGetConnectionProfileRequest + * @property {string|null} [name] GetConnectionProfileRequest name */ /** - * Constructs a new DeleteConnectionProfileRequest. + * Constructs a new GetConnectionProfileRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a DeleteConnectionProfileRequest. - * @implements IDeleteConnectionProfileRequest + * @classdesc Represents a GetConnectionProfileRequest. + * @implements IGetConnectionProfileRequest * @constructor - * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest=} [properties] Properties to set */ - function DeleteConnectionProfileRequest(properties) { + function GetConnectionProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5796,90 +5680,70 @@ } /** - * DeleteConnectionProfileRequest name. + * GetConnectionProfileRequest name. * @member {string} name - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest - * @instance - */ - DeleteConnectionProfileRequest.prototype.name = ""; - - /** - * DeleteConnectionProfileRequest requestId. - * @member {string} requestId - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest - * @instance - */ - DeleteConnectionProfileRequest.prototype.requestId = ""; - - /** - * DeleteConnectionProfileRequest force. - * @member {boolean} force - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest * @instance */ - DeleteConnectionProfileRequest.prototype.force = false; + GetConnectionProfileRequest.prototype.name = ""; /** - * Creates a new DeleteConnectionProfileRequest instance using the specified properties. + * Creates a new GetConnectionProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} DeleteConnectionProfileRequest instance + * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.GetConnectionProfileRequest} GetConnectionProfileRequest instance */ - DeleteConnectionProfileRequest.create = function create(properties) { - return new DeleteConnectionProfileRequest(properties); + GetConnectionProfileRequest.create = function create(properties) { + return new GetConnectionProfileRequest(properties); }; /** - * Encodes the specified DeleteConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DeleteConnectionProfileRequest.verify|verify} messages. + * Encodes the specified GetConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GetConnectionProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest} message DeleteConnectionProfileRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest} message GetConnectionProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteConnectionProfileRequest.encode = function encode(message, writer) { + GetConnectionProfileRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; /** - * Encodes the specified DeleteConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DeleteConnectionProfileRequest.verify|verify} messages. + * Encodes the specified GetConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GetConnectionProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest} message DeleteConnectionProfileRequest message or plain object to encode + * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest} message GetConnectionProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteConnectionProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetConnectionProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteConnectionProfileRequest message from the specified reader or buffer. + * Decodes a GetConnectionProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} DeleteConnectionProfileRequest + * @returns {google.cloud.clouddms.v1.GetConnectionProfileRequest} GetConnectionProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteConnectionProfileRequest.decode = function decode(reader, length) { + GetConnectionProfileRequest.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.clouddms.v1.DeleteConnectionProfileRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.GetConnectionProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -5887,14 +5751,6 @@ message.name = reader.string(); break; } - case 2: { - message.requestId = reader.string(); - break; - } - case 3: { - message.force = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -5904,145 +5760,127 @@ }; /** - * Decodes a DeleteConnectionProfileRequest message from the specified reader or buffer, length delimited. + * Decodes a GetConnectionProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} DeleteConnectionProfileRequest + * @returns {google.cloud.clouddms.v1.GetConnectionProfileRequest} GetConnectionProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteConnectionProfileRequest.decodeDelimited = function decodeDelimited(reader) { + GetConnectionProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteConnectionProfileRequest message. + * Verifies a GetConnectionProfileRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteConnectionProfileRequest.verify = function verify(message) { + GetConnectionProfileRequest.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; return null; }; /** - * Creates a DeleteConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} DeleteConnectionProfileRequest + * @returns {google.cloud.clouddms.v1.GetConnectionProfileRequest} GetConnectionProfileRequest */ - DeleteConnectionProfileRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.DeleteConnectionProfileRequest) + GetConnectionProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.GetConnectionProfileRequest) return object; - var message = new $root.google.cloud.clouddms.v1.DeleteConnectionProfileRequest(); + var message = new $root.google.cloud.clouddms.v1.GetConnectionProfileRequest(); if (object.name != null) message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.force != null) - message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a DeleteConnectionProfileRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetConnectionProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} message DeleteConnectionProfileRequest + * @param {google.cloud.clouddms.v1.GetConnectionProfileRequest} message GetConnectionProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteConnectionProfileRequest.toObject = function toObject(message, options) { + GetConnectionProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.requestId = ""; - object.force = false; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; return object; }; /** - * Converts this DeleteConnectionProfileRequest to JSON. + * Converts this GetConnectionProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest * @instance * @returns {Object.} JSON object */ - DeleteConnectionProfileRequest.prototype.toJSON = function toJSON() { + GetConnectionProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteConnectionProfileRequest + * Gets the default type url for GetConnectionProfileRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteConnectionProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetConnectionProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.DeleteConnectionProfileRequest"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.GetConnectionProfileRequest"; }; - return DeleteConnectionProfileRequest; + return GetConnectionProfileRequest; })(); - v1.OperationMetadata = (function() { + v1.CreateConnectionProfileRequest = (function() { /** - * Properties of an OperationMetadata. + * Properties of a CreateConnectionProfileRequest. * @memberof google.cloud.clouddms.v1 - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion + * @interface ICreateConnectionProfileRequest + * @property {string|null} [parent] CreateConnectionProfileRequest parent + * @property {string|null} [connectionProfileId] CreateConnectionProfileRequest connectionProfileId + * @property {google.cloud.clouddms.v1.IConnectionProfile|null} [connectionProfile] CreateConnectionProfileRequest connectionProfile + * @property {string|null} [requestId] CreateConnectionProfileRequest requestId + * @property {boolean|null} [validateOnly] CreateConnectionProfileRequest validateOnly + * @property {boolean|null} [skipValidation] CreateConnectionProfileRequest skipValidation */ /** - * Constructs a new OperationMetadata. + * Constructs a new CreateConnectionProfileRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata + * @classdesc Represents a CreateConnectionProfileRequest. + * @implements ICreateConnectionProfileRequest * @constructor - * @param {google.cloud.clouddms.v1.IOperationMetadata=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest=} [properties] Properties to set */ - function OperationMetadata(properties) { + function CreateConnectionProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6050,159 +5888,145 @@ } /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.clouddms.v1.OperationMetadata + * CreateConnectionProfileRequest parent. + * @member {string} parent + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @instance */ - OperationMetadata.prototype.createTime = null; + CreateConnectionProfileRequest.prototype.parent = ""; /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.clouddms.v1.OperationMetadata + * CreateConnectionProfileRequest connectionProfileId. + * @member {string} connectionProfileId + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @instance */ - OperationMetadata.prototype.endTime = null; + CreateConnectionProfileRequest.prototype.connectionProfileId = ""; /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.clouddms.v1.OperationMetadata + * CreateConnectionProfileRequest connectionProfile. + * @member {google.cloud.clouddms.v1.IConnectionProfile|null|undefined} connectionProfile + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @instance */ - OperationMetadata.prototype.target = ""; + CreateConnectionProfileRequest.prototype.connectionProfile = null; /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.clouddms.v1.OperationMetadata + * CreateConnectionProfileRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @instance */ - OperationMetadata.prototype.verb = ""; + CreateConnectionProfileRequest.prototype.requestId = ""; /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.clouddms.v1.OperationMetadata + * CreateConnectionProfileRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @instance */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.clouddms.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; + CreateConnectionProfileRequest.prototype.validateOnly = false; /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.clouddms.v1.OperationMetadata + * CreateConnectionProfileRequest skipValidation. + * @member {boolean} skipValidation + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @instance */ - OperationMetadata.prototype.apiVersion = ""; + CreateConnectionProfileRequest.prototype.skipValidation = false; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new CreateConnectionProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.OperationMetadata + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.OperationMetadata} OperationMetadata instance + * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.CreateConnectionProfileRequest} CreateConnectionProfileRequest instance */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); + CreateConnectionProfileRequest.create = function create(properties) { + return new CreateConnectionProfileRequest(properties); }; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.clouddms.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified CreateConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CreateConnectionProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.OperationMetadata + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest} message CreateConnectionProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encode = function encode(message, writer) { + CreateConnectionProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, 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.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.connectionProfileId != null && Object.hasOwnProperty.call(message, "connectionProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.connectionProfileId); + if (message.connectionProfile != null && Object.hasOwnProperty.call(message, "connectionProfile")) + $root.google.cloud.clouddms.v1.ConnectionProfile.encode(message.connectionProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + if (message.skipValidation != null && Object.hasOwnProperty.call(message, "skipValidation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.skipValidation); return writer; }; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified CreateConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CreateConnectionProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.OperationMetadata + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest} message CreateConnectionProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + CreateConnectionProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a CreateConnectionProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.OperationMetadata + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.clouddms.v1.CreateConnectionProfileRequest} CreateConnectionProfileRequest * @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) { + CreateConnectionProfileRequest.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.clouddms.v1.OperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.CreateConnectionProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.parent = reader.string(); break; } case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.connectionProfileId = reader.string(); break; } case 3: { - message.target = reader.string(); + message.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.decode(reader, reader.uint32()); break; } case 4: { - message.verb = reader.string(); + message.requestId = reader.string(); break; } case 5: { - message.statusMessage = reader.string(); + message.validateOnly = reader.bool(); break; } case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); + message.skipValidation = reader.bool(); break; } default: @@ -6214,184 +6038,172 @@ }; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a CreateConnectionProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.OperationMetadata + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.clouddms.v1.CreateConnectionProfileRequest} CreateConnectionProfileRequest * @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) { + CreateConnectionProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OperationMetadata message. + * Verifies a CreateConnectionProfileRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.OperationMetadata + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @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) { + CreateConnectionProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object 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 (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.connectionProfileId != null && message.hasOwnProperty("connectionProfileId")) + if (!$util.isString(message.connectionProfileId)) + return "connectionProfileId: string expected"; + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) { + var error = $root.google.cloud.clouddms.v1.ConnectionProfile.verify(message.connectionProfile); if (error) - return "endTime." + error; + return "connectionProfile." + error; } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.skipValidation != null && message.hasOwnProperty("skipValidation")) + if (typeof message.skipValidation !== "boolean") + return "skipValidation: boolean expected"; return null; }; /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a CreateConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.OperationMetadata + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.clouddms.v1.CreateConnectionProfileRequest} CreateConnectionProfileRequest */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.OperationMetadata) + CreateConnectionProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.CreateConnectionProfileRequest) return object; - var message = new $root.google.cloud.clouddms.v1.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.clouddms.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.clouddms.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + var message = new $root.google.cloud.clouddms.v1.CreateConnectionProfileRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.connectionProfileId != null) + message.connectionProfileId = String(object.connectionProfileId); + if (object.connectionProfile != null) { + if (typeof object.connectionProfile !== "object") + throw TypeError(".google.cloud.clouddms.v1.CreateConnectionProfileRequest.connectionProfile: object expected"); + message.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.fromObject(object.connectionProfile); } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.skipValidation != null) + message.skipValidation = Boolean(object.skipValidation); return message; }; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a CreateConnectionProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.OperationMetadata + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.OperationMetadata} message OperationMetadata + * @param {google.cloud.clouddms.v1.CreateConnectionProfileRequest} message CreateConnectionProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationMetadata.toObject = function toObject(message, options) { + CreateConnectionProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; + object.parent = ""; + object.connectionProfileId = ""; + object.connectionProfile = null; + object.requestId = ""; + object.validateOnly = false; + object.skipValidation = false; } - 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 (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.connectionProfileId != null && message.hasOwnProperty("connectionProfileId")) + object.connectionProfileId = message.connectionProfileId; + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) + object.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.toObject(message.connectionProfile, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.skipValidation != null && message.hasOwnProperty("skipValidation")) + object.skipValidation = message.skipValidation; return object; }; /** - * Converts this OperationMetadata to JSON. + * Converts this CreateConnectionProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.OperationMetadata + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @instance * @returns {Object.} JSON object */ - OperationMetadata.prototype.toJSON = function toJSON() { + CreateConnectionProfileRequest.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 CreateConnectionProfileRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.OperationMetadata + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateConnectionProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.OperationMetadata"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.CreateConnectionProfileRequest"; }; - return OperationMetadata; + return CreateConnectionProfileRequest; })(); - v1.SslConfig = (function() { + v1.UpdateConnectionProfileRequest = (function() { /** - * Properties of a SslConfig. + * Properties of an UpdateConnectionProfileRequest. * @memberof google.cloud.clouddms.v1 - * @interface ISslConfig - * @property {google.cloud.clouddms.v1.SslConfig.SslType|null} [type] SslConfig type - * @property {string|null} [clientKey] SslConfig clientKey - * @property {string|null} [clientCertificate] SslConfig clientCertificate - * @property {string|null} [caCertificate] SslConfig caCertificate + * @interface IUpdateConnectionProfileRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateConnectionProfileRequest updateMask + * @property {google.cloud.clouddms.v1.IConnectionProfile|null} [connectionProfile] UpdateConnectionProfileRequest connectionProfile + * @property {string|null} [requestId] UpdateConnectionProfileRequest requestId + * @property {boolean|null} [validateOnly] UpdateConnectionProfileRequest validateOnly + * @property {boolean|null} [skipValidation] UpdateConnectionProfileRequest skipValidation */ /** - * Constructs a new SslConfig. + * Constructs a new UpdateConnectionProfileRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a SslConfig. - * @implements ISslConfig + * @classdesc Represents an UpdateConnectionProfileRequest. + * @implements IUpdateConnectionProfileRequest * @constructor - * @param {google.cloud.clouddms.v1.ISslConfig=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest=} [properties] Properties to set */ - function SslConfig(properties) { + function UpdateConnectionProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6399,117 +6211,131 @@ } /** - * SslConfig type. - * @member {google.cloud.clouddms.v1.SslConfig.SslType} type - * @memberof google.cloud.clouddms.v1.SslConfig + * UpdateConnectionProfileRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @instance */ - SslConfig.prototype.type = 0; + UpdateConnectionProfileRequest.prototype.updateMask = null; /** - * SslConfig clientKey. - * @member {string} clientKey - * @memberof google.cloud.clouddms.v1.SslConfig + * UpdateConnectionProfileRequest connectionProfile. + * @member {google.cloud.clouddms.v1.IConnectionProfile|null|undefined} connectionProfile + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @instance */ - SslConfig.prototype.clientKey = ""; + UpdateConnectionProfileRequest.prototype.connectionProfile = null; /** - * SslConfig clientCertificate. - * @member {string} clientCertificate - * @memberof google.cloud.clouddms.v1.SslConfig + * UpdateConnectionProfileRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @instance */ - SslConfig.prototype.clientCertificate = ""; + UpdateConnectionProfileRequest.prototype.requestId = ""; /** - * SslConfig caCertificate. - * @member {string} caCertificate - * @memberof google.cloud.clouddms.v1.SslConfig + * UpdateConnectionProfileRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @instance */ - SslConfig.prototype.caCertificate = ""; + UpdateConnectionProfileRequest.prototype.validateOnly = false; /** - * Creates a new SslConfig instance using the specified properties. + * UpdateConnectionProfileRequest skipValidation. + * @member {boolean} skipValidation + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @instance + */ + UpdateConnectionProfileRequest.prototype.skipValidation = false; + + /** + * Creates a new UpdateConnectionProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.SslConfig + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.ISslConfig=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.SslConfig} SslConfig instance + * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} UpdateConnectionProfileRequest instance */ - SslConfig.create = function create(properties) { - return new SslConfig(properties); + UpdateConnectionProfileRequest.create = function create(properties) { + return new UpdateConnectionProfileRequest(properties); }; /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.clouddms.v1.SslConfig.verify|verify} messages. + * Encodes the specified UpdateConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.UpdateConnectionProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.SslConfig + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.ISslConfig} message SslConfig message or plain object to encode + * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest} message UpdateConnectionProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslConfig.encode = function encode(message, writer) { + UpdateConnectionProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientKey); - if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientCertificate); - if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.caCertificate); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.connectionProfile != null && Object.hasOwnProperty.call(message, "connectionProfile")) + $root.google.cloud.clouddms.v1.ConnectionProfile.encode(message.connectionProfile, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.skipValidation != null && Object.hasOwnProperty.call(message, "skipValidation")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipValidation); return writer; }; /** - * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SslConfig.verify|verify} messages. + * Encodes the specified UpdateConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.UpdateConnectionProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.SslConfig + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.ISslConfig} message SslConfig message or plain object to encode + * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest} message UpdateConnectionProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + UpdateConnectionProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SslConfig message from the specified reader or buffer. + * Decodes an UpdateConnectionProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.SslConfig + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.SslConfig} SslConfig + * @returns {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} UpdateConnectionProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SslConfig.decode = function decode(reader, length) { + UpdateConnectionProfileRequest.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.clouddms.v1.SslConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.UpdateConnectionProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.type = reader.int32(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.clientKey = reader.string(); + message.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.decode(reader, reader.uint32()); break; } case 3: { - message.clientCertificate = reader.string(); + message.requestId = reader.string(); break; } case 4: { - message.caCertificate = reader.string(); + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.skipValidation = reader.bool(); break; } default: @@ -6521,193 +6347,167 @@ }; /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * Decodes an UpdateConnectionProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.SslConfig + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.SslConfig} SslConfig + * @returns {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} UpdateConnectionProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SslConfig.decodeDelimited = function decodeDelimited(reader) { + UpdateConnectionProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SslConfig message. + * Verifies an UpdateConnectionProfileRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.SslConfig + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SslConfig.verify = function verify(message) { + UpdateConnectionProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.clientKey != null && message.hasOwnProperty("clientKey")) - if (!$util.isString(message.clientKey)) - return "clientKey: string expected"; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) - if (!$util.isString(message.clientCertificate)) - return "clientCertificate: string expected"; - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) - if (!$util.isString(message.caCertificate)) - return "caCertificate: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) { + var error = $root.google.cloud.clouddms.v1.ConnectionProfile.verify(message.connectionProfile); + if (error) + return "connectionProfile." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.skipValidation != null && message.hasOwnProperty("skipValidation")) + if (typeof message.skipValidation !== "boolean") + return "skipValidation: boolean expected"; return null; }; /** - * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.SslConfig + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.SslConfig} SslConfig + * @returns {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} UpdateConnectionProfileRequest */ - SslConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.SslConfig) + UpdateConnectionProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.UpdateConnectionProfileRequest) return object; - var message = new $root.google.cloud.clouddms.v1.SslConfig(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "SSL_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "SERVER_ONLY": - case 1: - message.type = 1; - break; - case "SERVER_CLIENT": - case 2: - message.type = 2; - break; + var message = new $root.google.cloud.clouddms.v1.UpdateConnectionProfileRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.clouddms.v1.UpdateConnectionProfileRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.clientKey != null) - message.clientKey = String(object.clientKey); - if (object.clientCertificate != null) - message.clientCertificate = String(object.clientCertificate); - if (object.caCertificate != null) - message.caCertificate = String(object.caCertificate); + if (object.connectionProfile != null) { + if (typeof object.connectionProfile !== "object") + throw TypeError(".google.cloud.clouddms.v1.UpdateConnectionProfileRequest.connectionProfile: object expected"); + message.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.fromObject(object.connectionProfile); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.skipValidation != null) + message.skipValidation = Boolean(object.skipValidation); return message; }; /** - * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * Creates a plain object from an UpdateConnectionProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.SslConfig + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.SslConfig} message SslConfig + * @param {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} message UpdateConnectionProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslConfig.toObject = function toObject(message, options) { + UpdateConnectionProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.type = options.enums === String ? "SSL_TYPE_UNSPECIFIED" : 0; - object.clientKey = ""; - object.clientCertificate = ""; - object.caCertificate = ""; + object.updateMask = null; + object.connectionProfile = null; + object.requestId = ""; + object.validateOnly = false; + object.skipValidation = false; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.clouddms.v1.SslConfig.SslType[message.type] === undefined ? message.type : $root.google.cloud.clouddms.v1.SslConfig.SslType[message.type] : message.type; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) - object.clientKey = message.clientKey; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) - object.clientCertificate = message.clientCertificate; - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) - object.caCertificate = message.caCertificate; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) + object.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.toObject(message.connectionProfile, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.skipValidation != null && message.hasOwnProperty("skipValidation")) + object.skipValidation = message.skipValidation; return object; }; /** - * Converts this SslConfig to JSON. + * Converts this UpdateConnectionProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.SslConfig + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @instance * @returns {Object.} JSON object */ - SslConfig.prototype.toJSON = function toJSON() { + UpdateConnectionProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SslConfig + * Gets the default type url for UpdateConnectionProfileRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.SslConfig + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateConnectionProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.SslConfig"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.UpdateConnectionProfileRequest"; }; - /** - * SslType enum. - * @name google.cloud.clouddms.v1.SslConfig.SslType - * @enum {number} - * @property {number} SSL_TYPE_UNSPECIFIED=0 SSL_TYPE_UNSPECIFIED value - * @property {number} SERVER_ONLY=1 SERVER_ONLY value - * @property {number} SERVER_CLIENT=2 SERVER_CLIENT value - */ - SslConfig.SslType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SSL_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SERVER_ONLY"] = 1; - values[valuesById[2] = "SERVER_CLIENT"] = 2; - return values; - })(); - - return SslConfig; + return UpdateConnectionProfileRequest; })(); - v1.MySqlConnectionProfile = (function() { + v1.DeleteConnectionProfileRequest = (function() { /** - * Properties of a MySqlConnectionProfile. + * Properties of a DeleteConnectionProfileRequest. * @memberof google.cloud.clouddms.v1 - * @interface IMySqlConnectionProfile - * @property {string|null} [host] MySqlConnectionProfile host - * @property {number|null} [port] MySqlConnectionProfile port - * @property {string|null} [username] MySqlConnectionProfile username - * @property {string|null} [password] MySqlConnectionProfile password - * @property {boolean|null} [passwordSet] MySqlConnectionProfile passwordSet - * @property {google.cloud.clouddms.v1.ISslConfig|null} [ssl] MySqlConnectionProfile ssl - * @property {string|null} [cloudSqlId] MySqlConnectionProfile cloudSqlId + * @interface IDeleteConnectionProfileRequest + * @property {string|null} [name] DeleteConnectionProfileRequest name + * @property {string|null} [requestId] DeleteConnectionProfileRequest requestId + * @property {boolean|null} [force] DeleteConnectionProfileRequest force */ /** - * Constructs a new MySqlConnectionProfile. + * Constructs a new DeleteConnectionProfileRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a MySqlConnectionProfile. - * @implements IMySqlConnectionProfile + * @classdesc Represents a DeleteConnectionProfileRequest. + * @implements IDeleteConnectionProfileRequest * @constructor - * @param {google.cloud.clouddms.v1.IMySqlConnectionProfile=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest=} [properties] Properties to set */ - function MySqlConnectionProfile(properties) { + function DeleteConnectionProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6715,159 +6515,103 @@ } /** - * MySqlConnectionProfile host. - * @member {string} host - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile - * @instance - */ - MySqlConnectionProfile.prototype.host = ""; - - /** - * MySqlConnectionProfile port. - * @member {number} port - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile - * @instance - */ - MySqlConnectionProfile.prototype.port = 0; - - /** - * MySqlConnectionProfile username. - * @member {string} username - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile - * @instance - */ - MySqlConnectionProfile.prototype.username = ""; - - /** - * MySqlConnectionProfile password. - * @member {string} password - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile - * @instance - */ - MySqlConnectionProfile.prototype.password = ""; - - /** - * MySqlConnectionProfile passwordSet. - * @member {boolean} passwordSet - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * DeleteConnectionProfileRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @instance */ - MySqlConnectionProfile.prototype.passwordSet = false; + DeleteConnectionProfileRequest.prototype.name = ""; /** - * MySqlConnectionProfile ssl. - * @member {google.cloud.clouddms.v1.ISslConfig|null|undefined} ssl - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * DeleteConnectionProfileRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @instance */ - MySqlConnectionProfile.prototype.ssl = null; + DeleteConnectionProfileRequest.prototype.requestId = ""; /** - * MySqlConnectionProfile cloudSqlId. - * @member {string} cloudSqlId - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * DeleteConnectionProfileRequest force. + * @member {boolean} force + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @instance */ - MySqlConnectionProfile.prototype.cloudSqlId = ""; + DeleteConnectionProfileRequest.prototype.force = false; /** - * Creates a new MySqlConnectionProfile instance using the specified properties. + * Creates a new DeleteConnectionProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.IMySqlConnectionProfile=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.MySqlConnectionProfile} MySqlConnectionProfile instance + * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} DeleteConnectionProfileRequest instance */ - MySqlConnectionProfile.create = function create(properties) { - return new MySqlConnectionProfile(properties); + DeleteConnectionProfileRequest.create = function create(properties) { + return new DeleteConnectionProfileRequest(properties); }; /** - * Encodes the specified MySqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.MySqlConnectionProfile.verify|verify} messages. + * Encodes the specified DeleteConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DeleteConnectionProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.IMySqlConnectionProfile} message MySqlConnectionProfile message or plain object to encode + * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest} message DeleteConnectionProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MySqlConnectionProfile.encode = function encode(message, writer) { + DeleteConnectionProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.host != null && Object.hasOwnProperty.call(message, "host")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.host); - if (message.port != null && Object.hasOwnProperty.call(message, "port")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.port); - if (message.username != null && Object.hasOwnProperty.call(message, "username")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.username); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.password); - if (message.passwordSet != null && Object.hasOwnProperty.call(message, "passwordSet")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.passwordSet); - if (message.ssl != null && Object.hasOwnProperty.call(message, "ssl")) - $root.google.cloud.clouddms.v1.SslConfig.encode(message.ssl, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.cloudSqlId != null && Object.hasOwnProperty.call(message, "cloudSqlId")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.cloudSqlId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; /** - * Encodes the specified MySqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MySqlConnectionProfile.verify|verify} messages. + * Encodes the specified DeleteConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DeleteConnectionProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.IMySqlConnectionProfile} message MySqlConnectionProfile message or plain object to encode + * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest} message DeleteConnectionProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MySqlConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + DeleteConnectionProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MySqlConnectionProfile message from the specified reader or buffer. + * Decodes a DeleteConnectionProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.MySqlConnectionProfile} MySqlConnectionProfile + * @returns {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} DeleteConnectionProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MySqlConnectionProfile.decode = function decode(reader, length) { + DeleteConnectionProfileRequest.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.clouddms.v1.MySqlConnectionProfile(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.DeleteConnectionProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.host = reader.string(); + message.name = reader.string(); break; } case 2: { - message.port = reader.int32(); + message.requestId = reader.string(); break; } case 3: { - message.username = reader.string(); - break; - } - case 4: { - message.password = reader.string(); - break; - } - case 5: { - message.passwordSet = reader.bool(); - break; - } - case 6: { - message.ssl = $root.google.cloud.clouddms.v1.SslConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.cloudSqlId = reader.string(); + message.force = reader.bool(); break; } default: @@ -6879,182 +6623,143 @@ }; /** - * Decodes a MySqlConnectionProfile message from the specified reader or buffer, length delimited. + * Decodes a DeleteConnectionProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.MySqlConnectionProfile} MySqlConnectionProfile + * @returns {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} DeleteConnectionProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MySqlConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + DeleteConnectionProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MySqlConnectionProfile message. + * Verifies a DeleteConnectionProfileRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MySqlConnectionProfile.verify = function verify(message) { + DeleteConnectionProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.host != null && message.hasOwnProperty("host")) - if (!$util.isString(message.host)) - return "host: string expected"; - if (message.port != null && message.hasOwnProperty("port")) - if (!$util.isInteger(message.port)) - return "port: integer expected"; - if (message.username != null && message.hasOwnProperty("username")) - if (!$util.isString(message.username)) - return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; - if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) - if (typeof message.passwordSet !== "boolean") - return "passwordSet: boolean expected"; - if (message.ssl != null && message.hasOwnProperty("ssl")) { - var error = $root.google.cloud.clouddms.v1.SslConfig.verify(message.ssl); - if (error) - return "ssl." + error; - } - if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) - if (!$util.isString(message.cloudSqlId)) - return "cloudSqlId: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates a MySqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.MySqlConnectionProfile} MySqlConnectionProfile + * @returns {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} DeleteConnectionProfileRequest */ - MySqlConnectionProfile.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.MySqlConnectionProfile) + DeleteConnectionProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DeleteConnectionProfileRequest) return object; - var message = new $root.google.cloud.clouddms.v1.MySqlConnectionProfile(); - if (object.host != null) - message.host = String(object.host); - if (object.port != null) - message.port = object.port | 0; - if (object.username != null) - message.username = String(object.username); - if (object.password != null) - message.password = String(object.password); - if (object.passwordSet != null) - message.passwordSet = Boolean(object.passwordSet); - if (object.ssl != null) { - if (typeof object.ssl !== "object") - throw TypeError(".google.cloud.clouddms.v1.MySqlConnectionProfile.ssl: object expected"); - message.ssl = $root.google.cloud.clouddms.v1.SslConfig.fromObject(object.ssl); - } - if (object.cloudSqlId != null) - message.cloudSqlId = String(object.cloudSqlId); + var message = new $root.google.cloud.clouddms.v1.DeleteConnectionProfileRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a MySqlConnectionProfile message. Also converts values to other types if specified. + * Creates a plain object from a DeleteConnectionProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @static - * @param {google.cloud.clouddms.v1.MySqlConnectionProfile} message MySqlConnectionProfile + * @param {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} message DeleteConnectionProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MySqlConnectionProfile.toObject = function toObject(message, options) { + DeleteConnectionProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.host = ""; - object.port = 0; - object.username = ""; - object.password = ""; - object.passwordSet = false; - object.ssl = null; - object.cloudSqlId = ""; - } - if (message.host != null && message.hasOwnProperty("host")) - object.host = message.host; - if (message.port != null && message.hasOwnProperty("port")) - object.port = message.port; - if (message.username != null && message.hasOwnProperty("username")) - object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; - if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) - object.passwordSet = message.passwordSet; - if (message.ssl != null && message.hasOwnProperty("ssl")) - object.ssl = $root.google.cloud.clouddms.v1.SslConfig.toObject(message.ssl, options); - if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) - object.cloudSqlId = message.cloudSqlId; + object.name = ""; + object.requestId = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this MySqlConnectionProfile to JSON. + * Converts this DeleteConnectionProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @instance * @returns {Object.} JSON object */ - MySqlConnectionProfile.prototype.toJSON = function toJSON() { + DeleteConnectionProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MySqlConnectionProfile + * Gets the default type url for DeleteConnectionProfileRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MySqlConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteConnectionProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.MySqlConnectionProfile"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.DeleteConnectionProfileRequest"; }; - return MySqlConnectionProfile; + return DeleteConnectionProfileRequest; })(); - v1.PostgreSqlConnectionProfile = (function() { + v1.CreatePrivateConnectionRequest = (function() { /** - * Properties of a PostgreSqlConnectionProfile. + * Properties of a CreatePrivateConnectionRequest. * @memberof google.cloud.clouddms.v1 - * @interface IPostgreSqlConnectionProfile - * @property {string|null} [host] PostgreSqlConnectionProfile host - * @property {number|null} [port] PostgreSqlConnectionProfile port - * @property {string|null} [username] PostgreSqlConnectionProfile username - * @property {string|null} [password] PostgreSqlConnectionProfile password - * @property {boolean|null} [passwordSet] PostgreSqlConnectionProfile passwordSet - * @property {google.cloud.clouddms.v1.ISslConfig|null} [ssl] PostgreSqlConnectionProfile ssl - * @property {string|null} [cloudSqlId] PostgreSqlConnectionProfile cloudSqlId + * @interface ICreatePrivateConnectionRequest + * @property {string|null} [parent] CreatePrivateConnectionRequest parent + * @property {string|null} [privateConnectionId] CreatePrivateConnectionRequest privateConnectionId + * @property {google.cloud.clouddms.v1.IPrivateConnection|null} [privateConnection] CreatePrivateConnectionRequest privateConnection + * @property {string|null} [requestId] CreatePrivateConnectionRequest requestId + * @property {boolean|null} [skipValidation] CreatePrivateConnectionRequest skipValidation */ /** - * Constructs a new PostgreSqlConnectionProfile. + * Constructs a new CreatePrivateConnectionRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a PostgreSqlConnectionProfile. - * @implements IPostgreSqlConnectionProfile + * @classdesc Represents a CreatePrivateConnectionRequest. + * @implements ICreatePrivateConnectionRequest * @constructor - * @param {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.ICreatePrivateConnectionRequest=} [properties] Properties to set */ - function PostgreSqlConnectionProfile(properties) { + function CreatePrivateConnectionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7062,159 +6767,131 @@ } /** - * PostgreSqlConnectionProfile host. - * @member {string} host - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile - * @instance - */ - PostgreSqlConnectionProfile.prototype.host = ""; - - /** - * PostgreSqlConnectionProfile port. - * @member {number} port - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile - * @instance - */ - PostgreSqlConnectionProfile.prototype.port = 0; - - /** - * PostgreSqlConnectionProfile username. - * @member {string} username - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * CreatePrivateConnectionRequest parent. + * @member {string} parent + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @instance */ - PostgreSqlConnectionProfile.prototype.username = ""; + CreatePrivateConnectionRequest.prototype.parent = ""; /** - * PostgreSqlConnectionProfile password. - * @member {string} password - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * CreatePrivateConnectionRequest privateConnectionId. + * @member {string} privateConnectionId + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @instance */ - PostgreSqlConnectionProfile.prototype.password = ""; + CreatePrivateConnectionRequest.prototype.privateConnectionId = ""; /** - * PostgreSqlConnectionProfile passwordSet. - * @member {boolean} passwordSet - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * CreatePrivateConnectionRequest privateConnection. + * @member {google.cloud.clouddms.v1.IPrivateConnection|null|undefined} privateConnection + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @instance */ - PostgreSqlConnectionProfile.prototype.passwordSet = false; + CreatePrivateConnectionRequest.prototype.privateConnection = null; /** - * PostgreSqlConnectionProfile ssl. - * @member {google.cloud.clouddms.v1.ISslConfig|null|undefined} ssl - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * CreatePrivateConnectionRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @instance */ - PostgreSqlConnectionProfile.prototype.ssl = null; + CreatePrivateConnectionRequest.prototype.requestId = ""; /** - * PostgreSqlConnectionProfile cloudSqlId. - * @member {string} cloudSqlId - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * CreatePrivateConnectionRequest skipValidation. + * @member {boolean} skipValidation + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @instance */ - PostgreSqlConnectionProfile.prototype.cloudSqlId = ""; + CreatePrivateConnectionRequest.prototype.skipValidation = false; /** - * Creates a new PostgreSqlConnectionProfile instance using the specified properties. + * Creates a new CreatePrivateConnectionRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @static - * @param {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} PostgreSqlConnectionProfile instance + * @param {google.cloud.clouddms.v1.ICreatePrivateConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.CreatePrivateConnectionRequest} CreatePrivateConnectionRequest instance */ - PostgreSqlConnectionProfile.create = function create(properties) { - return new PostgreSqlConnectionProfile(properties); + CreatePrivateConnectionRequest.create = function create(properties) { + return new CreatePrivateConnectionRequest(properties); }; /** - * Encodes the specified PostgreSqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify|verify} messages. + * Encodes the specified CreatePrivateConnectionRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CreatePrivateConnectionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @static - * @param {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile} message PostgreSqlConnectionProfile message or plain object to encode + * @param {google.cloud.clouddms.v1.ICreatePrivateConnectionRequest} message CreatePrivateConnectionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PostgreSqlConnectionProfile.encode = function encode(message, writer) { + CreatePrivateConnectionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.host != null && Object.hasOwnProperty.call(message, "host")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.host); - if (message.port != null && Object.hasOwnProperty.call(message, "port")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.port); - if (message.username != null && Object.hasOwnProperty.call(message, "username")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.username); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.password); - if (message.passwordSet != null && Object.hasOwnProperty.call(message, "passwordSet")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.passwordSet); - if (message.ssl != null && Object.hasOwnProperty.call(message, "ssl")) - $root.google.cloud.clouddms.v1.SslConfig.encode(message.ssl, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.cloudSqlId != null && Object.hasOwnProperty.call(message, "cloudSqlId")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.cloudSqlId); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.privateConnectionId != null && Object.hasOwnProperty.call(message, "privateConnectionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateConnectionId); + if (message.privateConnection != null && Object.hasOwnProperty.call(message, "privateConnection")) + $root.google.cloud.clouddms.v1.PrivateConnection.encode(message.privateConnection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.skipValidation != null && Object.hasOwnProperty.call(message, "skipValidation")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipValidation); return writer; }; /** - * Encodes the specified PostgreSqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify|verify} messages. + * Encodes the specified CreatePrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CreatePrivateConnectionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @static - * @param {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile} message PostgreSqlConnectionProfile message or plain object to encode + * @param {google.cloud.clouddms.v1.ICreatePrivateConnectionRequest} message CreatePrivateConnectionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PostgreSqlConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + CreatePrivateConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PostgreSqlConnectionProfile message from the specified reader or buffer. + * Decodes a CreatePrivateConnectionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} PostgreSqlConnectionProfile + * @returns {google.cloud.clouddms.v1.CreatePrivateConnectionRequest} CreatePrivateConnectionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PostgreSqlConnectionProfile.decode = function decode(reader, length) { + CreatePrivateConnectionRequest.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.clouddms.v1.PostgreSqlConnectionProfile(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.CreatePrivateConnectionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.host = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.port = reader.int32(); + message.privateConnectionId = reader.string(); break; } case 3: { - message.username = reader.string(); + message.privateConnection = $root.google.cloud.clouddms.v1.PrivateConnection.decode(reader, reader.uint32()); break; } case 4: { - message.password = reader.string(); + message.requestId = reader.string(); break; } case 5: { - message.passwordSet = reader.bool(); - break; - } - case 6: { - message.ssl = $root.google.cloud.clouddms.v1.SslConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.cloudSqlId = reader.string(); + message.skipValidation = reader.bool(); break; } default: @@ -7226,179 +6903,164 @@ }; /** - * Decodes a PostgreSqlConnectionProfile message from the specified reader or buffer, length delimited. + * Decodes a CreatePrivateConnectionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} PostgreSqlConnectionProfile + * @returns {google.cloud.clouddms.v1.CreatePrivateConnectionRequest} CreatePrivateConnectionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PostgreSqlConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + CreatePrivateConnectionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PostgreSqlConnectionProfile message. + * Verifies a CreatePrivateConnectionRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PostgreSqlConnectionProfile.verify = function verify(message) { + CreatePrivateConnectionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.host != null && message.hasOwnProperty("host")) - if (!$util.isString(message.host)) - return "host: string expected"; - if (message.port != null && message.hasOwnProperty("port")) - if (!$util.isInteger(message.port)) - return "port: integer expected"; - if (message.username != null && message.hasOwnProperty("username")) - if (!$util.isString(message.username)) - return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; - if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) - if (typeof message.passwordSet !== "boolean") - return "passwordSet: boolean expected"; - if (message.ssl != null && message.hasOwnProperty("ssl")) { - var error = $root.google.cloud.clouddms.v1.SslConfig.verify(message.ssl); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.privateConnectionId != null && message.hasOwnProperty("privateConnectionId")) + if (!$util.isString(message.privateConnectionId)) + return "privateConnectionId: string expected"; + if (message.privateConnection != null && message.hasOwnProperty("privateConnection")) { + var error = $root.google.cloud.clouddms.v1.PrivateConnection.verify(message.privateConnection); if (error) - return "ssl." + error; + return "privateConnection." + error; } - if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) - if (!$util.isString(message.cloudSqlId)) - return "cloudSqlId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.skipValidation != null && message.hasOwnProperty("skipValidation")) + if (typeof message.skipValidation !== "boolean") + return "skipValidation: boolean expected"; return null; }; /** - * Creates a PostgreSqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * Creates a CreatePrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} PostgreSqlConnectionProfile + * @returns {google.cloud.clouddms.v1.CreatePrivateConnectionRequest} CreatePrivateConnectionRequest */ - PostgreSqlConnectionProfile.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile) + CreatePrivateConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.CreatePrivateConnectionRequest) return object; - var message = new $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile(); - if (object.host != null) - message.host = String(object.host); - if (object.port != null) - message.port = object.port | 0; - if (object.username != null) - message.username = String(object.username); - if (object.password != null) - message.password = String(object.password); - if (object.passwordSet != null) - message.passwordSet = Boolean(object.passwordSet); - if (object.ssl != null) { - if (typeof object.ssl !== "object") - throw TypeError(".google.cloud.clouddms.v1.PostgreSqlConnectionProfile.ssl: object expected"); - message.ssl = $root.google.cloud.clouddms.v1.SslConfig.fromObject(object.ssl); + var message = new $root.google.cloud.clouddms.v1.CreatePrivateConnectionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.privateConnectionId != null) + message.privateConnectionId = String(object.privateConnectionId); + if (object.privateConnection != null) { + if (typeof object.privateConnection !== "object") + throw TypeError(".google.cloud.clouddms.v1.CreatePrivateConnectionRequest.privateConnection: object expected"); + message.privateConnection = $root.google.cloud.clouddms.v1.PrivateConnection.fromObject(object.privateConnection); } - if (object.cloudSqlId != null) - message.cloudSqlId = String(object.cloudSqlId); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.skipValidation != null) + message.skipValidation = Boolean(object.skipValidation); return message; }; /** - * Creates a plain object from a PostgreSqlConnectionProfile message. Also converts values to other types if specified. + * Creates a plain object from a CreatePrivateConnectionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @static - * @param {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} message PostgreSqlConnectionProfile + * @param {google.cloud.clouddms.v1.CreatePrivateConnectionRequest} message CreatePrivateConnectionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PostgreSqlConnectionProfile.toObject = function toObject(message, options) { + CreatePrivateConnectionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.host = ""; - object.port = 0; - object.username = ""; - object.password = ""; - object.passwordSet = false; - object.ssl = null; - object.cloudSqlId = ""; + object.parent = ""; + object.privateConnectionId = ""; + object.privateConnection = null; + object.requestId = ""; + object.skipValidation = false; } - if (message.host != null && message.hasOwnProperty("host")) - object.host = message.host; - if (message.port != null && message.hasOwnProperty("port")) - object.port = message.port; - if (message.username != null && message.hasOwnProperty("username")) - object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; - if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) - object.passwordSet = message.passwordSet; - if (message.ssl != null && message.hasOwnProperty("ssl")) - object.ssl = $root.google.cloud.clouddms.v1.SslConfig.toObject(message.ssl, options); - if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) - object.cloudSqlId = message.cloudSqlId; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.privateConnectionId != null && message.hasOwnProperty("privateConnectionId")) + object.privateConnectionId = message.privateConnectionId; + if (message.privateConnection != null && message.hasOwnProperty("privateConnection")) + object.privateConnection = $root.google.cloud.clouddms.v1.PrivateConnection.toObject(message.privateConnection, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.skipValidation != null && message.hasOwnProperty("skipValidation")) + object.skipValidation = message.skipValidation; return object; }; /** - * Converts this PostgreSqlConnectionProfile to JSON. + * Converts this CreatePrivateConnectionRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @instance * @returns {Object.} JSON object */ - PostgreSqlConnectionProfile.prototype.toJSON = function toJSON() { + CreatePrivateConnectionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PostgreSqlConnectionProfile + * Gets the default type url for CreatePrivateConnectionRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.CreatePrivateConnectionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PostgreSqlConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreatePrivateConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.PostgreSqlConnectionProfile"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.CreatePrivateConnectionRequest"; }; - return PostgreSqlConnectionProfile; + return CreatePrivateConnectionRequest; })(); - v1.CloudSqlConnectionProfile = (function() { + v1.ListPrivateConnectionsRequest = (function() { /** - * Properties of a CloudSqlConnectionProfile. + * Properties of a ListPrivateConnectionsRequest. * @memberof google.cloud.clouddms.v1 - * @interface ICloudSqlConnectionProfile - * @property {string|null} [cloudSqlId] CloudSqlConnectionProfile cloudSqlId - * @property {google.cloud.clouddms.v1.ICloudSqlSettings|null} [settings] CloudSqlConnectionProfile settings - * @property {string|null} [privateIp] CloudSqlConnectionProfile privateIp - * @property {string|null} [publicIp] CloudSqlConnectionProfile publicIp + * @interface IListPrivateConnectionsRequest + * @property {string|null} [parent] ListPrivateConnectionsRequest parent + * @property {number|null} [pageSize] ListPrivateConnectionsRequest pageSize + * @property {string|null} [pageToken] ListPrivateConnectionsRequest pageToken + * @property {string|null} [filter] ListPrivateConnectionsRequest filter + * @property {string|null} [orderBy] ListPrivateConnectionsRequest orderBy */ /** - * Constructs a new CloudSqlConnectionProfile. + * Constructs a new ListPrivateConnectionsRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a CloudSqlConnectionProfile. - * @implements ICloudSqlConnectionProfile + * @classdesc Represents a ListPrivateConnectionsRequest. + * @implements IListPrivateConnectionsRequest * @constructor - * @param {google.cloud.clouddms.v1.ICloudSqlConnectionProfile=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IListPrivateConnectionsRequest=} [properties] Properties to set */ - function CloudSqlConnectionProfile(properties) { + function ListPrivateConnectionsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7406,117 +7068,131 @@ } /** - * CloudSqlConnectionProfile cloudSqlId. - * @member {string} cloudSqlId - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * ListPrivateConnectionsRequest parent. + * @member {string} parent + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @instance */ - CloudSqlConnectionProfile.prototype.cloudSqlId = ""; + ListPrivateConnectionsRequest.prototype.parent = ""; /** - * CloudSqlConnectionProfile settings. - * @member {google.cloud.clouddms.v1.ICloudSqlSettings|null|undefined} settings - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * ListPrivateConnectionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @instance */ - CloudSqlConnectionProfile.prototype.settings = null; + ListPrivateConnectionsRequest.prototype.pageSize = 0; /** - * CloudSqlConnectionProfile privateIp. - * @member {string} privateIp - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * ListPrivateConnectionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @instance */ - CloudSqlConnectionProfile.prototype.privateIp = ""; + ListPrivateConnectionsRequest.prototype.pageToken = ""; /** - * CloudSqlConnectionProfile publicIp. - * @member {string} publicIp - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * ListPrivateConnectionsRequest filter. + * @member {string} filter + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @instance */ - CloudSqlConnectionProfile.prototype.publicIp = ""; + ListPrivateConnectionsRequest.prototype.filter = ""; /** - * Creates a new CloudSqlConnectionProfile instance using the specified properties. + * ListPrivateConnectionsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest + * @instance + */ + ListPrivateConnectionsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListPrivateConnectionsRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @static - * @param {google.cloud.clouddms.v1.ICloudSqlConnectionProfile=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.CloudSqlConnectionProfile} CloudSqlConnectionProfile instance + * @param {google.cloud.clouddms.v1.IListPrivateConnectionsRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ListPrivateConnectionsRequest} ListPrivateConnectionsRequest instance */ - CloudSqlConnectionProfile.create = function create(properties) { - return new CloudSqlConnectionProfile(properties); + ListPrivateConnectionsRequest.create = function create(properties) { + return new ListPrivateConnectionsRequest(properties); }; /** - * Encodes the specified CloudSqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify|verify} messages. + * Encodes the specified ListPrivateConnectionsRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ListPrivateConnectionsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @static - * @param {google.cloud.clouddms.v1.ICloudSqlConnectionProfile} message CloudSqlConnectionProfile message or plain object to encode + * @param {google.cloud.clouddms.v1.IListPrivateConnectionsRequest} message ListPrivateConnectionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloudSqlConnectionProfile.encode = function encode(message, writer) { + ListPrivateConnectionsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cloudSqlId != null && Object.hasOwnProperty.call(message, "cloudSqlId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudSqlId); - if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) - $root.google.cloud.clouddms.v1.CloudSqlSettings.encode(message.settings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.privateIp != null && Object.hasOwnProperty.call(message, "privateIp")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.privateIp); - if (message.publicIp != null && Object.hasOwnProperty.call(message, "publicIp")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicIp); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified CloudSqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify|verify} messages. + * Encodes the specified ListPrivateConnectionsRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListPrivateConnectionsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @static - * @param {google.cloud.clouddms.v1.ICloudSqlConnectionProfile} message CloudSqlConnectionProfile message or plain object to encode + * @param {google.cloud.clouddms.v1.IListPrivateConnectionsRequest} message ListPrivateConnectionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloudSqlConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + ListPrivateConnectionsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CloudSqlConnectionProfile message from the specified reader or buffer. + * Decodes a ListPrivateConnectionsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.CloudSqlConnectionProfile} CloudSqlConnectionProfile + * @returns {google.cloud.clouddms.v1.ListPrivateConnectionsRequest} ListPrivateConnectionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CloudSqlConnectionProfile.decode = function decode(reader, length) { + ListPrivateConnectionsRequest.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.clouddms.v1.CloudSqlConnectionProfile(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ListPrivateConnectionsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.cloudSqlId = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.settings = $root.google.cloud.clouddms.v1.CloudSqlSettings.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; } case 3: { - message.privateIp = reader.string(); + message.pageToken = reader.string(); break; } case 4: { - message.publicIp = reader.string(); + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -7528,155 +7204,159 @@ }; /** - * Decodes a CloudSqlConnectionProfile message from the specified reader or buffer, length delimited. + * Decodes a ListPrivateConnectionsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.CloudSqlConnectionProfile} CloudSqlConnectionProfile + * @returns {google.cloud.clouddms.v1.ListPrivateConnectionsRequest} ListPrivateConnectionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CloudSqlConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + ListPrivateConnectionsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CloudSqlConnectionProfile message. + * Verifies a ListPrivateConnectionsRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CloudSqlConnectionProfile.verify = function verify(message) { + ListPrivateConnectionsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) - if (!$util.isString(message.cloudSqlId)) - return "cloudSqlId: string expected"; - if (message.settings != null && message.hasOwnProperty("settings")) { - var error = $root.google.cloud.clouddms.v1.CloudSqlSettings.verify(message.settings); - if (error) - return "settings." + error; - } - if (message.privateIp != null && message.hasOwnProperty("privateIp")) - if (!$util.isString(message.privateIp)) - return "privateIp: string expected"; - if (message.publicIp != null && message.hasOwnProperty("publicIp")) - if (!$util.isString(message.publicIp)) - return "publicIp: 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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a CloudSqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * Creates a ListPrivateConnectionsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.CloudSqlConnectionProfile} CloudSqlConnectionProfile + * @returns {google.cloud.clouddms.v1.ListPrivateConnectionsRequest} ListPrivateConnectionsRequest */ - CloudSqlConnectionProfile.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile) + ListPrivateConnectionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ListPrivateConnectionsRequest) return object; - var message = new $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile(); - if (object.cloudSqlId != null) - message.cloudSqlId = String(object.cloudSqlId); - if (object.settings != null) { - if (typeof object.settings !== "object") - throw TypeError(".google.cloud.clouddms.v1.CloudSqlConnectionProfile.settings: object expected"); - message.settings = $root.google.cloud.clouddms.v1.CloudSqlSettings.fromObject(object.settings); - } - if (object.privateIp != null) - message.privateIp = String(object.privateIp); - if (object.publicIp != null) - message.publicIp = String(object.publicIp); + var message = new $root.google.cloud.clouddms.v1.ListPrivateConnectionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a CloudSqlConnectionProfile message. Also converts values to other types if specified. + * Creates a plain object from a ListPrivateConnectionsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @static - * @param {google.cloud.clouddms.v1.CloudSqlConnectionProfile} message CloudSqlConnectionProfile + * @param {google.cloud.clouddms.v1.ListPrivateConnectionsRequest} message ListPrivateConnectionsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloudSqlConnectionProfile.toObject = function toObject(message, options) { + ListPrivateConnectionsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.cloudSqlId = ""; - object.settings = null; - object.privateIp = ""; - object.publicIp = ""; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } - if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) - object.cloudSqlId = message.cloudSqlId; - if (message.settings != null && message.hasOwnProperty("settings")) - object.settings = $root.google.cloud.clouddms.v1.CloudSqlSettings.toObject(message.settings, options); - if (message.privateIp != null && message.hasOwnProperty("privateIp")) - object.privateIp = message.privateIp; - if (message.publicIp != null && message.hasOwnProperty("publicIp")) - object.publicIp = message.publicIp; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this CloudSqlConnectionProfile to JSON. + * Converts this ListPrivateConnectionsRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @instance * @returns {Object.} JSON object */ - CloudSqlConnectionProfile.prototype.toJSON = function toJSON() { + ListPrivateConnectionsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CloudSqlConnectionProfile + * Gets the default type url for ListPrivateConnectionsRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CloudSqlConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListPrivateConnectionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.CloudSqlConnectionProfile"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.ListPrivateConnectionsRequest"; }; - return CloudSqlConnectionProfile; + return ListPrivateConnectionsRequest; })(); - v1.SqlAclEntry = (function() { + v1.ListPrivateConnectionsResponse = (function() { /** - * Properties of a SqlAclEntry. + * Properties of a ListPrivateConnectionsResponse. * @memberof google.cloud.clouddms.v1 - * @interface ISqlAclEntry - * @property {string|null} [value] SqlAclEntry value - * @property {google.protobuf.ITimestamp|null} [expireTime] SqlAclEntry expireTime - * @property {google.protobuf.IDuration|null} [ttl] SqlAclEntry ttl - * @property {string|null} [label] SqlAclEntry label + * @interface IListPrivateConnectionsResponse + * @property {Array.|null} [privateConnections] ListPrivateConnectionsResponse privateConnections + * @property {string|null} [nextPageToken] ListPrivateConnectionsResponse nextPageToken + * @property {Array.|null} [unreachable] ListPrivateConnectionsResponse unreachable */ /** - * Constructs a new SqlAclEntry. + * Constructs a new ListPrivateConnectionsResponse. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a SqlAclEntry. - * @implements ISqlAclEntry + * @classdesc Represents a ListPrivateConnectionsResponse. + * @implements IListPrivateConnectionsResponse * @constructor - * @param {google.cloud.clouddms.v1.ISqlAclEntry=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IListPrivateConnectionsResponse=} [properties] Properties to set */ - function SqlAclEntry(properties) { + function ListPrivateConnectionsResponse(properties) { + this.privateConnections = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7684,131 +7364,109 @@ } /** - * SqlAclEntry value. - * @member {string} value - * @memberof google.cloud.clouddms.v1.SqlAclEntry - * @instance - */ - SqlAclEntry.prototype.value = ""; - - /** - * SqlAclEntry expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.clouddms.v1.SqlAclEntry - * @instance - */ - SqlAclEntry.prototype.expireTime = null; - - /** - * SqlAclEntry ttl. - * @member {google.protobuf.IDuration|null|undefined} ttl - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * ListPrivateConnectionsResponse privateConnections. + * @member {Array.} privateConnections + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @instance */ - SqlAclEntry.prototype.ttl = null; + ListPrivateConnectionsResponse.prototype.privateConnections = $util.emptyArray; /** - * SqlAclEntry label. - * @member {string} label - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * ListPrivateConnectionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @instance */ - SqlAclEntry.prototype.label = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ListPrivateConnectionsResponse.prototype.nextPageToken = ""; /** - * SqlAclEntry expiration. - * @member {"expireTime"|"ttl"|undefined} expiration - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * ListPrivateConnectionsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @instance */ - Object.defineProperty(SqlAclEntry.prototype, "expiration", { - get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListPrivateConnectionsResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new SqlAclEntry instance using the specified properties. + * Creates a new ListPrivateConnectionsResponse instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @static - * @param {google.cloud.clouddms.v1.ISqlAclEntry=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.SqlAclEntry} SqlAclEntry instance + * @param {google.cloud.clouddms.v1.IListPrivateConnectionsResponse=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ListPrivateConnectionsResponse} ListPrivateConnectionsResponse instance */ - SqlAclEntry.create = function create(properties) { - return new SqlAclEntry(properties); + ListPrivateConnectionsResponse.create = function create(properties) { + return new ListPrivateConnectionsResponse(properties); }; /** - * Encodes the specified SqlAclEntry message. Does not implicitly {@link google.cloud.clouddms.v1.SqlAclEntry.verify|verify} messages. + * Encodes the specified ListPrivateConnectionsResponse message. Does not implicitly {@link google.cloud.clouddms.v1.ListPrivateConnectionsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @static - * @param {google.cloud.clouddms.v1.ISqlAclEntry} message SqlAclEntry message or plain object to encode + * @param {google.cloud.clouddms.v1.IListPrivateConnectionsResponse} message ListPrivateConnectionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlAclEntry.encode = function encode(message, writer) { + ListPrivateConnectionsResponse.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.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.label); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) - $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.privateConnections != null && message.privateConnections.length) + for (var i = 0; i < message.privateConnections.length; ++i) + $root.google.cloud.clouddms.v1.PrivateConnection.encode(message.privateConnections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified SqlAclEntry message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SqlAclEntry.verify|verify} messages. + * Encodes the specified ListPrivateConnectionsResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListPrivateConnectionsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @static - * @param {google.cloud.clouddms.v1.ISqlAclEntry} message SqlAclEntry message or plain object to encode + * @param {google.cloud.clouddms.v1.IListPrivateConnectionsResponse} message ListPrivateConnectionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlAclEntry.encodeDelimited = function encodeDelimited(message, writer) { + ListPrivateConnectionsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SqlAclEntry message from the specified reader or buffer. + * Decodes a ListPrivateConnectionsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.SqlAclEntry} SqlAclEntry + * @returns {google.cloud.clouddms.v1.ListPrivateConnectionsResponse} ListPrivateConnectionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SqlAclEntry.decode = function decode(reader, length) { + ListPrivateConnectionsResponse.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.clouddms.v1.SqlAclEntry(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ListPrivateConnectionsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.string(); - break; - } - case 10: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.privateConnections && message.privateConnections.length)) + message.privateConnections = []; + message.privateConnections.push($root.google.cloud.clouddms.v1.PrivateConnection.decode(reader, reader.uint32())); break; } - case 11: { - message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + case 2: { + message.nextPageToken = reader.string(); break; } case 3: { - message.label = reader.string(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -7820,174 +7478,170 @@ }; /** - * Decodes a SqlAclEntry message from the specified reader or buffer, length delimited. + * Decodes a ListPrivateConnectionsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.SqlAclEntry} SqlAclEntry + * @returns {google.cloud.clouddms.v1.ListPrivateConnectionsResponse} ListPrivateConnectionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SqlAclEntry.decodeDelimited = function decodeDelimited(reader) { + ListPrivateConnectionsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SqlAclEntry message. + * Verifies a ListPrivateConnectionsResponse message. * @function verify - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SqlAclEntry.verify = function verify(message) { + ListPrivateConnectionsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - properties.expiration = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (message.privateConnections != null && message.hasOwnProperty("privateConnections")) { + if (!Array.isArray(message.privateConnections)) + return "privateConnections: array expected"; + for (var i = 0; i < message.privateConnections.length; ++i) { + var error = $root.google.cloud.clouddms.v1.PrivateConnection.verify(message.privateConnections[i]); if (error) - return "expireTime." + error; + return "privateConnections." + error; } } - if (message.ttl != null && message.hasOwnProperty("ttl")) { - if (properties.expiration === 1) - return "expiration: multiple values"; - properties.expiration = 1; - { - var error = $root.google.protobuf.Duration.verify(message.ttl); - if (error) - return "ttl." + error; - } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; } - if (message.label != null && message.hasOwnProperty("label")) - if (!$util.isString(message.label)) - return "label: string expected"; return null; }; /** - * Creates a SqlAclEntry message from a plain object. Also converts values to their respective internal types. + * Creates a ListPrivateConnectionsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.SqlAclEntry} SqlAclEntry + * @returns {google.cloud.clouddms.v1.ListPrivateConnectionsResponse} ListPrivateConnectionsResponse */ - SqlAclEntry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.SqlAclEntry) + ListPrivateConnectionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ListPrivateConnectionsResponse) return object; - var message = new $root.google.cloud.clouddms.v1.SqlAclEntry(); - if (object.value != null) - message.value = String(object.value); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.clouddms.v1.SqlAclEntry.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + var message = new $root.google.cloud.clouddms.v1.ListPrivateConnectionsResponse(); + if (object.privateConnections) { + if (!Array.isArray(object.privateConnections)) + throw TypeError(".google.cloud.clouddms.v1.ListPrivateConnectionsResponse.privateConnections: array expected"); + message.privateConnections = []; + for (var i = 0; i < object.privateConnections.length; ++i) { + if (typeof object.privateConnections[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.ListPrivateConnectionsResponse.privateConnections: object expected"); + message.privateConnections[i] = $root.google.cloud.clouddms.v1.PrivateConnection.fromObject(object.privateConnections[i]); + } } - if (object.ttl != null) { - if (typeof object.ttl !== "object") - throw TypeError(".google.cloud.clouddms.v1.SqlAclEntry.ttl: object expected"); - message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.clouddms.v1.ListPrivateConnectionsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); } - if (object.label != null) - message.label = String(object.label); return message; }; /** - * Creates a plain object from a SqlAclEntry message. Also converts values to other types if specified. + * Creates a plain object from a ListPrivateConnectionsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @static - * @param {google.cloud.clouddms.v1.SqlAclEntry} message SqlAclEntry + * @param {google.cloud.clouddms.v1.ListPrivateConnectionsResponse} message ListPrivateConnectionsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlAclEntry.toObject = function toObject(message, options) { + ListPrivateConnectionsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.value = ""; - object.label = ""; + if (options.arrays || options.defaults) { + object.privateConnections = []; + object.unreachable = []; } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.label != null && message.hasOwnProperty("label")) - object.label = message.label; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (options.oneofs) - object.expiration = "expireTime"; + if (options.defaults) + object.nextPageToken = ""; + if (message.privateConnections && message.privateConnections.length) { + object.privateConnections = []; + for (var j = 0; j < message.privateConnections.length; ++j) + object.privateConnections[j] = $root.google.cloud.clouddms.v1.PrivateConnection.toObject(message.privateConnections[j], options); } - if (message.ttl != null && message.hasOwnProperty("ttl")) { - object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); - if (options.oneofs) - object.expiration = "ttl"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } return object; }; /** - * Converts this SqlAclEntry to JSON. + * Converts this ListPrivateConnectionsResponse to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @instance * @returns {Object.} JSON object */ - SqlAclEntry.prototype.toJSON = function toJSON() { + ListPrivateConnectionsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SqlAclEntry + * Gets the default type url for ListPrivateConnectionsResponse * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @memberof google.cloud.clouddms.v1.ListPrivateConnectionsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SqlAclEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListPrivateConnectionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.SqlAclEntry"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.ListPrivateConnectionsResponse"; }; - return SqlAclEntry; + return ListPrivateConnectionsResponse; })(); - v1.SqlIpConfig = (function() { + v1.DeletePrivateConnectionRequest = (function() { /** - * Properties of a SqlIpConfig. + * Properties of a DeletePrivateConnectionRequest. * @memberof google.cloud.clouddms.v1 - * @interface ISqlIpConfig - * @property {google.protobuf.IBoolValue|null} [enableIpv4] SqlIpConfig enableIpv4 - * @property {string|null} [privateNetwork] SqlIpConfig privateNetwork - * @property {google.protobuf.IBoolValue|null} [requireSsl] SqlIpConfig requireSsl - * @property {Array.|null} [authorizedNetworks] SqlIpConfig authorizedNetworks + * @interface IDeletePrivateConnectionRequest + * @property {string|null} [name] DeletePrivateConnectionRequest name + * @property {string|null} [requestId] DeletePrivateConnectionRequest requestId */ /** - * Constructs a new SqlIpConfig. + * Constructs a new DeletePrivateConnectionRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a SqlIpConfig. - * @implements ISqlIpConfig + * @classdesc Represents a DeletePrivateConnectionRequest. + * @implements IDeletePrivateConnectionRequest * @constructor - * @param {google.cloud.clouddms.v1.ISqlIpConfig=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IDeletePrivateConnectionRequest=} [properties] Properties to set */ - function SqlIpConfig(properties) { - this.authorizedNetworks = []; + function DeletePrivateConnectionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7995,120 +7649,89 @@ } /** - * SqlIpConfig enableIpv4. - * @member {google.protobuf.IBoolValue|null|undefined} enableIpv4 - * @memberof google.cloud.clouddms.v1.SqlIpConfig - * @instance - */ - SqlIpConfig.prototype.enableIpv4 = null; - - /** - * SqlIpConfig privateNetwork. - * @member {string} privateNetwork - * @memberof google.cloud.clouddms.v1.SqlIpConfig - * @instance - */ - SqlIpConfig.prototype.privateNetwork = ""; - - /** - * SqlIpConfig requireSsl. - * @member {google.protobuf.IBoolValue|null|undefined} requireSsl - * @memberof google.cloud.clouddms.v1.SqlIpConfig + * DeletePrivateConnectionRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.DeletePrivateConnectionRequest * @instance */ - SqlIpConfig.prototype.requireSsl = null; + DeletePrivateConnectionRequest.prototype.name = ""; /** - * SqlIpConfig authorizedNetworks. - * @member {Array.} authorizedNetworks - * @memberof google.cloud.clouddms.v1.SqlIpConfig + * DeletePrivateConnectionRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.DeletePrivateConnectionRequest * @instance */ - SqlIpConfig.prototype.authorizedNetworks = $util.emptyArray; + DeletePrivateConnectionRequest.prototype.requestId = ""; /** - * Creates a new SqlIpConfig instance using the specified properties. + * Creates a new DeletePrivateConnectionRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @memberof google.cloud.clouddms.v1.DeletePrivateConnectionRequest * @static - * @param {google.cloud.clouddms.v1.ISqlIpConfig=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.SqlIpConfig} SqlIpConfig instance + * @param {google.cloud.clouddms.v1.IDeletePrivateConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DeletePrivateConnectionRequest} DeletePrivateConnectionRequest instance */ - SqlIpConfig.create = function create(properties) { - return new SqlIpConfig(properties); + DeletePrivateConnectionRequest.create = function create(properties) { + return new DeletePrivateConnectionRequest(properties); }; /** - * Encodes the specified SqlIpConfig message. Does not implicitly {@link google.cloud.clouddms.v1.SqlIpConfig.verify|verify} messages. + * Encodes the specified DeletePrivateConnectionRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DeletePrivateConnectionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @memberof google.cloud.clouddms.v1.DeletePrivateConnectionRequest * @static - * @param {google.cloud.clouddms.v1.ISqlIpConfig} message SqlIpConfig message or plain object to encode + * @param {google.cloud.clouddms.v1.IDeletePrivateConnectionRequest} message DeletePrivateConnectionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlIpConfig.encode = function encode(message, writer) { + DeletePrivateConnectionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enableIpv4 != null && Object.hasOwnProperty.call(message, "enableIpv4")) - $root.google.protobuf.BoolValue.encode(message.enableIpv4, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateNetwork); - if (message.requireSsl != null && Object.hasOwnProperty.call(message, "requireSsl")) - $root.google.protobuf.BoolValue.encode(message.requireSsl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.authorizedNetworks != null && message.authorizedNetworks.length) - for (var i = 0; i < message.authorizedNetworks.length; ++i) - $root.google.cloud.clouddms.v1.SqlAclEntry.encode(message.authorizedNetworks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); return writer; }; /** - * Encodes the specified SqlIpConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SqlIpConfig.verify|verify} messages. + * Encodes the specified DeletePrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DeletePrivateConnectionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @memberof google.cloud.clouddms.v1.DeletePrivateConnectionRequest * @static - * @param {google.cloud.clouddms.v1.ISqlIpConfig} message SqlIpConfig message or plain object to encode + * @param {google.cloud.clouddms.v1.IDeletePrivateConnectionRequest} message DeletePrivateConnectionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlIpConfig.encodeDelimited = function encodeDelimited(message, writer) { + DeletePrivateConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SqlIpConfig message from the specified reader or buffer. + * Decodes a DeletePrivateConnectionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @memberof google.cloud.clouddms.v1.DeletePrivateConnectionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.SqlIpConfig} SqlIpConfig + * @returns {google.cloud.clouddms.v1.DeletePrivateConnectionRequest} DeletePrivateConnectionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SqlIpConfig.decode = function decode(reader, length) { + DeletePrivateConnectionRequest.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.clouddms.v1.SqlIpConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.DeletePrivateConnectionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.enableIpv4 = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.privateNetwork = reader.string(); - break; - } - case 3: { - message.requireSsl = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.authorizedNetworks && message.authorizedNetworks.length)) - message.authorizedNetworks = []; - message.authorizedNetworks.push($root.google.cloud.clouddms.v1.SqlAclEntry.decode(reader, reader.uint32())); + message.requestId = reader.string(); break; } default: @@ -8120,191 +7743,131 @@ }; /** - * Decodes a SqlIpConfig message from the specified reader or buffer, length delimited. + * Decodes a DeletePrivateConnectionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @memberof google.cloud.clouddms.v1.DeletePrivateConnectionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.SqlIpConfig} SqlIpConfig + * @returns {google.cloud.clouddms.v1.DeletePrivateConnectionRequest} DeletePrivateConnectionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SqlIpConfig.decodeDelimited = function decodeDelimited(reader) { + DeletePrivateConnectionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SqlIpConfig message. + * Verifies a DeletePrivateConnectionRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @memberof google.cloud.clouddms.v1.DeletePrivateConnectionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SqlIpConfig.verify = function verify(message) { + DeletePrivateConnectionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.enableIpv4 != null && message.hasOwnProperty("enableIpv4")) { - var error = $root.google.protobuf.BoolValue.verify(message.enableIpv4); - if (error) - return "enableIpv4." + error; - } - if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) - if (!$util.isString(message.privateNetwork)) - return "privateNetwork: string expected"; - if (message.requireSsl != null && message.hasOwnProperty("requireSsl")) { - var error = $root.google.protobuf.BoolValue.verify(message.requireSsl); - if (error) - return "requireSsl." + error; - } - if (message.authorizedNetworks != null && message.hasOwnProperty("authorizedNetworks")) { - if (!Array.isArray(message.authorizedNetworks)) - return "authorizedNetworks: array expected"; - for (var i = 0; i < message.authorizedNetworks.length; ++i) { - var error = $root.google.cloud.clouddms.v1.SqlAclEntry.verify(message.authorizedNetworks[i]); - if (error) - return "authorizedNetworks." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a SqlIpConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DeletePrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @memberof google.cloud.clouddms.v1.DeletePrivateConnectionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.SqlIpConfig} SqlIpConfig + * @returns {google.cloud.clouddms.v1.DeletePrivateConnectionRequest} DeletePrivateConnectionRequest */ - SqlIpConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.SqlIpConfig) + DeletePrivateConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DeletePrivateConnectionRequest) return object; - var message = new $root.google.cloud.clouddms.v1.SqlIpConfig(); - if (object.enableIpv4 != null) { - if (typeof object.enableIpv4 !== "object") - throw TypeError(".google.cloud.clouddms.v1.SqlIpConfig.enableIpv4: object expected"); - message.enableIpv4 = $root.google.protobuf.BoolValue.fromObject(object.enableIpv4); - } - if (object.privateNetwork != null) - message.privateNetwork = String(object.privateNetwork); - if (object.requireSsl != null) { - if (typeof object.requireSsl !== "object") - throw TypeError(".google.cloud.clouddms.v1.SqlIpConfig.requireSsl: object expected"); - message.requireSsl = $root.google.protobuf.BoolValue.fromObject(object.requireSsl); - } - if (object.authorizedNetworks) { - if (!Array.isArray(object.authorizedNetworks)) - throw TypeError(".google.cloud.clouddms.v1.SqlIpConfig.authorizedNetworks: array expected"); - message.authorizedNetworks = []; - for (var i = 0; i < object.authorizedNetworks.length; ++i) { - if (typeof object.authorizedNetworks[i] !== "object") - throw TypeError(".google.cloud.clouddms.v1.SqlIpConfig.authorizedNetworks: object expected"); - message.authorizedNetworks[i] = $root.google.cloud.clouddms.v1.SqlAclEntry.fromObject(object.authorizedNetworks[i]); - } - } + var message = new $root.google.cloud.clouddms.v1.DeletePrivateConnectionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a SqlIpConfig message. Also converts values to other types if specified. + * Creates a plain object from a DeletePrivateConnectionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @memberof google.cloud.clouddms.v1.DeletePrivateConnectionRequest * @static - * @param {google.cloud.clouddms.v1.SqlIpConfig} message SqlIpConfig + * @param {google.cloud.clouddms.v1.DeletePrivateConnectionRequest} message DeletePrivateConnectionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlIpConfig.toObject = function toObject(message, options) { + DeletePrivateConnectionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.authorizedNetworks = []; if (options.defaults) { - object.enableIpv4 = null; - object.privateNetwork = ""; - object.requireSsl = null; - } - if (message.enableIpv4 != null && message.hasOwnProperty("enableIpv4")) - object.enableIpv4 = $root.google.protobuf.BoolValue.toObject(message.enableIpv4, options); - if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) - object.privateNetwork = message.privateNetwork; - if (message.requireSsl != null && message.hasOwnProperty("requireSsl")) - object.requireSsl = $root.google.protobuf.BoolValue.toObject(message.requireSsl, options); - if (message.authorizedNetworks && message.authorizedNetworks.length) { - object.authorizedNetworks = []; - for (var j = 0; j < message.authorizedNetworks.length; ++j) - object.authorizedNetworks[j] = $root.google.cloud.clouddms.v1.SqlAclEntry.toObject(message.authorizedNetworks[j], options); + object.name = ""; + object.requestId = ""; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this SqlIpConfig to JSON. + * Converts this DeletePrivateConnectionRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @memberof google.cloud.clouddms.v1.DeletePrivateConnectionRequest * @instance * @returns {Object.} JSON object */ - SqlIpConfig.prototype.toJSON = function toJSON() { + DeletePrivateConnectionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SqlIpConfig + * Gets the default type url for DeletePrivateConnectionRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @memberof google.cloud.clouddms.v1.DeletePrivateConnectionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SqlIpConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeletePrivateConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.SqlIpConfig"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.DeletePrivateConnectionRequest"; }; - return SqlIpConfig; + return DeletePrivateConnectionRequest; })(); - v1.CloudSqlSettings = (function() { + v1.GetPrivateConnectionRequest = (function() { /** - * Properties of a CloudSqlSettings. + * Properties of a GetPrivateConnectionRequest. * @memberof google.cloud.clouddms.v1 - * @interface ICloudSqlSettings - * @property {google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion|null} [databaseVersion] CloudSqlSettings databaseVersion - * @property {Object.|null} [userLabels] CloudSqlSettings userLabels - * @property {string|null} [tier] CloudSqlSettings tier - * @property {google.protobuf.IInt64Value|null} [storageAutoResizeLimit] CloudSqlSettings storageAutoResizeLimit - * @property {google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy|null} [activationPolicy] CloudSqlSettings activationPolicy - * @property {google.cloud.clouddms.v1.ISqlIpConfig|null} [ipConfig] CloudSqlSettings ipConfig - * @property {google.protobuf.IBoolValue|null} [autoStorageIncrease] CloudSqlSettings autoStorageIncrease - * @property {Object.|null} [databaseFlags] CloudSqlSettings databaseFlags - * @property {google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType|null} [dataDiskType] CloudSqlSettings dataDiskType - * @property {google.protobuf.IInt64Value|null} [dataDiskSizeGb] CloudSqlSettings dataDiskSizeGb - * @property {string|null} [zone] CloudSqlSettings zone - * @property {string|null} [sourceId] CloudSqlSettings sourceId - * @property {string|null} [rootPassword] CloudSqlSettings rootPassword - * @property {boolean|null} [rootPasswordSet] CloudSqlSettings rootPasswordSet - * @property {string|null} [collation] CloudSqlSettings collation + * @interface IGetPrivateConnectionRequest + * @property {string|null} [name] GetPrivateConnectionRequest name */ /** - * Constructs a new CloudSqlSettings. + * Constructs a new GetPrivateConnectionRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a CloudSqlSettings. - * @implements ICloudSqlSettings + * @classdesc Represents a GetPrivateConnectionRequest. + * @implements IGetPrivateConnectionRequest * @constructor - * @param {google.cloud.clouddms.v1.ICloudSqlSettings=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IGetPrivateConnectionRequest=} [properties] Properties to set */ - function CloudSqlSettings(properties) { - this.userLabels = {}; - this.databaseFlags = {}; + function GetPrivateConnectionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8312,311 +7875,75 @@ } /** - * CloudSqlSettings databaseVersion. - * @member {google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion} databaseVersion - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.databaseVersion = 0; - - /** - * CloudSqlSettings userLabels. - * @member {Object.} userLabels - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.userLabels = $util.emptyObject; - - /** - * CloudSqlSettings tier. - * @member {string} tier - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.tier = ""; - - /** - * CloudSqlSettings storageAutoResizeLimit. - * @member {google.protobuf.IInt64Value|null|undefined} storageAutoResizeLimit - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.storageAutoResizeLimit = null; - - /** - * CloudSqlSettings activationPolicy. - * @member {google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy} activationPolicy - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.activationPolicy = 0; - - /** - * CloudSqlSettings ipConfig. - * @member {google.cloud.clouddms.v1.ISqlIpConfig|null|undefined} ipConfig - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.ipConfig = null; - - /** - * CloudSqlSettings autoStorageIncrease. - * @member {google.protobuf.IBoolValue|null|undefined} autoStorageIncrease - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.autoStorageIncrease = null; - - /** - * CloudSqlSettings databaseFlags. - * @member {Object.} databaseFlags - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.databaseFlags = $util.emptyObject; - - /** - * CloudSqlSettings dataDiskType. - * @member {google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType} dataDiskType - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.dataDiskType = 0; - - /** - * CloudSqlSettings dataDiskSizeGb. - * @member {google.protobuf.IInt64Value|null|undefined} dataDiskSizeGb - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.dataDiskSizeGb = null; - - /** - * CloudSqlSettings zone. - * @member {string} zone - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.zone = ""; - - /** - * CloudSqlSettings sourceId. - * @member {string} sourceId - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.sourceId = ""; - - /** - * CloudSqlSettings rootPassword. - * @member {string} rootPassword - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.rootPassword = ""; - - /** - * CloudSqlSettings rootPasswordSet. - * @member {boolean} rootPasswordSet - * @memberof google.cloud.clouddms.v1.CloudSqlSettings - * @instance - */ - CloudSqlSettings.prototype.rootPasswordSet = false; - - /** - * CloudSqlSettings collation. - * @member {string} collation - * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * GetPrivateConnectionRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.GetPrivateConnectionRequest * @instance */ - CloudSqlSettings.prototype.collation = ""; + GetPrivateConnectionRequest.prototype.name = ""; /** - * Creates a new CloudSqlSettings instance using the specified properties. + * Creates a new GetPrivateConnectionRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @memberof google.cloud.clouddms.v1.GetPrivateConnectionRequest * @static - * @param {google.cloud.clouddms.v1.ICloudSqlSettings=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.CloudSqlSettings} CloudSqlSettings instance + * @param {google.cloud.clouddms.v1.IGetPrivateConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.GetPrivateConnectionRequest} GetPrivateConnectionRequest instance */ - CloudSqlSettings.create = function create(properties) { - return new CloudSqlSettings(properties); + GetPrivateConnectionRequest.create = function create(properties) { + return new GetPrivateConnectionRequest(properties); }; /** - * Encodes the specified CloudSqlSettings message. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlSettings.verify|verify} messages. + * Encodes the specified GetPrivateConnectionRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GetPrivateConnectionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @memberof google.cloud.clouddms.v1.GetPrivateConnectionRequest * @static - * @param {google.cloud.clouddms.v1.ICloudSqlSettings} message CloudSqlSettings message or plain object to encode + * @param {google.cloud.clouddms.v1.IGetPrivateConnectionRequest} message GetPrivateConnectionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloudSqlSettings.encode = function encode(message, writer) { + GetPrivateConnectionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.databaseVersion); - if (message.userLabels != null && Object.hasOwnProperty.call(message, "userLabels")) - for (var keys = Object.keys(message.userLabels), 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.userLabels[keys[i]]).ldelim(); - if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.tier); - if (message.storageAutoResizeLimit != null && Object.hasOwnProperty.call(message, "storageAutoResizeLimit")) - $root.google.protobuf.Int64Value.encode(message.storageAutoResizeLimit, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.activationPolicy); - if (message.ipConfig != null && Object.hasOwnProperty.call(message, "ipConfig")) - $root.google.cloud.clouddms.v1.SqlIpConfig.encode(message.ipConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.autoStorageIncrease != null && Object.hasOwnProperty.call(message, "autoStorageIncrease")) - $root.google.protobuf.BoolValue.encode(message.autoStorageIncrease, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) - for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); - if (message.dataDiskType != null && Object.hasOwnProperty.call(message, "dataDiskType")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.dataDiskType); - if (message.dataDiskSizeGb != null && Object.hasOwnProperty.call(message, "dataDiskSizeGb")) - $root.google.protobuf.Int64Value.encode(message.dataDiskSizeGb, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.zone); - if (message.sourceId != null && Object.hasOwnProperty.call(message, "sourceId")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.sourceId); - if (message.rootPassword != null && Object.hasOwnProperty.call(message, "rootPassword")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.rootPassword); - if (message.rootPasswordSet != null && Object.hasOwnProperty.call(message, "rootPasswordSet")) - writer.uint32(/* id 14, wireType 0 =*/112).bool(message.rootPasswordSet); - if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.collation); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CloudSqlSettings message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlSettings.verify|verify} messages. + * Encodes the specified GetPrivateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GetPrivateConnectionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @memberof google.cloud.clouddms.v1.GetPrivateConnectionRequest * @static - * @param {google.cloud.clouddms.v1.ICloudSqlSettings} message CloudSqlSettings message or plain object to encode + * @param {google.cloud.clouddms.v1.IGetPrivateConnectionRequest} message GetPrivateConnectionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloudSqlSettings.encodeDelimited = function encodeDelimited(message, writer) { + GetPrivateConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CloudSqlSettings message from the specified reader or buffer. + * Decodes a GetPrivateConnectionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @memberof google.cloud.clouddms.v1.GetPrivateConnectionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.CloudSqlSettings} CloudSqlSettings + * @returns {google.cloud.clouddms.v1.GetPrivateConnectionRequest} GetPrivateConnectionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CloudSqlSettings.decode = function decode(reader, length) { + GetPrivateConnectionRequest.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.clouddms.v1.CloudSqlSettings(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.GetPrivateConnectionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.databaseVersion = reader.int32(); - break; - } - case 2: { - if (message.userLabels === $util.emptyObject) - message.userLabels = {}; - 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.userLabels[key] = value; - break; - } - case 3: { - message.tier = reader.string(); - break; - } - case 4: { - message.storageAutoResizeLimit = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - case 5: { - message.activationPolicy = reader.int32(); - break; - } - case 6: { - message.ipConfig = $root.google.cloud.clouddms.v1.SqlIpConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.autoStorageIncrease = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; - } - case 8: { - if (message.databaseFlags === $util.emptyObject) - message.databaseFlags = {}; - 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.databaseFlags[key] = value; - break; - } - case 9: { - message.dataDiskType = reader.int32(); - break; - } - case 10: { - message.dataDiskSizeGb = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - } - case 11: { - message.zone = reader.string(); - break; - } - case 12: { - message.sourceId = reader.string(); - break; - } - case 13: { - message.rootPassword = reader.string(); - break; - } - case 14: { - message.rootPasswordSet = reader.bool(); - break; - } - case 15: { - message.collation = reader.string(); + message.name = reader.string(); break; } default: @@ -8628,445 +7955,128 @@ }; /** - * Decodes a CloudSqlSettings message from the specified reader or buffer, length delimited. + * Decodes a GetPrivateConnectionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @memberof google.cloud.clouddms.v1.GetPrivateConnectionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.CloudSqlSettings} CloudSqlSettings + * @returns {google.cloud.clouddms.v1.GetPrivateConnectionRequest} GetPrivateConnectionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CloudSqlSettings.decodeDelimited = function decodeDelimited(reader) { + GetPrivateConnectionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CloudSqlSettings message. + * Verifies a GetPrivateConnectionRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @memberof google.cloud.clouddms.v1.GetPrivateConnectionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CloudSqlSettings.verify = function verify(message) { + GetPrivateConnectionRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { - default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.userLabels != null && message.hasOwnProperty("userLabels")) { - if (!$util.isObject(message.userLabels)) - return "userLabels: object expected"; - var key = Object.keys(message.userLabels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.userLabels[key[i]])) - return "userLabels: string{k:string} expected"; - } - if (message.tier != null && message.hasOwnProperty("tier")) - if (!$util.isString(message.tier)) - return "tier: string expected"; - if (message.storageAutoResizeLimit != null && message.hasOwnProperty("storageAutoResizeLimit")) { - var error = $root.google.protobuf.Int64Value.verify(message.storageAutoResizeLimit); - if (error) - return "storageAutoResizeLimit." + error; - } - if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) - switch (message.activationPolicy) { - default: - return "activationPolicy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.ipConfig != null && message.hasOwnProperty("ipConfig")) { - var error = $root.google.cloud.clouddms.v1.SqlIpConfig.verify(message.ipConfig); - if (error) - return "ipConfig." + error; - } - if (message.autoStorageIncrease != null && message.hasOwnProperty("autoStorageIncrease")) { - var error = $root.google.protobuf.BoolValue.verify(message.autoStorageIncrease); - if (error) - return "autoStorageIncrease." + error; - } - if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { - if (!$util.isObject(message.databaseFlags)) - return "databaseFlags: object expected"; - var key = Object.keys(message.databaseFlags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.databaseFlags[key[i]])) - return "databaseFlags: string{k:string} expected"; - } - if (message.dataDiskType != null && message.hasOwnProperty("dataDiskType")) - switch (message.dataDiskType) { - default: - return "dataDiskType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.dataDiskSizeGb != null && message.hasOwnProperty("dataDiskSizeGb")) { - var error = $root.google.protobuf.Int64Value.verify(message.dataDiskSizeGb); - if (error) - return "dataDiskSizeGb." + error; - } - if (message.zone != null && message.hasOwnProperty("zone")) - if (!$util.isString(message.zone)) - return "zone: string expected"; - if (message.sourceId != null && message.hasOwnProperty("sourceId")) - if (!$util.isString(message.sourceId)) - return "sourceId: string expected"; - if (message.rootPassword != null && message.hasOwnProperty("rootPassword")) - if (!$util.isString(message.rootPassword)) - return "rootPassword: string expected"; - if (message.rootPasswordSet != null && message.hasOwnProperty("rootPasswordSet")) - if (typeof message.rootPasswordSet !== "boolean") - return "rootPasswordSet: boolean expected"; - if (message.collation != null && message.hasOwnProperty("collation")) - if (!$util.isString(message.collation)) - return "collation: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CloudSqlSettings message from a plain object. Also converts values to their respective internal types. + * Creates a GetPrivateConnectionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @memberof google.cloud.clouddms.v1.GetPrivateConnectionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.CloudSqlSettings} CloudSqlSettings + * @returns {google.cloud.clouddms.v1.GetPrivateConnectionRequest} GetPrivateConnectionRequest */ - CloudSqlSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.CloudSqlSettings) + GetPrivateConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.GetPrivateConnectionRequest) return object; - var message = new $root.google.cloud.clouddms.v1.CloudSqlSettings(); - switch (object.databaseVersion) { - default: - if (typeof object.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; - break; - } - break; - case "SQL_DATABASE_VERSION_UNSPECIFIED": - case 0: - message.databaseVersion = 0; - break; - case "MYSQL_5_6": - case 1: - message.databaseVersion = 1; - break; - case "MYSQL_5_7": - case 2: - message.databaseVersion = 2; - break; - case "POSTGRES_9_6": - case 3: - message.databaseVersion = 3; - break; - case "POSTGRES_11": - case 4: - message.databaseVersion = 4; - break; - case "POSTGRES_10": - case 5: - message.databaseVersion = 5; - break; - case "MYSQL_8_0": - case 6: - message.databaseVersion = 6; - break; - case "POSTGRES_12": - case 7: - message.databaseVersion = 7; - break; - case "POSTGRES_13": - case 8: - message.databaseVersion = 8; - break; - } - if (object.userLabels) { - if (typeof object.userLabels !== "object") - throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.userLabels: object expected"); - message.userLabels = {}; - for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) - message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); - } - if (object.tier != null) - message.tier = String(object.tier); - if (object.storageAutoResizeLimit != null) { - if (typeof object.storageAutoResizeLimit !== "object") - throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.storageAutoResizeLimit: object expected"); - message.storageAutoResizeLimit = $root.google.protobuf.Int64Value.fromObject(object.storageAutoResizeLimit); - } - switch (object.activationPolicy) { - default: - if (typeof object.activationPolicy === "number") { - message.activationPolicy = object.activationPolicy; - break; - } - break; - case "SQL_ACTIVATION_POLICY_UNSPECIFIED": - case 0: - message.activationPolicy = 0; - break; - case "ALWAYS": - case 1: - message.activationPolicy = 1; - break; - case "NEVER": - case 2: - message.activationPolicy = 2; - break; - } - if (object.ipConfig != null) { - if (typeof object.ipConfig !== "object") - throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.ipConfig: object expected"); - message.ipConfig = $root.google.cloud.clouddms.v1.SqlIpConfig.fromObject(object.ipConfig); - } - if (object.autoStorageIncrease != null) { - if (typeof object.autoStorageIncrease !== "object") - throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.autoStorageIncrease: object expected"); - message.autoStorageIncrease = $root.google.protobuf.BoolValue.fromObject(object.autoStorageIncrease); - } - if (object.databaseFlags) { - if (typeof object.databaseFlags !== "object") - throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.databaseFlags: object expected"); - message.databaseFlags = {}; - for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) - message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); - } - switch (object.dataDiskType) { - default: - if (typeof object.dataDiskType === "number") { - message.dataDiskType = object.dataDiskType; - break; - } - break; - case "SQL_DATA_DISK_TYPE_UNSPECIFIED": - case 0: - message.dataDiskType = 0; - break; - case "PD_SSD": - case 1: - message.dataDiskType = 1; - break; - case "PD_HDD": - case 2: - message.dataDiskType = 2; - break; - } - if (object.dataDiskSizeGb != null) { - if (typeof object.dataDiskSizeGb !== "object") - throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.dataDiskSizeGb: object expected"); - message.dataDiskSizeGb = $root.google.protobuf.Int64Value.fromObject(object.dataDiskSizeGb); - } - if (object.zone != null) - message.zone = String(object.zone); - if (object.sourceId != null) - message.sourceId = String(object.sourceId); - if (object.rootPassword != null) - message.rootPassword = String(object.rootPassword); - if (object.rootPasswordSet != null) - message.rootPasswordSet = Boolean(object.rootPasswordSet); - if (object.collation != null) - message.collation = String(object.collation); + var message = new $root.google.cloud.clouddms.v1.GetPrivateConnectionRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CloudSqlSettings message. Also converts values to other types if specified. + * Creates a plain object from a GetPrivateConnectionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @memberof google.cloud.clouddms.v1.GetPrivateConnectionRequest * @static - * @param {google.cloud.clouddms.v1.CloudSqlSettings} message CloudSqlSettings + * @param {google.cloud.clouddms.v1.GetPrivateConnectionRequest} message GetPrivateConnectionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloudSqlSettings.toObject = function toObject(message, options) { + GetPrivateConnectionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) { - object.userLabels = {}; - object.databaseFlags = {}; - } - if (options.defaults) { - object.databaseVersion = options.enums === String ? "SQL_DATABASE_VERSION_UNSPECIFIED" : 0; - object.tier = ""; - object.storageAutoResizeLimit = null; - object.activationPolicy = options.enums === String ? "SQL_ACTIVATION_POLICY_UNSPECIFIED" : 0; - object.ipConfig = null; - object.autoStorageIncrease = null; - object.dataDiskType = options.enums === String ? "SQL_DATA_DISK_TYPE_UNSPECIFIED" : 0; - object.dataDiskSizeGb = null; - object.zone = ""; - object.sourceId = ""; - object.rootPassword = ""; - object.rootPasswordSet = false; - object.collation = ""; - } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - object.databaseVersion = options.enums === String ? $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion[message.databaseVersion] : message.databaseVersion; - var keys2; - if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { - object.userLabels = {}; - for (var j = 0; j < keys2.length; ++j) - object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; - } - if (message.tier != null && message.hasOwnProperty("tier")) - object.tier = message.tier; - if (message.storageAutoResizeLimit != null && message.hasOwnProperty("storageAutoResizeLimit")) - object.storageAutoResizeLimit = $root.google.protobuf.Int64Value.toObject(message.storageAutoResizeLimit, options); - if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) - object.activationPolicy = options.enums === String ? $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy[message.activationPolicy] === undefined ? message.activationPolicy : $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy[message.activationPolicy] : message.activationPolicy; - if (message.ipConfig != null && message.hasOwnProperty("ipConfig")) - object.ipConfig = $root.google.cloud.clouddms.v1.SqlIpConfig.toObject(message.ipConfig, options); - if (message.autoStorageIncrease != null && message.hasOwnProperty("autoStorageIncrease")) - object.autoStorageIncrease = $root.google.protobuf.BoolValue.toObject(message.autoStorageIncrease, options); - if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { - object.databaseFlags = {}; - for (var j = 0; j < keys2.length; ++j) - object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; - } - if (message.dataDiskType != null && message.hasOwnProperty("dataDiskType")) - object.dataDiskType = options.enums === String ? $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType[message.dataDiskType] === undefined ? message.dataDiskType : $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType[message.dataDiskType] : message.dataDiskType; - if (message.dataDiskSizeGb != null && message.hasOwnProperty("dataDiskSizeGb")) - object.dataDiskSizeGb = $root.google.protobuf.Int64Value.toObject(message.dataDiskSizeGb, options); - if (message.zone != null && message.hasOwnProperty("zone")) - object.zone = message.zone; - if (message.sourceId != null && message.hasOwnProperty("sourceId")) - object.sourceId = message.sourceId; - if (message.rootPassword != null && message.hasOwnProperty("rootPassword")) - object.rootPassword = message.rootPassword; - if (message.rootPasswordSet != null && message.hasOwnProperty("rootPasswordSet")) - object.rootPasswordSet = message.rootPasswordSet; - if (message.collation != null && message.hasOwnProperty("collation")) - object.collation = message.collation; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CloudSqlSettings to JSON. + * Converts this GetPrivateConnectionRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @memberof google.cloud.clouddms.v1.GetPrivateConnectionRequest * @instance * @returns {Object.} JSON object */ - CloudSqlSettings.prototype.toJSON = function toJSON() { + GetPrivateConnectionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CloudSqlSettings + * Gets the default type url for GetPrivateConnectionRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @memberof google.cloud.clouddms.v1.GetPrivateConnectionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CloudSqlSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetPrivateConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.CloudSqlSettings"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.GetPrivateConnectionRequest"; }; - /** - * SqlActivationPolicy enum. - * @name google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy - * @enum {number} - * @property {number} SQL_ACTIVATION_POLICY_UNSPECIFIED=0 SQL_ACTIVATION_POLICY_UNSPECIFIED value - * @property {number} ALWAYS=1 ALWAYS value - * @property {number} NEVER=2 NEVER value - */ - CloudSqlSettings.SqlActivationPolicy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SQL_ACTIVATION_POLICY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALWAYS"] = 1; - values[valuesById[2] = "NEVER"] = 2; - return values; - })(); - - /** - * SqlDataDiskType enum. - * @name google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType - * @enum {number} - * @property {number} SQL_DATA_DISK_TYPE_UNSPECIFIED=0 SQL_DATA_DISK_TYPE_UNSPECIFIED value - * @property {number} PD_SSD=1 PD_SSD value - * @property {number} PD_HDD=2 PD_HDD value - */ - CloudSqlSettings.SqlDataDiskType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SQL_DATA_DISK_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PD_SSD"] = 1; - values[valuesById[2] = "PD_HDD"] = 2; - return values; - })(); - - /** - * SqlDatabaseVersion enum. - * @name google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion - * @enum {number} - * @property {number} SQL_DATABASE_VERSION_UNSPECIFIED=0 SQL_DATABASE_VERSION_UNSPECIFIED value - * @property {number} MYSQL_5_6=1 MYSQL_5_6 value - * @property {number} MYSQL_5_7=2 MYSQL_5_7 value - * @property {number} POSTGRES_9_6=3 POSTGRES_9_6 value - * @property {number} POSTGRES_11=4 POSTGRES_11 value - * @property {number} POSTGRES_10=5 POSTGRES_10 value - * @property {number} MYSQL_8_0=6 MYSQL_8_0 value - * @property {number} POSTGRES_12=7 POSTGRES_12 value - * @property {number} POSTGRES_13=8 POSTGRES_13 value - */ - CloudSqlSettings.SqlDatabaseVersion = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SQL_DATABASE_VERSION_UNSPECIFIED"] = 0; - values[valuesById[1] = "MYSQL_5_6"] = 1; - values[valuesById[2] = "MYSQL_5_7"] = 2; - values[valuesById[3] = "POSTGRES_9_6"] = 3; - values[valuesById[4] = "POSTGRES_11"] = 4; - values[valuesById[5] = "POSTGRES_10"] = 5; - values[valuesById[6] = "MYSQL_8_0"] = 6; - values[valuesById[7] = "POSTGRES_12"] = 7; - values[valuesById[8] = "POSTGRES_13"] = 8; - return values; - })(); - - return CloudSqlSettings; + return GetPrivateConnectionRequest; })(); - v1.StaticIpConnectivity = (function() { + v1.OperationMetadata = (function() { /** - * Properties of a StaticIpConnectivity. + * Properties of an OperationMetadata. * @memberof google.cloud.clouddms.v1 - * @interface IStaticIpConnectivity + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion */ /** - * Constructs a new StaticIpConnectivity. + * Constructs a new OperationMetadata. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a StaticIpConnectivity. - * @implements IStaticIpConnectivity + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata * @constructor - * @param {google.cloud.clouddms.v1.IStaticIpConnectivity=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IOperationMetadata=} [properties] Properties to set */ - function StaticIpConnectivity(properties) { + function OperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9074,63 +8084,161 @@ } /** - * Creates a new StaticIpConnectivity instance using the specified properties. - * @function create - * @memberof google.cloud.clouddms.v1.StaticIpConnectivity - * @static - * @param {google.cloud.clouddms.v1.IStaticIpConnectivity=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.StaticIpConnectivity} StaticIpConnectivity instance + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance */ - StaticIpConnectivity.create = function create(properties) { - return new StaticIpConnectivity(properties); - }; + OperationMetadata.prototype.createTime = null; /** - * Encodes the specified StaticIpConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.StaticIpConnectivity.verify|verify} messages. - * @function encode - * @memberof google.cloud.clouddms.v1.StaticIpConnectivity - * @static - * @param {google.cloud.clouddms.v1.IStaticIpConnectivity} message StaticIpConnectivity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance */ - StaticIpConnectivity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; + OperationMetadata.prototype.endTime = null; /** - * Encodes the specified StaticIpConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StaticIpConnectivity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.StaticIpConnectivity - * @static - * @param {google.cloud.clouddms.v1.IStaticIpConnectivity} message StaticIpConnectivity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance */ - StaticIpConnectivity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @static + * @param {google.cloud.clouddms.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); }; /** - * Decodes a StaticIpConnectivity message from the specified reader or buffer. + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.clouddms.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @static + * @param {google.cloud.clouddms.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @static + * @param {google.cloud.clouddms.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @memberof google.cloud.clouddms.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.clouddms.v1.StaticIpConnectivity} StaticIpConnectivity + * @returns {google.cloud.clouddms.v1.OperationMetadata} OperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StaticIpConnectivity.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.clouddms.v1.StaticIpConnectivity(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.OperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.createTime = $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.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9140,112 +8248,184 @@ }; /** - * Decodes a StaticIpConnectivity 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.clouddms.v1.StaticIpConnectivity + * @memberof google.cloud.clouddms.v1.OperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.StaticIpConnectivity} StaticIpConnectivity + * @returns {google.cloud.clouddms.v1.OperationMetadata} OperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StaticIpConnectivity.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 StaticIpConnectivity message. + * Verifies an OperationMetadata message. * @function verify - * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @memberof google.cloud.clouddms.v1.OperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StaticIpConnectivity.verify = function verify(message) { + OperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object 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; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; return null; }; /** - * Creates a StaticIpConnectivity 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.clouddms.v1.StaticIpConnectivity + * @memberof google.cloud.clouddms.v1.OperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.StaticIpConnectivity} StaticIpConnectivity + * @returns {google.cloud.clouddms.v1.OperationMetadata} OperationMetadata */ - StaticIpConnectivity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.StaticIpConnectivity) + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.OperationMetadata) return object; - return new $root.google.cloud.clouddms.v1.StaticIpConnectivity(); + var message = new $root.google.cloud.clouddms.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.clouddms.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.clouddms.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; }; /** - * Creates a plain object from a StaticIpConnectivity message. Also converts values to other types if specified. + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @memberof google.cloud.clouddms.v1.OperationMetadata * @static - * @param {google.cloud.clouddms.v1.StaticIpConnectivity} message StaticIpConnectivity + * @param {google.cloud.clouddms.v1.OperationMetadata} message OperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StaticIpConnectivity.toObject = function toObject() { - return {}; + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + 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 (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; }; /** - * Converts this StaticIpConnectivity to JSON. + * Converts this OperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @memberof google.cloud.clouddms.v1.OperationMetadata * @instance * @returns {Object.} JSON object */ - StaticIpConnectivity.prototype.toJSON = function toJSON() { + OperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for StaticIpConnectivity + * Gets the default type url for OperationMetadata * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @memberof google.cloud.clouddms.v1.OperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - StaticIpConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.StaticIpConnectivity"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.OperationMetadata"; }; - return StaticIpConnectivity; + return OperationMetadata; })(); - v1.ReverseSshConnectivity = (function() { + v1.ListConversionWorkspacesRequest = (function() { /** - * Properties of a ReverseSshConnectivity. + * Properties of a ListConversionWorkspacesRequest. * @memberof google.cloud.clouddms.v1 - * @interface IReverseSshConnectivity - * @property {string|null} [vmIp] ReverseSshConnectivity vmIp - * @property {number|null} [vmPort] ReverseSshConnectivity vmPort - * @property {string|null} [vm] ReverseSshConnectivity vm - * @property {string|null} [vpc] ReverseSshConnectivity vpc + * @interface IListConversionWorkspacesRequest + * @property {string|null} [parent] ListConversionWorkspacesRequest parent + * @property {number|null} [pageSize] ListConversionWorkspacesRequest pageSize + * @property {string|null} [pageToken] ListConversionWorkspacesRequest pageToken + * @property {string|null} [filter] ListConversionWorkspacesRequest filter */ /** - * Constructs a new ReverseSshConnectivity. + * Constructs a new ListConversionWorkspacesRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a ReverseSshConnectivity. - * @implements IReverseSshConnectivity + * @classdesc Represents a ListConversionWorkspacesRequest. + * @implements IListConversionWorkspacesRequest * @constructor - * @param {google.cloud.clouddms.v1.IReverseSshConnectivity=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IListConversionWorkspacesRequest=} [properties] Properties to set */ - function ReverseSshConnectivity(properties) { + function ListConversionWorkspacesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9253,117 +8433,117 @@ } /** - * ReverseSshConnectivity vmIp. - * @member {string} vmIp - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * ListConversionWorkspacesRequest parent. + * @member {string} parent + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @instance */ - ReverseSshConnectivity.prototype.vmIp = ""; + ListConversionWorkspacesRequest.prototype.parent = ""; /** - * ReverseSshConnectivity vmPort. - * @member {number} vmPort - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * ListConversionWorkspacesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @instance */ - ReverseSshConnectivity.prototype.vmPort = 0; + ListConversionWorkspacesRequest.prototype.pageSize = 0; /** - * ReverseSshConnectivity vm. - * @member {string} vm - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * ListConversionWorkspacesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @instance */ - ReverseSshConnectivity.prototype.vm = ""; + ListConversionWorkspacesRequest.prototype.pageToken = ""; /** - * ReverseSshConnectivity vpc. - * @member {string} vpc - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * ListConversionWorkspacesRequest filter. + * @member {string} filter + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @instance */ - ReverseSshConnectivity.prototype.vpc = ""; + ListConversionWorkspacesRequest.prototype.filter = ""; /** - * Creates a new ReverseSshConnectivity instance using the specified properties. + * Creates a new ListConversionWorkspacesRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @static - * @param {google.cloud.clouddms.v1.IReverseSshConnectivity=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.ReverseSshConnectivity} ReverseSshConnectivity instance + * @param {google.cloud.clouddms.v1.IListConversionWorkspacesRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ListConversionWorkspacesRequest} ListConversionWorkspacesRequest instance */ - ReverseSshConnectivity.create = function create(properties) { - return new ReverseSshConnectivity(properties); + ListConversionWorkspacesRequest.create = function create(properties) { + return new ListConversionWorkspacesRequest(properties); }; /** - * Encodes the specified ReverseSshConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.ReverseSshConnectivity.verify|verify} messages. + * Encodes the specified ListConversionWorkspacesRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ListConversionWorkspacesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @static - * @param {google.cloud.clouddms.v1.IReverseSshConnectivity} message ReverseSshConnectivity message or plain object to encode + * @param {google.cloud.clouddms.v1.IListConversionWorkspacesRequest} message ListConversionWorkspacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReverseSshConnectivity.encode = function encode(message, writer) { + ListConversionWorkspacesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.vmIp != null && Object.hasOwnProperty.call(message, "vmIp")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmIp); - if (message.vmPort != null && Object.hasOwnProperty.call(message, "vmPort")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.vmPort); - if (message.vm != null && Object.hasOwnProperty.call(message, "vm")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.vm); - if (message.vpc != null && Object.hasOwnProperty.call(message, "vpc")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.vpc); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); return writer; }; /** - * Encodes the specified ReverseSshConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ReverseSshConnectivity.verify|verify} messages. + * Encodes the specified ListConversionWorkspacesRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListConversionWorkspacesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @static - * @param {google.cloud.clouddms.v1.IReverseSshConnectivity} message ReverseSshConnectivity message or plain object to encode + * @param {google.cloud.clouddms.v1.IListConversionWorkspacesRequest} message ListConversionWorkspacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReverseSshConnectivity.encodeDelimited = function encodeDelimited(message, writer) { + ListConversionWorkspacesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReverseSshConnectivity message from the specified reader or buffer. + * Decodes a ListConversionWorkspacesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.ReverseSshConnectivity} ReverseSshConnectivity + * @returns {google.cloud.clouddms.v1.ListConversionWorkspacesRequest} ListConversionWorkspacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReverseSshConnectivity.decode = function decode(reader, length) { + ListConversionWorkspacesRequest.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.clouddms.v1.ReverseSshConnectivity(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ListConversionWorkspacesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.vmIp = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.vmPort = reader.int32(); + message.pageSize = reader.int32(); break; } case 3: { - message.vm = reader.string(); + message.pageToken = reader.string(); break; } case 4: { - message.vpc = reader.string(); + message.filter = reader.string(); break; } default: @@ -9375,147 +8555,151 @@ }; /** - * Decodes a ReverseSshConnectivity message from the specified reader or buffer, length delimited. + * Decodes a ListConversionWorkspacesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.ReverseSshConnectivity} ReverseSshConnectivity + * @returns {google.cloud.clouddms.v1.ListConversionWorkspacesRequest} ListConversionWorkspacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReverseSshConnectivity.decodeDelimited = function decodeDelimited(reader) { + ListConversionWorkspacesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReverseSshConnectivity message. + * Verifies a ListConversionWorkspacesRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReverseSshConnectivity.verify = function verify(message) { + ListConversionWorkspacesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.vmIp != null && message.hasOwnProperty("vmIp")) - if (!$util.isString(message.vmIp)) - return "vmIp: string expected"; - if (message.vmPort != null && message.hasOwnProperty("vmPort")) - if (!$util.isInteger(message.vmPort)) - return "vmPort: integer expected"; - if (message.vm != null && message.hasOwnProperty("vm")) - if (!$util.isString(message.vm)) - return "vm: string expected"; - if (message.vpc != null && message.hasOwnProperty("vpc")) - if (!$util.isString(message.vpc)) - return "vpc: 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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; return null; }; /** - * Creates a ReverseSshConnectivity message from a plain object. Also converts values to their respective internal types. + * Creates a ListConversionWorkspacesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.ReverseSshConnectivity} ReverseSshConnectivity + * @returns {google.cloud.clouddms.v1.ListConversionWorkspacesRequest} ListConversionWorkspacesRequest */ - ReverseSshConnectivity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.ReverseSshConnectivity) + ListConversionWorkspacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ListConversionWorkspacesRequest) return object; - var message = new $root.google.cloud.clouddms.v1.ReverseSshConnectivity(); - if (object.vmIp != null) - message.vmIp = String(object.vmIp); - if (object.vmPort != null) - message.vmPort = object.vmPort | 0; - if (object.vm != null) - message.vm = String(object.vm); - if (object.vpc != null) - message.vpc = String(object.vpc); + var message = new $root.google.cloud.clouddms.v1.ListConversionWorkspacesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); return message; }; /** - * Creates a plain object from a ReverseSshConnectivity message. Also converts values to other types if specified. + * Creates a plain object from a ListConversionWorkspacesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @static - * @param {google.cloud.clouddms.v1.ReverseSshConnectivity} message ReverseSshConnectivity + * @param {google.cloud.clouddms.v1.ListConversionWorkspacesRequest} message ListConversionWorkspacesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReverseSshConnectivity.toObject = function toObject(message, options) { + ListConversionWorkspacesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.vmIp = ""; - object.vmPort = 0; - object.vm = ""; - object.vpc = ""; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; } - if (message.vmIp != null && message.hasOwnProperty("vmIp")) - object.vmIp = message.vmIp; - if (message.vmPort != null && message.hasOwnProperty("vmPort")) - object.vmPort = message.vmPort; - if (message.vm != null && message.hasOwnProperty("vm")) - object.vm = message.vm; - if (message.vpc != null && message.hasOwnProperty("vpc")) - object.vpc = message.vpc; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; return object; }; /** - * Converts this ReverseSshConnectivity to JSON. + * Converts this ListConversionWorkspacesRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @instance * @returns {Object.} JSON object */ - ReverseSshConnectivity.prototype.toJSON = function toJSON() { + ListConversionWorkspacesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReverseSshConnectivity + * Gets the default type url for ListConversionWorkspacesRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReverseSshConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListConversionWorkspacesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.ReverseSshConnectivity"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.ListConversionWorkspacesRequest"; }; - return ReverseSshConnectivity; + return ListConversionWorkspacesRequest; })(); - v1.VpcPeeringConnectivity = (function() { + v1.ListConversionWorkspacesResponse = (function() { /** - * Properties of a VpcPeeringConnectivity. + * Properties of a ListConversionWorkspacesResponse. * @memberof google.cloud.clouddms.v1 - * @interface IVpcPeeringConnectivity - * @property {string|null} [vpc] VpcPeeringConnectivity vpc + * @interface IListConversionWorkspacesResponse + * @property {Array.|null} [conversionWorkspaces] ListConversionWorkspacesResponse conversionWorkspaces + * @property {string|null} [nextPageToken] ListConversionWorkspacesResponse nextPageToken + * @property {Array.|null} [unreachable] ListConversionWorkspacesResponse unreachable */ /** - * Constructs a new VpcPeeringConnectivity. + * Constructs a new ListConversionWorkspacesResponse. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a VpcPeeringConnectivity. - * @implements IVpcPeeringConnectivity + * @classdesc Represents a ListConversionWorkspacesResponse. + * @implements IListConversionWorkspacesResponse * @constructor - * @param {google.cloud.clouddms.v1.IVpcPeeringConnectivity=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IListConversionWorkspacesResponse=} [properties] Properties to set */ - function VpcPeeringConnectivity(properties) { + function ListConversionWorkspacesResponse(properties) { + this.conversionWorkspaces = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9523,75 +8707,109 @@ } /** - * VpcPeeringConnectivity vpc. - * @member {string} vpc - * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * ListConversionWorkspacesResponse conversionWorkspaces. + * @member {Array.} conversionWorkspaces + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse * @instance */ - VpcPeeringConnectivity.prototype.vpc = ""; + ListConversionWorkspacesResponse.prototype.conversionWorkspaces = $util.emptyArray; /** - * Creates a new VpcPeeringConnectivity instance using the specified properties. + * ListConversionWorkspacesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse + * @instance + */ + ListConversionWorkspacesResponse.prototype.nextPageToken = ""; + + /** + * ListConversionWorkspacesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse + * @instance + */ + ListConversionWorkspacesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListConversionWorkspacesResponse instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse * @static - * @param {google.cloud.clouddms.v1.IVpcPeeringConnectivity=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.VpcPeeringConnectivity} VpcPeeringConnectivity instance + * @param {google.cloud.clouddms.v1.IListConversionWorkspacesResponse=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ListConversionWorkspacesResponse} ListConversionWorkspacesResponse instance */ - VpcPeeringConnectivity.create = function create(properties) { - return new VpcPeeringConnectivity(properties); + ListConversionWorkspacesResponse.create = function create(properties) { + return new ListConversionWorkspacesResponse(properties); }; /** - * Encodes the specified VpcPeeringConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConnectivity.verify|verify} messages. + * Encodes the specified ListConversionWorkspacesResponse message. Does not implicitly {@link google.cloud.clouddms.v1.ListConversionWorkspacesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse * @static - * @param {google.cloud.clouddms.v1.IVpcPeeringConnectivity} message VpcPeeringConnectivity message or plain object to encode + * @param {google.cloud.clouddms.v1.IListConversionWorkspacesResponse} message ListConversionWorkspacesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VpcPeeringConnectivity.encode = function encode(message, writer) { + ListConversionWorkspacesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.vpc != null && Object.hasOwnProperty.call(message, "vpc")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.vpc); + if (message.conversionWorkspaces != null && message.conversionWorkspaces.length) + for (var i = 0; i < message.conversionWorkspaces.length; ++i) + $root.google.cloud.clouddms.v1.ConversionWorkspace.encode(message.conversionWorkspaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified VpcPeeringConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConnectivity.verify|verify} messages. + * Encodes the specified ListConversionWorkspacesResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListConversionWorkspacesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse * @static - * @param {google.cloud.clouddms.v1.IVpcPeeringConnectivity} message VpcPeeringConnectivity message or plain object to encode + * @param {google.cloud.clouddms.v1.IListConversionWorkspacesResponse} message ListConversionWorkspacesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VpcPeeringConnectivity.encodeDelimited = function encodeDelimited(message, writer) { + ListConversionWorkspacesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VpcPeeringConnectivity message from the specified reader or buffer. + * Decodes a ListConversionWorkspacesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.VpcPeeringConnectivity} VpcPeeringConnectivity + * @returns {google.cloud.clouddms.v1.ListConversionWorkspacesResponse} ListConversionWorkspacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VpcPeeringConnectivity.decode = function decode(reader, length) { + ListConversionWorkspacesResponse.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.clouddms.v1.VpcPeeringConnectivity(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ListConversionWorkspacesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.vpc = reader.string(); + if (!(message.conversionWorkspaces && message.conversionWorkspaces.length)) + message.conversionWorkspaces = []; + message.conversionWorkspaces.push($root.google.cloud.clouddms.v1.ConversionWorkspace.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -9603,123 +8821,169 @@ }; /** - * Decodes a VpcPeeringConnectivity message from the specified reader or buffer, length delimited. + * Decodes a ListConversionWorkspacesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.VpcPeeringConnectivity} VpcPeeringConnectivity + * @returns {google.cloud.clouddms.v1.ListConversionWorkspacesResponse} ListConversionWorkspacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VpcPeeringConnectivity.decodeDelimited = function decodeDelimited(reader) { + ListConversionWorkspacesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VpcPeeringConnectivity message. + * Verifies a ListConversionWorkspacesResponse message. * @function verify - * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VpcPeeringConnectivity.verify = function verify(message) { + ListConversionWorkspacesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.vpc != null && message.hasOwnProperty("vpc")) - if (!$util.isString(message.vpc)) - return "vpc: string expected"; + if (message.conversionWorkspaces != null && message.hasOwnProperty("conversionWorkspaces")) { + if (!Array.isArray(message.conversionWorkspaces)) + return "conversionWorkspaces: array expected"; + for (var i = 0; i < message.conversionWorkspaces.length; ++i) { + var error = $root.google.cloud.clouddms.v1.ConversionWorkspace.verify(message.conversionWorkspaces[i]); + if (error) + return "conversionWorkspaces." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } return null; }; /** - * Creates a VpcPeeringConnectivity message from a plain object. Also converts values to their respective internal types. + * Creates a ListConversionWorkspacesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.VpcPeeringConnectivity} VpcPeeringConnectivity + * @returns {google.cloud.clouddms.v1.ListConversionWorkspacesResponse} ListConversionWorkspacesResponse */ - VpcPeeringConnectivity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.VpcPeeringConnectivity) + ListConversionWorkspacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ListConversionWorkspacesResponse) return object; - var message = new $root.google.cloud.clouddms.v1.VpcPeeringConnectivity(); - if (object.vpc != null) - message.vpc = String(object.vpc); - return message; - }; - - /** - * Creates a plain object from a VpcPeeringConnectivity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity - * @static - * @param {google.cloud.clouddms.v1.VpcPeeringConnectivity} message VpcPeeringConnectivity + var message = new $root.google.cloud.clouddms.v1.ListConversionWorkspacesResponse(); + if (object.conversionWorkspaces) { + if (!Array.isArray(object.conversionWorkspaces)) + throw TypeError(".google.cloud.clouddms.v1.ListConversionWorkspacesResponse.conversionWorkspaces: array expected"); + message.conversionWorkspaces = []; + for (var i = 0; i < object.conversionWorkspaces.length; ++i) { + if (typeof object.conversionWorkspaces[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.ListConversionWorkspacesResponse.conversionWorkspaces: object expected"); + message.conversionWorkspaces[i] = $root.google.cloud.clouddms.v1.ConversionWorkspace.fromObject(object.conversionWorkspaces[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.clouddms.v1.ListConversionWorkspacesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListConversionWorkspacesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse + * @static + * @param {google.cloud.clouddms.v1.ListConversionWorkspacesResponse} message ListConversionWorkspacesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VpcPeeringConnectivity.toObject = function toObject(message, options) { + ListConversionWorkspacesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.conversionWorkspaces = []; + object.unreachable = []; + } if (options.defaults) - object.vpc = ""; - if (message.vpc != null && message.hasOwnProperty("vpc")) - object.vpc = message.vpc; + object.nextPageToken = ""; + if (message.conversionWorkspaces && message.conversionWorkspaces.length) { + object.conversionWorkspaces = []; + for (var j = 0; j < message.conversionWorkspaces.length; ++j) + object.conversionWorkspaces[j] = $root.google.cloud.clouddms.v1.ConversionWorkspace.toObject(message.conversionWorkspaces[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } return object; }; /** - * Converts this VpcPeeringConnectivity to JSON. + * Converts this ListConversionWorkspacesResponse to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse * @instance * @returns {Object.} JSON object */ - VpcPeeringConnectivity.prototype.toJSON = function toJSON() { + ListConversionWorkspacesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VpcPeeringConnectivity + * Gets the default type url for ListConversionWorkspacesResponse * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @memberof google.cloud.clouddms.v1.ListConversionWorkspacesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VpcPeeringConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListConversionWorkspacesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.VpcPeeringConnectivity"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.ListConversionWorkspacesResponse"; }; - return VpcPeeringConnectivity; + return ListConversionWorkspacesResponse; })(); - v1.DatabaseType = (function() { + v1.GetConversionWorkspaceRequest = (function() { /** - * Properties of a DatabaseType. + * Properties of a GetConversionWorkspaceRequest. * @memberof google.cloud.clouddms.v1 - * @interface IDatabaseType - * @property {google.cloud.clouddms.v1.DatabaseProvider|null} [provider] DatabaseType provider - * @property {google.cloud.clouddms.v1.DatabaseEngine|null} [engine] DatabaseType engine + * @interface IGetConversionWorkspaceRequest + * @property {string|null} [name] GetConversionWorkspaceRequest name */ /** - * Constructs a new DatabaseType. + * Constructs a new GetConversionWorkspaceRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a DatabaseType. - * @implements IDatabaseType + * @classdesc Represents a GetConversionWorkspaceRequest. + * @implements IGetConversionWorkspaceRequest * @constructor - * @param {google.cloud.clouddms.v1.IDatabaseType=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IGetConversionWorkspaceRequest=} [properties] Properties to set */ - function DatabaseType(properties) { + function GetConversionWorkspaceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9727,89 +8991,75 @@ } /** - * DatabaseType provider. - * @member {google.cloud.clouddms.v1.DatabaseProvider} provider - * @memberof google.cloud.clouddms.v1.DatabaseType - * @instance - */ - DatabaseType.prototype.provider = 0; - - /** - * DatabaseType engine. - * @member {google.cloud.clouddms.v1.DatabaseEngine} engine - * @memberof google.cloud.clouddms.v1.DatabaseType + * GetConversionWorkspaceRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.GetConversionWorkspaceRequest * @instance */ - DatabaseType.prototype.engine = 0; + GetConversionWorkspaceRequest.prototype.name = ""; /** - * Creates a new DatabaseType instance using the specified properties. + * Creates a new GetConversionWorkspaceRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.DatabaseType + * @memberof google.cloud.clouddms.v1.GetConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.IDatabaseType=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.DatabaseType} DatabaseType instance + * @param {google.cloud.clouddms.v1.IGetConversionWorkspaceRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.GetConversionWorkspaceRequest} GetConversionWorkspaceRequest instance */ - DatabaseType.create = function create(properties) { - return new DatabaseType(properties); + GetConversionWorkspaceRequest.create = function create(properties) { + return new GetConversionWorkspaceRequest(properties); }; /** - * Encodes the specified DatabaseType message. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseType.verify|verify} messages. + * Encodes the specified GetConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GetConversionWorkspaceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.DatabaseType + * @memberof google.cloud.clouddms.v1.GetConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.IDatabaseType} message DatabaseType message or plain object to encode + * @param {google.cloud.clouddms.v1.IGetConversionWorkspaceRequest} message GetConversionWorkspaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseType.encode = function encode(message, writer) { + GetConversionWorkspaceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.provider != null && Object.hasOwnProperty.call(message, "provider")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.provider); - if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.engine); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified DatabaseType message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseType.verify|verify} messages. + * Encodes the specified GetConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GetConversionWorkspaceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.DatabaseType + * @memberof google.cloud.clouddms.v1.GetConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.IDatabaseType} message DatabaseType message or plain object to encode + * @param {google.cloud.clouddms.v1.IGetConversionWorkspaceRequest} message GetConversionWorkspaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseType.encodeDelimited = function encodeDelimited(message, writer) { + GetConversionWorkspaceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DatabaseType message from the specified reader or buffer. + * Decodes a GetConversionWorkspaceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.DatabaseType + * @memberof google.cloud.clouddms.v1.GetConversionWorkspaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.DatabaseType} DatabaseType + * @returns {google.cloud.clouddms.v1.GetConversionWorkspaceRequest} GetConversionWorkspaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DatabaseType.decode = function decode(reader, length) { + GetConversionWorkspaceRequest.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.clouddms.v1.DatabaseType(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.GetConversionWorkspaceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.provider = reader.int32(); - break; - } - case 2: { - message.engine = reader.int32(); + message.name = reader.string(); break; } default: @@ -9821,198 +9071,125 @@ }; /** - * Decodes a DatabaseType message from the specified reader or buffer, length delimited. + * Decodes a GetConversionWorkspaceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.DatabaseType + * @memberof google.cloud.clouddms.v1.GetConversionWorkspaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.DatabaseType} DatabaseType + * @returns {google.cloud.clouddms.v1.GetConversionWorkspaceRequest} GetConversionWorkspaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DatabaseType.decodeDelimited = function decodeDelimited(reader) { + GetConversionWorkspaceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DatabaseType message. + * Verifies a GetConversionWorkspaceRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.DatabaseType + * @memberof google.cloud.clouddms.v1.GetConversionWorkspaceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DatabaseType.verify = function verify(message) { + GetConversionWorkspaceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.provider != null && message.hasOwnProperty("provider")) - switch (message.provider) { - default: - return "provider: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.engine != null && message.hasOwnProperty("engine")) - switch (message.engine) { - default: - return "engine: enum value expected"; - case 0: - case 1: - case 2: - break; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a DatabaseType message from a plain object. Also converts values to their respective internal types. + * Creates a GetConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.DatabaseType + * @memberof google.cloud.clouddms.v1.GetConversionWorkspaceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.DatabaseType} DatabaseType + * @returns {google.cloud.clouddms.v1.GetConversionWorkspaceRequest} GetConversionWorkspaceRequest */ - DatabaseType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.DatabaseType) + GetConversionWorkspaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.GetConversionWorkspaceRequest) return object; - var message = new $root.google.cloud.clouddms.v1.DatabaseType(); - switch (object.provider) { - default: - if (typeof object.provider === "number") { - message.provider = object.provider; - break; - } - break; - case "DATABASE_PROVIDER_UNSPECIFIED": - case 0: - message.provider = 0; - break; - case "CLOUDSQL": - case 1: - message.provider = 1; - break; - case "RDS": - case 2: - message.provider = 2; - break; - } - switch (object.engine) { - default: - if (typeof object.engine === "number") { - message.engine = object.engine; - break; - } - break; - case "DATABASE_ENGINE_UNSPECIFIED": - case 0: - message.engine = 0; - break; - case "MYSQL": - case 1: - message.engine = 1; - break; - case "POSTGRESQL": - case 2: - message.engine = 2; - break; - } + var message = new $root.google.cloud.clouddms.v1.GetConversionWorkspaceRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a DatabaseType message. Also converts values to other types if specified. + * Creates a plain object from a GetConversionWorkspaceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.DatabaseType + * @memberof google.cloud.clouddms.v1.GetConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.DatabaseType} message DatabaseType + * @param {google.cloud.clouddms.v1.GetConversionWorkspaceRequest} message GetConversionWorkspaceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DatabaseType.toObject = function toObject(message, options) { + GetConversionWorkspaceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.provider = options.enums === String ? "DATABASE_PROVIDER_UNSPECIFIED" : 0; - object.engine = options.enums === String ? "DATABASE_ENGINE_UNSPECIFIED" : 0; - } - if (message.provider != null && message.hasOwnProperty("provider")) - object.provider = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseProvider[message.provider] === undefined ? message.provider : $root.google.cloud.clouddms.v1.DatabaseProvider[message.provider] : message.provider; - if (message.engine != null && message.hasOwnProperty("engine")) - object.engine = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseEngine[message.engine] === undefined ? message.engine : $root.google.cloud.clouddms.v1.DatabaseEngine[message.engine] : message.engine; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this DatabaseType to JSON. + * Converts this GetConversionWorkspaceRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.DatabaseType + * @memberof google.cloud.clouddms.v1.GetConversionWorkspaceRequest * @instance * @returns {Object.} JSON object */ - DatabaseType.prototype.toJSON = function toJSON() { + GetConversionWorkspaceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DatabaseType + * Gets the default type url for GetConversionWorkspaceRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.DatabaseType + * @memberof google.cloud.clouddms.v1.GetConversionWorkspaceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DatabaseType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetConversionWorkspaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.DatabaseType"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.GetConversionWorkspaceRequest"; }; - return DatabaseType; + return GetConversionWorkspaceRequest; })(); - v1.MigrationJob = (function() { + v1.CreateConversionWorkspaceRequest = (function() { /** - * Properties of a MigrationJob. + * Properties of a CreateConversionWorkspaceRequest. * @memberof google.cloud.clouddms.v1 - * @interface IMigrationJob - * @property {string|null} [name] MigrationJob name - * @property {google.protobuf.ITimestamp|null} [createTime] MigrationJob createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] MigrationJob updateTime - * @property {Object.|null} [labels] MigrationJob labels - * @property {string|null} [displayName] MigrationJob displayName - * @property {google.cloud.clouddms.v1.MigrationJob.State|null} [state] MigrationJob state - * @property {google.cloud.clouddms.v1.MigrationJob.Phase|null} [phase] MigrationJob phase - * @property {google.cloud.clouddms.v1.MigrationJob.Type|null} [type] MigrationJob type - * @property {string|null} [dumpPath] MigrationJob dumpPath - * @property {string|null} [source] MigrationJob source - * @property {string|null} [destination] MigrationJob destination - * @property {google.cloud.clouddms.v1.IReverseSshConnectivity|null} [reverseSshConnectivity] MigrationJob reverseSshConnectivity - * @property {google.cloud.clouddms.v1.IVpcPeeringConnectivity|null} [vpcPeeringConnectivity] MigrationJob vpcPeeringConnectivity - * @property {google.cloud.clouddms.v1.IStaticIpConnectivity|null} [staticIpConnectivity] MigrationJob staticIpConnectivity - * @property {google.protobuf.IDuration|null} [duration] MigrationJob duration - * @property {google.rpc.IStatus|null} [error] MigrationJob error - * @property {google.cloud.clouddms.v1.IDatabaseType|null} [sourceDatabase] MigrationJob sourceDatabase - * @property {google.cloud.clouddms.v1.IDatabaseType|null} [destinationDatabase] MigrationJob destinationDatabase - * @property {google.protobuf.ITimestamp|null} [endTime] MigrationJob endTime + * @interface ICreateConversionWorkspaceRequest + * @property {string|null} [parent] CreateConversionWorkspaceRequest parent + * @property {string|null} [conversionWorkspaceId] CreateConversionWorkspaceRequest conversionWorkspaceId + * @property {google.cloud.clouddms.v1.IConversionWorkspace|null} [conversionWorkspace] CreateConversionWorkspaceRequest conversionWorkspace + * @property {string|null} [requestId] CreateConversionWorkspaceRequest requestId */ /** - * Constructs a new MigrationJob. + * Constructs a new CreateConversionWorkspaceRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a MigrationJob. - * @implements IMigrationJob + * @classdesc Represents a CreateConversionWorkspaceRequest. + * @implements ICreateConversionWorkspaceRequest * @constructor - * @param {google.cloud.clouddms.v1.IMigrationJob=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest=} [properties] Properties to set */ - function MigrationJob(properties) { - this.labels = {}; + function CreateConversionWorkspaceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10020,361 +9197,380 @@ } /** - * MigrationJob name. - * @member {string} name - * @memberof google.cloud.clouddms.v1.MigrationJob + * CreateConversionWorkspaceRequest parent. + * @member {string} parent + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest * @instance */ - MigrationJob.prototype.name = ""; + CreateConversionWorkspaceRequest.prototype.parent = ""; /** - * MigrationJob createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.clouddms.v1.MigrationJob + * CreateConversionWorkspaceRequest conversionWorkspaceId. + * @member {string} conversionWorkspaceId + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest * @instance */ - MigrationJob.prototype.createTime = null; + CreateConversionWorkspaceRequest.prototype.conversionWorkspaceId = ""; /** - * MigrationJob updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.clouddms.v1.MigrationJob + * CreateConversionWorkspaceRequest conversionWorkspace. + * @member {google.cloud.clouddms.v1.IConversionWorkspace|null|undefined} conversionWorkspace + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest * @instance */ - MigrationJob.prototype.updateTime = null; + CreateConversionWorkspaceRequest.prototype.conversionWorkspace = null; /** - * MigrationJob labels. - * @member {Object.} labels - * @memberof google.cloud.clouddms.v1.MigrationJob + * CreateConversionWorkspaceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest * @instance */ - MigrationJob.prototype.labels = $util.emptyObject; + CreateConversionWorkspaceRequest.prototype.requestId = ""; /** - * MigrationJob displayName. - * @member {string} displayName - * @memberof google.cloud.clouddms.v1.MigrationJob - * @instance + * Creates a new CreateConversionWorkspaceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.CreateConversionWorkspaceRequest} CreateConversionWorkspaceRequest instance */ - MigrationJob.prototype.displayName = ""; + CreateConversionWorkspaceRequest.create = function create(properties) { + return new CreateConversionWorkspaceRequest(properties); + }; /** - * MigrationJob state. - * @member {google.cloud.clouddms.v1.MigrationJob.State} state - * @memberof google.cloud.clouddms.v1.MigrationJob - * @instance - */ - MigrationJob.prototype.state = 0; - - /** - * MigrationJob phase. - * @member {google.cloud.clouddms.v1.MigrationJob.Phase} phase - * @memberof google.cloud.clouddms.v1.MigrationJob - * @instance + * Encodes the specified CreateConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CreateConversionWorkspaceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest} message CreateConversionWorkspaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - MigrationJob.prototype.phase = 0; + CreateConversionWorkspaceRequest.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.conversionWorkspaceId != null && Object.hasOwnProperty.call(message, "conversionWorkspaceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.conversionWorkspaceId); + if (message.conversionWorkspace != null && Object.hasOwnProperty.call(message, "conversionWorkspace")) + $root.google.cloud.clouddms.v1.ConversionWorkspace.encode(message.conversionWorkspace, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; /** - * MigrationJob type. - * @member {google.cloud.clouddms.v1.MigrationJob.Type} type - * @memberof google.cloud.clouddms.v1.MigrationJob - * @instance + * Encodes the specified CreateConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CreateConversionWorkspaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest} message CreateConversionWorkspaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - MigrationJob.prototype.type = 0; + CreateConversionWorkspaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * MigrationJob dumpPath. - * @member {string} dumpPath - * @memberof google.cloud.clouddms.v1.MigrationJob - * @instance + * Decodes a CreateConversionWorkspaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.CreateConversionWorkspaceRequest} CreateConversionWorkspaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrationJob.prototype.dumpPath = ""; + CreateConversionWorkspaceRequest.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.clouddms.v1.CreateConversionWorkspaceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.conversionWorkspaceId = reader.string(); + break; + } + case 3: { + message.conversionWorkspace = $root.google.cloud.clouddms.v1.ConversionWorkspace.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * MigrationJob source. - * @member {string} source - * @memberof google.cloud.clouddms.v1.MigrationJob - * @instance + * Decodes a CreateConversionWorkspaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.CreateConversionWorkspaceRequest} CreateConversionWorkspaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrationJob.prototype.source = ""; + CreateConversionWorkspaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * MigrationJob destination. - * @member {string} destination - * @memberof google.cloud.clouddms.v1.MigrationJob - * @instance + * Verifies a CreateConversionWorkspaceRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigrationJob.prototype.destination = ""; + CreateConversionWorkspaceRequest.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.conversionWorkspaceId != null && message.hasOwnProperty("conversionWorkspaceId")) + if (!$util.isString(message.conversionWorkspaceId)) + return "conversionWorkspaceId: string expected"; + if (message.conversionWorkspace != null && message.hasOwnProperty("conversionWorkspace")) { + var error = $root.google.cloud.clouddms.v1.ConversionWorkspace.verify(message.conversionWorkspace); + if (error) + return "conversionWorkspace." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; /** - * MigrationJob reverseSshConnectivity. - * @member {google.cloud.clouddms.v1.IReverseSshConnectivity|null|undefined} reverseSshConnectivity - * @memberof google.cloud.clouddms.v1.MigrationJob - * @instance + * Creates a CreateConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.CreateConversionWorkspaceRequest} CreateConversionWorkspaceRequest */ - MigrationJob.prototype.reverseSshConnectivity = null; + CreateConversionWorkspaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.conversionWorkspaceId != null) + message.conversionWorkspaceId = String(object.conversionWorkspaceId); + if (object.conversionWorkspace != null) { + if (typeof object.conversionWorkspace !== "object") + throw TypeError(".google.cloud.clouddms.v1.CreateConversionWorkspaceRequest.conversionWorkspace: object expected"); + message.conversionWorkspace = $root.google.cloud.clouddms.v1.ConversionWorkspace.fromObject(object.conversionWorkspace); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; /** - * MigrationJob vpcPeeringConnectivity. - * @member {google.cloud.clouddms.v1.IVpcPeeringConnectivity|null|undefined} vpcPeeringConnectivity - * @memberof google.cloud.clouddms.v1.MigrationJob - * @instance + * Creates a plain object from a CreateConversionWorkspaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.CreateConversionWorkspaceRequest} message CreateConversionWorkspaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - MigrationJob.prototype.vpcPeeringConnectivity = null; + CreateConversionWorkspaceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.conversionWorkspaceId = ""; + object.conversionWorkspace = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.conversionWorkspaceId != null && message.hasOwnProperty("conversionWorkspaceId")) + object.conversionWorkspaceId = message.conversionWorkspaceId; + if (message.conversionWorkspace != null && message.hasOwnProperty("conversionWorkspace")) + object.conversionWorkspace = $root.google.cloud.clouddms.v1.ConversionWorkspace.toObject(message.conversionWorkspace, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; /** - * MigrationJob staticIpConnectivity. - * @member {google.cloud.clouddms.v1.IStaticIpConnectivity|null|undefined} staticIpConnectivity - * @memberof google.cloud.clouddms.v1.MigrationJob + * Converts this CreateConversionWorkspaceRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest * @instance + * @returns {Object.} JSON object */ - MigrationJob.prototype.staticIpConnectivity = null; + CreateConversionWorkspaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * MigrationJob duration. - * @member {google.protobuf.IDuration|null|undefined} duration - * @memberof google.cloud.clouddms.v1.MigrationJob - * @instance + * Gets the default type url for CreateConversionWorkspaceRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.CreateConversionWorkspaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - MigrationJob.prototype.duration = null; + CreateConversionWorkspaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.CreateConversionWorkspaceRequest"; + }; + + return CreateConversionWorkspaceRequest; + })(); + + v1.UpdateConversionWorkspaceRequest = (function() { /** - * MigrationJob error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.clouddms.v1.MigrationJob - * @instance + * Properties of an UpdateConversionWorkspaceRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IUpdateConversionWorkspaceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateConversionWorkspaceRequest updateMask + * @property {google.cloud.clouddms.v1.IConversionWorkspace|null} [conversionWorkspace] UpdateConversionWorkspaceRequest conversionWorkspace + * @property {string|null} [requestId] UpdateConversionWorkspaceRequest requestId */ - MigrationJob.prototype.error = null; /** - * MigrationJob sourceDatabase. - * @member {google.cloud.clouddms.v1.IDatabaseType|null|undefined} sourceDatabase - * @memberof google.cloud.clouddms.v1.MigrationJob - * @instance + * Constructs a new UpdateConversionWorkspaceRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents an UpdateConversionWorkspaceRequest. + * @implements IUpdateConversionWorkspaceRequest + * @constructor + * @param {google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest=} [properties] Properties to set */ - MigrationJob.prototype.sourceDatabase = null; + function UpdateConversionWorkspaceRequest(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]]; + } /** - * MigrationJob destinationDatabase. - * @member {google.cloud.clouddms.v1.IDatabaseType|null|undefined} destinationDatabase - * @memberof google.cloud.clouddms.v1.MigrationJob + * UpdateConversionWorkspaceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @instance */ - MigrationJob.prototype.destinationDatabase = null; + UpdateConversionWorkspaceRequest.prototype.updateMask = null; /** - * MigrationJob endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.clouddms.v1.MigrationJob + * UpdateConversionWorkspaceRequest conversionWorkspace. + * @member {google.cloud.clouddms.v1.IConversionWorkspace|null|undefined} conversionWorkspace + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @instance */ - MigrationJob.prototype.endTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + UpdateConversionWorkspaceRequest.prototype.conversionWorkspace = null; /** - * MigrationJob connectivity. - * @member {"reverseSshConnectivity"|"vpcPeeringConnectivity"|"staticIpConnectivity"|undefined} connectivity - * @memberof google.cloud.clouddms.v1.MigrationJob + * UpdateConversionWorkspaceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @instance */ - Object.defineProperty(MigrationJob.prototype, "connectivity", { - get: $util.oneOfGetter($oneOfFields = ["reverseSshConnectivity", "vpcPeeringConnectivity", "staticIpConnectivity"]), - set: $util.oneOfSetter($oneOfFields) - }); + UpdateConversionWorkspaceRequest.prototype.requestId = ""; /** - * Creates a new MigrationJob instance using the specified properties. + * Creates a new UpdateConversionWorkspaceRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.MigrationJob + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.IMigrationJob=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.MigrationJob} MigrationJob instance + * @param {google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest} UpdateConversionWorkspaceRequest instance */ - MigrationJob.create = function create(properties) { - return new MigrationJob(properties); + UpdateConversionWorkspaceRequest.create = function create(properties) { + return new UpdateConversionWorkspaceRequest(properties); }; /** - * Encodes the specified MigrationJob message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.verify|verify} messages. + * Encodes the specified UpdateConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.MigrationJob + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.IMigrationJob} message MigrationJob message or plain object to encode + * @param {google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest} message UpdateConversionWorkspaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrationJob.encode = function encode(message, writer) { + UpdateConversionWorkspaceRequest.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).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 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.phase != null && Object.hasOwnProperty.call(message, "phase")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.phase); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); - if (message.dumpPath != null && Object.hasOwnProperty.call(message, "dumpPath")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.dumpPath); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.source); - if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.destination); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.sourceDatabase != null && Object.hasOwnProperty.call(message, "sourceDatabase")) - $root.google.cloud.clouddms.v1.DatabaseType.encode(message.sourceDatabase, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.destinationDatabase != null && Object.hasOwnProperty.call(message, "destinationDatabase")) - $root.google.cloud.clouddms.v1.DatabaseType.encode(message.destinationDatabase, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.reverseSshConnectivity != null && Object.hasOwnProperty.call(message, "reverseSshConnectivity")) - $root.google.cloud.clouddms.v1.ReverseSshConnectivity.encode(message.reverseSshConnectivity, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); - if (message.vpcPeeringConnectivity != null && Object.hasOwnProperty.call(message, "vpcPeeringConnectivity")) - $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.encode(message.vpcPeeringConnectivity, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); - if (message.staticIpConnectivity != null && Object.hasOwnProperty.call(message, "staticIpConnectivity")) - $root.google.cloud.clouddms.v1.StaticIpConnectivity.encode(message.staticIpConnectivity, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.conversionWorkspace != null && Object.hasOwnProperty.call(message, "conversionWorkspace")) + $root.google.cloud.clouddms.v1.ConversionWorkspace.encode(message.conversionWorkspace, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); return writer; }; /** - * Encodes the specified MigrationJob message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.verify|verify} messages. + * Encodes the specified UpdateConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.MigrationJob + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.IMigrationJob} message MigrationJob message or plain object to encode + * @param {google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest} message UpdateConversionWorkspaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrationJob.encodeDelimited = function encodeDelimited(message, writer) { + UpdateConversionWorkspaceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigrationJob message from the specified reader or buffer. + * Decodes an UpdateConversionWorkspaceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.MigrationJob + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.MigrationJob} MigrationJob + * @returns {google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest} UpdateConversionWorkspaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrationJob.decode = function decode(reader, length) { + UpdateConversionWorkspaceRequest.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.clouddms.v1.MigrationJob(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.conversionWorkspace = $root.google.cloud.clouddms.v1.ConversionWorkspace.decode(reader, reader.uint32()); break; } case 3: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - 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; - } - case 5: { - message.displayName = reader.string(); - break; - } - case 6: { - message.state = reader.int32(); - break; - } - case 7: { - message.phase = reader.int32(); - break; - } - case 8: { - message.type = reader.int32(); - break; - } - case 9: { - message.dumpPath = reader.string(); - break; - } - case 10: { - message.source = reader.string(); - break; - } - case 11: { - message.destination = reader.string(); - break; - } - case 101: { - message.reverseSshConnectivity = $root.google.cloud.clouddms.v1.ReverseSshConnectivity.decode(reader, reader.uint32()); - break; - } - case 102: { - message.vpcPeeringConnectivity = $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.decode(reader, reader.uint32()); - break; - } - case 103: { - message.staticIpConnectivity = $root.google.cloud.clouddms.v1.StaticIpConnectivity.decode(reader, reader.uint32()); - break; - } - case 12: { - message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 13: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 14: { - message.sourceDatabase = $root.google.cloud.clouddms.v1.DatabaseType.decode(reader, reader.uint32()); - break; - } - case 15: { - message.destinationDatabase = $root.google.cloud.clouddms.v1.DatabaseType.decode(reader, reader.uint32()); - break; - } - case 16: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.requestId = reader.string(); break; } default: @@ -10386,595 +9582,150 @@ }; /** - * Decodes a MigrationJob message from the specified reader or buffer, length delimited. + * Decodes an UpdateConversionWorkspaceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.MigrationJob + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.MigrationJob} MigrationJob + * @returns {google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest} UpdateConversionWorkspaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrationJob.decodeDelimited = function decodeDelimited(reader) { + UpdateConversionWorkspaceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigrationJob message. + * Verifies an UpdateConversionWorkspaceRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.MigrationJob + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigrationJob.verify = function verify(message) { + UpdateConversionWorkspaceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.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"; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: 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: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - break; - } - if (message.phase != null && message.hasOwnProperty("phase")) - switch (message.phase) { - default: - return "phase: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.dumpPath != null && message.hasOwnProperty("dumpPath")) - if (!$util.isString(message.dumpPath)) - return "dumpPath: string expected"; - if (message.source != null && message.hasOwnProperty("source")) - if (!$util.isString(message.source)) - return "source: string expected"; - if (message.destination != null && message.hasOwnProperty("destination")) - if (!$util.isString(message.destination)) - return "destination: string expected"; - if (message.reverseSshConnectivity != null && message.hasOwnProperty("reverseSshConnectivity")) { - properties.connectivity = 1; - { - var error = $root.google.cloud.clouddms.v1.ReverseSshConnectivity.verify(message.reverseSshConnectivity); - if (error) - return "reverseSshConnectivity." + error; - } - } - if (message.vpcPeeringConnectivity != null && message.hasOwnProperty("vpcPeeringConnectivity")) { - if (properties.connectivity === 1) - return "connectivity: multiple values"; - properties.connectivity = 1; - { - var error = $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.verify(message.vpcPeeringConnectivity); - if (error) - return "vpcPeeringConnectivity." + error; - } - } - if (message.staticIpConnectivity != null && message.hasOwnProperty("staticIpConnectivity")) { - if (properties.connectivity === 1) - return "connectivity: multiple values"; - properties.connectivity = 1; - { - var error = $root.google.cloud.clouddms.v1.StaticIpConnectivity.verify(message.staticIpConnectivity); - if (error) - return "staticIpConnectivity." + error; - } - } - if (message.duration != null && message.hasOwnProperty("duration")) { - var error = $root.google.protobuf.Duration.verify(message.duration); - if (error) - return "duration." + error; - } - if (message.error != null && message.hasOwnProperty("error")) { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) { - var error = $root.google.cloud.clouddms.v1.DatabaseType.verify(message.sourceDatabase); - if (error) - return "sourceDatabase." + error; - } - if (message.destinationDatabase != null && message.hasOwnProperty("destinationDatabase")) { - var error = $root.google.cloud.clouddms.v1.DatabaseType.verify(message.destinationDatabase); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "destinationDatabase." + error; + return "updateMask." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (message.conversionWorkspace != null && message.hasOwnProperty("conversionWorkspace")) { + var error = $root.google.cloud.clouddms.v1.ConversionWorkspace.verify(message.conversionWorkspace); if (error) - return "endTime." + error; + return "conversionWorkspace." + error; } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a MigrationJob message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.MigrationJob + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.MigrationJob} MigrationJob + * @returns {google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest} UpdateConversionWorkspaceRequest */ - MigrationJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.MigrationJob) + UpdateConversionWorkspaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest) return object; - var message = new $root.google.cloud.clouddms.v1.MigrationJob(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.clouddms.v1.MigrationJob.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + var message = new $root.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.clouddms.v1.MigrationJob.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.clouddms.v1.MigrationJob.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.displayName != null) - message.displayName = String(object.displayName); - 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 "MAINTENANCE": - case 1: - message.state = 1; - break; - case "DRAFT": - case 2: - message.state = 2; - break; - case "CREATING": - case 3: - message.state = 3; - break; - case "NOT_STARTED": - case 4: - message.state = 4; - break; - case "RUNNING": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "COMPLETED": - case 7: - message.state = 7; - break; - case "DELETING": - case 8: - message.state = 8; - break; - case "STOPPING": - case 9: - message.state = 9; - break; - case "STOPPED": - case 10: - message.state = 10; - break; - case "DELETED": - case 11: - message.state = 11; - break; - case "UPDATING": - case 12: - message.state = 12; - break; - case "STARTING": - case 13: - message.state = 13; - break; - case "RESTARTING": - case 14: - message.state = 14; - break; - case "RESUMING": - case 15: - message.state = 15; - break; - } - switch (object.phase) { - default: - if (typeof object.phase === "number") { - message.phase = object.phase; - break; - } - break; - case "PHASE_UNSPECIFIED": - case 0: - message.phase = 0; - break; - case "FULL_DUMP": - case 1: - message.phase = 1; - break; - case "CDC": - case 2: - message.phase = 2; - break; - case "PROMOTE_IN_PROGRESS": - case 3: - message.phase = 3; - break; - case "WAITING_FOR_SOURCE_WRITES_TO_STOP": - case 4: - message.phase = 4; - break; - case "PREPARING_THE_DUMP": - case 5: - message.phase = 5; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "ONE_TIME": - case 1: - message.type = 1; - break; - case "CONTINUOUS": - case 2: - message.type = 2; - break; - } - if (object.dumpPath != null) - message.dumpPath = String(object.dumpPath); - if (object.source != null) - message.source = String(object.source); - if (object.destination != null) - message.destination = String(object.destination); - if (object.reverseSshConnectivity != null) { - if (typeof object.reverseSshConnectivity !== "object") - throw TypeError(".google.cloud.clouddms.v1.MigrationJob.reverseSshConnectivity: object expected"); - message.reverseSshConnectivity = $root.google.cloud.clouddms.v1.ReverseSshConnectivity.fromObject(object.reverseSshConnectivity); - } - if (object.vpcPeeringConnectivity != null) { - if (typeof object.vpcPeeringConnectivity !== "object") - throw TypeError(".google.cloud.clouddms.v1.MigrationJob.vpcPeeringConnectivity: object expected"); - message.vpcPeeringConnectivity = $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.fromObject(object.vpcPeeringConnectivity); - } - if (object.staticIpConnectivity != null) { - if (typeof object.staticIpConnectivity !== "object") - throw TypeError(".google.cloud.clouddms.v1.MigrationJob.staticIpConnectivity: object expected"); - message.staticIpConnectivity = $root.google.cloud.clouddms.v1.StaticIpConnectivity.fromObject(object.staticIpConnectivity); - } - if (object.duration != null) { - if (typeof object.duration !== "object") - throw TypeError(".google.cloud.clouddms.v1.MigrationJob.duration: object expected"); - message.duration = $root.google.protobuf.Duration.fromObject(object.duration); - } - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.clouddms.v1.MigrationJob.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.sourceDatabase != null) { - if (typeof object.sourceDatabase !== "object") - throw TypeError(".google.cloud.clouddms.v1.MigrationJob.sourceDatabase: object expected"); - message.sourceDatabase = $root.google.cloud.clouddms.v1.DatabaseType.fromObject(object.sourceDatabase); - } - if (object.destinationDatabase != null) { - if (typeof object.destinationDatabase !== "object") - throw TypeError(".google.cloud.clouddms.v1.MigrationJob.destinationDatabase: object expected"); - message.destinationDatabase = $root.google.cloud.clouddms.v1.DatabaseType.fromObject(object.destinationDatabase); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.clouddms.v1.MigrationJob.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + if (object.conversionWorkspace != null) { + if (typeof object.conversionWorkspace !== "object") + throw TypeError(".google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest.conversionWorkspace: object expected"); + message.conversionWorkspace = $root.google.cloud.clouddms.v1.ConversionWorkspace.fromObject(object.conversionWorkspace); } + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a MigrationJob message. Also converts values to other types if specified. + * Creates a plain object from an UpdateConversionWorkspaceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.MigrationJob + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.MigrationJob} message MigrationJob + * @param {google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest} message UpdateConversionWorkspaceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MigrationJob.toObject = function toObject(message, options) { + UpdateConversionWorkspaceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; if (options.defaults) { - object.name = ""; - object.createTime = null; - object.updateTime = null; - object.displayName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.phase = options.enums === String ? "PHASE_UNSPECIFIED" : 0; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.dumpPath = ""; - object.source = ""; - object.destination = ""; - object.duration = null; - object.error = null; - object.sourceDatabase = null; - object.destinationDatabase = null; - object.endTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - 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.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.clouddms.v1.MigrationJob.State[message.state] === undefined ? message.state : $root.google.cloud.clouddms.v1.MigrationJob.State[message.state] : message.state; - if (message.phase != null && message.hasOwnProperty("phase")) - object.phase = options.enums === String ? $root.google.cloud.clouddms.v1.MigrationJob.Phase[message.phase] === undefined ? message.phase : $root.google.cloud.clouddms.v1.MigrationJob.Phase[message.phase] : message.phase; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.clouddms.v1.MigrationJob.Type[message.type] === undefined ? message.type : $root.google.cloud.clouddms.v1.MigrationJob.Type[message.type] : message.type; - if (message.dumpPath != null && message.hasOwnProperty("dumpPath")) - object.dumpPath = message.dumpPath; - if (message.source != null && message.hasOwnProperty("source")) - object.source = message.source; - if (message.destination != null && message.hasOwnProperty("destination")) - object.destination = message.destination; - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) - object.sourceDatabase = $root.google.cloud.clouddms.v1.DatabaseType.toObject(message.sourceDatabase, options); - if (message.destinationDatabase != null && message.hasOwnProperty("destinationDatabase")) - object.destinationDatabase = $root.google.cloud.clouddms.v1.DatabaseType.toObject(message.destinationDatabase, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.reverseSshConnectivity != null && message.hasOwnProperty("reverseSshConnectivity")) { - object.reverseSshConnectivity = $root.google.cloud.clouddms.v1.ReverseSshConnectivity.toObject(message.reverseSshConnectivity, options); - if (options.oneofs) - object.connectivity = "reverseSshConnectivity"; - } - if (message.vpcPeeringConnectivity != null && message.hasOwnProperty("vpcPeeringConnectivity")) { - object.vpcPeeringConnectivity = $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.toObject(message.vpcPeeringConnectivity, options); - if (options.oneofs) - object.connectivity = "vpcPeeringConnectivity"; - } - if (message.staticIpConnectivity != null && message.hasOwnProperty("staticIpConnectivity")) { - object.staticIpConnectivity = $root.google.cloud.clouddms.v1.StaticIpConnectivity.toObject(message.staticIpConnectivity, options); - if (options.oneofs) - object.connectivity = "staticIpConnectivity"; + object.updateMask = null; + object.conversionWorkspace = null; + object.requestId = ""; } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.conversionWorkspace != null && message.hasOwnProperty("conversionWorkspace")) + object.conversionWorkspace = $root.google.cloud.clouddms.v1.ConversionWorkspace.toObject(message.conversionWorkspace, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this MigrationJob to JSON. + * Converts this UpdateConversionWorkspaceRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.MigrationJob + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @instance * @returns {Object.} JSON object */ - MigrationJob.prototype.toJSON = function toJSON() { + UpdateConversionWorkspaceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MigrationJob + * Gets the default type url for UpdateConversionWorkspaceRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.MigrationJob + * @memberof google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MigrationJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateConversionWorkspaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.MigrationJob"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest"; }; - /** - * State enum. - * @name google.cloud.clouddms.v1.MigrationJob.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} MAINTENANCE=1 MAINTENANCE value - * @property {number} DRAFT=2 DRAFT value - * @property {number} CREATING=3 CREATING value - * @property {number} NOT_STARTED=4 NOT_STARTED value - * @property {number} RUNNING=5 RUNNING value - * @property {number} FAILED=6 FAILED value - * @property {number} COMPLETED=7 COMPLETED value - * @property {number} DELETING=8 DELETING value - * @property {number} STOPPING=9 STOPPING value - * @property {number} STOPPED=10 STOPPED value - * @property {number} DELETED=11 DELETED value - * @property {number} UPDATING=12 UPDATING value - * @property {number} STARTING=13 STARTING value - * @property {number} RESTARTING=14 RESTARTING value - * @property {number} RESUMING=15 RESUMING value - */ - MigrationJob.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "MAINTENANCE"] = 1; - values[valuesById[2] = "DRAFT"] = 2; - values[valuesById[3] = "CREATING"] = 3; - values[valuesById[4] = "NOT_STARTED"] = 4; - values[valuesById[5] = "RUNNING"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[7] = "COMPLETED"] = 7; - values[valuesById[8] = "DELETING"] = 8; - values[valuesById[9] = "STOPPING"] = 9; - values[valuesById[10] = "STOPPED"] = 10; - values[valuesById[11] = "DELETED"] = 11; - values[valuesById[12] = "UPDATING"] = 12; - values[valuesById[13] = "STARTING"] = 13; - values[valuesById[14] = "RESTARTING"] = 14; - values[valuesById[15] = "RESUMING"] = 15; - return values; - })(); - - /** - * Phase enum. - * @name google.cloud.clouddms.v1.MigrationJob.Phase - * @enum {number} - * @property {number} PHASE_UNSPECIFIED=0 PHASE_UNSPECIFIED value - * @property {number} FULL_DUMP=1 FULL_DUMP value - * @property {number} CDC=2 CDC value - * @property {number} PROMOTE_IN_PROGRESS=3 PROMOTE_IN_PROGRESS value - * @property {number} WAITING_FOR_SOURCE_WRITES_TO_STOP=4 WAITING_FOR_SOURCE_WRITES_TO_STOP value - * @property {number} PREPARING_THE_DUMP=5 PREPARING_THE_DUMP value - */ - MigrationJob.Phase = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PHASE_UNSPECIFIED"] = 0; - values[valuesById[1] = "FULL_DUMP"] = 1; - values[valuesById[2] = "CDC"] = 2; - values[valuesById[3] = "PROMOTE_IN_PROGRESS"] = 3; - values[valuesById[4] = "WAITING_FOR_SOURCE_WRITES_TO_STOP"] = 4; - values[valuesById[5] = "PREPARING_THE_DUMP"] = 5; - return values; - })(); - - /** - * Type enum. - * @name google.cloud.clouddms.v1.MigrationJob.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} ONE_TIME=1 ONE_TIME value - * @property {number} CONTINUOUS=2 CONTINUOUS value - */ - MigrationJob.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ONE_TIME"] = 1; - values[valuesById[2] = "CONTINUOUS"] = 2; - return values; - })(); - - return MigrationJob; + return UpdateConversionWorkspaceRequest; })(); - v1.ConnectionProfile = (function() { + v1.DeleteConversionWorkspaceRequest = (function() { /** - * Properties of a ConnectionProfile. + * Properties of a DeleteConversionWorkspaceRequest. * @memberof google.cloud.clouddms.v1 - * @interface IConnectionProfile - * @property {string|null} [name] ConnectionProfile name - * @property {google.protobuf.ITimestamp|null} [createTime] ConnectionProfile createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ConnectionProfile updateTime - * @property {Object.|null} [labels] ConnectionProfile labels - * @property {google.cloud.clouddms.v1.ConnectionProfile.State|null} [state] ConnectionProfile state - * @property {string|null} [displayName] ConnectionProfile displayName - * @property {google.cloud.clouddms.v1.IMySqlConnectionProfile|null} [mysql] ConnectionProfile mysql - * @property {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile|null} [postgresql] ConnectionProfile postgresql - * @property {google.cloud.clouddms.v1.ICloudSqlConnectionProfile|null} [cloudsql] ConnectionProfile cloudsql - * @property {google.rpc.IStatus|null} [error] ConnectionProfile error - * @property {google.cloud.clouddms.v1.DatabaseProvider|null} [provider] ConnectionProfile provider + * @interface IDeleteConversionWorkspaceRequest + * @property {string|null} [name] DeleteConversionWorkspaceRequest name + * @property {string|null} [requestId] DeleteConversionWorkspaceRequest requestId */ /** - * Constructs a new ConnectionProfile. + * Constructs a new DeleteConversionWorkspaceRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a ConnectionProfile. - * @implements IConnectionProfile + * @classdesc Represents a DeleteConversionWorkspaceRequest. + * @implements IDeleteConversionWorkspaceRequest * @constructor - * @param {google.cloud.clouddms.v1.IConnectionProfile=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest=} [properties] Properties to set */ - function ConnectionProfile(properties) { - this.labels = {}; + function DeleteConversionWorkspaceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10982,185 +9733,80 @@ } /** - * ConnectionProfile name. + * DeleteConversionWorkspaceRequest name. * @member {string} name - * @memberof google.cloud.clouddms.v1.ConnectionProfile - * @instance - */ - ConnectionProfile.prototype.name = ""; - - /** - * ConnectionProfile createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.clouddms.v1.ConnectionProfile - * @instance - */ - ConnectionProfile.prototype.createTime = null; - - /** - * ConnectionProfile updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.clouddms.v1.ConnectionProfile - * @instance - */ - ConnectionProfile.prototype.updateTime = null; - - /** - * ConnectionProfile labels. - * @member {Object.} labels - * @memberof google.cloud.clouddms.v1.ConnectionProfile - * @instance - */ - ConnectionProfile.prototype.labels = $util.emptyObject; - - /** - * ConnectionProfile state. - * @member {google.cloud.clouddms.v1.ConnectionProfile.State} state - * @memberof google.cloud.clouddms.v1.ConnectionProfile - * @instance - */ - ConnectionProfile.prototype.state = 0; - - /** - * ConnectionProfile displayName. - * @member {string} displayName - * @memberof google.cloud.clouddms.v1.ConnectionProfile - * @instance - */ - ConnectionProfile.prototype.displayName = ""; - - /** - * ConnectionProfile mysql. - * @member {google.cloud.clouddms.v1.IMySqlConnectionProfile|null|undefined} mysql - * @memberof google.cloud.clouddms.v1.ConnectionProfile - * @instance - */ - ConnectionProfile.prototype.mysql = null; - - /** - * ConnectionProfile postgresql. - * @member {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile|null|undefined} postgresql - * @memberof google.cloud.clouddms.v1.ConnectionProfile - * @instance - */ - ConnectionProfile.prototype.postgresql = null; - - /** - * ConnectionProfile cloudsql. - * @member {google.cloud.clouddms.v1.ICloudSqlConnectionProfile|null|undefined} cloudsql - * @memberof google.cloud.clouddms.v1.ConnectionProfile - * @instance - */ - ConnectionProfile.prototype.cloudsql = null; - - /** - * ConnectionProfile error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.clouddms.v1.ConnectionProfile - * @instance - */ - ConnectionProfile.prototype.error = null; - - /** - * ConnectionProfile provider. - * @member {google.cloud.clouddms.v1.DatabaseProvider} provider - * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest * @instance */ - ConnectionProfile.prototype.provider = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + DeleteConversionWorkspaceRequest.prototype.name = ""; /** - * ConnectionProfile connectionProfile. - * @member {"mysql"|"postgresql"|"cloudsql"|undefined} connectionProfile - * @memberof google.cloud.clouddms.v1.ConnectionProfile + * DeleteConversionWorkspaceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest * @instance */ - Object.defineProperty(ConnectionProfile.prototype, "connectionProfile", { - get: $util.oneOfGetter($oneOfFields = ["mysql", "postgresql", "cloudsql"]), - set: $util.oneOfSetter($oneOfFields) - }); + DeleteConversionWorkspaceRequest.prototype.requestId = ""; /** - * Creates a new ConnectionProfile instance using the specified properties. + * Creates a new DeleteConversionWorkspaceRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.IConnectionProfile=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.ConnectionProfile} ConnectionProfile instance + * @param {google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest} DeleteConversionWorkspaceRequest instance */ - ConnectionProfile.create = function create(properties) { - return new ConnectionProfile(properties); + DeleteConversionWorkspaceRequest.create = function create(properties) { + return new DeleteConversionWorkspaceRequest(properties); }; /** - * Encodes the specified ConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.ConnectionProfile.verify|verify} messages. + * Encodes the specified DeleteConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.IConnectionProfile} message ConnectionProfile message or plain object to encode + * @param {google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest} message DeleteConversionWorkspaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConnectionProfile.encode = function encode(message, writer) { + DeleteConversionWorkspaceRequest.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).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 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.provider != null && Object.hasOwnProperty.call(message, "provider")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.provider); - if (message.mysql != null && Object.hasOwnProperty.call(message, "mysql")) - $root.google.cloud.clouddms.v1.MySqlConnectionProfile.encode(message.mysql, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); - if (message.postgresql != null && Object.hasOwnProperty.call(message, "postgresql")) - $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.encode(message.postgresql, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); - if (message.cloudsql != null && Object.hasOwnProperty.call(message, "cloudsql")) - $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.encode(message.cloudsql, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); return writer; }; /** - * Encodes the specified ConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConnectionProfile.verify|verify} messages. + * Encodes the specified DeleteConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.IConnectionProfile} message ConnectionProfile message or plain object to encode + * @param {google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest} message DeleteConversionWorkspaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + DeleteConversionWorkspaceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ConnectionProfile message from the specified reader or buffer. + * Decodes a DeleteConversionWorkspaceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.ConnectionProfile} ConnectionProfile + * @returns {google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest} DeleteConversionWorkspaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ConnectionProfile.decode = function decode(reader, length) { + DeleteConversionWorkspaceRequest.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.clouddms.v1.ConnectionProfile(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -11169,62 +9815,7 @@ break; } case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - 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; - } - case 5: { - message.state = reader.int32(); - break; - } - case 6: { - message.displayName = reader.string(); - break; - } - case 100: { - message.mysql = $root.google.cloud.clouddms.v1.MySqlConnectionProfile.decode(reader, reader.uint32()); - break; - } - case 101: { - message.postgresql = $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.decode(reader, reader.uint32()); - break; - } - case 102: { - message.cloudsql = $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.decode(reader, reader.uint32()); - break; - } - case 7: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 8: { - message.provider = reader.int32(); + message.requestId = reader.string(); break; } default: @@ -11236,369 +9827,132 @@ }; /** - * Decodes a ConnectionProfile message from the specified reader or buffer, length delimited. + * Decodes a DeleteConversionWorkspaceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.ConnectionProfile} ConnectionProfile + * @returns {google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest} DeleteConversionWorkspaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + DeleteConversionWorkspaceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ConnectionProfile message. + * Verifies a DeleteConversionWorkspaceRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ConnectionProfile.verify = function verify(message) { + DeleteConversionWorkspaceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.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"; - } - 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: - case 6: - case 7: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.mysql != null && message.hasOwnProperty("mysql")) { - properties.connectionProfile = 1; - { - var error = $root.google.cloud.clouddms.v1.MySqlConnectionProfile.verify(message.mysql); - if (error) - return "mysql." + error; - } - } - if (message.postgresql != null && message.hasOwnProperty("postgresql")) { - if (properties.connectionProfile === 1) - return "connectionProfile: multiple values"; - properties.connectionProfile = 1; - { - var error = $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify(message.postgresql); - if (error) - return "postgresql." + error; - } - } - if (message.cloudsql != null && message.hasOwnProperty("cloudsql")) { - if (properties.connectionProfile === 1) - return "connectionProfile: multiple values"; - properties.connectionProfile = 1; - { - var error = $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify(message.cloudsql); - if (error) - return "cloudsql." + error; - } - } - if (message.error != null && message.hasOwnProperty("error")) { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - if (message.provider != null && message.hasOwnProperty("provider")) - switch (message.provider) { - default: - return "provider: enum value expected"; - case 0: - case 1: - case 2: - break; - } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a ConnectionProfile message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.ConnectionProfile} ConnectionProfile + * @returns {google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest} DeleteConversionWorkspaceRequest */ - ConnectionProfile.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.ConnectionProfile) + DeleteConversionWorkspaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest) return object; - var message = new $root.google.cloud.clouddms.v1.ConnectionProfile(); + var message = new $root.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest(); if (object.name != null) message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.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.clouddms.v1.ConnectionProfile.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.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]]); - } - 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 "DRAFT": - case 1: - message.state = 1; - break; - case "CREATING": - case 2: - message.state = 2; - break; - case "READY": - case 3: - message.state = 3; - break; - case "UPDATING": - case 4: - message.state = 4; - break; - case "DELETING": - case 5: - message.state = 5; - break; - case "DELETED": - case 6: - message.state = 6; - break; - case "FAILED": - case 7: - message.state = 7; - break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.mysql != null) { - if (typeof object.mysql !== "object") - throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.mysql: object expected"); - message.mysql = $root.google.cloud.clouddms.v1.MySqlConnectionProfile.fromObject(object.mysql); - } - if (object.postgresql != null) { - if (typeof object.postgresql !== "object") - throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.postgresql: object expected"); - message.postgresql = $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.fromObject(object.postgresql); - } - if (object.cloudsql != null) { - if (typeof object.cloudsql !== "object") - throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.cloudsql: object expected"); - message.cloudsql = $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.fromObject(object.cloudsql); - } - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - switch (object.provider) { - default: - if (typeof object.provider === "number") { - message.provider = object.provider; - break; - } - break; - case "DATABASE_PROVIDER_UNSPECIFIED": - case 0: - message.provider = 0; - break; - case "CLOUDSQL": - case 1: - message.provider = 1; - break; - case "RDS": - case 2: - message.provider = 2; - break; - } + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a ConnectionProfile message. Also converts values to other types if specified. + * Creates a plain object from a DeleteConversionWorkspaceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.ConnectionProfile} message ConnectionProfile + * @param {google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest} message DeleteConversionWorkspaceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConnectionProfile.toObject = function toObject(message, options) { + DeleteConversionWorkspaceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; if (options.defaults) { object.name = ""; - object.createTime = null; - object.updateTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.displayName = ""; - object.error = null; - object.provider = options.enums === String ? "DATABASE_PROVIDER_UNSPECIFIED" : 0; + object.requestId = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - 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.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.clouddms.v1.ConnectionProfile.State[message.state] === undefined ? message.state : $root.google.cloud.clouddms.v1.ConnectionProfile.State[message.state] : message.state; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (message.provider != null && message.hasOwnProperty("provider")) - object.provider = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseProvider[message.provider] === undefined ? message.provider : $root.google.cloud.clouddms.v1.DatabaseProvider[message.provider] : message.provider; - if (message.mysql != null && message.hasOwnProperty("mysql")) { - object.mysql = $root.google.cloud.clouddms.v1.MySqlConnectionProfile.toObject(message.mysql, options); - if (options.oneofs) - object.connectionProfile = "mysql"; - } - if (message.postgresql != null && message.hasOwnProperty("postgresql")) { - object.postgresql = $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.toObject(message.postgresql, options); - if (options.oneofs) - object.connectionProfile = "postgresql"; - } - if (message.cloudsql != null && message.hasOwnProperty("cloudsql")) { - object.cloudsql = $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.toObject(message.cloudsql, options); - if (options.oneofs) - object.connectionProfile = "cloudsql"; - } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this ConnectionProfile to JSON. + * Converts this DeleteConversionWorkspaceRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest * @instance * @returns {Object.} JSON object */ - ConnectionProfile.prototype.toJSON = function toJSON() { + DeleteConversionWorkspaceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ConnectionProfile + * Gets the default type url for DeleteConversionWorkspaceRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @memberof google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteConversionWorkspaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.ConnectionProfile"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest"; }; - /** - * State enum. - * @name google.cloud.clouddms.v1.ConnectionProfile.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} DRAFT=1 DRAFT value - * @property {number} CREATING=2 CREATING value - * @property {number} READY=3 READY value - * @property {number} UPDATING=4 UPDATING value - * @property {number} DELETING=5 DELETING value - * @property {number} DELETED=6 DELETED value - * @property {number} FAILED=7 FAILED value - */ - ConnectionProfile.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DRAFT"] = 1; - values[valuesById[2] = "CREATING"] = 2; - values[valuesById[3] = "READY"] = 3; - values[valuesById[4] = "UPDATING"] = 4; - values[valuesById[5] = "DELETING"] = 5; - values[valuesById[6] = "DELETED"] = 6; - values[valuesById[7] = "FAILED"] = 7; - return values; - })(); - - return ConnectionProfile; + return DeleteConversionWorkspaceRequest; })(); - v1.MigrationJobVerificationError = (function() { + v1.CommitConversionWorkspaceRequest = (function() { /** - * Properties of a MigrationJobVerificationError. + * Properties of a CommitConversionWorkspaceRequest. * @memberof google.cloud.clouddms.v1 - * @interface IMigrationJobVerificationError - * @property {google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode|null} [errorCode] MigrationJobVerificationError errorCode - * @property {string|null} [errorMessage] MigrationJobVerificationError errorMessage - * @property {string|null} [errorDetailMessage] MigrationJobVerificationError errorDetailMessage + * @interface ICommitConversionWorkspaceRequest + * @property {string|null} [name] CommitConversionWorkspaceRequest name + * @property {string|null} [commitName] CommitConversionWorkspaceRequest commitName */ /** - * Constructs a new MigrationJobVerificationError. + * Constructs a new CommitConversionWorkspaceRequest. * @memberof google.cloud.clouddms.v1 - * @classdesc Represents a MigrationJobVerificationError. - * @implements IMigrationJobVerificationError + * @classdesc Represents a CommitConversionWorkspaceRequest. + * @implements ICommitConversionWorkspaceRequest * @constructor - * @param {google.cloud.clouddms.v1.IMigrationJobVerificationError=} [properties] Properties to set + * @param {google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest=} [properties] Properties to set */ - function MigrationJobVerificationError(properties) { + function CommitConversionWorkspaceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11606,103 +9960,89 @@ } /** - * MigrationJobVerificationError errorCode. - * @member {google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode} errorCode - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError - * @instance - */ - MigrationJobVerificationError.prototype.errorCode = 0; - - /** - * MigrationJobVerificationError errorMessage. - * @member {string} errorMessage - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * CommitConversionWorkspaceRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.CommitConversionWorkspaceRequest * @instance */ - MigrationJobVerificationError.prototype.errorMessage = ""; + CommitConversionWorkspaceRequest.prototype.name = ""; /** - * MigrationJobVerificationError errorDetailMessage. - * @member {string} errorDetailMessage - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * CommitConversionWorkspaceRequest commitName. + * @member {string} commitName + * @memberof google.cloud.clouddms.v1.CommitConversionWorkspaceRequest * @instance */ - MigrationJobVerificationError.prototype.errorDetailMessage = ""; + CommitConversionWorkspaceRequest.prototype.commitName = ""; /** - * Creates a new MigrationJobVerificationError instance using the specified properties. + * Creates a new CommitConversionWorkspaceRequest instance using the specified properties. * @function create - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @memberof google.cloud.clouddms.v1.CommitConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.IMigrationJobVerificationError=} [properties] Properties to set - * @returns {google.cloud.clouddms.v1.MigrationJobVerificationError} MigrationJobVerificationError instance + * @param {google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.CommitConversionWorkspaceRequest} CommitConversionWorkspaceRequest instance */ - MigrationJobVerificationError.create = function create(properties) { - return new MigrationJobVerificationError(properties); + CommitConversionWorkspaceRequest.create = function create(properties) { + return new CommitConversionWorkspaceRequest(properties); }; /** - * Encodes the specified MigrationJobVerificationError message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJobVerificationError.verify|verify} messages. + * Encodes the specified CommitConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CommitConversionWorkspaceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @memberof google.cloud.clouddms.v1.CommitConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.IMigrationJobVerificationError} message MigrationJobVerificationError message or plain object to encode + * @param {google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest} message CommitConversionWorkspaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrationJobVerificationError.encode = function encode(message, writer) { + CommitConversionWorkspaceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorCode); - if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); - if (message.errorDetailMessage != null && Object.hasOwnProperty.call(message, "errorDetailMessage")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorDetailMessage); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.commitName != null && Object.hasOwnProperty.call(message, "commitName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.commitName); return writer; }; /** - * Encodes the specified MigrationJobVerificationError message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJobVerificationError.verify|verify} messages. + * Encodes the specified CommitConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CommitConversionWorkspaceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @memberof google.cloud.clouddms.v1.CommitConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.IMigrationJobVerificationError} message MigrationJobVerificationError message or plain object to encode + * @param {google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest} message CommitConversionWorkspaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MigrationJobVerificationError.encodeDelimited = function encodeDelimited(message, writer) { + CommitConversionWorkspaceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigrationJobVerificationError message from the specified reader or buffer. + * Decodes a CommitConversionWorkspaceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @memberof google.cloud.clouddms.v1.CommitConversionWorkspaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.clouddms.v1.MigrationJobVerificationError} MigrationJobVerificationError + * @returns {google.cloud.clouddms.v1.CommitConversionWorkspaceRequest} CommitConversionWorkspaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrationJobVerificationError.decode = function decode(reader, length) { + CommitConversionWorkspaceRequest.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.clouddms.v1.MigrationJobVerificationError(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.errorCode = reader.int32(); + message.name = reader.string(); break; } case 2: { - message.errorMessage = reader.string(); - break; - } - case 3: { - message.errorDetailMessage = reader.string(); + message.commitName = reader.string(); break; } default: @@ -11714,818 +10054,22609 @@ }; /** - * Decodes a MigrationJobVerificationError message from the specified reader or buffer, length delimited. + * Decodes a CommitConversionWorkspaceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @memberof google.cloud.clouddms.v1.CommitConversionWorkspaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.clouddms.v1.MigrationJobVerificationError} MigrationJobVerificationError + * @returns {google.cloud.clouddms.v1.CommitConversionWorkspaceRequest} CommitConversionWorkspaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MigrationJobVerificationError.decodeDelimited = function decodeDelimited(reader) { + CommitConversionWorkspaceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigrationJobVerificationError message. + * Verifies a CommitConversionWorkspaceRequest message. * @function verify - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @memberof google.cloud.clouddms.v1.CommitConversionWorkspaceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MigrationJobVerificationError.verify = function verify(message) { + CommitConversionWorkspaceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.errorCode != null && message.hasOwnProperty("errorCode")) - switch (message.errorCode) { - default: - return "errorCode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 21: - break; - } - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) - if (!$util.isString(message.errorMessage)) - return "errorMessage: string expected"; - if (message.errorDetailMessage != null && message.hasOwnProperty("errorDetailMessage")) - if (!$util.isString(message.errorDetailMessage)) - return "errorDetailMessage: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.commitName != null && message.hasOwnProperty("commitName")) + if (!$util.isString(message.commitName)) + return "commitName: string expected"; return null; }; /** - * Creates a MigrationJobVerificationError message from a plain object. Also converts values to their respective internal types. + * Creates a CommitConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @memberof google.cloud.clouddms.v1.CommitConversionWorkspaceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.clouddms.v1.MigrationJobVerificationError} MigrationJobVerificationError + * @returns {google.cloud.clouddms.v1.CommitConversionWorkspaceRequest} CommitConversionWorkspaceRequest */ - MigrationJobVerificationError.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.clouddms.v1.MigrationJobVerificationError) + CommitConversionWorkspaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest) return object; - var message = new $root.google.cloud.clouddms.v1.MigrationJobVerificationError(); - switch (object.errorCode) { - default: - if (typeof object.errorCode === "number") { - message.errorCode = object.errorCode; - break; - } - break; - case "ERROR_CODE_UNSPECIFIED": - case 0: - message.errorCode = 0; - break; - case "CONNECTION_FAILURE": - case 1: - message.errorCode = 1; - break; - case "AUTHENTICATION_FAILURE": - case 2: - message.errorCode = 2; - break; - case "INVALID_CONNECTION_PROFILE_CONFIG": - case 3: - message.errorCode = 3; - break; - case "VERSION_INCOMPATIBILITY": - case 4: - message.errorCode = 4; - break; - case "CONNECTION_PROFILE_TYPES_INCOMPATIBILITY": - case 5: - message.errorCode = 5; - break; - case "NO_PGLOGICAL_INSTALLED": - case 7: - message.errorCode = 7; - break; - case "PGLOGICAL_NODE_ALREADY_EXISTS": - case 8: - message.errorCode = 8; - break; - case "INVALID_WAL_LEVEL": - case 9: - message.errorCode = 9; - break; - case "INVALID_SHARED_PRELOAD_LIBRARY": - case 10: - message.errorCode = 10; - break; - case "INSUFFICIENT_MAX_REPLICATION_SLOTS": - case 11: - message.errorCode = 11; - break; - case "INSUFFICIENT_MAX_WAL_SENDERS": - case 12: - message.errorCode = 12; - break; - case "INSUFFICIENT_MAX_WORKER_PROCESSES": - case 13: - message.errorCode = 13; - break; - case "UNSUPPORTED_EXTENSIONS": - case 14: - message.errorCode = 14; - break; - case "UNSUPPORTED_MIGRATION_TYPE": - case 15: - message.errorCode = 15; - break; - case "INVALID_RDS_LOGICAL_REPLICATION": - case 16: - message.errorCode = 16; - break; - case "UNSUPPORTED_GTID_MODE": - case 17: - message.errorCode = 17; - break; - case "UNSUPPORTED_TABLE_DEFINITION": - case 18: - message.errorCode = 18; - break; - case "UNSUPPORTED_DEFINER": - case 19: - message.errorCode = 19; - break; - case "CANT_RESTART_RUNNING_MIGRATION": - case 21: - message.errorCode = 21; - break; - } - if (object.errorMessage != null) - message.errorMessage = String(object.errorMessage); - if (object.errorDetailMessage != null) - message.errorDetailMessage = String(object.errorDetailMessage); + var message = new $root.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.commitName != null) + message.commitName = String(object.commitName); return message; }; /** - * Creates a plain object from a MigrationJobVerificationError message. Also converts values to other types if specified. + * Creates a plain object from a CommitConversionWorkspaceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @memberof google.cloud.clouddms.v1.CommitConversionWorkspaceRequest * @static - * @param {google.cloud.clouddms.v1.MigrationJobVerificationError} message MigrationJobVerificationError + * @param {google.cloud.clouddms.v1.CommitConversionWorkspaceRequest} message CommitConversionWorkspaceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MigrationJobVerificationError.toObject = function toObject(message, options) { + CommitConversionWorkspaceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.errorCode = options.enums === String ? "ERROR_CODE_UNSPECIFIED" : 0; - object.errorMessage = ""; - object.errorDetailMessage = ""; + object.name = ""; + object.commitName = ""; } - if (message.errorCode != null && message.hasOwnProperty("errorCode")) - object.errorCode = options.enums === String ? $root.google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode[message.errorCode] === undefined ? message.errorCode : $root.google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode[message.errorCode] : message.errorCode; - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) - object.errorMessage = message.errorMessage; - if (message.errorDetailMessage != null && message.hasOwnProperty("errorDetailMessage")) - object.errorDetailMessage = message.errorDetailMessage; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.commitName != null && message.hasOwnProperty("commitName")) + object.commitName = message.commitName; return object; }; /** - * Converts this MigrationJobVerificationError to JSON. + * Converts this CommitConversionWorkspaceRequest to JSON. * @function toJSON - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @memberof google.cloud.clouddms.v1.CommitConversionWorkspaceRequest * @instance * @returns {Object.} JSON object */ - MigrationJobVerificationError.prototype.toJSON = function toJSON() { + CommitConversionWorkspaceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MigrationJobVerificationError + * Gets the default type url for CommitConversionWorkspaceRequest * @function getTypeUrl - * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @memberof google.cloud.clouddms.v1.CommitConversionWorkspaceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MigrationJobVerificationError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CommitConversionWorkspaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.clouddms.v1.MigrationJobVerificationError"; + return typeUrlPrefix + "/google.cloud.clouddms.v1.CommitConversionWorkspaceRequest"; }; + return CommitConversionWorkspaceRequest; + })(); + + v1.RollbackConversionWorkspaceRequest = (function() { + /** - * ErrorCode enum. - * @name google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode - * @enum {number} - * @property {number} ERROR_CODE_UNSPECIFIED=0 ERROR_CODE_UNSPECIFIED value - * @property {number} CONNECTION_FAILURE=1 CONNECTION_FAILURE value - * @property {number} AUTHENTICATION_FAILURE=2 AUTHENTICATION_FAILURE value - * @property {number} INVALID_CONNECTION_PROFILE_CONFIG=3 INVALID_CONNECTION_PROFILE_CONFIG value - * @property {number} VERSION_INCOMPATIBILITY=4 VERSION_INCOMPATIBILITY value - * @property {number} CONNECTION_PROFILE_TYPES_INCOMPATIBILITY=5 CONNECTION_PROFILE_TYPES_INCOMPATIBILITY value - * @property {number} NO_PGLOGICAL_INSTALLED=7 NO_PGLOGICAL_INSTALLED value - * @property {number} PGLOGICAL_NODE_ALREADY_EXISTS=8 PGLOGICAL_NODE_ALREADY_EXISTS value - * @property {number} INVALID_WAL_LEVEL=9 INVALID_WAL_LEVEL value - * @property {number} INVALID_SHARED_PRELOAD_LIBRARY=10 INVALID_SHARED_PRELOAD_LIBRARY value - * @property {number} INSUFFICIENT_MAX_REPLICATION_SLOTS=11 INSUFFICIENT_MAX_REPLICATION_SLOTS value - * @property {number} INSUFFICIENT_MAX_WAL_SENDERS=12 INSUFFICIENT_MAX_WAL_SENDERS value - * @property {number} INSUFFICIENT_MAX_WORKER_PROCESSES=13 INSUFFICIENT_MAX_WORKER_PROCESSES value - * @property {number} UNSUPPORTED_EXTENSIONS=14 UNSUPPORTED_EXTENSIONS value - * @property {number} UNSUPPORTED_MIGRATION_TYPE=15 UNSUPPORTED_MIGRATION_TYPE value - * @property {number} INVALID_RDS_LOGICAL_REPLICATION=16 INVALID_RDS_LOGICAL_REPLICATION value - * @property {number} UNSUPPORTED_GTID_MODE=17 UNSUPPORTED_GTID_MODE value - * @property {number} UNSUPPORTED_TABLE_DEFINITION=18 UNSUPPORTED_TABLE_DEFINITION value - * @property {number} UNSUPPORTED_DEFINER=19 UNSUPPORTED_DEFINER value - * @property {number} CANT_RESTART_RUNNING_MIGRATION=21 CANT_RESTART_RUNNING_MIGRATION value + * Properties of a RollbackConversionWorkspaceRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IRollbackConversionWorkspaceRequest + * @property {string|null} [name] RollbackConversionWorkspaceRequest name */ - MigrationJobVerificationError.ErrorCode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ERROR_CODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CONNECTION_FAILURE"] = 1; - values[valuesById[2] = "AUTHENTICATION_FAILURE"] = 2; - values[valuesById[3] = "INVALID_CONNECTION_PROFILE_CONFIG"] = 3; - values[valuesById[4] = "VERSION_INCOMPATIBILITY"] = 4; - values[valuesById[5] = "CONNECTION_PROFILE_TYPES_INCOMPATIBILITY"] = 5; - values[valuesById[7] = "NO_PGLOGICAL_INSTALLED"] = 7; - values[valuesById[8] = "PGLOGICAL_NODE_ALREADY_EXISTS"] = 8; - values[valuesById[9] = "INVALID_WAL_LEVEL"] = 9; - values[valuesById[10] = "INVALID_SHARED_PRELOAD_LIBRARY"] = 10; - values[valuesById[11] = "INSUFFICIENT_MAX_REPLICATION_SLOTS"] = 11; - values[valuesById[12] = "INSUFFICIENT_MAX_WAL_SENDERS"] = 12; - values[valuesById[13] = "INSUFFICIENT_MAX_WORKER_PROCESSES"] = 13; - values[valuesById[14] = "UNSUPPORTED_EXTENSIONS"] = 14; - values[valuesById[15] = "UNSUPPORTED_MIGRATION_TYPE"] = 15; - values[valuesById[16] = "INVALID_RDS_LOGICAL_REPLICATION"] = 16; - values[valuesById[17] = "UNSUPPORTED_GTID_MODE"] = 17; - values[valuesById[18] = "UNSUPPORTED_TABLE_DEFINITION"] = 18; - values[valuesById[19] = "UNSUPPORTED_DEFINER"] = 19; - values[valuesById[21] = "CANT_RESTART_RUNNING_MIGRATION"] = 21; - return values; - })(); - return MigrationJobVerificationError; - })(); + /** + * Constructs a new RollbackConversionWorkspaceRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a RollbackConversionWorkspaceRequest. + * @implements IRollbackConversionWorkspaceRequest + * @constructor + * @param {google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest=} [properties] Properties to set + */ + function RollbackConversionWorkspaceRequest(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]]; + } - /** - * DatabaseEngine enum. - * @name google.cloud.clouddms.v1.DatabaseEngine - * @enum {number} - * @property {number} DATABASE_ENGINE_UNSPECIFIED=0 DATABASE_ENGINE_UNSPECIFIED value - * @property {number} MYSQL=1 MYSQL value - * @property {number} POSTGRESQL=2 POSTGRESQL value - */ - v1.DatabaseEngine = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATABASE_ENGINE_UNSPECIFIED"] = 0; - values[valuesById[1] = "MYSQL"] = 1; - values[valuesById[2] = "POSTGRESQL"] = 2; - return values; - })(); + /** + * RollbackConversionWorkspaceRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest + * @instance + */ + RollbackConversionWorkspaceRequest.prototype.name = ""; - /** - * DatabaseProvider enum. - * @name google.cloud.clouddms.v1.DatabaseProvider - * @enum {number} - * @property {number} DATABASE_PROVIDER_UNSPECIFIED=0 DATABASE_PROVIDER_UNSPECIFIED value - * @property {number} CLOUDSQL=1 CLOUDSQL value - * @property {number} RDS=2 RDS value - */ - v1.DatabaseProvider = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATABASE_PROVIDER_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUDSQL"] = 1; - values[valuesById[2] = "RDS"] = 2; - return values; - })(); + /** + * Creates a new RollbackConversionWorkspaceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest} RollbackConversionWorkspaceRequest instance + */ + RollbackConversionWorkspaceRequest.create = function create(properties) { + return new RollbackConversionWorkspaceRequest(properties); + }; - return v1; - })(); + /** + * Encodes the specified RollbackConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest} message RollbackConversionWorkspaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackConversionWorkspaceRequest.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; + }; - return clouddms; - })(); + /** + * Encodes the specified RollbackConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest} message RollbackConversionWorkspaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackConversionWorkspaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return cloud; - })(); + /** + * Decodes a RollbackConversionWorkspaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest} RollbackConversionWorkspaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackConversionWorkspaceRequest.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.clouddms.v1.RollbackConversionWorkspaceRequest(); + 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; + }; - google.api = (function() { + /** + * Decodes a RollbackConversionWorkspaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest} RollbackConversionWorkspaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackConversionWorkspaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; + /** + * Verifies a RollbackConversionWorkspaceRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollbackConversionWorkspaceRequest.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; + }; - api.Http = (function() { + /** + * Creates a RollbackConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest} RollbackConversionWorkspaceRequest + */ + RollbackConversionWorkspaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ + /** + * Creates a plain object from a RollbackConversionWorkspaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest} message RollbackConversionWorkspaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollbackConversionWorkspaceRequest.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; + }; - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; + /** + * Converts this RollbackConversionWorkspaceRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest + * @instance + * @returns {Object.} JSON object + */ + RollbackConversionWorkspaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; + /** + * Gets the default type url for RollbackConversionWorkspaceRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollbackConversionWorkspaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest"; + }; - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; + return RollbackConversionWorkspaceRequest; + })(); - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; + v1.ApplyConversionWorkspaceRequest = (function() { - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of an ApplyConversionWorkspaceRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IApplyConversionWorkspaceRequest + * @property {string|null} [name] ApplyConversionWorkspaceRequest name + * @property {string|null} [filter] ApplyConversionWorkspaceRequest filter + * @property {string|null} [connectionProfile] ApplyConversionWorkspaceRequest connectionProfile + */ - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; + /** + * Constructs a new ApplyConversionWorkspaceRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents an ApplyConversionWorkspaceRequest. + * @implements IApplyConversionWorkspaceRequest + * @constructor + * @param {google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest=} [properties] Properties to set + */ + function ApplyConversionWorkspaceRequest(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 message; - }; - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ApplyConversionWorkspaceRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @instance + */ + ApplyConversionWorkspaceRequest.prototype.name = ""; - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; + /** + * ApplyConversionWorkspaceRequest filter. + * @member {string} filter + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @instance + */ + ApplyConversionWorkspaceRequest.prototype.filter = ""; - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; + /** + * ApplyConversionWorkspaceRequest connectionProfile. + * @member {string|null|undefined} connectionProfile + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @instance + */ + ApplyConversionWorkspaceRequest.prototype.connectionProfile = null; - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ApplyConversionWorkspaceRequest destination. + * @member {"connectionProfile"|undefined} destination + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @instance + */ + Object.defineProperty(ApplyConversionWorkspaceRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["connectionProfile"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; + /** + * Creates a new ApplyConversionWorkspaceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest} ApplyConversionWorkspaceRequest instance + */ + ApplyConversionWorkspaceRequest.create = function create(properties) { + return new ApplyConversionWorkspaceRequest(properties); + }; - return Http; - })(); + /** + * Encodes the specified ApplyConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest} message ApplyConversionWorkspaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyConversionWorkspaceRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.connectionProfile != null && Object.hasOwnProperty.call(message, "connectionProfile")) + writer.uint32(/* id 100, wireType 2 =*/802).string(message.connectionProfile); + return writer; + }; - api.HttpRule = (function() { + /** + * Encodes the specified ApplyConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest} message ApplyConversionWorkspaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyConversionWorkspaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ + /** + * Decodes an ApplyConversionWorkspaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest} ApplyConversionWorkspaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyConversionWorkspaceRequest.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.clouddms.v1.ApplyConversionWorkspaceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 100: { + message.connectionProfile = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes an ApplyConversionWorkspaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest} ApplyConversionWorkspaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyConversionWorkspaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; + /** + * Verifies an ApplyConversionWorkspaceRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplyConversionWorkspaceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) { + properties.destination = 1; + if (!$util.isString(message.connectionProfile)) + return "connectionProfile: string expected"; + } + return null; + }; - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; + /** + * Creates an ApplyConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest} ApplyConversionWorkspaceRequest + */ + ApplyConversionWorkspaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.connectionProfile != null) + message.connectionProfile = String(object.connectionProfile); + return message; + }; - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; + /** + * Creates a plain object from an ApplyConversionWorkspaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest} message ApplyConversionWorkspaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplyConversionWorkspaceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.filter = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) { + object.connectionProfile = message.connectionProfile; + if (options.oneofs) + object.destination = "connectionProfile"; + } + return object; + }; - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; + /** + * Converts this ApplyConversionWorkspaceRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @instance + * @returns {Object.} JSON object + */ + ApplyConversionWorkspaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; + /** + * Gets the default type url for ApplyConversionWorkspaceRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplyConversionWorkspaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest"; + }; - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; + return ApplyConversionWorkspaceRequest; + })(); - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; + v1.SeedConversionWorkspaceRequest = (function() { - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; + /** + * Properties of a SeedConversionWorkspaceRequest. + * @memberof google.cloud.clouddms.v1 + * @interface ISeedConversionWorkspaceRequest + * @property {string|null} [name] SeedConversionWorkspaceRequest name + * @property {boolean|null} [autoCommit] SeedConversionWorkspaceRequest autoCommit + * @property {string|null} [sourceConnectionProfile] SeedConversionWorkspaceRequest sourceConnectionProfile + * @property {string|null} [destinationConnectionProfile] SeedConversionWorkspaceRequest destinationConnectionProfile + */ - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; + /** + * Constructs a new SeedConversionWorkspaceRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SeedConversionWorkspaceRequest. + * @implements ISeedConversionWorkspaceRequest + * @constructor + * @param {google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest=} [properties] Properties to set + */ + function SeedConversionWorkspaceRequest(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]]; + } - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; + /** + * SeedConversionWorkspaceRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @instance + */ + SeedConversionWorkspaceRequest.prototype.name = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * SeedConversionWorkspaceRequest autoCommit. + * @member {boolean} autoCommit + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @instance + */ + SeedConversionWorkspaceRequest.prototype.autoCommit = false; - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * SeedConversionWorkspaceRequest sourceConnectionProfile. + * @member {string|null|undefined} sourceConnectionProfile + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @instance + */ + SeedConversionWorkspaceRequest.prototype.sourceConnectionProfile = null; - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; + /** + * SeedConversionWorkspaceRequest destinationConnectionProfile. + * @member {string|null|undefined} destinationConnectionProfile + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @instance + */ + SeedConversionWorkspaceRequest.prototype.destinationConnectionProfile = null; - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * SeedConversionWorkspaceRequest seedFrom. + * @member {"sourceConnectionProfile"|"destinationConnectionProfile"|undefined} seedFrom + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @instance + */ + Object.defineProperty(SeedConversionWorkspaceRequest.prototype, "seedFrom", { + get: $util.oneOfGetter($oneOfFields = ["sourceConnectionProfile", "destinationConnectionProfile"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; + /** + * Creates a new SeedConversionWorkspaceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SeedConversionWorkspaceRequest} SeedConversionWorkspaceRequest instance + */ + SeedConversionWorkspaceRequest.create = function create(properties) { + return new SeedConversionWorkspaceRequest(properties); + }; + + /** + * Encodes the specified SeedConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.SeedConversionWorkspaceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest} message SeedConversionWorkspaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeedConversionWorkspaceRequest.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.autoCommit != null && Object.hasOwnProperty.call(message, "autoCommit")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autoCommit); + if (message.sourceConnectionProfile != null && Object.hasOwnProperty.call(message, "sourceConnectionProfile")) + writer.uint32(/* id 100, wireType 2 =*/802).string(message.sourceConnectionProfile); + if (message.destinationConnectionProfile != null && Object.hasOwnProperty.call(message, "destinationConnectionProfile")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.destinationConnectionProfile); + return writer; + }; + + /** + * Encodes the specified SeedConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SeedConversionWorkspaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest} message SeedConversionWorkspaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeedConversionWorkspaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SeedConversionWorkspaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SeedConversionWorkspaceRequest} SeedConversionWorkspaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeedConversionWorkspaceRequest.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.clouddms.v1.SeedConversionWorkspaceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.autoCommit = reader.bool(); + break; + } + case 100: { + message.sourceConnectionProfile = reader.string(); + break; + } + case 101: { + message.destinationConnectionProfile = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - case 5: { - message["delete"] = reader.string(); - break; + return message; + }; + + /** + * Decodes a SeedConversionWorkspaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SeedConversionWorkspaceRequest} SeedConversionWorkspaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeedConversionWorkspaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SeedConversionWorkspaceRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SeedConversionWorkspaceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.autoCommit != null && message.hasOwnProperty("autoCommit")) + if (typeof message.autoCommit !== "boolean") + return "autoCommit: boolean expected"; + if (message.sourceConnectionProfile != null && message.hasOwnProperty("sourceConnectionProfile")) { + properties.seedFrom = 1; + if (!$util.isString(message.sourceConnectionProfile)) + return "sourceConnectionProfile: string expected"; + } + if (message.destinationConnectionProfile != null && message.hasOwnProperty("destinationConnectionProfile")) { + if (properties.seedFrom === 1) + return "seedFrom: multiple values"; + properties.seedFrom = 1; + if (!$util.isString(message.destinationConnectionProfile)) + return "destinationConnectionProfile: string expected"; } - case 6: { - message.patch = reader.string(); - break; + return null; + }; + + /** + * Creates a SeedConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SeedConversionWorkspaceRequest} SeedConversionWorkspaceRequest + */ + SeedConversionWorkspaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.autoCommit != null) + message.autoCommit = Boolean(object.autoCommit); + if (object.sourceConnectionProfile != null) + message.sourceConnectionProfile = String(object.sourceConnectionProfile); + if (object.destinationConnectionProfile != null) + message.destinationConnectionProfile = String(object.destinationConnectionProfile); + return message; + }; + + /** + * Creates a plain object from a SeedConversionWorkspaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.SeedConversionWorkspaceRequest} message SeedConversionWorkspaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SeedConversionWorkspaceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.autoCommit = false; } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.autoCommit != null && message.hasOwnProperty("autoCommit")) + object.autoCommit = message.autoCommit; + if (message.sourceConnectionProfile != null && message.hasOwnProperty("sourceConnectionProfile")) { + object.sourceConnectionProfile = message.sourceConnectionProfile; + if (options.oneofs) + object.seedFrom = "sourceConnectionProfile"; } - case 7: { - message.body = reader.string(); - break; + if (message.destinationConnectionProfile != null && message.hasOwnProperty("destinationConnectionProfile")) { + object.destinationConnectionProfile = message.destinationConnectionProfile; + if (options.oneofs) + object.seedFrom = "destinationConnectionProfile"; } - case 12: { + return object; + }; + + /** + * Converts this SeedConversionWorkspaceRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @instance + * @returns {Object.} JSON object + */ + SeedConversionWorkspaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SeedConversionWorkspaceRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SeedConversionWorkspaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SeedConversionWorkspaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SeedConversionWorkspaceRequest"; + }; + + return SeedConversionWorkspaceRequest; + })(); + + v1.ConvertConversionWorkspaceRequest = (function() { + + /** + * Properties of a ConvertConversionWorkspaceRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IConvertConversionWorkspaceRequest + * @property {string|null} [name] ConvertConversionWorkspaceRequest name + * @property {boolean|null} [autoCommit] ConvertConversionWorkspaceRequest autoCommit + * @property {string|null} [filter] ConvertConversionWorkspaceRequest filter + */ + + /** + * Constructs a new ConvertConversionWorkspaceRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ConvertConversionWorkspaceRequest. + * @implements IConvertConversionWorkspaceRequest + * @constructor + * @param {google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest=} [properties] Properties to set + */ + function ConvertConversionWorkspaceRequest(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]]; + } + + /** + * ConvertConversionWorkspaceRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @instance + */ + ConvertConversionWorkspaceRequest.prototype.name = ""; + + /** + * ConvertConversionWorkspaceRequest autoCommit. + * @member {boolean} autoCommit + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @instance + */ + ConvertConversionWorkspaceRequest.prototype.autoCommit = false; + + /** + * ConvertConversionWorkspaceRequest filter. + * @member {string} filter + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @instance + */ + ConvertConversionWorkspaceRequest.prototype.filter = ""; + + /** + * Creates a new ConvertConversionWorkspaceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest} ConvertConversionWorkspaceRequest instance + */ + ConvertConversionWorkspaceRequest.create = function create(properties) { + return new ConvertConversionWorkspaceRequest(properties); + }; + + /** + * Encodes the specified ConvertConversionWorkspaceRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest} message ConvertConversionWorkspaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConvertConversionWorkspaceRequest.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.autoCommit != null && Object.hasOwnProperty.call(message, "autoCommit")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.autoCommit); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ConvertConversionWorkspaceRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest} message ConvertConversionWorkspaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConvertConversionWorkspaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConvertConversionWorkspaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest} ConvertConversionWorkspaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConvertConversionWorkspaceRequest.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.clouddms.v1.ConvertConversionWorkspaceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.autoCommit = reader.bool(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConvertConversionWorkspaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest} ConvertConversionWorkspaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConvertConversionWorkspaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConvertConversionWorkspaceRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConvertConversionWorkspaceRequest.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.autoCommit != null && message.hasOwnProperty("autoCommit")) + if (typeof message.autoCommit !== "boolean") + return "autoCommit: boolean expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ConvertConversionWorkspaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest} ConvertConversionWorkspaceRequest + */ + ConvertConversionWorkspaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.autoCommit != null) + message.autoCommit = Boolean(object.autoCommit); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ConvertConversionWorkspaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @static + * @param {google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest} message ConvertConversionWorkspaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConvertConversionWorkspaceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.autoCommit = false; + object.filter = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.autoCommit != null && message.hasOwnProperty("autoCommit")) + object.autoCommit = message.autoCommit; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ConvertConversionWorkspaceRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @instance + * @returns {Object.} JSON object + */ + ConvertConversionWorkspaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConvertConversionWorkspaceRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConvertConversionWorkspaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest"; + }; + + return ConvertConversionWorkspaceRequest; + })(); + + v1.ImportMappingRulesRequest = (function() { + + /** + * Properties of an ImportMappingRulesRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IImportMappingRulesRequest + * @property {string|null} [parent] ImportMappingRulesRequest parent + * @property {google.cloud.clouddms.v1.ImportRulesFileFormat|null} [rulesFormat] ImportMappingRulesRequest rulesFormat + * @property {Array.|null} [rulesFiles] ImportMappingRulesRequest rulesFiles + * @property {boolean|null} [autoCommit] ImportMappingRulesRequest autoCommit + */ + + /** + * Constructs a new ImportMappingRulesRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents an ImportMappingRulesRequest. + * @implements IImportMappingRulesRequest + * @constructor + * @param {google.cloud.clouddms.v1.IImportMappingRulesRequest=} [properties] Properties to set + */ + function ImportMappingRulesRequest(properties) { + this.rulesFiles = []; + 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]]; + } + + /** + * ImportMappingRulesRequest parent. + * @member {string} parent + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @instance + */ + ImportMappingRulesRequest.prototype.parent = ""; + + /** + * ImportMappingRulesRequest rulesFormat. + * @member {google.cloud.clouddms.v1.ImportRulesFileFormat} rulesFormat + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @instance + */ + ImportMappingRulesRequest.prototype.rulesFormat = 0; + + /** + * ImportMappingRulesRequest rulesFiles. + * @member {Array.} rulesFiles + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @instance + */ + ImportMappingRulesRequest.prototype.rulesFiles = $util.emptyArray; + + /** + * ImportMappingRulesRequest autoCommit. + * @member {boolean} autoCommit + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @instance + */ + ImportMappingRulesRequest.prototype.autoCommit = false; + + /** + * Creates a new ImportMappingRulesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @static + * @param {google.cloud.clouddms.v1.IImportMappingRulesRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ImportMappingRulesRequest} ImportMappingRulesRequest instance + */ + ImportMappingRulesRequest.create = function create(properties) { + return new ImportMappingRulesRequest(properties); + }; + + /** + * Encodes the specified ImportMappingRulesRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ImportMappingRulesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @static + * @param {google.cloud.clouddms.v1.IImportMappingRulesRequest} message ImportMappingRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportMappingRulesRequest.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.rulesFormat != null && Object.hasOwnProperty.call(message, "rulesFormat")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rulesFormat); + if (message.rulesFiles != null && message.rulesFiles.length) + for (var i = 0; i < message.rulesFiles.length; ++i) + $root.google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile.encode(message.rulesFiles[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.autoCommit != null && Object.hasOwnProperty.call(message, "autoCommit")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.autoCommit); + return writer; + }; + + /** + * Encodes the specified ImportMappingRulesRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ImportMappingRulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @static + * @param {google.cloud.clouddms.v1.IImportMappingRulesRequest} message ImportMappingRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportMappingRulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportMappingRulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ImportMappingRulesRequest} ImportMappingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportMappingRulesRequest.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.clouddms.v1.ImportMappingRulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.rulesFormat = reader.int32(); + break; + } + case 3: { + if (!(message.rulesFiles && message.rulesFiles.length)) + message.rulesFiles = []; + message.rulesFiles.push($root.google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile.decode(reader, reader.uint32())); + break; + } + case 6: { + message.autoCommit = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportMappingRulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ImportMappingRulesRequest} ImportMappingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportMappingRulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportMappingRulesRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportMappingRulesRequest.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.rulesFormat != null && message.hasOwnProperty("rulesFormat")) + switch (message.rulesFormat) { + default: + return "rulesFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.rulesFiles != null && message.hasOwnProperty("rulesFiles")) { + if (!Array.isArray(message.rulesFiles)) + return "rulesFiles: array expected"; + for (var i = 0; i < message.rulesFiles.length; ++i) { + var error = $root.google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile.verify(message.rulesFiles[i]); + if (error) + return "rulesFiles." + error; + } + } + if (message.autoCommit != null && message.hasOwnProperty("autoCommit")) + if (typeof message.autoCommit !== "boolean") + return "autoCommit: boolean expected"; + return null; + }; + + /** + * Creates an ImportMappingRulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ImportMappingRulesRequest} ImportMappingRulesRequest + */ + ImportMappingRulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ImportMappingRulesRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.ImportMappingRulesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.rulesFormat) { + default: + if (typeof object.rulesFormat === "number") { + message.rulesFormat = object.rulesFormat; + break; + } + break; + case "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED": + case 0: + message.rulesFormat = 0; + break; + case "IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE": + case 1: + message.rulesFormat = 1; + break; + case "IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE": + case 2: + message.rulesFormat = 2; + break; + } + if (object.rulesFiles) { + if (!Array.isArray(object.rulesFiles)) + throw TypeError(".google.cloud.clouddms.v1.ImportMappingRulesRequest.rulesFiles: array expected"); + message.rulesFiles = []; + for (var i = 0; i < object.rulesFiles.length; ++i) { + if (typeof object.rulesFiles[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.ImportMappingRulesRequest.rulesFiles: object expected"); + message.rulesFiles[i] = $root.google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile.fromObject(object.rulesFiles[i]); + } + } + if (object.autoCommit != null) + message.autoCommit = Boolean(object.autoCommit); + return message; + }; + + /** + * Creates a plain object from an ImportMappingRulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @static + * @param {google.cloud.clouddms.v1.ImportMappingRulesRequest} message ImportMappingRulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportMappingRulesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rulesFiles = []; + if (options.defaults) { + object.parent = ""; + object.rulesFormat = options.enums === String ? "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED" : 0; + object.autoCommit = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.rulesFormat != null && message.hasOwnProperty("rulesFormat")) + object.rulesFormat = options.enums === String ? $root.google.cloud.clouddms.v1.ImportRulesFileFormat[message.rulesFormat] === undefined ? message.rulesFormat : $root.google.cloud.clouddms.v1.ImportRulesFileFormat[message.rulesFormat] : message.rulesFormat; + if (message.rulesFiles && message.rulesFiles.length) { + object.rulesFiles = []; + for (var j = 0; j < message.rulesFiles.length; ++j) + object.rulesFiles[j] = $root.google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile.toObject(message.rulesFiles[j], options); + } + if (message.autoCommit != null && message.hasOwnProperty("autoCommit")) + object.autoCommit = message.autoCommit; + return object; + }; + + /** + * Converts this ImportMappingRulesRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @instance + * @returns {Object.} JSON object + */ + ImportMappingRulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportMappingRulesRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportMappingRulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ImportMappingRulesRequest"; + }; + + ImportMappingRulesRequest.RulesFile = (function() { + + /** + * Properties of a RulesFile. + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @interface IRulesFile + * @property {string|null} [rulesSourceFilename] RulesFile rulesSourceFilename + * @property {string|null} [rulesContent] RulesFile rulesContent + */ + + /** + * Constructs a new RulesFile. + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest + * @classdesc Represents a RulesFile. + * @implements IRulesFile + * @constructor + * @param {google.cloud.clouddms.v1.ImportMappingRulesRequest.IRulesFile=} [properties] Properties to set + */ + function RulesFile(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]]; + } + + /** + * RulesFile rulesSourceFilename. + * @member {string} rulesSourceFilename + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile + * @instance + */ + RulesFile.prototype.rulesSourceFilename = ""; + + /** + * RulesFile rulesContent. + * @member {string} rulesContent + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile + * @instance + */ + RulesFile.prototype.rulesContent = ""; + + /** + * Creates a new RulesFile instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile + * @static + * @param {google.cloud.clouddms.v1.ImportMappingRulesRequest.IRulesFile=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile} RulesFile instance + */ + RulesFile.create = function create(properties) { + return new RulesFile(properties); + }; + + /** + * Encodes the specified RulesFile message. Does not implicitly {@link google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile + * @static + * @param {google.cloud.clouddms.v1.ImportMappingRulesRequest.IRulesFile} message RulesFile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RulesFile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rulesSourceFilename != null && Object.hasOwnProperty.call(message, "rulesSourceFilename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rulesSourceFilename); + if (message.rulesContent != null && Object.hasOwnProperty.call(message, "rulesContent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rulesContent); + return writer; + }; + + /** + * Encodes the specified RulesFile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile + * @static + * @param {google.cloud.clouddms.v1.ImportMappingRulesRequest.IRulesFile} message RulesFile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RulesFile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RulesFile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile} RulesFile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RulesFile.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.clouddms.v1.ImportMappingRulesRequest.RulesFile(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rulesSourceFilename = reader.string(); + break; + } + case 2: { + message.rulesContent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RulesFile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile} RulesFile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RulesFile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RulesFile message. + * @function verify + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RulesFile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rulesSourceFilename != null && message.hasOwnProperty("rulesSourceFilename")) + if (!$util.isString(message.rulesSourceFilename)) + return "rulesSourceFilename: string expected"; + if (message.rulesContent != null && message.hasOwnProperty("rulesContent")) + if (!$util.isString(message.rulesContent)) + return "rulesContent: string expected"; + return null; + }; + + /** + * Creates a RulesFile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile} RulesFile + */ + RulesFile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile) + return object; + var message = new $root.google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile(); + if (object.rulesSourceFilename != null) + message.rulesSourceFilename = String(object.rulesSourceFilename); + if (object.rulesContent != null) + message.rulesContent = String(object.rulesContent); + return message; + }; + + /** + * Creates a plain object from a RulesFile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile + * @static + * @param {google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile} message RulesFile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RulesFile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rulesSourceFilename = ""; + object.rulesContent = ""; + } + if (message.rulesSourceFilename != null && message.hasOwnProperty("rulesSourceFilename")) + object.rulesSourceFilename = message.rulesSourceFilename; + if (message.rulesContent != null && message.hasOwnProperty("rulesContent")) + object.rulesContent = message.rulesContent; + return object; + }; + + /** + * Converts this RulesFile to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile + * @instance + * @returns {Object.} JSON object + */ + RulesFile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RulesFile + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RulesFile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ImportMappingRulesRequest.RulesFile"; + }; + + return RulesFile; + })(); + + return ImportMappingRulesRequest; + })(); + + v1.DescribeDatabaseEntitiesRequest = (function() { + + /** + * Properties of a DescribeDatabaseEntitiesRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IDescribeDatabaseEntitiesRequest + * @property {string|null} [conversionWorkspace] DescribeDatabaseEntitiesRequest conversionWorkspace + * @property {number|null} [pageSize] DescribeDatabaseEntitiesRequest pageSize + * @property {string|null} [pageToken] DescribeDatabaseEntitiesRequest pageToken + * @property {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType|null} [tree] DescribeDatabaseEntitiesRequest tree + * @property {boolean|null} [uncommitted] DescribeDatabaseEntitiesRequest uncommitted + * @property {string|null} [commitId] DescribeDatabaseEntitiesRequest commitId + * @property {string|null} [filter] DescribeDatabaseEntitiesRequest filter + */ + + /** + * Constructs a new DescribeDatabaseEntitiesRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a DescribeDatabaseEntitiesRequest. + * @implements IDescribeDatabaseEntitiesRequest + * @constructor + * @param {google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest=} [properties] Properties to set + */ + function DescribeDatabaseEntitiesRequest(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]]; + } + + /** + * DescribeDatabaseEntitiesRequest conversionWorkspace. + * @member {string} conversionWorkspace + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @instance + */ + DescribeDatabaseEntitiesRequest.prototype.conversionWorkspace = ""; + + /** + * DescribeDatabaseEntitiesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @instance + */ + DescribeDatabaseEntitiesRequest.prototype.pageSize = 0; + + /** + * DescribeDatabaseEntitiesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @instance + */ + DescribeDatabaseEntitiesRequest.prototype.pageToken = ""; + + /** + * DescribeDatabaseEntitiesRequest tree. + * @member {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType} tree + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @instance + */ + DescribeDatabaseEntitiesRequest.prototype.tree = 0; + + /** + * DescribeDatabaseEntitiesRequest uncommitted. + * @member {boolean} uncommitted + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @instance + */ + DescribeDatabaseEntitiesRequest.prototype.uncommitted = false; + + /** + * DescribeDatabaseEntitiesRequest commitId. + * @member {string} commitId + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @instance + */ + DescribeDatabaseEntitiesRequest.prototype.commitId = ""; + + /** + * DescribeDatabaseEntitiesRequest filter. + * @member {string} filter + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @instance + */ + DescribeDatabaseEntitiesRequest.prototype.filter = ""; + + /** + * Creates a new DescribeDatabaseEntitiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @static + * @param {google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest} DescribeDatabaseEntitiesRequest instance + */ + DescribeDatabaseEntitiesRequest.create = function create(properties) { + return new DescribeDatabaseEntitiesRequest(properties); + }; + + /** + * Encodes the specified DescribeDatabaseEntitiesRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @static + * @param {google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest} message DescribeDatabaseEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescribeDatabaseEntitiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversionWorkspace != null && Object.hasOwnProperty.call(message, "conversionWorkspace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversionWorkspace); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.tree != null && Object.hasOwnProperty.call(message, "tree")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.tree); + if (message.uncommitted != null && Object.hasOwnProperty.call(message, "uncommitted")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.uncommitted); + if (message.commitId != null && Object.hasOwnProperty.call(message, "commitId")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.commitId); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.filter); + return writer; + }; + + /** + * Encodes the specified DescribeDatabaseEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @static + * @param {google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest} message DescribeDatabaseEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescribeDatabaseEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescribeDatabaseEntitiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest} DescribeDatabaseEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescribeDatabaseEntitiesRequest.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.clouddms.v1.DescribeDatabaseEntitiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.conversionWorkspace = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.tree = reader.int32(); + break; + } + case 11: { + message.uncommitted = reader.bool(); + break; + } + case 12: { + message.commitId = reader.string(); + break; + } + case 13: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescribeDatabaseEntitiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest} DescribeDatabaseEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescribeDatabaseEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescribeDatabaseEntitiesRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescribeDatabaseEntitiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversionWorkspace != null && message.hasOwnProperty("conversionWorkspace")) + if (!$util.isString(message.conversionWorkspace)) + return "conversionWorkspace: 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.tree != null && message.hasOwnProperty("tree")) + switch (message.tree) { + default: + return "tree: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.uncommitted != null && message.hasOwnProperty("uncommitted")) + if (typeof message.uncommitted !== "boolean") + return "uncommitted: boolean expected"; + if (message.commitId != null && message.hasOwnProperty("commitId")) + if (!$util.isString(message.commitId)) + return "commitId: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a DescribeDatabaseEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest} DescribeDatabaseEntitiesRequest + */ + DescribeDatabaseEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest(); + if (object.conversionWorkspace != null) + message.conversionWorkspace = String(object.conversionWorkspace); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + switch (object.tree) { + default: + if (typeof object.tree === "number") { + message.tree = object.tree; + break; + } + break; + case "DB_TREE_TYPE_UNSPECIFIED": + case 0: + message.tree = 0; + break; + case "SOURCE_TREE": + case 1: + message.tree = 1; + break; + case "DRAFT_TREE": + case 2: + message.tree = 2; + break; + case "DESTINATION_TREE": + case 3: + message.tree = 3; + break; + } + if (object.uncommitted != null) + message.uncommitted = Boolean(object.uncommitted); + if (object.commitId != null) + message.commitId = String(object.commitId); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a DescribeDatabaseEntitiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @static + * @param {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest} message DescribeDatabaseEntitiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescribeDatabaseEntitiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.conversionWorkspace = ""; + object.pageSize = 0; + object.pageToken = ""; + object.tree = options.enums === String ? "DB_TREE_TYPE_UNSPECIFIED" : 0; + object.uncommitted = false; + object.commitId = ""; + object.filter = ""; + } + if (message.conversionWorkspace != null && message.hasOwnProperty("conversionWorkspace")) + object.conversionWorkspace = message.conversionWorkspace; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.tree != null && message.hasOwnProperty("tree")) + object.tree = options.enums === String ? $root.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType[message.tree] === undefined ? message.tree : $root.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType[message.tree] : message.tree; + if (message.uncommitted != null && message.hasOwnProperty("uncommitted")) + object.uncommitted = message.uncommitted; + if (message.commitId != null && message.hasOwnProperty("commitId")) + object.commitId = message.commitId; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this DescribeDatabaseEntitiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @instance + * @returns {Object.} JSON object + */ + DescribeDatabaseEntitiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescribeDatabaseEntitiesRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescribeDatabaseEntitiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest"; + }; + + /** + * DBTreeType enum. + * @name google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType + * @enum {number} + * @property {number} DB_TREE_TYPE_UNSPECIFIED=0 DB_TREE_TYPE_UNSPECIFIED value + * @property {number} SOURCE_TREE=1 SOURCE_TREE value + * @property {number} DRAFT_TREE=2 DRAFT_TREE value + * @property {number} DESTINATION_TREE=3 DESTINATION_TREE value + */ + DescribeDatabaseEntitiesRequest.DBTreeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DB_TREE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SOURCE_TREE"] = 1; + values[valuesById[2] = "DRAFT_TREE"] = 2; + values[valuesById[3] = "DESTINATION_TREE"] = 3; + return values; + })(); + + return DescribeDatabaseEntitiesRequest; + })(); + + v1.DescribeDatabaseEntitiesResponse = (function() { + + /** + * Properties of a DescribeDatabaseEntitiesResponse. + * @memberof google.cloud.clouddms.v1 + * @interface IDescribeDatabaseEntitiesResponse + * @property {Array.|null} [databaseEntities] DescribeDatabaseEntitiesResponse databaseEntities + * @property {string|null} [nextPageToken] DescribeDatabaseEntitiesResponse nextPageToken + */ + + /** + * Constructs a new DescribeDatabaseEntitiesResponse. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a DescribeDatabaseEntitiesResponse. + * @implements IDescribeDatabaseEntitiesResponse + * @constructor + * @param {google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse=} [properties] Properties to set + */ + function DescribeDatabaseEntitiesResponse(properties) { + this.databaseEntities = []; + 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]]; + } + + /** + * DescribeDatabaseEntitiesResponse databaseEntities. + * @member {Array.} databaseEntities + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse + * @instance + */ + DescribeDatabaseEntitiesResponse.prototype.databaseEntities = $util.emptyArray; + + /** + * DescribeDatabaseEntitiesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse + * @instance + */ + DescribeDatabaseEntitiesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new DescribeDatabaseEntitiesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse + * @static + * @param {google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse} DescribeDatabaseEntitiesResponse instance + */ + DescribeDatabaseEntitiesResponse.create = function create(properties) { + return new DescribeDatabaseEntitiesResponse(properties); + }; + + /** + * Encodes the specified DescribeDatabaseEntitiesResponse message. Does not implicitly {@link google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse + * @static + * @param {google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse} message DescribeDatabaseEntitiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescribeDatabaseEntitiesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databaseEntities != null && message.databaseEntities.length) + for (var i = 0; i < message.databaseEntities.length; ++i) + $root.google.cloud.clouddms.v1.DatabaseEntity.encode(message.databaseEntities[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 DescribeDatabaseEntitiesResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse + * @static + * @param {google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse} message DescribeDatabaseEntitiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescribeDatabaseEntitiesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescribeDatabaseEntitiesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse} DescribeDatabaseEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescribeDatabaseEntitiesResponse.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.clouddms.v1.DescribeDatabaseEntitiesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.databaseEntities && message.databaseEntities.length)) + message.databaseEntities = []; + message.databaseEntities.push($root.google.cloud.clouddms.v1.DatabaseEntity.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescribeDatabaseEntitiesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse} DescribeDatabaseEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescribeDatabaseEntitiesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescribeDatabaseEntitiesResponse message. + * @function verify + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescribeDatabaseEntitiesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databaseEntities != null && message.hasOwnProperty("databaseEntities")) { + if (!Array.isArray(message.databaseEntities)) + return "databaseEntities: array expected"; + for (var i = 0; i < message.databaseEntities.length; ++i) { + var error = $root.google.cloud.clouddms.v1.DatabaseEntity.verify(message.databaseEntities[i]); + if (error) + return "databaseEntities." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a DescribeDatabaseEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse} DescribeDatabaseEntitiesResponse + */ + DescribeDatabaseEntitiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse) + return object; + var message = new $root.google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse(); + if (object.databaseEntities) { + if (!Array.isArray(object.databaseEntities)) + throw TypeError(".google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse.databaseEntities: array expected"); + message.databaseEntities = []; + for (var i = 0; i < object.databaseEntities.length; ++i) { + if (typeof object.databaseEntities[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse.databaseEntities: object expected"); + message.databaseEntities[i] = $root.google.cloud.clouddms.v1.DatabaseEntity.fromObject(object.databaseEntities[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a DescribeDatabaseEntitiesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse + * @static + * @param {google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse} message DescribeDatabaseEntitiesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescribeDatabaseEntitiesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.databaseEntities = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.databaseEntities && message.databaseEntities.length) { + object.databaseEntities = []; + for (var j = 0; j < message.databaseEntities.length; ++j) + object.databaseEntities[j] = $root.google.cloud.clouddms.v1.DatabaseEntity.toObject(message.databaseEntities[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this DescribeDatabaseEntitiesResponse to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse + * @instance + * @returns {Object.} JSON object + */ + DescribeDatabaseEntitiesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescribeDatabaseEntitiesResponse + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescribeDatabaseEntitiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse"; + }; + + return DescribeDatabaseEntitiesResponse; + })(); + + v1.SearchBackgroundJobsRequest = (function() { + + /** + * Properties of a SearchBackgroundJobsRequest. + * @memberof google.cloud.clouddms.v1 + * @interface ISearchBackgroundJobsRequest + * @property {string|null} [conversionWorkspace] SearchBackgroundJobsRequest conversionWorkspace + * @property {boolean|null} [returnMostRecentPerJobType] SearchBackgroundJobsRequest returnMostRecentPerJobType + * @property {number|null} [maxSize] SearchBackgroundJobsRequest maxSize + * @property {google.protobuf.ITimestamp|null} [completedUntilTime] SearchBackgroundJobsRequest completedUntilTime + */ + + /** + * Constructs a new SearchBackgroundJobsRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SearchBackgroundJobsRequest. + * @implements ISearchBackgroundJobsRequest + * @constructor + * @param {google.cloud.clouddms.v1.ISearchBackgroundJobsRequest=} [properties] Properties to set + */ + function SearchBackgroundJobsRequest(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]]; + } + + /** + * SearchBackgroundJobsRequest conversionWorkspace. + * @member {string} conversionWorkspace + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @instance + */ + SearchBackgroundJobsRequest.prototype.conversionWorkspace = ""; + + /** + * SearchBackgroundJobsRequest returnMostRecentPerJobType. + * @member {boolean} returnMostRecentPerJobType + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @instance + */ + SearchBackgroundJobsRequest.prototype.returnMostRecentPerJobType = false; + + /** + * SearchBackgroundJobsRequest maxSize. + * @member {number} maxSize + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @instance + */ + SearchBackgroundJobsRequest.prototype.maxSize = 0; + + /** + * SearchBackgroundJobsRequest completedUntilTime. + * @member {google.protobuf.ITimestamp|null|undefined} completedUntilTime + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @instance + */ + SearchBackgroundJobsRequest.prototype.completedUntilTime = null; + + /** + * Creates a new SearchBackgroundJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @static + * @param {google.cloud.clouddms.v1.ISearchBackgroundJobsRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SearchBackgroundJobsRequest} SearchBackgroundJobsRequest instance + */ + SearchBackgroundJobsRequest.create = function create(properties) { + return new SearchBackgroundJobsRequest(properties); + }; + + /** + * Encodes the specified SearchBackgroundJobsRequest message. Does not implicitly {@link google.cloud.clouddms.v1.SearchBackgroundJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @static + * @param {google.cloud.clouddms.v1.ISearchBackgroundJobsRequest} message SearchBackgroundJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchBackgroundJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversionWorkspace != null && Object.hasOwnProperty.call(message, "conversionWorkspace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversionWorkspace); + if (message.returnMostRecentPerJobType != null && Object.hasOwnProperty.call(message, "returnMostRecentPerJobType")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.returnMostRecentPerJobType); + if (message.maxSize != null && Object.hasOwnProperty.call(message, "maxSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxSize); + if (message.completedUntilTime != null && Object.hasOwnProperty.call(message, "completedUntilTime")) + $root.google.protobuf.Timestamp.encode(message.completedUntilTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchBackgroundJobsRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SearchBackgroundJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @static + * @param {google.cloud.clouddms.v1.ISearchBackgroundJobsRequest} message SearchBackgroundJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchBackgroundJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchBackgroundJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SearchBackgroundJobsRequest} SearchBackgroundJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchBackgroundJobsRequest.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.clouddms.v1.SearchBackgroundJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.conversionWorkspace = reader.string(); + break; + } + case 2: { + message.returnMostRecentPerJobType = reader.bool(); + break; + } + case 3: { + message.maxSize = reader.int32(); + break; + } + case 4: { + message.completedUntilTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchBackgroundJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SearchBackgroundJobsRequest} SearchBackgroundJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchBackgroundJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchBackgroundJobsRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchBackgroundJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversionWorkspace != null && message.hasOwnProperty("conversionWorkspace")) + if (!$util.isString(message.conversionWorkspace)) + return "conversionWorkspace: string expected"; + if (message.returnMostRecentPerJobType != null && message.hasOwnProperty("returnMostRecentPerJobType")) + if (typeof message.returnMostRecentPerJobType !== "boolean") + return "returnMostRecentPerJobType: boolean expected"; + if (message.maxSize != null && message.hasOwnProperty("maxSize")) + if (!$util.isInteger(message.maxSize)) + return "maxSize: integer expected"; + if (message.completedUntilTime != null && message.hasOwnProperty("completedUntilTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completedUntilTime); + if (error) + return "completedUntilTime." + error; + } + return null; + }; + + /** + * Creates a SearchBackgroundJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SearchBackgroundJobsRequest} SearchBackgroundJobsRequest + */ + SearchBackgroundJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SearchBackgroundJobsRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.SearchBackgroundJobsRequest(); + if (object.conversionWorkspace != null) + message.conversionWorkspace = String(object.conversionWorkspace); + if (object.returnMostRecentPerJobType != null) + message.returnMostRecentPerJobType = Boolean(object.returnMostRecentPerJobType); + if (object.maxSize != null) + message.maxSize = object.maxSize | 0; + if (object.completedUntilTime != null) { + if (typeof object.completedUntilTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.SearchBackgroundJobsRequest.completedUntilTime: object expected"); + message.completedUntilTime = $root.google.protobuf.Timestamp.fromObject(object.completedUntilTime); + } + return message; + }; + + /** + * Creates a plain object from a SearchBackgroundJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @static + * @param {google.cloud.clouddms.v1.SearchBackgroundJobsRequest} message SearchBackgroundJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchBackgroundJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.conversionWorkspace = ""; + object.returnMostRecentPerJobType = false; + object.maxSize = 0; + object.completedUntilTime = null; + } + if (message.conversionWorkspace != null && message.hasOwnProperty("conversionWorkspace")) + object.conversionWorkspace = message.conversionWorkspace; + if (message.returnMostRecentPerJobType != null && message.hasOwnProperty("returnMostRecentPerJobType")) + object.returnMostRecentPerJobType = message.returnMostRecentPerJobType; + if (message.maxSize != null && message.hasOwnProperty("maxSize")) + object.maxSize = message.maxSize; + if (message.completedUntilTime != null && message.hasOwnProperty("completedUntilTime")) + object.completedUntilTime = $root.google.protobuf.Timestamp.toObject(message.completedUntilTime, options); + return object; + }; + + /** + * Converts this SearchBackgroundJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchBackgroundJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchBackgroundJobsRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchBackgroundJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SearchBackgroundJobsRequest"; + }; + + return SearchBackgroundJobsRequest; + })(); + + v1.SearchBackgroundJobsResponse = (function() { + + /** + * Properties of a SearchBackgroundJobsResponse. + * @memberof google.cloud.clouddms.v1 + * @interface ISearchBackgroundJobsResponse + * @property {Array.|null} [jobs] SearchBackgroundJobsResponse jobs + */ + + /** + * Constructs a new SearchBackgroundJobsResponse. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SearchBackgroundJobsResponse. + * @implements ISearchBackgroundJobsResponse + * @constructor + * @param {google.cloud.clouddms.v1.ISearchBackgroundJobsResponse=} [properties] Properties to set + */ + function SearchBackgroundJobsResponse(properties) { + this.jobs = []; + 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]]; + } + + /** + * SearchBackgroundJobsResponse jobs. + * @member {Array.} jobs + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsResponse + * @instance + */ + SearchBackgroundJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * Creates a new SearchBackgroundJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsResponse + * @static + * @param {google.cloud.clouddms.v1.ISearchBackgroundJobsResponse=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SearchBackgroundJobsResponse} SearchBackgroundJobsResponse instance + */ + SearchBackgroundJobsResponse.create = function create(properties) { + return new SearchBackgroundJobsResponse(properties); + }; + + /** + * Encodes the specified SearchBackgroundJobsResponse message. Does not implicitly {@link google.cloud.clouddms.v1.SearchBackgroundJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsResponse + * @static + * @param {google.cloud.clouddms.v1.ISearchBackgroundJobsResponse} message SearchBackgroundJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchBackgroundJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchBackgroundJobsResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SearchBackgroundJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsResponse + * @static + * @param {google.cloud.clouddms.v1.ISearchBackgroundJobsResponse} message SearchBackgroundJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchBackgroundJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchBackgroundJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SearchBackgroundJobsResponse} SearchBackgroundJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchBackgroundJobsResponse.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.clouddms.v1.SearchBackgroundJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.clouddms.v1.BackgroundJobLogEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchBackgroundJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SearchBackgroundJobsResponse} SearchBackgroundJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchBackgroundJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchBackgroundJobsResponse message. + * @function verify + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchBackgroundJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + return null; + }; + + /** + * Creates a SearchBackgroundJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SearchBackgroundJobsResponse} SearchBackgroundJobsResponse + */ + SearchBackgroundJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SearchBackgroundJobsResponse) + return object; + var message = new $root.google.cloud.clouddms.v1.SearchBackgroundJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.clouddms.v1.SearchBackgroundJobsResponse.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.SearchBackgroundJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.fromObject(object.jobs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SearchBackgroundJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsResponse + * @static + * @param {google.cloud.clouddms.v1.SearchBackgroundJobsResponse} message SearchBackgroundJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchBackgroundJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jobs = []; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.toObject(message.jobs[j], options); + } + return object; + }; + + /** + * Converts this SearchBackgroundJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchBackgroundJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchBackgroundJobsResponse + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SearchBackgroundJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchBackgroundJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SearchBackgroundJobsResponse"; + }; + + return SearchBackgroundJobsResponse; + })(); + + v1.DescribeConversionWorkspaceRevisionsRequest = (function() { + + /** + * Properties of a DescribeConversionWorkspaceRevisionsRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IDescribeConversionWorkspaceRevisionsRequest + * @property {string|null} [conversionWorkspace] DescribeConversionWorkspaceRevisionsRequest conversionWorkspace + * @property {string|null} [commitId] DescribeConversionWorkspaceRevisionsRequest commitId + */ + + /** + * Constructs a new DescribeConversionWorkspaceRevisionsRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a DescribeConversionWorkspaceRevisionsRequest. + * @implements IDescribeConversionWorkspaceRevisionsRequest + * @constructor + * @param {google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest=} [properties] Properties to set + */ + function DescribeConversionWorkspaceRevisionsRequest(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]]; + } + + /** + * DescribeConversionWorkspaceRevisionsRequest conversionWorkspace. + * @member {string} conversionWorkspace + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest + * @instance + */ + DescribeConversionWorkspaceRevisionsRequest.prototype.conversionWorkspace = ""; + + /** + * DescribeConversionWorkspaceRevisionsRequest commitId. + * @member {string} commitId + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest + * @instance + */ + DescribeConversionWorkspaceRevisionsRequest.prototype.commitId = ""; + + /** + * Creates a new DescribeConversionWorkspaceRevisionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest + * @static + * @param {google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest} DescribeConversionWorkspaceRevisionsRequest instance + */ + DescribeConversionWorkspaceRevisionsRequest.create = function create(properties) { + return new DescribeConversionWorkspaceRevisionsRequest(properties); + }; + + /** + * Encodes the specified DescribeConversionWorkspaceRevisionsRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest + * @static + * @param {google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest} message DescribeConversionWorkspaceRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescribeConversionWorkspaceRevisionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversionWorkspace != null && Object.hasOwnProperty.call(message, "conversionWorkspace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversionWorkspace); + if (message.commitId != null && Object.hasOwnProperty.call(message, "commitId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.commitId); + return writer; + }; + + /** + * Encodes the specified DescribeConversionWorkspaceRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest + * @static + * @param {google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest} message DescribeConversionWorkspaceRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescribeConversionWorkspaceRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescribeConversionWorkspaceRevisionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest} DescribeConversionWorkspaceRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescribeConversionWorkspaceRevisionsRequest.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.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.conversionWorkspace = reader.string(); + break; + } + case 2: { + message.commitId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescribeConversionWorkspaceRevisionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest} DescribeConversionWorkspaceRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescribeConversionWorkspaceRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescribeConversionWorkspaceRevisionsRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescribeConversionWorkspaceRevisionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversionWorkspace != null && message.hasOwnProperty("conversionWorkspace")) + if (!$util.isString(message.conversionWorkspace)) + return "conversionWorkspace: string expected"; + if (message.commitId != null && message.hasOwnProperty("commitId")) + if (!$util.isString(message.commitId)) + return "commitId: string expected"; + return null; + }; + + /** + * Creates a DescribeConversionWorkspaceRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest} DescribeConversionWorkspaceRevisionsRequest + */ + DescribeConversionWorkspaceRevisionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest(); + if (object.conversionWorkspace != null) + message.conversionWorkspace = String(object.conversionWorkspace); + if (object.commitId != null) + message.commitId = String(object.commitId); + return message; + }; + + /** + * Creates a plain object from a DescribeConversionWorkspaceRevisionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest + * @static + * @param {google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest} message DescribeConversionWorkspaceRevisionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescribeConversionWorkspaceRevisionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.conversionWorkspace = ""; + object.commitId = ""; + } + if (message.conversionWorkspace != null && message.hasOwnProperty("conversionWorkspace")) + object.conversionWorkspace = message.conversionWorkspace; + if (message.commitId != null && message.hasOwnProperty("commitId")) + object.commitId = message.commitId; + return object; + }; + + /** + * Converts this DescribeConversionWorkspaceRevisionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest + * @instance + * @returns {Object.} JSON object + */ + DescribeConversionWorkspaceRevisionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescribeConversionWorkspaceRevisionsRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescribeConversionWorkspaceRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest"; + }; + + return DescribeConversionWorkspaceRevisionsRequest; + })(); + + v1.DescribeConversionWorkspaceRevisionsResponse = (function() { + + /** + * Properties of a DescribeConversionWorkspaceRevisionsResponse. + * @memberof google.cloud.clouddms.v1 + * @interface IDescribeConversionWorkspaceRevisionsResponse + * @property {Array.|null} [revisions] DescribeConversionWorkspaceRevisionsResponse revisions + */ + + /** + * Constructs a new DescribeConversionWorkspaceRevisionsResponse. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a DescribeConversionWorkspaceRevisionsResponse. + * @implements IDescribeConversionWorkspaceRevisionsResponse + * @constructor + * @param {google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse=} [properties] Properties to set + */ + function DescribeConversionWorkspaceRevisionsResponse(properties) { + this.revisions = []; + 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]]; + } + + /** + * DescribeConversionWorkspaceRevisionsResponse revisions. + * @member {Array.} revisions + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse + * @instance + */ + DescribeConversionWorkspaceRevisionsResponse.prototype.revisions = $util.emptyArray; + + /** + * Creates a new DescribeConversionWorkspaceRevisionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse + * @static + * @param {google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse} DescribeConversionWorkspaceRevisionsResponse instance + */ + DescribeConversionWorkspaceRevisionsResponse.create = function create(properties) { + return new DescribeConversionWorkspaceRevisionsResponse(properties); + }; + + /** + * Encodes the specified DescribeConversionWorkspaceRevisionsResponse message. Does not implicitly {@link google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse + * @static + * @param {google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse} message DescribeConversionWorkspaceRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescribeConversionWorkspaceRevisionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revisions != null && message.revisions.length) + for (var i = 0; i < message.revisions.length; ++i) + $root.google.cloud.clouddms.v1.ConversionWorkspace.encode(message.revisions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DescribeConversionWorkspaceRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse + * @static + * @param {google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse} message DescribeConversionWorkspaceRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescribeConversionWorkspaceRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescribeConversionWorkspaceRevisionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse} DescribeConversionWorkspaceRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescribeConversionWorkspaceRevisionsResponse.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.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.revisions && message.revisions.length)) + message.revisions = []; + message.revisions.push($root.google.cloud.clouddms.v1.ConversionWorkspace.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescribeConversionWorkspaceRevisionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse} DescribeConversionWorkspaceRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescribeConversionWorkspaceRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescribeConversionWorkspaceRevisionsResponse message. + * @function verify + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescribeConversionWorkspaceRevisionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revisions != null && message.hasOwnProperty("revisions")) { + if (!Array.isArray(message.revisions)) + return "revisions: array expected"; + for (var i = 0; i < message.revisions.length; ++i) { + var error = $root.google.cloud.clouddms.v1.ConversionWorkspace.verify(message.revisions[i]); + if (error) + return "revisions." + error; + } + } + return null; + }; + + /** + * Creates a DescribeConversionWorkspaceRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse} DescribeConversionWorkspaceRevisionsResponse + */ + DescribeConversionWorkspaceRevisionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse) + return object; + var message = new $root.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse(); + if (object.revisions) { + if (!Array.isArray(object.revisions)) + throw TypeError(".google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse.revisions: array expected"); + message.revisions = []; + for (var i = 0; i < object.revisions.length; ++i) { + if (typeof object.revisions[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse.revisions: object expected"); + message.revisions[i] = $root.google.cloud.clouddms.v1.ConversionWorkspace.fromObject(object.revisions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DescribeConversionWorkspaceRevisionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse + * @static + * @param {google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse} message DescribeConversionWorkspaceRevisionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescribeConversionWorkspaceRevisionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.revisions = []; + if (message.revisions && message.revisions.length) { + object.revisions = []; + for (var j = 0; j < message.revisions.length; ++j) + object.revisions[j] = $root.google.cloud.clouddms.v1.ConversionWorkspace.toObject(message.revisions[j], options); + } + return object; + }; + + /** + * Converts this DescribeConversionWorkspaceRevisionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse + * @instance + * @returns {Object.} JSON object + */ + DescribeConversionWorkspaceRevisionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescribeConversionWorkspaceRevisionsResponse + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescribeConversionWorkspaceRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse"; + }; + + return DescribeConversionWorkspaceRevisionsResponse; + })(); + + v1.FetchStaticIpsRequest = (function() { + + /** + * Properties of a FetchStaticIpsRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IFetchStaticIpsRequest + * @property {string|null} [name] FetchStaticIpsRequest name + * @property {number|null} [pageSize] FetchStaticIpsRequest pageSize + * @property {string|null} [pageToken] FetchStaticIpsRequest pageToken + */ + + /** + * Constructs a new FetchStaticIpsRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a FetchStaticIpsRequest. + * @implements IFetchStaticIpsRequest + * @constructor + * @param {google.cloud.clouddms.v1.IFetchStaticIpsRequest=} [properties] Properties to set + */ + function FetchStaticIpsRequest(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]]; + } + + /** + * FetchStaticIpsRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @instance + */ + FetchStaticIpsRequest.prototype.name = ""; + + /** + * FetchStaticIpsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @instance + */ + FetchStaticIpsRequest.prototype.pageSize = 0; + + /** + * FetchStaticIpsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @instance + */ + FetchStaticIpsRequest.prototype.pageToken = ""; + + /** + * Creates a new FetchStaticIpsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @static + * @param {google.cloud.clouddms.v1.IFetchStaticIpsRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.FetchStaticIpsRequest} FetchStaticIpsRequest instance + */ + FetchStaticIpsRequest.create = function create(properties) { + return new FetchStaticIpsRequest(properties); + }; + + /** + * Encodes the specified FetchStaticIpsRequest message. Does not implicitly {@link google.cloud.clouddms.v1.FetchStaticIpsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @static + * @param {google.cloud.clouddms.v1.IFetchStaticIpsRequest} message FetchStaticIpsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchStaticIpsRequest.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.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 FetchStaticIpsRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.FetchStaticIpsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @static + * @param {google.cloud.clouddms.v1.IFetchStaticIpsRequest} message FetchStaticIpsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchStaticIpsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchStaticIpsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.FetchStaticIpsRequest} FetchStaticIpsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchStaticIpsRequest.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.clouddms.v1.FetchStaticIpsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchStaticIpsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.FetchStaticIpsRequest} FetchStaticIpsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchStaticIpsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchStaticIpsRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchStaticIpsRequest.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a FetchStaticIpsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.FetchStaticIpsRequest} FetchStaticIpsRequest + */ + FetchStaticIpsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.FetchStaticIpsRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.FetchStaticIpsRequest(); + if (object.name != null) + message.name = String(object.name); + 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 FetchStaticIpsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @static + * @param {google.cloud.clouddms.v1.FetchStaticIpsRequest} message FetchStaticIpsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchStaticIpsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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 FetchStaticIpsRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @instance + * @returns {Object.} JSON object + */ + FetchStaticIpsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchStaticIpsRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.FetchStaticIpsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchStaticIpsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.FetchStaticIpsRequest"; + }; + + return FetchStaticIpsRequest; + })(); + + v1.FetchStaticIpsResponse = (function() { + + /** + * Properties of a FetchStaticIpsResponse. + * @memberof google.cloud.clouddms.v1 + * @interface IFetchStaticIpsResponse + * @property {Array.|null} [staticIps] FetchStaticIpsResponse staticIps + * @property {string|null} [nextPageToken] FetchStaticIpsResponse nextPageToken + */ + + /** + * Constructs a new FetchStaticIpsResponse. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a FetchStaticIpsResponse. + * @implements IFetchStaticIpsResponse + * @constructor + * @param {google.cloud.clouddms.v1.IFetchStaticIpsResponse=} [properties] Properties to set + */ + function FetchStaticIpsResponse(properties) { + this.staticIps = []; + 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]]; + } + + /** + * FetchStaticIpsResponse staticIps. + * @member {Array.} staticIps + * @memberof google.cloud.clouddms.v1.FetchStaticIpsResponse + * @instance + */ + FetchStaticIpsResponse.prototype.staticIps = $util.emptyArray; + + /** + * FetchStaticIpsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.clouddms.v1.FetchStaticIpsResponse + * @instance + */ + FetchStaticIpsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new FetchStaticIpsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.FetchStaticIpsResponse + * @static + * @param {google.cloud.clouddms.v1.IFetchStaticIpsResponse=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.FetchStaticIpsResponse} FetchStaticIpsResponse instance + */ + FetchStaticIpsResponse.create = function create(properties) { + return new FetchStaticIpsResponse(properties); + }; + + /** + * Encodes the specified FetchStaticIpsResponse message. Does not implicitly {@link google.cloud.clouddms.v1.FetchStaticIpsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.FetchStaticIpsResponse + * @static + * @param {google.cloud.clouddms.v1.IFetchStaticIpsResponse} message FetchStaticIpsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchStaticIpsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.staticIps != null && message.staticIps.length) + for (var i = 0; i < message.staticIps.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.staticIps[i]); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified FetchStaticIpsResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.FetchStaticIpsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.FetchStaticIpsResponse + * @static + * @param {google.cloud.clouddms.v1.IFetchStaticIpsResponse} message FetchStaticIpsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchStaticIpsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchStaticIpsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.FetchStaticIpsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.FetchStaticIpsResponse} FetchStaticIpsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchStaticIpsResponse.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.clouddms.v1.FetchStaticIpsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.staticIps && message.staticIps.length)) + message.staticIps = []; + message.staticIps.push(reader.string()); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchStaticIpsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.FetchStaticIpsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.FetchStaticIpsResponse} FetchStaticIpsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchStaticIpsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchStaticIpsResponse message. + * @function verify + * @memberof google.cloud.clouddms.v1.FetchStaticIpsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchStaticIpsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.staticIps != null && message.hasOwnProperty("staticIps")) { + if (!Array.isArray(message.staticIps)) + return "staticIps: array expected"; + for (var i = 0; i < message.staticIps.length; ++i) + if (!$util.isString(message.staticIps[i])) + return "staticIps: string[] expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a FetchStaticIpsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.FetchStaticIpsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.FetchStaticIpsResponse} FetchStaticIpsResponse + */ + FetchStaticIpsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.FetchStaticIpsResponse) + return object; + var message = new $root.google.cloud.clouddms.v1.FetchStaticIpsResponse(); + if (object.staticIps) { + if (!Array.isArray(object.staticIps)) + throw TypeError(".google.cloud.clouddms.v1.FetchStaticIpsResponse.staticIps: array expected"); + message.staticIps = []; + for (var i = 0; i < object.staticIps.length; ++i) + message.staticIps[i] = String(object.staticIps[i]); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a FetchStaticIpsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.FetchStaticIpsResponse + * @static + * @param {google.cloud.clouddms.v1.FetchStaticIpsResponse} message FetchStaticIpsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchStaticIpsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.staticIps = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.staticIps && message.staticIps.length) { + object.staticIps = []; + for (var j = 0; j < message.staticIps.length; ++j) + object.staticIps[j] = message.staticIps[j]; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this FetchStaticIpsResponse to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.FetchStaticIpsResponse + * @instance + * @returns {Object.} JSON object + */ + FetchStaticIpsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchStaticIpsResponse + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.FetchStaticIpsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchStaticIpsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.FetchStaticIpsResponse"; + }; + + return FetchStaticIpsResponse; + })(); + + v1.SslConfig = (function() { + + /** + * Properties of a SslConfig. + * @memberof google.cloud.clouddms.v1 + * @interface ISslConfig + * @property {google.cloud.clouddms.v1.SslConfig.SslType|null} [type] SslConfig type + * @property {string|null} [clientKey] SslConfig clientKey + * @property {string|null} [clientCertificate] SslConfig clientCertificate + * @property {string|null} [caCertificate] SslConfig caCertificate + */ + + /** + * Constructs a new SslConfig. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SslConfig. + * @implements ISslConfig + * @constructor + * @param {google.cloud.clouddms.v1.ISslConfig=} [properties] Properties to set + */ + function SslConfig(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]]; + } + + /** + * SslConfig type. + * @member {google.cloud.clouddms.v1.SslConfig.SslType} type + * @memberof google.cloud.clouddms.v1.SslConfig + * @instance + */ + SslConfig.prototype.type = 0; + + /** + * SslConfig clientKey. + * @member {string} clientKey + * @memberof google.cloud.clouddms.v1.SslConfig + * @instance + */ + SslConfig.prototype.clientKey = ""; + + /** + * SslConfig clientCertificate. + * @member {string} clientCertificate + * @memberof google.cloud.clouddms.v1.SslConfig + * @instance + */ + SslConfig.prototype.clientCertificate = ""; + + /** + * SslConfig caCertificate. + * @member {string} caCertificate + * @memberof google.cloud.clouddms.v1.SslConfig + * @instance + */ + SslConfig.prototype.caCertificate = ""; + + /** + * Creates a new SslConfig instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {google.cloud.clouddms.v1.ISslConfig=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SslConfig} SslConfig instance + */ + SslConfig.create = function create(properties) { + return new SslConfig(properties); + }; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.clouddms.v1.SslConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {google.cloud.clouddms.v1.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientKey); + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientCertificate); + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.caCertificate); + return writer; + }; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SslConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {google.cloud.clouddms.v1.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.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.clouddms.v1.SslConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.clientKey = reader.string(); + break; + } + case 3: { + message.clientCertificate = reader.string(); + break; + } + case 4: { + message.caCertificate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslConfig message. + * @function verify + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (!$util.isString(message.clientKey)) + return "clientKey: string expected"; + if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (!$util.isString(message.clientCertificate)) + return "clientCertificate: string expected"; + if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (!$util.isString(message.caCertificate)) + return "caCertificate: string expected"; + return null; + }; + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SslConfig} SslConfig + */ + SslConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SslConfig) + return object; + var message = new $root.google.cloud.clouddms.v1.SslConfig(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "SSL_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "SERVER_ONLY": + case 1: + message.type = 1; + break; + case "SERVER_CLIENT": + case 2: + message.type = 2; + break; + } + if (object.clientKey != null) + message.clientKey = String(object.clientKey); + if (object.clientCertificate != null) + message.clientCertificate = String(object.clientCertificate); + if (object.caCertificate != null) + message.caCertificate = String(object.caCertificate); + return message; + }; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {google.cloud.clouddms.v1.SslConfig} message SslConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "SSL_TYPE_UNSPECIFIED" : 0; + object.clientKey = ""; + object.clientCertificate = ""; + object.caCertificate = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.clouddms.v1.SslConfig.SslType[message.type] === undefined ? message.type : $root.google.cloud.clouddms.v1.SslConfig.SslType[message.type] : message.type; + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + object.clientKey = message.clientKey; + if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + object.clientCertificate = message.clientCertificate; + if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + object.caCertificate = message.caCertificate; + return object; + }; + + /** + * Converts this SslConfig to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SslConfig + * @instance + * @returns {Object.} JSON object + */ + SslConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SslConfig + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SslConfig"; + }; + + /** + * SslType enum. + * @name google.cloud.clouddms.v1.SslConfig.SslType + * @enum {number} + * @property {number} SSL_TYPE_UNSPECIFIED=0 SSL_TYPE_UNSPECIFIED value + * @property {number} SERVER_ONLY=1 SERVER_ONLY value + * @property {number} SERVER_CLIENT=2 SERVER_CLIENT value + */ + SslConfig.SslType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERVER_ONLY"] = 1; + values[valuesById[2] = "SERVER_CLIENT"] = 2; + return values; + })(); + + return SslConfig; + })(); + + v1.MySqlConnectionProfile = (function() { + + /** + * Properties of a MySqlConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @interface IMySqlConnectionProfile + * @property {string|null} [host] MySqlConnectionProfile host + * @property {number|null} [port] MySqlConnectionProfile port + * @property {string|null} [username] MySqlConnectionProfile username + * @property {string|null} [password] MySqlConnectionProfile password + * @property {boolean|null} [passwordSet] MySqlConnectionProfile passwordSet + * @property {google.cloud.clouddms.v1.ISslConfig|null} [ssl] MySqlConnectionProfile ssl + * @property {string|null} [cloudSqlId] MySqlConnectionProfile cloudSqlId + */ + + /** + * Constructs a new MySqlConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a MySqlConnectionProfile. + * @implements IMySqlConnectionProfile + * @constructor + * @param {google.cloud.clouddms.v1.IMySqlConnectionProfile=} [properties] Properties to set + */ + function MySqlConnectionProfile(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]]; + } + + /** + * MySqlConnectionProfile host. + * @member {string} host + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.host = ""; + + /** + * MySqlConnectionProfile port. + * @member {number} port + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.port = 0; + + /** + * MySqlConnectionProfile username. + * @member {string} username + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.username = ""; + + /** + * MySqlConnectionProfile password. + * @member {string} password + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.password = ""; + + /** + * MySqlConnectionProfile passwordSet. + * @member {boolean} passwordSet + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.passwordSet = false; + + /** + * MySqlConnectionProfile ssl. + * @member {google.cloud.clouddms.v1.ISslConfig|null|undefined} ssl + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.ssl = null; + + /** + * MySqlConnectionProfile cloudSqlId. + * @member {string} cloudSqlId + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.cloudSqlId = ""; + + /** + * Creates a new MySqlConnectionProfile instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IMySqlConnectionProfile=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.MySqlConnectionProfile} MySqlConnectionProfile instance + */ + MySqlConnectionProfile.create = function create(properties) { + return new MySqlConnectionProfile(properties); + }; + + /** + * Encodes the specified MySqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.MySqlConnectionProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IMySqlConnectionProfile} message MySqlConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MySqlConnectionProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.port); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.password); + if (message.passwordSet != null && Object.hasOwnProperty.call(message, "passwordSet")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.passwordSet); + if (message.ssl != null && Object.hasOwnProperty.call(message, "ssl")) + $root.google.cloud.clouddms.v1.SslConfig.encode(message.ssl, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.cloudSqlId != null && Object.hasOwnProperty.call(message, "cloudSqlId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cloudSqlId); + return writer; + }; + + /** + * Encodes the specified MySqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MySqlConnectionProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IMySqlConnectionProfile} message MySqlConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MySqlConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MySqlConnectionProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.MySqlConnectionProfile} MySqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MySqlConnectionProfile.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.clouddms.v1.MySqlConnectionProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.host = reader.string(); + break; + } + case 2: { + message.port = reader.int32(); + break; + } + case 3: { + message.username = reader.string(); + break; + } + case 4: { + message.password = reader.string(); + break; + } + case 5: { + message.passwordSet = reader.bool(); + break; + } + case 6: { + message.ssl = $root.google.cloud.clouddms.v1.SslConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.cloudSqlId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MySqlConnectionProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.MySqlConnectionProfile} MySqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MySqlConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MySqlConnectionProfile message. + * @function verify + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MySqlConnectionProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) + if (typeof message.passwordSet !== "boolean") + return "passwordSet: boolean expected"; + if (message.ssl != null && message.hasOwnProperty("ssl")) { + var error = $root.google.cloud.clouddms.v1.SslConfig.verify(message.ssl); + if (error) + return "ssl." + error; + } + if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) + if (!$util.isString(message.cloudSqlId)) + return "cloudSqlId: string expected"; + return null; + }; + + /** + * Creates a MySqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.MySqlConnectionProfile} MySqlConnectionProfile + */ + MySqlConnectionProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.MySqlConnectionProfile) + return object; + var message = new $root.google.cloud.clouddms.v1.MySqlConnectionProfile(); + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.passwordSet != null) + message.passwordSet = Boolean(object.passwordSet); + if (object.ssl != null) { + if (typeof object.ssl !== "object") + throw TypeError(".google.cloud.clouddms.v1.MySqlConnectionProfile.ssl: object expected"); + message.ssl = $root.google.cloud.clouddms.v1.SslConfig.fromObject(object.ssl); + } + if (object.cloudSqlId != null) + message.cloudSqlId = String(object.cloudSqlId); + return message; + }; + + /** + * Creates a plain object from a MySqlConnectionProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.MySqlConnectionProfile} message MySqlConnectionProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MySqlConnectionProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.host = ""; + object.port = 0; + object.username = ""; + object.password = ""; + object.passwordSet = false; + object.ssl = null; + object.cloudSqlId = ""; + } + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) + object.passwordSet = message.passwordSet; + if (message.ssl != null && message.hasOwnProperty("ssl")) + object.ssl = $root.google.cloud.clouddms.v1.SslConfig.toObject(message.ssl, options); + if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) + object.cloudSqlId = message.cloudSqlId; + return object; + }; + + /** + * Converts this MySqlConnectionProfile to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + * @returns {Object.} JSON object + */ + MySqlConnectionProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MySqlConnectionProfile + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MySqlConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.MySqlConnectionProfile"; + }; + + return MySqlConnectionProfile; + })(); + + /** + * NetworkArchitecture enum. + * @name google.cloud.clouddms.v1.NetworkArchitecture + * @enum {number} + * @property {number} NETWORK_ARCHITECTURE_UNSPECIFIED=0 NETWORK_ARCHITECTURE_UNSPECIFIED value + * @property {number} NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER=1 NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER value + * @property {number} NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER=2 NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER value + */ + v1.NetworkArchitecture = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NETWORK_ARCHITECTURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER"] = 1; + values[valuesById[2] = "NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER"] = 2; + return values; + })(); + + v1.PostgreSqlConnectionProfile = (function() { + + /** + * Properties of a PostgreSqlConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @interface IPostgreSqlConnectionProfile + * @property {string|null} [host] PostgreSqlConnectionProfile host + * @property {number|null} [port] PostgreSqlConnectionProfile port + * @property {string|null} [username] PostgreSqlConnectionProfile username + * @property {string|null} [password] PostgreSqlConnectionProfile password + * @property {boolean|null} [passwordSet] PostgreSqlConnectionProfile passwordSet + * @property {google.cloud.clouddms.v1.ISslConfig|null} [ssl] PostgreSqlConnectionProfile ssl + * @property {string|null} [cloudSqlId] PostgreSqlConnectionProfile cloudSqlId + * @property {google.cloud.clouddms.v1.NetworkArchitecture|null} [networkArchitecture] PostgreSqlConnectionProfile networkArchitecture + * @property {google.cloud.clouddms.v1.IStaticIpConnectivity|null} [staticIpConnectivity] PostgreSqlConnectionProfile staticIpConnectivity + * @property {google.cloud.clouddms.v1.IPrivateServiceConnectConnectivity|null} [privateServiceConnectConnectivity] PostgreSqlConnectionProfile privateServiceConnectConnectivity + */ + + /** + * Constructs a new PostgreSqlConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a PostgreSqlConnectionProfile. + * @implements IPostgreSqlConnectionProfile + * @constructor + * @param {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile=} [properties] Properties to set + */ + function PostgreSqlConnectionProfile(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]]; + } + + /** + * PostgreSqlConnectionProfile host. + * @member {string} host + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.host = ""; + + /** + * PostgreSqlConnectionProfile port. + * @member {number} port + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.port = 0; + + /** + * PostgreSqlConnectionProfile username. + * @member {string} username + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.username = ""; + + /** + * PostgreSqlConnectionProfile password. + * @member {string} password + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.password = ""; + + /** + * PostgreSqlConnectionProfile passwordSet. + * @member {boolean} passwordSet + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.passwordSet = false; + + /** + * PostgreSqlConnectionProfile ssl. + * @member {google.cloud.clouddms.v1.ISslConfig|null|undefined} ssl + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.ssl = null; + + /** + * PostgreSqlConnectionProfile cloudSqlId. + * @member {string} cloudSqlId + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.cloudSqlId = ""; + + /** + * PostgreSqlConnectionProfile networkArchitecture. + * @member {google.cloud.clouddms.v1.NetworkArchitecture} networkArchitecture + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.networkArchitecture = 0; + + /** + * PostgreSqlConnectionProfile staticIpConnectivity. + * @member {google.cloud.clouddms.v1.IStaticIpConnectivity|null|undefined} staticIpConnectivity + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.staticIpConnectivity = null; + + /** + * PostgreSqlConnectionProfile privateServiceConnectConnectivity. + * @member {google.cloud.clouddms.v1.IPrivateServiceConnectConnectivity|null|undefined} privateServiceConnectConnectivity + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.privateServiceConnectConnectivity = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PostgreSqlConnectionProfile connectivity. + * @member {"staticIpConnectivity"|"privateServiceConnectConnectivity"|undefined} connectivity + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + Object.defineProperty(PostgreSqlConnectionProfile.prototype, "connectivity", { + get: $util.oneOfGetter($oneOfFields = ["staticIpConnectivity", "privateServiceConnectConnectivity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PostgreSqlConnectionProfile instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} PostgreSqlConnectionProfile instance + */ + PostgreSqlConnectionProfile.create = function create(properties) { + return new PostgreSqlConnectionProfile(properties); + }; + + /** + * Encodes the specified PostgreSqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile} message PostgreSqlConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostgreSqlConnectionProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.port); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.password); + if (message.passwordSet != null && Object.hasOwnProperty.call(message, "passwordSet")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.passwordSet); + if (message.ssl != null && Object.hasOwnProperty.call(message, "ssl")) + $root.google.cloud.clouddms.v1.SslConfig.encode(message.ssl, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.cloudSqlId != null && Object.hasOwnProperty.call(message, "cloudSqlId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cloudSqlId); + if (message.networkArchitecture != null && Object.hasOwnProperty.call(message, "networkArchitecture")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.networkArchitecture); + if (message.staticIpConnectivity != null && Object.hasOwnProperty.call(message, "staticIpConnectivity")) + $root.google.cloud.clouddms.v1.StaticIpConnectivity.encode(message.staticIpConnectivity, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.privateServiceConnectConnectivity != null && Object.hasOwnProperty.call(message, "privateServiceConnectConnectivity")) + $root.google.cloud.clouddms.v1.PrivateServiceConnectConnectivity.encode(message.privateServiceConnectConnectivity, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PostgreSqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile} message PostgreSqlConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostgreSqlConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PostgreSqlConnectionProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} PostgreSqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostgreSqlConnectionProfile.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.clouddms.v1.PostgreSqlConnectionProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.host = reader.string(); + break; + } + case 2: { + message.port = reader.int32(); + break; + } + case 3: { + message.username = reader.string(); + break; + } + case 4: { + message.password = reader.string(); + break; + } + case 5: { + message.passwordSet = reader.bool(); + break; + } + case 6: { + message.ssl = $root.google.cloud.clouddms.v1.SslConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.cloudSqlId = reader.string(); + break; + } + case 8: { + message.networkArchitecture = reader.int32(); + break; + } + case 100: { + message.staticIpConnectivity = $root.google.cloud.clouddms.v1.StaticIpConnectivity.decode(reader, reader.uint32()); + break; + } + case 101: { + message.privateServiceConnectConnectivity = $root.google.cloud.clouddms.v1.PrivateServiceConnectConnectivity.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PostgreSqlConnectionProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} PostgreSqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostgreSqlConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PostgreSqlConnectionProfile message. + * @function verify + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PostgreSqlConnectionProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) + if (typeof message.passwordSet !== "boolean") + return "passwordSet: boolean expected"; + if (message.ssl != null && message.hasOwnProperty("ssl")) { + var error = $root.google.cloud.clouddms.v1.SslConfig.verify(message.ssl); + if (error) + return "ssl." + error; + } + if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) + if (!$util.isString(message.cloudSqlId)) + return "cloudSqlId: string expected"; + if (message.networkArchitecture != null && message.hasOwnProperty("networkArchitecture")) + switch (message.networkArchitecture) { + default: + return "networkArchitecture: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.staticIpConnectivity != null && message.hasOwnProperty("staticIpConnectivity")) { + properties.connectivity = 1; + { + var error = $root.google.cloud.clouddms.v1.StaticIpConnectivity.verify(message.staticIpConnectivity); + if (error) + return "staticIpConnectivity." + error; + } + } + if (message.privateServiceConnectConnectivity != null && message.hasOwnProperty("privateServiceConnectConnectivity")) { + if (properties.connectivity === 1) + return "connectivity: multiple values"; + properties.connectivity = 1; + { + var error = $root.google.cloud.clouddms.v1.PrivateServiceConnectConnectivity.verify(message.privateServiceConnectConnectivity); + if (error) + return "privateServiceConnectConnectivity." + error; + } + } + return null; + }; + + /** + * Creates a PostgreSqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} PostgreSqlConnectionProfile + */ + PostgreSqlConnectionProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile) + return object; + var message = new $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile(); + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.passwordSet != null) + message.passwordSet = Boolean(object.passwordSet); + if (object.ssl != null) { + if (typeof object.ssl !== "object") + throw TypeError(".google.cloud.clouddms.v1.PostgreSqlConnectionProfile.ssl: object expected"); + message.ssl = $root.google.cloud.clouddms.v1.SslConfig.fromObject(object.ssl); + } + if (object.cloudSqlId != null) + message.cloudSqlId = String(object.cloudSqlId); + switch (object.networkArchitecture) { + default: + if (typeof object.networkArchitecture === "number") { + message.networkArchitecture = object.networkArchitecture; + break; + } + break; + case "NETWORK_ARCHITECTURE_UNSPECIFIED": + case 0: + message.networkArchitecture = 0; + break; + case "NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER": + case 1: + message.networkArchitecture = 1; + break; + case "NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER": + case 2: + message.networkArchitecture = 2; + break; + } + if (object.staticIpConnectivity != null) { + if (typeof object.staticIpConnectivity !== "object") + throw TypeError(".google.cloud.clouddms.v1.PostgreSqlConnectionProfile.staticIpConnectivity: object expected"); + message.staticIpConnectivity = $root.google.cloud.clouddms.v1.StaticIpConnectivity.fromObject(object.staticIpConnectivity); + } + if (object.privateServiceConnectConnectivity != null) { + if (typeof object.privateServiceConnectConnectivity !== "object") + throw TypeError(".google.cloud.clouddms.v1.PostgreSqlConnectionProfile.privateServiceConnectConnectivity: object expected"); + message.privateServiceConnectConnectivity = $root.google.cloud.clouddms.v1.PrivateServiceConnectConnectivity.fromObject(object.privateServiceConnectConnectivity); + } + return message; + }; + + /** + * Creates a plain object from a PostgreSqlConnectionProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} message PostgreSqlConnectionProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PostgreSqlConnectionProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.host = ""; + object.port = 0; + object.username = ""; + object.password = ""; + object.passwordSet = false; + object.ssl = null; + object.cloudSqlId = ""; + object.networkArchitecture = options.enums === String ? "NETWORK_ARCHITECTURE_UNSPECIFIED" : 0; + } + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) + object.passwordSet = message.passwordSet; + if (message.ssl != null && message.hasOwnProperty("ssl")) + object.ssl = $root.google.cloud.clouddms.v1.SslConfig.toObject(message.ssl, options); + if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) + object.cloudSqlId = message.cloudSqlId; + if (message.networkArchitecture != null && message.hasOwnProperty("networkArchitecture")) + object.networkArchitecture = options.enums === String ? $root.google.cloud.clouddms.v1.NetworkArchitecture[message.networkArchitecture] === undefined ? message.networkArchitecture : $root.google.cloud.clouddms.v1.NetworkArchitecture[message.networkArchitecture] : message.networkArchitecture; + if (message.staticIpConnectivity != null && message.hasOwnProperty("staticIpConnectivity")) { + object.staticIpConnectivity = $root.google.cloud.clouddms.v1.StaticIpConnectivity.toObject(message.staticIpConnectivity, options); + if (options.oneofs) + object.connectivity = "staticIpConnectivity"; + } + if (message.privateServiceConnectConnectivity != null && message.hasOwnProperty("privateServiceConnectConnectivity")) { + object.privateServiceConnectConnectivity = $root.google.cloud.clouddms.v1.PrivateServiceConnectConnectivity.toObject(message.privateServiceConnectConnectivity, options); + if (options.oneofs) + object.connectivity = "privateServiceConnectConnectivity"; + } + return object; + }; + + /** + * Converts this PostgreSqlConnectionProfile to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + * @returns {Object.} JSON object + */ + PostgreSqlConnectionProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PostgreSqlConnectionProfile + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PostgreSqlConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.PostgreSqlConnectionProfile"; + }; + + return PostgreSqlConnectionProfile; + })(); + + v1.OracleConnectionProfile = (function() { + + /** + * Properties of an OracleConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @interface IOracleConnectionProfile + * @property {string|null} [host] OracleConnectionProfile host + * @property {number|null} [port] OracleConnectionProfile port + * @property {string|null} [username] OracleConnectionProfile username + * @property {string|null} [password] OracleConnectionProfile password + * @property {boolean|null} [passwordSet] OracleConnectionProfile passwordSet + * @property {string|null} [databaseService] OracleConnectionProfile databaseService + * @property {google.cloud.clouddms.v1.IStaticServiceIpConnectivity|null} [staticServiceIpConnectivity] OracleConnectionProfile staticServiceIpConnectivity + * @property {google.cloud.clouddms.v1.IForwardSshTunnelConnectivity|null} [forwardSshConnectivity] OracleConnectionProfile forwardSshConnectivity + * @property {google.cloud.clouddms.v1.IPrivateConnectivity|null} [privateConnectivity] OracleConnectionProfile privateConnectivity + */ + + /** + * Constructs a new OracleConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents an OracleConnectionProfile. + * @implements IOracleConnectionProfile + * @constructor + * @param {google.cloud.clouddms.v1.IOracleConnectionProfile=} [properties] Properties to set + */ + function OracleConnectionProfile(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]]; + } + + /** + * OracleConnectionProfile host. + * @member {string} host + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @instance + */ + OracleConnectionProfile.prototype.host = ""; + + /** + * OracleConnectionProfile port. + * @member {number} port + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @instance + */ + OracleConnectionProfile.prototype.port = 0; + + /** + * OracleConnectionProfile username. + * @member {string} username + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @instance + */ + OracleConnectionProfile.prototype.username = ""; + + /** + * OracleConnectionProfile password. + * @member {string} password + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @instance + */ + OracleConnectionProfile.prototype.password = ""; + + /** + * OracleConnectionProfile passwordSet. + * @member {boolean} passwordSet + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @instance + */ + OracleConnectionProfile.prototype.passwordSet = false; + + /** + * OracleConnectionProfile databaseService. + * @member {string} databaseService + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @instance + */ + OracleConnectionProfile.prototype.databaseService = ""; + + /** + * OracleConnectionProfile staticServiceIpConnectivity. + * @member {google.cloud.clouddms.v1.IStaticServiceIpConnectivity|null|undefined} staticServiceIpConnectivity + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @instance + */ + OracleConnectionProfile.prototype.staticServiceIpConnectivity = null; + + /** + * OracleConnectionProfile forwardSshConnectivity. + * @member {google.cloud.clouddms.v1.IForwardSshTunnelConnectivity|null|undefined} forwardSshConnectivity + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @instance + */ + OracleConnectionProfile.prototype.forwardSshConnectivity = null; + + /** + * OracleConnectionProfile privateConnectivity. + * @member {google.cloud.clouddms.v1.IPrivateConnectivity|null|undefined} privateConnectivity + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @instance + */ + OracleConnectionProfile.prototype.privateConnectivity = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OracleConnectionProfile connectivity. + * @member {"staticServiceIpConnectivity"|"forwardSshConnectivity"|"privateConnectivity"|undefined} connectivity + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @instance + */ + Object.defineProperty(OracleConnectionProfile.prototype, "connectivity", { + get: $util.oneOfGetter($oneOfFields = ["staticServiceIpConnectivity", "forwardSshConnectivity", "privateConnectivity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OracleConnectionProfile instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IOracleConnectionProfile=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.OracleConnectionProfile} OracleConnectionProfile instance + */ + OracleConnectionProfile.create = function create(properties) { + return new OracleConnectionProfile(properties); + }; + + /** + * Encodes the specified OracleConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.OracleConnectionProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IOracleConnectionProfile} message OracleConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OracleConnectionProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.port); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.password); + if (message.passwordSet != null && Object.hasOwnProperty.call(message, "passwordSet")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.passwordSet); + if (message.databaseService != null && Object.hasOwnProperty.call(message, "databaseService")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.databaseService); + if (message.staticServiceIpConnectivity != null && Object.hasOwnProperty.call(message, "staticServiceIpConnectivity")) + $root.google.cloud.clouddms.v1.StaticServiceIpConnectivity.encode(message.staticServiceIpConnectivity, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.forwardSshConnectivity != null && Object.hasOwnProperty.call(message, "forwardSshConnectivity")) + $root.google.cloud.clouddms.v1.ForwardSshTunnelConnectivity.encode(message.forwardSshConnectivity, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.privateConnectivity != null && Object.hasOwnProperty.call(message, "privateConnectivity")) + $root.google.cloud.clouddms.v1.PrivateConnectivity.encode(message.privateConnectivity, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OracleConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.OracleConnectionProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IOracleConnectionProfile} message OracleConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OracleConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OracleConnectionProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.OracleConnectionProfile} OracleConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OracleConnectionProfile.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.clouddms.v1.OracleConnectionProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.host = reader.string(); + break; + } + case 2: { + message.port = reader.int32(); + break; + } + case 3: { + message.username = reader.string(); + break; + } + case 4: { + message.password = reader.string(); + break; + } + case 5: { + message.passwordSet = reader.bool(); + break; + } + case 6: { + message.databaseService = reader.string(); + break; + } + case 100: { + message.staticServiceIpConnectivity = $root.google.cloud.clouddms.v1.StaticServiceIpConnectivity.decode(reader, reader.uint32()); + break; + } + case 101: { + message.forwardSshConnectivity = $root.google.cloud.clouddms.v1.ForwardSshTunnelConnectivity.decode(reader, reader.uint32()); + break; + } + case 102: { + message.privateConnectivity = $root.google.cloud.clouddms.v1.PrivateConnectivity.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OracleConnectionProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.OracleConnectionProfile} OracleConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OracleConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OracleConnectionProfile message. + * @function verify + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OracleConnectionProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) + if (typeof message.passwordSet !== "boolean") + return "passwordSet: boolean expected"; + if (message.databaseService != null && message.hasOwnProperty("databaseService")) + if (!$util.isString(message.databaseService)) + return "databaseService: string expected"; + if (message.staticServiceIpConnectivity != null && message.hasOwnProperty("staticServiceIpConnectivity")) { + properties.connectivity = 1; + { + var error = $root.google.cloud.clouddms.v1.StaticServiceIpConnectivity.verify(message.staticServiceIpConnectivity); + if (error) + return "staticServiceIpConnectivity." + error; + } + } + if (message.forwardSshConnectivity != null && message.hasOwnProperty("forwardSshConnectivity")) { + if (properties.connectivity === 1) + return "connectivity: multiple values"; + properties.connectivity = 1; + { + var error = $root.google.cloud.clouddms.v1.ForwardSshTunnelConnectivity.verify(message.forwardSshConnectivity); + if (error) + return "forwardSshConnectivity." + error; + } + } + if (message.privateConnectivity != null && message.hasOwnProperty("privateConnectivity")) { + if (properties.connectivity === 1) + return "connectivity: multiple values"; + properties.connectivity = 1; + { + var error = $root.google.cloud.clouddms.v1.PrivateConnectivity.verify(message.privateConnectivity); + if (error) + return "privateConnectivity." + error; + } + } + return null; + }; + + /** + * Creates an OracleConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.OracleConnectionProfile} OracleConnectionProfile + */ + OracleConnectionProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.OracleConnectionProfile) + return object; + var message = new $root.google.cloud.clouddms.v1.OracleConnectionProfile(); + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.passwordSet != null) + message.passwordSet = Boolean(object.passwordSet); + if (object.databaseService != null) + message.databaseService = String(object.databaseService); + if (object.staticServiceIpConnectivity != null) { + if (typeof object.staticServiceIpConnectivity !== "object") + throw TypeError(".google.cloud.clouddms.v1.OracleConnectionProfile.staticServiceIpConnectivity: object expected"); + message.staticServiceIpConnectivity = $root.google.cloud.clouddms.v1.StaticServiceIpConnectivity.fromObject(object.staticServiceIpConnectivity); + } + if (object.forwardSshConnectivity != null) { + if (typeof object.forwardSshConnectivity !== "object") + throw TypeError(".google.cloud.clouddms.v1.OracleConnectionProfile.forwardSshConnectivity: object expected"); + message.forwardSshConnectivity = $root.google.cloud.clouddms.v1.ForwardSshTunnelConnectivity.fromObject(object.forwardSshConnectivity); + } + if (object.privateConnectivity != null) { + if (typeof object.privateConnectivity !== "object") + throw TypeError(".google.cloud.clouddms.v1.OracleConnectionProfile.privateConnectivity: object expected"); + message.privateConnectivity = $root.google.cloud.clouddms.v1.PrivateConnectivity.fromObject(object.privateConnectivity); + } + return message; + }; + + /** + * Creates a plain object from an OracleConnectionProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.OracleConnectionProfile} message OracleConnectionProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OracleConnectionProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.host = ""; + object.port = 0; + object.username = ""; + object.password = ""; + object.passwordSet = false; + object.databaseService = ""; + } + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) + object.passwordSet = message.passwordSet; + if (message.databaseService != null && message.hasOwnProperty("databaseService")) + object.databaseService = message.databaseService; + if (message.staticServiceIpConnectivity != null && message.hasOwnProperty("staticServiceIpConnectivity")) { + object.staticServiceIpConnectivity = $root.google.cloud.clouddms.v1.StaticServiceIpConnectivity.toObject(message.staticServiceIpConnectivity, options); + if (options.oneofs) + object.connectivity = "staticServiceIpConnectivity"; + } + if (message.forwardSshConnectivity != null && message.hasOwnProperty("forwardSshConnectivity")) { + object.forwardSshConnectivity = $root.google.cloud.clouddms.v1.ForwardSshTunnelConnectivity.toObject(message.forwardSshConnectivity, options); + if (options.oneofs) + object.connectivity = "forwardSshConnectivity"; + } + if (message.privateConnectivity != null && message.hasOwnProperty("privateConnectivity")) { + object.privateConnectivity = $root.google.cloud.clouddms.v1.PrivateConnectivity.toObject(message.privateConnectivity, options); + if (options.oneofs) + object.connectivity = "privateConnectivity"; + } + return object; + }; + + /** + * Converts this OracleConnectionProfile to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @instance + * @returns {Object.} JSON object + */ + OracleConnectionProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OracleConnectionProfile + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.OracleConnectionProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OracleConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.OracleConnectionProfile"; + }; + + return OracleConnectionProfile; + })(); + + v1.CloudSqlConnectionProfile = (function() { + + /** + * Properties of a CloudSqlConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @interface ICloudSqlConnectionProfile + * @property {string|null} [cloudSqlId] CloudSqlConnectionProfile cloudSqlId + * @property {google.cloud.clouddms.v1.ICloudSqlSettings|null} [settings] CloudSqlConnectionProfile settings + * @property {string|null} [privateIp] CloudSqlConnectionProfile privateIp + * @property {string|null} [publicIp] CloudSqlConnectionProfile publicIp + * @property {string|null} [additionalPublicIp] CloudSqlConnectionProfile additionalPublicIp + */ + + /** + * Constructs a new CloudSqlConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a CloudSqlConnectionProfile. + * @implements ICloudSqlConnectionProfile + * @constructor + * @param {google.cloud.clouddms.v1.ICloudSqlConnectionProfile=} [properties] Properties to set + */ + function CloudSqlConnectionProfile(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]]; + } + + /** + * CloudSqlConnectionProfile cloudSqlId. + * @member {string} cloudSqlId + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @instance + */ + CloudSqlConnectionProfile.prototype.cloudSqlId = ""; + + /** + * CloudSqlConnectionProfile settings. + * @member {google.cloud.clouddms.v1.ICloudSqlSettings|null|undefined} settings + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @instance + */ + CloudSqlConnectionProfile.prototype.settings = null; + + /** + * CloudSqlConnectionProfile privateIp. + * @member {string} privateIp + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @instance + */ + CloudSqlConnectionProfile.prototype.privateIp = ""; + + /** + * CloudSqlConnectionProfile publicIp. + * @member {string} publicIp + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @instance + */ + CloudSqlConnectionProfile.prototype.publicIp = ""; + + /** + * CloudSqlConnectionProfile additionalPublicIp. + * @member {string} additionalPublicIp + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @instance + */ + CloudSqlConnectionProfile.prototype.additionalPublicIp = ""; + + /** + * Creates a new CloudSqlConnectionProfile instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.ICloudSqlConnectionProfile=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.CloudSqlConnectionProfile} CloudSqlConnectionProfile instance + */ + CloudSqlConnectionProfile.create = function create(properties) { + return new CloudSqlConnectionProfile(properties); + }; + + /** + * Encodes the specified CloudSqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.ICloudSqlConnectionProfile} message CloudSqlConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlConnectionProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudSqlId != null && Object.hasOwnProperty.call(message, "cloudSqlId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudSqlId); + if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) + $root.google.cloud.clouddms.v1.CloudSqlSettings.encode(message.settings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.privateIp != null && Object.hasOwnProperty.call(message, "privateIp")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.privateIp); + if (message.publicIp != null && Object.hasOwnProperty.call(message, "publicIp")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicIp); + if (message.additionalPublicIp != null && Object.hasOwnProperty.call(message, "additionalPublicIp")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.additionalPublicIp); + return writer; + }; + + /** + * Encodes the specified CloudSqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.ICloudSqlConnectionProfile} message CloudSqlConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSqlConnectionProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.CloudSqlConnectionProfile} CloudSqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlConnectionProfile.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.clouddms.v1.CloudSqlConnectionProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cloudSqlId = reader.string(); + break; + } + case 2: { + message.settings = $root.google.cloud.clouddms.v1.CloudSqlSettings.decode(reader, reader.uint32()); + break; + } + case 3: { + message.privateIp = reader.string(); + break; + } + case 4: { + message.publicIp = reader.string(); + break; + } + case 5: { + message.additionalPublicIp = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSqlConnectionProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.CloudSqlConnectionProfile} CloudSqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSqlConnectionProfile message. + * @function verify + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSqlConnectionProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) + if (!$util.isString(message.cloudSqlId)) + return "cloudSqlId: string expected"; + if (message.settings != null && message.hasOwnProperty("settings")) { + var error = $root.google.cloud.clouddms.v1.CloudSqlSettings.verify(message.settings); + if (error) + return "settings." + error; + } + if (message.privateIp != null && message.hasOwnProperty("privateIp")) + if (!$util.isString(message.privateIp)) + return "privateIp: string expected"; + if (message.publicIp != null && message.hasOwnProperty("publicIp")) + if (!$util.isString(message.publicIp)) + return "publicIp: string expected"; + if (message.additionalPublicIp != null && message.hasOwnProperty("additionalPublicIp")) + if (!$util.isString(message.additionalPublicIp)) + return "additionalPublicIp: string expected"; + return null; + }; + + /** + * Creates a CloudSqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.CloudSqlConnectionProfile} CloudSqlConnectionProfile + */ + CloudSqlConnectionProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile) + return object; + var message = new $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile(); + if (object.cloudSqlId != null) + message.cloudSqlId = String(object.cloudSqlId); + if (object.settings != null) { + if (typeof object.settings !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlConnectionProfile.settings: object expected"); + message.settings = $root.google.cloud.clouddms.v1.CloudSqlSettings.fromObject(object.settings); + } + if (object.privateIp != null) + message.privateIp = String(object.privateIp); + if (object.publicIp != null) + message.publicIp = String(object.publicIp); + if (object.additionalPublicIp != null) + message.additionalPublicIp = String(object.additionalPublicIp); + return message; + }; + + /** + * Creates a plain object from a CloudSqlConnectionProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.CloudSqlConnectionProfile} message CloudSqlConnectionProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSqlConnectionProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cloudSqlId = ""; + object.settings = null; + object.privateIp = ""; + object.publicIp = ""; + object.additionalPublicIp = ""; + } + if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) + object.cloudSqlId = message.cloudSqlId; + if (message.settings != null && message.hasOwnProperty("settings")) + object.settings = $root.google.cloud.clouddms.v1.CloudSqlSettings.toObject(message.settings, options); + if (message.privateIp != null && message.hasOwnProperty("privateIp")) + object.privateIp = message.privateIp; + if (message.publicIp != null && message.hasOwnProperty("publicIp")) + object.publicIp = message.publicIp; + if (message.additionalPublicIp != null && message.hasOwnProperty("additionalPublicIp")) + object.additionalPublicIp = message.additionalPublicIp; + return object; + }; + + /** + * Converts this CloudSqlConnectionProfile to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @instance + * @returns {Object.} JSON object + */ + CloudSqlConnectionProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSqlConnectionProfile + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSqlConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.CloudSqlConnectionProfile"; + }; + + return CloudSqlConnectionProfile; + })(); + + v1.AlloyDbConnectionProfile = (function() { + + /** + * Properties of an AlloyDbConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @interface IAlloyDbConnectionProfile + * @property {string|null} [clusterId] AlloyDbConnectionProfile clusterId + * @property {google.cloud.clouddms.v1.IAlloyDbSettings|null} [settings] AlloyDbConnectionProfile settings + */ + + /** + * Constructs a new AlloyDbConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents an AlloyDbConnectionProfile. + * @implements IAlloyDbConnectionProfile + * @constructor + * @param {google.cloud.clouddms.v1.IAlloyDbConnectionProfile=} [properties] Properties to set + */ + function AlloyDbConnectionProfile(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]]; + } + + /** + * AlloyDbConnectionProfile clusterId. + * @member {string} clusterId + * @memberof google.cloud.clouddms.v1.AlloyDbConnectionProfile + * @instance + */ + AlloyDbConnectionProfile.prototype.clusterId = ""; + + /** + * AlloyDbConnectionProfile settings. + * @member {google.cloud.clouddms.v1.IAlloyDbSettings|null|undefined} settings + * @memberof google.cloud.clouddms.v1.AlloyDbConnectionProfile + * @instance + */ + AlloyDbConnectionProfile.prototype.settings = null; + + /** + * Creates a new AlloyDbConnectionProfile instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.AlloyDbConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IAlloyDbConnectionProfile=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.AlloyDbConnectionProfile} AlloyDbConnectionProfile instance + */ + AlloyDbConnectionProfile.create = function create(properties) { + return new AlloyDbConnectionProfile(properties); + }; + + /** + * Encodes the specified AlloyDbConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbConnectionProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.AlloyDbConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IAlloyDbConnectionProfile} message AlloyDbConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlloyDbConnectionProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterId); + if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) + $root.google.cloud.clouddms.v1.AlloyDbSettings.encode(message.settings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlloyDbConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbConnectionProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.AlloyDbConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IAlloyDbConnectionProfile} message AlloyDbConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlloyDbConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlloyDbConnectionProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.AlloyDbConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.AlloyDbConnectionProfile} AlloyDbConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlloyDbConnectionProfile.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.clouddms.v1.AlloyDbConnectionProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.clusterId = reader.string(); + break; + } + case 2: { + message.settings = $root.google.cloud.clouddms.v1.AlloyDbSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlloyDbConnectionProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.AlloyDbConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.AlloyDbConnectionProfile} AlloyDbConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlloyDbConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlloyDbConnectionProfile message. + * @function verify + * @memberof google.cloud.clouddms.v1.AlloyDbConnectionProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlloyDbConnectionProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.settings != null && message.hasOwnProperty("settings")) { + var error = $root.google.cloud.clouddms.v1.AlloyDbSettings.verify(message.settings); + if (error) + return "settings." + error; + } + return null; + }; + + /** + * Creates an AlloyDbConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.AlloyDbConnectionProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.AlloyDbConnectionProfile} AlloyDbConnectionProfile + */ + AlloyDbConnectionProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.AlloyDbConnectionProfile) + return object; + var message = new $root.google.cloud.clouddms.v1.AlloyDbConnectionProfile(); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.settings != null) { + if (typeof object.settings !== "object") + throw TypeError(".google.cloud.clouddms.v1.AlloyDbConnectionProfile.settings: object expected"); + message.settings = $root.google.cloud.clouddms.v1.AlloyDbSettings.fromObject(object.settings); + } + return message; + }; + + /** + * Creates a plain object from an AlloyDbConnectionProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.AlloyDbConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.AlloyDbConnectionProfile} message AlloyDbConnectionProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlloyDbConnectionProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clusterId = ""; + object.settings = null; + } + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.settings != null && message.hasOwnProperty("settings")) + object.settings = $root.google.cloud.clouddms.v1.AlloyDbSettings.toObject(message.settings, options); + return object; + }; + + /** + * Converts this AlloyDbConnectionProfile to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.AlloyDbConnectionProfile + * @instance + * @returns {Object.} JSON object + */ + AlloyDbConnectionProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlloyDbConnectionProfile + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.AlloyDbConnectionProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlloyDbConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.AlloyDbConnectionProfile"; + }; + + return AlloyDbConnectionProfile; + })(); + + v1.SqlAclEntry = (function() { + + /** + * Properties of a SqlAclEntry. + * @memberof google.cloud.clouddms.v1 + * @interface ISqlAclEntry + * @property {string|null} [value] SqlAclEntry value + * @property {google.protobuf.ITimestamp|null} [expireTime] SqlAclEntry expireTime + * @property {google.protobuf.IDuration|null} [ttl] SqlAclEntry ttl + * @property {string|null} [label] SqlAclEntry label + */ + + /** + * Constructs a new SqlAclEntry. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SqlAclEntry. + * @implements ISqlAclEntry + * @constructor + * @param {google.cloud.clouddms.v1.ISqlAclEntry=} [properties] Properties to set + */ + function SqlAclEntry(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]]; + } + + /** + * SqlAclEntry value. + * @member {string} value + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @instance + */ + SqlAclEntry.prototype.value = ""; + + /** + * SqlAclEntry expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @instance + */ + SqlAclEntry.prototype.expireTime = null; + + /** + * SqlAclEntry ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @instance + */ + SqlAclEntry.prototype.ttl = null; + + /** + * SqlAclEntry label. + * @member {string} label + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @instance + */ + SqlAclEntry.prototype.label = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SqlAclEntry expiration. + * @member {"expireTime"|"ttl"|undefined} expiration + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @instance + */ + Object.defineProperty(SqlAclEntry.prototype, "expiration", { + get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SqlAclEntry instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {google.cloud.clouddms.v1.ISqlAclEntry=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SqlAclEntry} SqlAclEntry instance + */ + SqlAclEntry.create = function create(properties) { + return new SqlAclEntry(properties); + }; + + /** + * Encodes the specified SqlAclEntry message. Does not implicitly {@link google.cloud.clouddms.v1.SqlAclEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {google.cloud.clouddms.v1.ISqlAclEntry} message SqlAclEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlAclEntry.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.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.label); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SqlAclEntry message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SqlAclEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {google.cloud.clouddms.v1.ISqlAclEntry} message SqlAclEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlAclEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlAclEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SqlAclEntry} SqlAclEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlAclEntry.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.clouddms.v1.SqlAclEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 10: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.label = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlAclEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SqlAclEntry} SqlAclEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlAclEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlAclEntry message. + * @function verify + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlAclEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + properties.expiration = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + if (properties.expiration === 1) + return "expiration: multiple values"; + properties.expiration = 1; + { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + return null; + }; + + /** + * Creates a SqlAclEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SqlAclEntry} SqlAclEntry + */ + SqlAclEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SqlAclEntry) + return object; + var message = new $root.google.cloud.clouddms.v1.SqlAclEntry(); + if (object.value != null) + message.value = String(object.value); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.SqlAclEntry.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.cloud.clouddms.v1.SqlAclEntry.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.label != null) + message.label = String(object.label); + return message; + }; + + /** + * Creates a plain object from a SqlAclEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {google.cloud.clouddms.v1.SqlAclEntry} message SqlAclEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlAclEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.label = ""; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (options.oneofs) + object.expiration = "expireTime"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (options.oneofs) + object.expiration = "ttl"; + } + return object; + }; + + /** + * Converts this SqlAclEntry to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @instance + * @returns {Object.} JSON object + */ + SqlAclEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlAclEntry + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlAclEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SqlAclEntry"; + }; + + return SqlAclEntry; + })(); + + v1.SqlIpConfig = (function() { + + /** + * Properties of a SqlIpConfig. + * @memberof google.cloud.clouddms.v1 + * @interface ISqlIpConfig + * @property {google.protobuf.IBoolValue|null} [enableIpv4] SqlIpConfig enableIpv4 + * @property {string|null} [privateNetwork] SqlIpConfig privateNetwork + * @property {string|null} [allocatedIpRange] SqlIpConfig allocatedIpRange + * @property {google.protobuf.IBoolValue|null} [requireSsl] SqlIpConfig requireSsl + * @property {Array.|null} [authorizedNetworks] SqlIpConfig authorizedNetworks + */ + + /** + * Constructs a new SqlIpConfig. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SqlIpConfig. + * @implements ISqlIpConfig + * @constructor + * @param {google.cloud.clouddms.v1.ISqlIpConfig=} [properties] Properties to set + */ + function SqlIpConfig(properties) { + this.authorizedNetworks = []; + 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]]; + } + + /** + * SqlIpConfig enableIpv4. + * @member {google.protobuf.IBoolValue|null|undefined} enableIpv4 + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @instance + */ + SqlIpConfig.prototype.enableIpv4 = null; + + /** + * SqlIpConfig privateNetwork. + * @member {string} privateNetwork + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @instance + */ + SqlIpConfig.prototype.privateNetwork = ""; + + /** + * SqlIpConfig allocatedIpRange. + * @member {string} allocatedIpRange + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @instance + */ + SqlIpConfig.prototype.allocatedIpRange = ""; + + /** + * SqlIpConfig requireSsl. + * @member {google.protobuf.IBoolValue|null|undefined} requireSsl + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @instance + */ + SqlIpConfig.prototype.requireSsl = null; + + /** + * SqlIpConfig authorizedNetworks. + * @member {Array.} authorizedNetworks + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @instance + */ + SqlIpConfig.prototype.authorizedNetworks = $util.emptyArray; + + /** + * Creates a new SqlIpConfig instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {google.cloud.clouddms.v1.ISqlIpConfig=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SqlIpConfig} SqlIpConfig instance + */ + SqlIpConfig.create = function create(properties) { + return new SqlIpConfig(properties); + }; + + /** + * Encodes the specified SqlIpConfig message. Does not implicitly {@link google.cloud.clouddms.v1.SqlIpConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {google.cloud.clouddms.v1.ISqlIpConfig} message SqlIpConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlIpConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableIpv4 != null && Object.hasOwnProperty.call(message, "enableIpv4")) + $root.google.protobuf.BoolValue.encode(message.enableIpv4, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateNetwork); + if (message.requireSsl != null && Object.hasOwnProperty.call(message, "requireSsl")) + $root.google.protobuf.BoolValue.encode(message.requireSsl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.authorizedNetworks != null && message.authorizedNetworks.length) + for (var i = 0; i < message.authorizedNetworks.length; ++i) + $root.google.cloud.clouddms.v1.SqlAclEntry.encode(message.authorizedNetworks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.allocatedIpRange); + return writer; + }; + + /** + * Encodes the specified SqlIpConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SqlIpConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {google.cloud.clouddms.v1.ISqlIpConfig} message SqlIpConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlIpConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlIpConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SqlIpConfig} SqlIpConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlIpConfig.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.clouddms.v1.SqlIpConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableIpv4 = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 2: { + message.privateNetwork = reader.string(); + break; + } + case 5: { + message.allocatedIpRange = reader.string(); + break; + } + case 3: { + message.requireSsl = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.authorizedNetworks && message.authorizedNetworks.length)) + message.authorizedNetworks = []; + message.authorizedNetworks.push($root.google.cloud.clouddms.v1.SqlAclEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlIpConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SqlIpConfig} SqlIpConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlIpConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlIpConfig message. + * @function verify + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlIpConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableIpv4 != null && message.hasOwnProperty("enableIpv4")) { + var error = $root.google.protobuf.BoolValue.verify(message.enableIpv4); + if (error) + return "enableIpv4." + error; + } + if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) + if (!$util.isString(message.privateNetwork)) + return "privateNetwork: string expected"; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (!$util.isString(message.allocatedIpRange)) + return "allocatedIpRange: string expected"; + if (message.requireSsl != null && message.hasOwnProperty("requireSsl")) { + var error = $root.google.protobuf.BoolValue.verify(message.requireSsl); + if (error) + return "requireSsl." + error; + } + if (message.authorizedNetworks != null && message.hasOwnProperty("authorizedNetworks")) { + if (!Array.isArray(message.authorizedNetworks)) + return "authorizedNetworks: array expected"; + for (var i = 0; i < message.authorizedNetworks.length; ++i) { + var error = $root.google.cloud.clouddms.v1.SqlAclEntry.verify(message.authorizedNetworks[i]); + if (error) + return "authorizedNetworks." + error; + } + } + return null; + }; + + /** + * Creates a SqlIpConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SqlIpConfig} SqlIpConfig + */ + SqlIpConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SqlIpConfig) + return object; + var message = new $root.google.cloud.clouddms.v1.SqlIpConfig(); + if (object.enableIpv4 != null) { + if (typeof object.enableIpv4 !== "object") + throw TypeError(".google.cloud.clouddms.v1.SqlIpConfig.enableIpv4: object expected"); + message.enableIpv4 = $root.google.protobuf.BoolValue.fromObject(object.enableIpv4); + } + if (object.privateNetwork != null) + message.privateNetwork = String(object.privateNetwork); + if (object.allocatedIpRange != null) + message.allocatedIpRange = String(object.allocatedIpRange); + if (object.requireSsl != null) { + if (typeof object.requireSsl !== "object") + throw TypeError(".google.cloud.clouddms.v1.SqlIpConfig.requireSsl: object expected"); + message.requireSsl = $root.google.protobuf.BoolValue.fromObject(object.requireSsl); + } + if (object.authorizedNetworks) { + if (!Array.isArray(object.authorizedNetworks)) + throw TypeError(".google.cloud.clouddms.v1.SqlIpConfig.authorizedNetworks: array expected"); + message.authorizedNetworks = []; + for (var i = 0; i < object.authorizedNetworks.length; ++i) { + if (typeof object.authorizedNetworks[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.SqlIpConfig.authorizedNetworks: object expected"); + message.authorizedNetworks[i] = $root.google.cloud.clouddms.v1.SqlAclEntry.fromObject(object.authorizedNetworks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SqlIpConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {google.cloud.clouddms.v1.SqlIpConfig} message SqlIpConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlIpConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.authorizedNetworks = []; + if (options.defaults) { + object.enableIpv4 = null; + object.privateNetwork = ""; + object.requireSsl = null; + object.allocatedIpRange = ""; + } + if (message.enableIpv4 != null && message.hasOwnProperty("enableIpv4")) + object.enableIpv4 = $root.google.protobuf.BoolValue.toObject(message.enableIpv4, options); + if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) + object.privateNetwork = message.privateNetwork; + if (message.requireSsl != null && message.hasOwnProperty("requireSsl")) + object.requireSsl = $root.google.protobuf.BoolValue.toObject(message.requireSsl, options); + if (message.authorizedNetworks && message.authorizedNetworks.length) { + object.authorizedNetworks = []; + for (var j = 0; j < message.authorizedNetworks.length; ++j) + object.authorizedNetworks[j] = $root.google.cloud.clouddms.v1.SqlAclEntry.toObject(message.authorizedNetworks[j], options); + } + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + object.allocatedIpRange = message.allocatedIpRange; + return object; + }; + + /** + * Converts this SqlIpConfig to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @instance + * @returns {Object.} JSON object + */ + SqlIpConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlIpConfig + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlIpConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SqlIpConfig"; + }; + + return SqlIpConfig; + })(); + + v1.CloudSqlSettings = (function() { + + /** + * Properties of a CloudSqlSettings. + * @memberof google.cloud.clouddms.v1 + * @interface ICloudSqlSettings + * @property {google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion|null} [databaseVersion] CloudSqlSettings databaseVersion + * @property {Object.|null} [userLabels] CloudSqlSettings userLabels + * @property {string|null} [tier] CloudSqlSettings tier + * @property {google.protobuf.IInt64Value|null} [storageAutoResizeLimit] CloudSqlSettings storageAutoResizeLimit + * @property {google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy|null} [activationPolicy] CloudSqlSettings activationPolicy + * @property {google.cloud.clouddms.v1.ISqlIpConfig|null} [ipConfig] CloudSqlSettings ipConfig + * @property {google.protobuf.IBoolValue|null} [autoStorageIncrease] CloudSqlSettings autoStorageIncrease + * @property {Object.|null} [databaseFlags] CloudSqlSettings databaseFlags + * @property {google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType|null} [dataDiskType] CloudSqlSettings dataDiskType + * @property {google.protobuf.IInt64Value|null} [dataDiskSizeGb] CloudSqlSettings dataDiskSizeGb + * @property {string|null} [zone] CloudSqlSettings zone + * @property {string|null} [secondaryZone] CloudSqlSettings secondaryZone + * @property {string|null} [sourceId] CloudSqlSettings sourceId + * @property {string|null} [rootPassword] CloudSqlSettings rootPassword + * @property {boolean|null} [rootPasswordSet] CloudSqlSettings rootPasswordSet + * @property {string|null} [collation] CloudSqlSettings collation + * @property {string|null} [cmekKeyName] CloudSqlSettings cmekKeyName + * @property {google.cloud.clouddms.v1.CloudSqlSettings.SqlAvailabilityType|null} [availabilityType] CloudSqlSettings availabilityType + */ + + /** + * Constructs a new CloudSqlSettings. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a CloudSqlSettings. + * @implements ICloudSqlSettings + * @constructor + * @param {google.cloud.clouddms.v1.ICloudSqlSettings=} [properties] Properties to set + */ + function CloudSqlSettings(properties) { + this.userLabels = {}; + this.databaseFlags = {}; + 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]]; + } + + /** + * CloudSqlSettings databaseVersion. + * @member {google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion} databaseVersion + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.databaseVersion = 0; + + /** + * CloudSqlSettings userLabels. + * @member {Object.} userLabels + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.userLabels = $util.emptyObject; + + /** + * CloudSqlSettings tier. + * @member {string} tier + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.tier = ""; + + /** + * CloudSqlSettings storageAutoResizeLimit. + * @member {google.protobuf.IInt64Value|null|undefined} storageAutoResizeLimit + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.storageAutoResizeLimit = null; + + /** + * CloudSqlSettings activationPolicy. + * @member {google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy} activationPolicy + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.activationPolicy = 0; + + /** + * CloudSqlSettings ipConfig. + * @member {google.cloud.clouddms.v1.ISqlIpConfig|null|undefined} ipConfig + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.ipConfig = null; + + /** + * CloudSqlSettings autoStorageIncrease. + * @member {google.protobuf.IBoolValue|null|undefined} autoStorageIncrease + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.autoStorageIncrease = null; + + /** + * CloudSqlSettings databaseFlags. + * @member {Object.} databaseFlags + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.databaseFlags = $util.emptyObject; + + /** + * CloudSqlSettings dataDiskType. + * @member {google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType} dataDiskType + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.dataDiskType = 0; + + /** + * CloudSqlSettings dataDiskSizeGb. + * @member {google.protobuf.IInt64Value|null|undefined} dataDiskSizeGb + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.dataDiskSizeGb = null; + + /** + * CloudSqlSettings zone. + * @member {string} zone + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.zone = ""; + + /** + * CloudSqlSettings secondaryZone. + * @member {string} secondaryZone + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.secondaryZone = ""; + + /** + * CloudSqlSettings sourceId. + * @member {string} sourceId + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.sourceId = ""; + + /** + * CloudSqlSettings rootPassword. + * @member {string} rootPassword + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.rootPassword = ""; + + /** + * CloudSqlSettings rootPasswordSet. + * @member {boolean} rootPasswordSet + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.rootPasswordSet = false; + + /** + * CloudSqlSettings collation. + * @member {string} collation + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.collation = ""; + + /** + * CloudSqlSettings cmekKeyName. + * @member {string} cmekKeyName + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.cmekKeyName = ""; + + /** + * CloudSqlSettings availabilityType. + * @member {google.cloud.clouddms.v1.CloudSqlSettings.SqlAvailabilityType} availabilityType + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.availabilityType = 0; + + /** + * Creates a new CloudSqlSettings instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {google.cloud.clouddms.v1.ICloudSqlSettings=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.CloudSqlSettings} CloudSqlSettings instance + */ + CloudSqlSettings.create = function create(properties) { + return new CloudSqlSettings(properties); + }; + + /** + * Encodes the specified CloudSqlSettings message. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {google.cloud.clouddms.v1.ICloudSqlSettings} message CloudSqlSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.databaseVersion); + if (message.userLabels != null && Object.hasOwnProperty.call(message, "userLabels")) + for (var keys = Object.keys(message.userLabels), 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.userLabels[keys[i]]).ldelim(); + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tier); + if (message.storageAutoResizeLimit != null && Object.hasOwnProperty.call(message, "storageAutoResizeLimit")) + $root.google.protobuf.Int64Value.encode(message.storageAutoResizeLimit, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.activationPolicy); + if (message.ipConfig != null && Object.hasOwnProperty.call(message, "ipConfig")) + $root.google.cloud.clouddms.v1.SqlIpConfig.encode(message.ipConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.autoStorageIncrease != null && Object.hasOwnProperty.call(message, "autoStorageIncrease")) + $root.google.protobuf.BoolValue.encode(message.autoStorageIncrease, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) + for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); + if (message.dataDiskType != null && Object.hasOwnProperty.call(message, "dataDiskType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.dataDiskType); + if (message.dataDiskSizeGb != null && Object.hasOwnProperty.call(message, "dataDiskSizeGb")) + $root.google.protobuf.Int64Value.encode(message.dataDiskSizeGb, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.zone); + if (message.sourceId != null && Object.hasOwnProperty.call(message, "sourceId")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.sourceId); + if (message.rootPassword != null && Object.hasOwnProperty.call(message, "rootPassword")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.rootPassword); + if (message.rootPasswordSet != null && Object.hasOwnProperty.call(message, "rootPasswordSet")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.rootPasswordSet); + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.collation); + if (message.cmekKeyName != null && Object.hasOwnProperty.call(message, "cmekKeyName")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.cmekKeyName); + if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.availabilityType); + if (message.secondaryZone != null && Object.hasOwnProperty.call(message, "secondaryZone")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.secondaryZone); + return writer; + }; + + /** + * Encodes the specified CloudSqlSettings message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {google.cloud.clouddms.v1.ICloudSqlSettings} message CloudSqlSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSqlSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.CloudSqlSettings} CloudSqlSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlSettings.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.clouddms.v1.CloudSqlSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.databaseVersion = reader.int32(); + break; + } + case 2: { + if (message.userLabels === $util.emptyObject) + message.userLabels = {}; + 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.userLabels[key] = value; + break; + } + case 3: { + message.tier = reader.string(); + break; + } + case 4: { + message.storageAutoResizeLimit = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 5: { + message.activationPolicy = reader.int32(); + break; + } + case 6: { + message.ipConfig = $root.google.cloud.clouddms.v1.SqlIpConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.autoStorageIncrease = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.databaseFlags === $util.emptyObject) + message.databaseFlags = {}; + 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.databaseFlags[key] = value; + break; + } + case 9: { + message.dataDiskType = reader.int32(); + break; + } + case 10: { + message.dataDiskSizeGb = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 11: { + message.zone = reader.string(); + break; + } + case 18: { + message.secondaryZone = reader.string(); + break; + } + case 12: { + message.sourceId = reader.string(); + break; + } + case 13: { + message.rootPassword = reader.string(); + break; + } + case 14: { + message.rootPasswordSet = reader.bool(); + break; + } + case 15: { + message.collation = reader.string(); + break; + } + case 16: { + message.cmekKeyName = reader.string(); + break; + } + case 17: { + message.availabilityType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSqlSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.CloudSqlSettings} CloudSqlSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSqlSettings message. + * @function verify + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSqlSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 17: + break; + } + if (message.userLabels != null && message.hasOwnProperty("userLabels")) { + if (!$util.isObject(message.userLabels)) + return "userLabels: object expected"; + var key = Object.keys(message.userLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.userLabels[key[i]])) + return "userLabels: string{k:string} expected"; + } + if (message.tier != null && message.hasOwnProperty("tier")) + if (!$util.isString(message.tier)) + return "tier: string expected"; + if (message.storageAutoResizeLimit != null && message.hasOwnProperty("storageAutoResizeLimit")) { + var error = $root.google.protobuf.Int64Value.verify(message.storageAutoResizeLimit); + if (error) + return "storageAutoResizeLimit." + error; + } + if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + switch (message.activationPolicy) { + default: + return "activationPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.ipConfig != null && message.hasOwnProperty("ipConfig")) { + var error = $root.google.cloud.clouddms.v1.SqlIpConfig.verify(message.ipConfig); + if (error) + return "ipConfig." + error; + } + if (message.autoStorageIncrease != null && message.hasOwnProperty("autoStorageIncrease")) { + var error = $root.google.protobuf.BoolValue.verify(message.autoStorageIncrease); + if (error) + return "autoStorageIncrease." + error; + } + if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { + if (!$util.isObject(message.databaseFlags)) + return "databaseFlags: object expected"; + var key = Object.keys(message.databaseFlags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.databaseFlags[key[i]])) + return "databaseFlags: string{k:string} expected"; + } + if (message.dataDiskType != null && message.hasOwnProperty("dataDiskType")) + switch (message.dataDiskType) { + default: + return "dataDiskType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.dataDiskSizeGb != null && message.hasOwnProperty("dataDiskSizeGb")) { + var error = $root.google.protobuf.Int64Value.verify(message.dataDiskSizeGb); + if (error) + return "dataDiskSizeGb." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.secondaryZone != null && message.hasOwnProperty("secondaryZone")) + if (!$util.isString(message.secondaryZone)) + return "secondaryZone: string expected"; + if (message.sourceId != null && message.hasOwnProperty("sourceId")) + if (!$util.isString(message.sourceId)) + return "sourceId: string expected"; + if (message.rootPassword != null && message.hasOwnProperty("rootPassword")) + if (!$util.isString(message.rootPassword)) + return "rootPassword: string expected"; + if (message.rootPasswordSet != null && message.hasOwnProperty("rootPasswordSet")) + if (typeof message.rootPasswordSet !== "boolean") + return "rootPasswordSet: boolean expected"; + if (message.collation != null && message.hasOwnProperty("collation")) + if (!$util.isString(message.collation)) + return "collation: string expected"; + if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) + if (!$util.isString(message.cmekKeyName)) + return "cmekKeyName: string expected"; + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + switch (message.availabilityType) { + default: + return "availabilityType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a CloudSqlSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.CloudSqlSettings} CloudSqlSettings + */ + CloudSqlSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.CloudSqlSettings) + return object; + var message = new $root.google.cloud.clouddms.v1.CloudSqlSettings(); + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "SQL_DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "MYSQL_5_6": + case 1: + message.databaseVersion = 1; + break; + case "MYSQL_5_7": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_9_6": + case 3: + message.databaseVersion = 3; + break; + case "POSTGRES_11": + case 4: + message.databaseVersion = 4; + break; + case "POSTGRES_10": + case 5: + message.databaseVersion = 5; + break; + case "MYSQL_8_0": + case 6: + message.databaseVersion = 6; + break; + case "POSTGRES_12": + case 7: + message.databaseVersion = 7; + break; + case "POSTGRES_13": + case 8: + message.databaseVersion = 8; + break; + case "POSTGRES_14": + case 17: + message.databaseVersion = 17; + break; + } + if (object.userLabels) { + if (typeof object.userLabels !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.userLabels: object expected"); + message.userLabels = {}; + for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) + message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); + } + if (object.tier != null) + message.tier = String(object.tier); + if (object.storageAutoResizeLimit != null) { + if (typeof object.storageAutoResizeLimit !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.storageAutoResizeLimit: object expected"); + message.storageAutoResizeLimit = $root.google.protobuf.Int64Value.fromObject(object.storageAutoResizeLimit); + } + switch (object.activationPolicy) { + default: + if (typeof object.activationPolicy === "number") { + message.activationPolicy = object.activationPolicy; + break; + } + break; + case "SQL_ACTIVATION_POLICY_UNSPECIFIED": + case 0: + message.activationPolicy = 0; + break; + case "ALWAYS": + case 1: + message.activationPolicy = 1; + break; + case "NEVER": + case 2: + message.activationPolicy = 2; + break; + } + if (object.ipConfig != null) { + if (typeof object.ipConfig !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.ipConfig: object expected"); + message.ipConfig = $root.google.cloud.clouddms.v1.SqlIpConfig.fromObject(object.ipConfig); + } + if (object.autoStorageIncrease != null) { + if (typeof object.autoStorageIncrease !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.autoStorageIncrease: object expected"); + message.autoStorageIncrease = $root.google.protobuf.BoolValue.fromObject(object.autoStorageIncrease); + } + if (object.databaseFlags) { + if (typeof object.databaseFlags !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.databaseFlags: object expected"); + message.databaseFlags = {}; + for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) + message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); + } + switch (object.dataDiskType) { + default: + if (typeof object.dataDiskType === "number") { + message.dataDiskType = object.dataDiskType; + break; + } + break; + case "SQL_DATA_DISK_TYPE_UNSPECIFIED": + case 0: + message.dataDiskType = 0; + break; + case "PD_SSD": + case 1: + message.dataDiskType = 1; + break; + case "PD_HDD": + case 2: + message.dataDiskType = 2; + break; + } + if (object.dataDiskSizeGb != null) { + if (typeof object.dataDiskSizeGb !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.dataDiskSizeGb: object expected"); + message.dataDiskSizeGb = $root.google.protobuf.Int64Value.fromObject(object.dataDiskSizeGb); + } + if (object.zone != null) + message.zone = String(object.zone); + if (object.secondaryZone != null) + message.secondaryZone = String(object.secondaryZone); + if (object.sourceId != null) + message.sourceId = String(object.sourceId); + if (object.rootPassword != null) + message.rootPassword = String(object.rootPassword); + if (object.rootPasswordSet != null) + message.rootPasswordSet = Boolean(object.rootPasswordSet); + if (object.collation != null) + message.collation = String(object.collation); + if (object.cmekKeyName != null) + message.cmekKeyName = String(object.cmekKeyName); + switch (object.availabilityType) { + default: + if (typeof object.availabilityType === "number") { + message.availabilityType = object.availabilityType; + break; + } + break; + case "SQL_AVAILABILITY_TYPE_UNSPECIFIED": + case 0: + message.availabilityType = 0; + break; + case "ZONAL": + case 1: + message.availabilityType = 1; + break; + case "REGIONAL": + case 2: + message.availabilityType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CloudSqlSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {google.cloud.clouddms.v1.CloudSqlSettings} message CloudSqlSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSqlSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.userLabels = {}; + object.databaseFlags = {}; + } + if (options.defaults) { + object.databaseVersion = options.enums === String ? "SQL_DATABASE_VERSION_UNSPECIFIED" : 0; + object.tier = ""; + object.storageAutoResizeLimit = null; + object.activationPolicy = options.enums === String ? "SQL_ACTIVATION_POLICY_UNSPECIFIED" : 0; + object.ipConfig = null; + object.autoStorageIncrease = null; + object.dataDiskType = options.enums === String ? "SQL_DATA_DISK_TYPE_UNSPECIFIED" : 0; + object.dataDiskSizeGb = null; + object.zone = ""; + object.sourceId = ""; + object.rootPassword = ""; + object.rootPasswordSet = false; + object.collation = ""; + object.cmekKeyName = ""; + object.availabilityType = options.enums === String ? "SQL_AVAILABILITY_TYPE_UNSPECIFIED" : 0; + object.secondaryZone = ""; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion[message.databaseVersion] : message.databaseVersion; + var keys2; + if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { + object.userLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; + } + if (message.tier != null && message.hasOwnProperty("tier")) + object.tier = message.tier; + if (message.storageAutoResizeLimit != null && message.hasOwnProperty("storageAutoResizeLimit")) + object.storageAutoResizeLimit = $root.google.protobuf.Int64Value.toObject(message.storageAutoResizeLimit, options); + if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + object.activationPolicy = options.enums === String ? $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy[message.activationPolicy] === undefined ? message.activationPolicy : $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy[message.activationPolicy] : message.activationPolicy; + if (message.ipConfig != null && message.hasOwnProperty("ipConfig")) + object.ipConfig = $root.google.cloud.clouddms.v1.SqlIpConfig.toObject(message.ipConfig, options); + if (message.autoStorageIncrease != null && message.hasOwnProperty("autoStorageIncrease")) + object.autoStorageIncrease = $root.google.protobuf.BoolValue.toObject(message.autoStorageIncrease, options); + if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { + object.databaseFlags = {}; + for (var j = 0; j < keys2.length; ++j) + object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; + } + if (message.dataDiskType != null && message.hasOwnProperty("dataDiskType")) + object.dataDiskType = options.enums === String ? $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType[message.dataDiskType] === undefined ? message.dataDiskType : $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType[message.dataDiskType] : message.dataDiskType; + if (message.dataDiskSizeGb != null && message.hasOwnProperty("dataDiskSizeGb")) + object.dataDiskSizeGb = $root.google.protobuf.Int64Value.toObject(message.dataDiskSizeGb, options); + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.sourceId != null && message.hasOwnProperty("sourceId")) + object.sourceId = message.sourceId; + if (message.rootPassword != null && message.hasOwnProperty("rootPassword")) + object.rootPassword = message.rootPassword; + if (message.rootPasswordSet != null && message.hasOwnProperty("rootPasswordSet")) + object.rootPasswordSet = message.rootPasswordSet; + if (message.collation != null && message.hasOwnProperty("collation")) + object.collation = message.collation; + if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) + object.cmekKeyName = message.cmekKeyName; + if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + object.availabilityType = options.enums === String ? $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlAvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlAvailabilityType[message.availabilityType] : message.availabilityType; + if (message.secondaryZone != null && message.hasOwnProperty("secondaryZone")) + object.secondaryZone = message.secondaryZone; + return object; + }; + + /** + * Converts this CloudSqlSettings to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + * @returns {Object.} JSON object + */ + CloudSqlSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSqlSettings + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSqlSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.CloudSqlSettings"; + }; + + /** + * SqlActivationPolicy enum. + * @name google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy + * @enum {number} + * @property {number} SQL_ACTIVATION_POLICY_UNSPECIFIED=0 SQL_ACTIVATION_POLICY_UNSPECIFIED value + * @property {number} ALWAYS=1 ALWAYS value + * @property {number} NEVER=2 NEVER value + */ + CloudSqlSettings.SqlActivationPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SQL_ACTIVATION_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALWAYS"] = 1; + values[valuesById[2] = "NEVER"] = 2; + return values; + })(); + + /** + * SqlDataDiskType enum. + * @name google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType + * @enum {number} + * @property {number} SQL_DATA_DISK_TYPE_UNSPECIFIED=0 SQL_DATA_DISK_TYPE_UNSPECIFIED value + * @property {number} PD_SSD=1 PD_SSD value + * @property {number} PD_HDD=2 PD_HDD value + */ + CloudSqlSettings.SqlDataDiskType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SQL_DATA_DISK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PD_SSD"] = 1; + values[valuesById[2] = "PD_HDD"] = 2; + return values; + })(); + + /** + * SqlDatabaseVersion enum. + * @name google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion + * @enum {number} + * @property {number} SQL_DATABASE_VERSION_UNSPECIFIED=0 SQL_DATABASE_VERSION_UNSPECIFIED value + * @property {number} MYSQL_5_6=1 MYSQL_5_6 value + * @property {number} MYSQL_5_7=2 MYSQL_5_7 value + * @property {number} POSTGRES_9_6=3 POSTGRES_9_6 value + * @property {number} POSTGRES_11=4 POSTGRES_11 value + * @property {number} POSTGRES_10=5 POSTGRES_10 value + * @property {number} MYSQL_8_0=6 MYSQL_8_0 value + * @property {number} POSTGRES_12=7 POSTGRES_12 value + * @property {number} POSTGRES_13=8 POSTGRES_13 value + * @property {number} POSTGRES_14=17 POSTGRES_14 value + */ + CloudSqlSettings.SqlDatabaseVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SQL_DATABASE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "MYSQL_5_6"] = 1; + values[valuesById[2] = "MYSQL_5_7"] = 2; + values[valuesById[3] = "POSTGRES_9_6"] = 3; + values[valuesById[4] = "POSTGRES_11"] = 4; + values[valuesById[5] = "POSTGRES_10"] = 5; + values[valuesById[6] = "MYSQL_8_0"] = 6; + values[valuesById[7] = "POSTGRES_12"] = 7; + values[valuesById[8] = "POSTGRES_13"] = 8; + values[valuesById[17] = "POSTGRES_14"] = 17; + return values; + })(); + + /** + * SqlAvailabilityType enum. + * @name google.cloud.clouddms.v1.CloudSqlSettings.SqlAvailabilityType + * @enum {number} + * @property {number} SQL_AVAILABILITY_TYPE_UNSPECIFIED=0 SQL_AVAILABILITY_TYPE_UNSPECIFIED value + * @property {number} ZONAL=1 ZONAL value + * @property {number} REGIONAL=2 REGIONAL value + */ + CloudSqlSettings.SqlAvailabilityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SQL_AVAILABILITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONAL"] = 1; + values[valuesById[2] = "REGIONAL"] = 2; + return values; + })(); + + return CloudSqlSettings; + })(); + + v1.AlloyDbSettings = (function() { + + /** + * Properties of an AlloyDbSettings. + * @memberof google.cloud.clouddms.v1 + * @interface IAlloyDbSettings + * @property {google.cloud.clouddms.v1.AlloyDbSettings.IUserPassword|null} [initialUser] AlloyDbSettings initialUser + * @property {string|null} [vpcNetwork] AlloyDbSettings vpcNetwork + * @property {Object.|null} [labels] AlloyDbSettings labels + * @property {google.cloud.clouddms.v1.AlloyDbSettings.IPrimaryInstanceSettings|null} [primaryInstanceSettings] AlloyDbSettings primaryInstanceSettings + * @property {google.cloud.clouddms.v1.AlloyDbSettings.IEncryptionConfig|null} [encryptionConfig] AlloyDbSettings encryptionConfig + */ + + /** + * Constructs a new AlloyDbSettings. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents an AlloyDbSettings. + * @implements IAlloyDbSettings + * @constructor + * @param {google.cloud.clouddms.v1.IAlloyDbSettings=} [properties] Properties to set + */ + function AlloyDbSettings(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlloyDbSettings initialUser. + * @member {google.cloud.clouddms.v1.AlloyDbSettings.IUserPassword|null|undefined} initialUser + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @instance + */ + AlloyDbSettings.prototype.initialUser = null; + + /** + * AlloyDbSettings vpcNetwork. + * @member {string} vpcNetwork + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @instance + */ + AlloyDbSettings.prototype.vpcNetwork = ""; + + /** + * AlloyDbSettings labels. + * @member {Object.} labels + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @instance + */ + AlloyDbSettings.prototype.labels = $util.emptyObject; + + /** + * AlloyDbSettings primaryInstanceSettings. + * @member {google.cloud.clouddms.v1.AlloyDbSettings.IPrimaryInstanceSettings|null|undefined} primaryInstanceSettings + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @instance + */ + AlloyDbSettings.prototype.primaryInstanceSettings = null; + + /** + * AlloyDbSettings encryptionConfig. + * @member {google.cloud.clouddms.v1.AlloyDbSettings.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @instance + */ + AlloyDbSettings.prototype.encryptionConfig = null; + + /** + * Creates a new AlloyDbSettings instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @static + * @param {google.cloud.clouddms.v1.IAlloyDbSettings=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.AlloyDbSettings} AlloyDbSettings instance + */ + AlloyDbSettings.create = function create(properties) { + return new AlloyDbSettings(properties); + }; + + /** + * Encodes the specified AlloyDbSettings message. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @static + * @param {google.cloud.clouddms.v1.IAlloyDbSettings} message AlloyDbSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlloyDbSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialUser != null && Object.hasOwnProperty.call(message, "initialUser")) + $root.google.cloud.clouddms.v1.AlloyDbSettings.UserPassword.encode(message.initialUser, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.vpcNetwork != null && Object.hasOwnProperty.call(message, "vpcNetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vpcNetwork); + 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 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.primaryInstanceSettings != null && Object.hasOwnProperty.call(message, "primaryInstanceSettings")) + $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.encode(message.primaryInstanceSettings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlloyDbSettings message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @static + * @param {google.cloud.clouddms.v1.IAlloyDbSettings} message AlloyDbSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlloyDbSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlloyDbSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.AlloyDbSettings} AlloyDbSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlloyDbSettings.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.clouddms.v1.AlloyDbSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialUser = $root.google.cloud.clouddms.v1.AlloyDbSettings.UserPassword.decode(reader, reader.uint32()); + break; + } + case 2: { + message.vpcNetwork = reader.string(); + break; + } + case 3: { + 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; + } + case 4: { + message.primaryInstanceSettings = $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.decode(reader, reader.uint32()); + break; + } + case 5: { + message.encryptionConfig = $root.google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlloyDbSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.AlloyDbSettings} AlloyDbSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlloyDbSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlloyDbSettings message. + * @function verify + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlloyDbSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialUser != null && message.hasOwnProperty("initialUser")) { + var error = $root.google.cloud.clouddms.v1.AlloyDbSettings.UserPassword.verify(message.initialUser); + if (error) + return "initialUser." + error; + } + if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) + if (!$util.isString(message.vpcNetwork)) + return "vpcNetwork: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.primaryInstanceSettings != null && message.hasOwnProperty("primaryInstanceSettings")) { + var error = $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.verify(message.primaryInstanceSettings); + if (error) + return "primaryInstanceSettings." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates an AlloyDbSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.AlloyDbSettings} AlloyDbSettings + */ + AlloyDbSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.AlloyDbSettings) + return object; + var message = new $root.google.cloud.clouddms.v1.AlloyDbSettings(); + if (object.initialUser != null) { + if (typeof object.initialUser !== "object") + throw TypeError(".google.cloud.clouddms.v1.AlloyDbSettings.initialUser: object expected"); + message.initialUser = $root.google.cloud.clouddms.v1.AlloyDbSettings.UserPassword.fromObject(object.initialUser); + } + if (object.vpcNetwork != null) + message.vpcNetwork = String(object.vpcNetwork); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.clouddms.v1.AlloyDbSettings.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.primaryInstanceSettings != null) { + if (typeof object.primaryInstanceSettings !== "object") + throw TypeError(".google.cloud.clouddms.v1.AlloyDbSettings.primaryInstanceSettings: object expected"); + message.primaryInstanceSettings = $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.fromObject(object.primaryInstanceSettings); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.clouddms.v1.AlloyDbSettings.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from an AlloyDbSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings} message AlloyDbSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlloyDbSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.initialUser = null; + object.vpcNetwork = ""; + object.primaryInstanceSettings = null; + object.encryptionConfig = null; + } + if (message.initialUser != null && message.hasOwnProperty("initialUser")) + object.initialUser = $root.google.cloud.clouddms.v1.AlloyDbSettings.UserPassword.toObject(message.initialUser, options); + if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) + object.vpcNetwork = message.vpcNetwork; + 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.primaryInstanceSettings != null && message.hasOwnProperty("primaryInstanceSettings")) + object.primaryInstanceSettings = $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.toObject(message.primaryInstanceSettings, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this AlloyDbSettings to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @instance + * @returns {Object.} JSON object + */ + AlloyDbSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlloyDbSettings + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlloyDbSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.AlloyDbSettings"; + }; + + AlloyDbSettings.UserPassword = (function() { + + /** + * Properties of a UserPassword. + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @interface IUserPassword + * @property {string|null} [user] UserPassword user + * @property {string|null} [password] UserPassword password + * @property {boolean|null} [passwordSet] UserPassword passwordSet + */ + + /** + * Constructs a new UserPassword. + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @classdesc Represents a UserPassword. + * @implements IUserPassword + * @constructor + * @param {google.cloud.clouddms.v1.AlloyDbSettings.IUserPassword=} [properties] Properties to set + */ + function UserPassword(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]]; + } + + /** + * UserPassword user. + * @member {string} user + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @instance + */ + UserPassword.prototype.user = ""; + + /** + * UserPassword password. + * @member {string} password + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @instance + */ + UserPassword.prototype.password = ""; + + /** + * UserPassword passwordSet. + * @member {boolean} passwordSet + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @instance + */ + UserPassword.prototype.passwordSet = false; + + /** + * Creates a new UserPassword instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.IUserPassword=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.UserPassword} UserPassword instance + */ + UserPassword.create = function create(properties) { + return new UserPassword(properties); + }; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.UserPassword.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.passwordSet != null && Object.hasOwnProperty.call(message, "passwordSet")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.passwordSet); + return writer; + }; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.UserPassword.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.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.clouddms.v1.AlloyDbSettings.UserPassword(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.user = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + case 3: { + message.passwordSet = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserPassword message. + * @function verify + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserPassword.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) + if (typeof message.passwordSet !== "boolean") + return "passwordSet: boolean expected"; + return null; + }; + + /** + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.UserPassword} UserPassword + */ + UserPassword.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.AlloyDbSettings.UserPassword) + return object; + var message = new $root.google.cloud.clouddms.v1.AlloyDbSettings.UserPassword(); + if (object.user != null) + message.user = String(object.user); + if (object.password != null) + message.password = String(object.password); + if (object.passwordSet != null) + message.passwordSet = Boolean(object.passwordSet); + return message; + }; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.UserPassword} message UserPassword + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserPassword.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.user = ""; + object.password = ""; + object.passwordSet = false; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) + object.passwordSet = message.passwordSet; + return object; + }; + + /** + * Converts this UserPassword to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @instance + * @returns {Object.} JSON object + */ + UserPassword.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserPassword + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.UserPassword + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.AlloyDbSettings.UserPassword"; + }; + + return UserPassword; + })(); + + AlloyDbSettings.PrimaryInstanceSettings = (function() { + + /** + * Properties of a PrimaryInstanceSettings. + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @interface IPrimaryInstanceSettings + * @property {string|null} [id] PrimaryInstanceSettings id + * @property {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.IMachineConfig|null} [machineConfig] PrimaryInstanceSettings machineConfig + * @property {Object.|null} [databaseFlags] PrimaryInstanceSettings databaseFlags + * @property {Object.|null} [labels] PrimaryInstanceSettings labels + * @property {string|null} [privateIp] PrimaryInstanceSettings privateIp + */ + + /** + * Constructs a new PrimaryInstanceSettings. + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @classdesc Represents a PrimaryInstanceSettings. + * @implements IPrimaryInstanceSettings + * @constructor + * @param {google.cloud.clouddms.v1.AlloyDbSettings.IPrimaryInstanceSettings=} [properties] Properties to set + */ + function PrimaryInstanceSettings(properties) { + this.databaseFlags = {}; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrimaryInstanceSettings id. + * @member {string} id + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @instance + */ + PrimaryInstanceSettings.prototype.id = ""; + + /** + * PrimaryInstanceSettings machineConfig. + * @member {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.IMachineConfig|null|undefined} machineConfig + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @instance + */ + PrimaryInstanceSettings.prototype.machineConfig = null; + + /** + * PrimaryInstanceSettings databaseFlags. + * @member {Object.} databaseFlags + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @instance + */ + PrimaryInstanceSettings.prototype.databaseFlags = $util.emptyObject; + + /** + * PrimaryInstanceSettings labels. + * @member {Object.} labels + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @instance + */ + PrimaryInstanceSettings.prototype.labels = $util.emptyObject; + + /** + * PrimaryInstanceSettings privateIp. + * @member {string} privateIp + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @instance + */ + PrimaryInstanceSettings.prototype.privateIp = ""; + + /** + * Creates a new PrimaryInstanceSettings instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.IPrimaryInstanceSettings=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings} PrimaryInstanceSettings instance + */ + PrimaryInstanceSettings.create = function create(properties) { + return new PrimaryInstanceSettings(properties); + }; + + /** + * Encodes the specified PrimaryInstanceSettings message. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.IPrimaryInstanceSettings} message PrimaryInstanceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryInstanceSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.machineConfig != null && Object.hasOwnProperty.call(message, "machineConfig")) + $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig.encode(message.machineConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) + for (var keys = Object.keys(message.databaseFlags), 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.databaseFlags[keys[i]]).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.privateIp != null && Object.hasOwnProperty.call(message, "privateIp")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.privateIp); + return writer; + }; + + /** + * Encodes the specified PrimaryInstanceSettings message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.IPrimaryInstanceSettings} message PrimaryInstanceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrimaryInstanceSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrimaryInstanceSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings} PrimaryInstanceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryInstanceSettings.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.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.machineConfig = $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.databaseFlags === $util.emptyObject) + message.databaseFlags = {}; + 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.databaseFlags[key] = value; + 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; + break; + } + case 8: { + message.privateIp = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrimaryInstanceSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings} PrimaryInstanceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrimaryInstanceSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrimaryInstanceSettings message. + * @function verify + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrimaryInstanceSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) { + var error = $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig.verify(message.machineConfig); + if (error) + return "machineConfig." + error; + } + if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { + if (!$util.isObject(message.databaseFlags)) + return "databaseFlags: object expected"; + var key = Object.keys(message.databaseFlags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.databaseFlags[key[i]])) + return "databaseFlags: string{k:string} expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.privateIp != null && message.hasOwnProperty("privateIp")) + if (!$util.isString(message.privateIp)) + return "privateIp: string expected"; + return null; + }; + + /** + * Creates a PrimaryInstanceSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings} PrimaryInstanceSettings + */ + PrimaryInstanceSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings) + return object; + var message = new $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings(); + if (object.id != null) + message.id = String(object.id); + if (object.machineConfig != null) { + if (typeof object.machineConfig !== "object") + throw TypeError(".google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.machineConfig: object expected"); + message.machineConfig = $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig.fromObject(object.machineConfig); + } + if (object.databaseFlags) { + if (typeof object.databaseFlags !== "object") + throw TypeError(".google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.databaseFlags: object expected"); + message.databaseFlags = {}; + for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) + message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.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.privateIp != null) + message.privateIp = String(object.privateIp); + return message; + }; + + /** + * Creates a plain object from a PrimaryInstanceSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings} message PrimaryInstanceSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrimaryInstanceSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.databaseFlags = {}; + object.labels = {}; + } + if (options.defaults) { + object.id = ""; + object.machineConfig = null; + object.privateIp = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.machineConfig != null && message.hasOwnProperty("machineConfig")) + object.machineConfig = $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig.toObject(message.machineConfig, options); + var keys2; + if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { + object.databaseFlags = {}; + for (var j = 0; j < keys2.length; ++j) + object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; + } + 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.privateIp != null && message.hasOwnProperty("privateIp")) + object.privateIp = message.privateIp; + return object; + }; + + /** + * Converts this PrimaryInstanceSettings to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @instance + * @returns {Object.} JSON object + */ + PrimaryInstanceSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrimaryInstanceSettings + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrimaryInstanceSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings"; + }; + + PrimaryInstanceSettings.MachineConfig = (function() { + + /** + * Properties of a MachineConfig. + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @interface IMachineConfig + * @property {number|null} [cpuCount] MachineConfig cpuCount + */ + + /** + * Constructs a new MachineConfig. + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings + * @classdesc Represents a MachineConfig. + * @implements IMachineConfig + * @constructor + * @param {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.IMachineConfig=} [properties] Properties to set + */ + function MachineConfig(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]]; + } + + /** + * MachineConfig cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig + * @instance + */ + MachineConfig.prototype.cpuCount = 0; + + /** + * Creates a new MachineConfig instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.IMachineConfig=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig} MachineConfig instance + */ + MachineConfig.create = function create(properties) { + return new MachineConfig(properties); + }; + + /** + * Encodes the specified MachineConfig message. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + return writer; + }; + + /** + * Encodes the specified MachineConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.IMachineConfig} message MachineConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MachineConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig} MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineConfig.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.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpuCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MachineConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig} MachineConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MachineConfig message. + * @function verify + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; + return null; + }; + + /** + * Creates a MachineConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig} MachineConfig + */ + MachineConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig) + return object; + var message = new $root.google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig(); + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; + return message; + }; + + /** + * Creates a plain object from a MachineConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig} message MachineConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cpuCount = 0; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + return object; + }; + + /** + * Converts this MachineConfig to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig + * @instance + * @returns {Object.} JSON object + */ + MachineConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MachineConfig + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MachineConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.AlloyDbSettings.PrimaryInstanceSettings.MachineConfig"; + }; + + return MachineConfig; + })(); + + return PrimaryInstanceSettings; + })(); + + AlloyDbSettings.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.cloud.clouddms.v1.AlloyDbSettings + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.cloud.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.IEncryptionConfig=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.AlloyDbSettings.EncryptionConfig) + return object; + var message = new $root.google.cloud.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.EncryptionConfig + * @static + * @param {google.cloud.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.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.clouddms.v1.AlloyDbSettings.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + return AlloyDbSettings; + })(); + + v1.StaticIpConnectivity = (function() { + + /** + * Properties of a StaticIpConnectivity. + * @memberof google.cloud.clouddms.v1 + * @interface IStaticIpConnectivity + */ + + /** + * Constructs a new StaticIpConnectivity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a StaticIpConnectivity. + * @implements IStaticIpConnectivity + * @constructor + * @param {google.cloud.clouddms.v1.IStaticIpConnectivity=} [properties] Properties to set + */ + function StaticIpConnectivity(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 StaticIpConnectivity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {google.cloud.clouddms.v1.IStaticIpConnectivity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.StaticIpConnectivity} StaticIpConnectivity instance + */ + StaticIpConnectivity.create = function create(properties) { + return new StaticIpConnectivity(properties); + }; + + /** + * Encodes the specified StaticIpConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.StaticIpConnectivity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {google.cloud.clouddms.v1.IStaticIpConnectivity} message StaticIpConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StaticIpConnectivity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified StaticIpConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StaticIpConnectivity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {google.cloud.clouddms.v1.IStaticIpConnectivity} message StaticIpConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StaticIpConnectivity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StaticIpConnectivity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.StaticIpConnectivity} StaticIpConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StaticIpConnectivity.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.clouddms.v1.StaticIpConnectivity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StaticIpConnectivity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.StaticIpConnectivity} StaticIpConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StaticIpConnectivity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StaticIpConnectivity message. + * @function verify + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StaticIpConnectivity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a StaticIpConnectivity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.StaticIpConnectivity} StaticIpConnectivity + */ + StaticIpConnectivity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.StaticIpConnectivity) + return object; + return new $root.google.cloud.clouddms.v1.StaticIpConnectivity(); + }; + + /** + * Creates a plain object from a StaticIpConnectivity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {google.cloud.clouddms.v1.StaticIpConnectivity} message StaticIpConnectivity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StaticIpConnectivity.toObject = function toObject() { + return {}; + }; + + /** + * Converts this StaticIpConnectivity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @instance + * @returns {Object.} JSON object + */ + StaticIpConnectivity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StaticIpConnectivity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StaticIpConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.StaticIpConnectivity"; + }; + + return StaticIpConnectivity; + })(); + + v1.PrivateServiceConnectConnectivity = (function() { + + /** + * Properties of a PrivateServiceConnectConnectivity. + * @memberof google.cloud.clouddms.v1 + * @interface IPrivateServiceConnectConnectivity + * @property {string|null} [serviceAttachment] PrivateServiceConnectConnectivity serviceAttachment + */ + + /** + * Constructs a new PrivateServiceConnectConnectivity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a PrivateServiceConnectConnectivity. + * @implements IPrivateServiceConnectConnectivity + * @constructor + * @param {google.cloud.clouddms.v1.IPrivateServiceConnectConnectivity=} [properties] Properties to set + */ + function PrivateServiceConnectConnectivity(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]]; + } + + /** + * PrivateServiceConnectConnectivity serviceAttachment. + * @member {string} serviceAttachment + * @memberof google.cloud.clouddms.v1.PrivateServiceConnectConnectivity + * @instance + */ + PrivateServiceConnectConnectivity.prototype.serviceAttachment = ""; + + /** + * Creates a new PrivateServiceConnectConnectivity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.PrivateServiceConnectConnectivity + * @static + * @param {google.cloud.clouddms.v1.IPrivateServiceConnectConnectivity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.PrivateServiceConnectConnectivity} PrivateServiceConnectConnectivity instance + */ + PrivateServiceConnectConnectivity.create = function create(properties) { + return new PrivateServiceConnectConnectivity(properties); + }; + + /** + * Encodes the specified PrivateServiceConnectConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.PrivateServiceConnectConnectivity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.PrivateServiceConnectConnectivity + * @static + * @param {google.cloud.clouddms.v1.IPrivateServiceConnectConnectivity} message PrivateServiceConnectConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateServiceConnectConnectivity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAttachment != null && Object.hasOwnProperty.call(message, "serviceAttachment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAttachment); + return writer; + }; + + /** + * Encodes the specified PrivateServiceConnectConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PrivateServiceConnectConnectivity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.PrivateServiceConnectConnectivity + * @static + * @param {google.cloud.clouddms.v1.IPrivateServiceConnectConnectivity} message PrivateServiceConnectConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateServiceConnectConnectivity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivateServiceConnectConnectivity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.PrivateServiceConnectConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.PrivateServiceConnectConnectivity} PrivateServiceConnectConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateServiceConnectConnectivity.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.clouddms.v1.PrivateServiceConnectConnectivity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceAttachment = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivateServiceConnectConnectivity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.PrivateServiceConnectConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.PrivateServiceConnectConnectivity} PrivateServiceConnectConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateServiceConnectConnectivity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivateServiceConnectConnectivity message. + * @function verify + * @memberof google.cloud.clouddms.v1.PrivateServiceConnectConnectivity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivateServiceConnectConnectivity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceAttachment != null && message.hasOwnProperty("serviceAttachment")) + if (!$util.isString(message.serviceAttachment)) + return "serviceAttachment: string expected"; + return null; + }; + + /** + * Creates a PrivateServiceConnectConnectivity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.PrivateServiceConnectConnectivity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.PrivateServiceConnectConnectivity} PrivateServiceConnectConnectivity + */ + PrivateServiceConnectConnectivity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.PrivateServiceConnectConnectivity) + return object; + var message = new $root.google.cloud.clouddms.v1.PrivateServiceConnectConnectivity(); + if (object.serviceAttachment != null) + message.serviceAttachment = String(object.serviceAttachment); + return message; + }; + + /** + * Creates a plain object from a PrivateServiceConnectConnectivity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.PrivateServiceConnectConnectivity + * @static + * @param {google.cloud.clouddms.v1.PrivateServiceConnectConnectivity} message PrivateServiceConnectConnectivity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivateServiceConnectConnectivity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.serviceAttachment = ""; + if (message.serviceAttachment != null && message.hasOwnProperty("serviceAttachment")) + object.serviceAttachment = message.serviceAttachment; + return object; + }; + + /** + * Converts this PrivateServiceConnectConnectivity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.PrivateServiceConnectConnectivity + * @instance + * @returns {Object.} JSON object + */ + PrivateServiceConnectConnectivity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivateServiceConnectConnectivity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.PrivateServiceConnectConnectivity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivateServiceConnectConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.PrivateServiceConnectConnectivity"; + }; + + return PrivateServiceConnectConnectivity; + })(); + + v1.ReverseSshConnectivity = (function() { + + /** + * Properties of a ReverseSshConnectivity. + * @memberof google.cloud.clouddms.v1 + * @interface IReverseSshConnectivity + * @property {string|null} [vmIp] ReverseSshConnectivity vmIp + * @property {number|null} [vmPort] ReverseSshConnectivity vmPort + * @property {string|null} [vm] ReverseSshConnectivity vm + * @property {string|null} [vpc] ReverseSshConnectivity vpc + */ + + /** + * Constructs a new ReverseSshConnectivity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ReverseSshConnectivity. + * @implements IReverseSshConnectivity + * @constructor + * @param {google.cloud.clouddms.v1.IReverseSshConnectivity=} [properties] Properties to set + */ + function ReverseSshConnectivity(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]]; + } + + /** + * ReverseSshConnectivity vmIp. + * @member {string} vmIp + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @instance + */ + ReverseSshConnectivity.prototype.vmIp = ""; + + /** + * ReverseSshConnectivity vmPort. + * @member {number} vmPort + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @instance + */ + ReverseSshConnectivity.prototype.vmPort = 0; + + /** + * ReverseSshConnectivity vm. + * @member {string} vm + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @instance + */ + ReverseSshConnectivity.prototype.vm = ""; + + /** + * ReverseSshConnectivity vpc. + * @member {string} vpc + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @instance + */ + ReverseSshConnectivity.prototype.vpc = ""; + + /** + * Creates a new ReverseSshConnectivity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {google.cloud.clouddms.v1.IReverseSshConnectivity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ReverseSshConnectivity} ReverseSshConnectivity instance + */ + ReverseSshConnectivity.create = function create(properties) { + return new ReverseSshConnectivity(properties); + }; + + /** + * Encodes the specified ReverseSshConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.ReverseSshConnectivity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {google.cloud.clouddms.v1.IReverseSshConnectivity} message ReverseSshConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReverseSshConnectivity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmIp != null && Object.hasOwnProperty.call(message, "vmIp")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmIp); + if (message.vmPort != null && Object.hasOwnProperty.call(message, "vmPort")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.vmPort); + if (message.vm != null && Object.hasOwnProperty.call(message, "vm")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.vm); + if (message.vpc != null && Object.hasOwnProperty.call(message, "vpc")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.vpc); + return writer; + }; + + /** + * Encodes the specified ReverseSshConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ReverseSshConnectivity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {google.cloud.clouddms.v1.IReverseSshConnectivity} message ReverseSshConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReverseSshConnectivity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReverseSshConnectivity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ReverseSshConnectivity} ReverseSshConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReverseSshConnectivity.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.clouddms.v1.ReverseSshConnectivity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vmIp = reader.string(); + break; + } + case 2: { + message.vmPort = reader.int32(); + break; + } + case 3: { + message.vm = reader.string(); + break; + } + case 4: { + message.vpc = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReverseSshConnectivity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ReverseSshConnectivity} ReverseSshConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReverseSshConnectivity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReverseSshConnectivity message. + * @function verify + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReverseSshConnectivity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vmIp != null && message.hasOwnProperty("vmIp")) + if (!$util.isString(message.vmIp)) + return "vmIp: string expected"; + if (message.vmPort != null && message.hasOwnProperty("vmPort")) + if (!$util.isInteger(message.vmPort)) + return "vmPort: integer expected"; + if (message.vm != null && message.hasOwnProperty("vm")) + if (!$util.isString(message.vm)) + return "vm: string expected"; + if (message.vpc != null && message.hasOwnProperty("vpc")) + if (!$util.isString(message.vpc)) + return "vpc: string expected"; + return null; + }; + + /** + * Creates a ReverseSshConnectivity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ReverseSshConnectivity} ReverseSshConnectivity + */ + ReverseSshConnectivity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ReverseSshConnectivity) + return object; + var message = new $root.google.cloud.clouddms.v1.ReverseSshConnectivity(); + if (object.vmIp != null) + message.vmIp = String(object.vmIp); + if (object.vmPort != null) + message.vmPort = object.vmPort | 0; + if (object.vm != null) + message.vm = String(object.vm); + if (object.vpc != null) + message.vpc = String(object.vpc); + return message; + }; + + /** + * Creates a plain object from a ReverseSshConnectivity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {google.cloud.clouddms.v1.ReverseSshConnectivity} message ReverseSshConnectivity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReverseSshConnectivity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.vmIp = ""; + object.vmPort = 0; + object.vm = ""; + object.vpc = ""; + } + if (message.vmIp != null && message.hasOwnProperty("vmIp")) + object.vmIp = message.vmIp; + if (message.vmPort != null && message.hasOwnProperty("vmPort")) + object.vmPort = message.vmPort; + if (message.vm != null && message.hasOwnProperty("vm")) + object.vm = message.vm; + if (message.vpc != null && message.hasOwnProperty("vpc")) + object.vpc = message.vpc; + return object; + }; + + /** + * Converts this ReverseSshConnectivity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @instance + * @returns {Object.} JSON object + */ + ReverseSshConnectivity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReverseSshConnectivity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReverseSshConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ReverseSshConnectivity"; + }; + + return ReverseSshConnectivity; + })(); + + v1.VpcPeeringConnectivity = (function() { + + /** + * Properties of a VpcPeeringConnectivity. + * @memberof google.cloud.clouddms.v1 + * @interface IVpcPeeringConnectivity + * @property {string|null} [vpc] VpcPeeringConnectivity vpc + */ + + /** + * Constructs a new VpcPeeringConnectivity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a VpcPeeringConnectivity. + * @implements IVpcPeeringConnectivity + * @constructor + * @param {google.cloud.clouddms.v1.IVpcPeeringConnectivity=} [properties] Properties to set + */ + function VpcPeeringConnectivity(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]]; + } + + /** + * VpcPeeringConnectivity vpc. + * @member {string} vpc + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @instance + */ + VpcPeeringConnectivity.prototype.vpc = ""; + + /** + * Creates a new VpcPeeringConnectivity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {google.cloud.clouddms.v1.IVpcPeeringConnectivity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.VpcPeeringConnectivity} VpcPeeringConnectivity instance + */ + VpcPeeringConnectivity.create = function create(properties) { + return new VpcPeeringConnectivity(properties); + }; + + /** + * Encodes the specified VpcPeeringConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConnectivity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {google.cloud.clouddms.v1.IVpcPeeringConnectivity} message VpcPeeringConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcPeeringConnectivity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vpc != null && Object.hasOwnProperty.call(message, "vpc")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vpc); + return writer; + }; + + /** + * Encodes the specified VpcPeeringConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConnectivity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {google.cloud.clouddms.v1.IVpcPeeringConnectivity} message VpcPeeringConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcPeeringConnectivity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcPeeringConnectivity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.VpcPeeringConnectivity} VpcPeeringConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcPeeringConnectivity.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.clouddms.v1.VpcPeeringConnectivity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vpc = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcPeeringConnectivity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.VpcPeeringConnectivity} VpcPeeringConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcPeeringConnectivity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcPeeringConnectivity message. + * @function verify + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcPeeringConnectivity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vpc != null && message.hasOwnProperty("vpc")) + if (!$util.isString(message.vpc)) + return "vpc: string expected"; + return null; + }; + + /** + * Creates a VpcPeeringConnectivity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.VpcPeeringConnectivity} VpcPeeringConnectivity + */ + VpcPeeringConnectivity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.VpcPeeringConnectivity) + return object; + var message = new $root.google.cloud.clouddms.v1.VpcPeeringConnectivity(); + if (object.vpc != null) + message.vpc = String(object.vpc); + return message; + }; + + /** + * Creates a plain object from a VpcPeeringConnectivity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {google.cloud.clouddms.v1.VpcPeeringConnectivity} message VpcPeeringConnectivity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcPeeringConnectivity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.vpc = ""; + if (message.vpc != null && message.hasOwnProperty("vpc")) + object.vpc = message.vpc; + return object; + }; + + /** + * Converts this VpcPeeringConnectivity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @instance + * @returns {Object.} JSON object + */ + VpcPeeringConnectivity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcPeeringConnectivity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcPeeringConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.VpcPeeringConnectivity"; + }; + + return VpcPeeringConnectivity; + })(); + + v1.ForwardSshTunnelConnectivity = (function() { + + /** + * Properties of a ForwardSshTunnelConnectivity. + * @memberof google.cloud.clouddms.v1 + * @interface IForwardSshTunnelConnectivity + * @property {string|null} [hostname] ForwardSshTunnelConnectivity hostname + * @property {string|null} [username] ForwardSshTunnelConnectivity username + * @property {number|null} [port] ForwardSshTunnelConnectivity port + * @property {string|null} [password] ForwardSshTunnelConnectivity password + * @property {string|null} [privateKey] ForwardSshTunnelConnectivity privateKey + */ + + /** + * Constructs a new ForwardSshTunnelConnectivity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ForwardSshTunnelConnectivity. + * @implements IForwardSshTunnelConnectivity + * @constructor + * @param {google.cloud.clouddms.v1.IForwardSshTunnelConnectivity=} [properties] Properties to set + */ + function ForwardSshTunnelConnectivity(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]]; + } + + /** + * ForwardSshTunnelConnectivity hostname. + * @member {string} hostname + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @instance + */ + ForwardSshTunnelConnectivity.prototype.hostname = ""; + + /** + * ForwardSshTunnelConnectivity username. + * @member {string} username + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @instance + */ + ForwardSshTunnelConnectivity.prototype.username = ""; + + /** + * ForwardSshTunnelConnectivity port. + * @member {number} port + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @instance + */ + ForwardSshTunnelConnectivity.prototype.port = 0; + + /** + * ForwardSshTunnelConnectivity password. + * @member {string|null|undefined} password + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @instance + */ + ForwardSshTunnelConnectivity.prototype.password = null; + + /** + * ForwardSshTunnelConnectivity privateKey. + * @member {string|null|undefined} privateKey + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @instance + */ + ForwardSshTunnelConnectivity.prototype.privateKey = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ForwardSshTunnelConnectivity authenticationMethod. + * @member {"password"|"privateKey"|undefined} authenticationMethod + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @instance + */ + Object.defineProperty(ForwardSshTunnelConnectivity.prototype, "authenticationMethod", { + get: $util.oneOfGetter($oneOfFields = ["password", "privateKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ForwardSshTunnelConnectivity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @static + * @param {google.cloud.clouddms.v1.IForwardSshTunnelConnectivity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ForwardSshTunnelConnectivity} ForwardSshTunnelConnectivity instance + */ + ForwardSshTunnelConnectivity.create = function create(properties) { + return new ForwardSshTunnelConnectivity(properties); + }; + + /** + * Encodes the specified ForwardSshTunnelConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.ForwardSshTunnelConnectivity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @static + * @param {google.cloud.clouddms.v1.IForwardSshTunnelConnectivity} message ForwardSshTunnelConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardSshTunnelConnectivity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostname); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.username); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.port); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 100, wireType 2 =*/802).string(message.password); + if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.privateKey); + return writer; + }; + + /** + * Encodes the specified ForwardSshTunnelConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ForwardSshTunnelConnectivity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @static + * @param {google.cloud.clouddms.v1.IForwardSshTunnelConnectivity} message ForwardSshTunnelConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardSshTunnelConnectivity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ForwardSshTunnelConnectivity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ForwardSshTunnelConnectivity} ForwardSshTunnelConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardSshTunnelConnectivity.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.clouddms.v1.ForwardSshTunnelConnectivity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hostname = reader.string(); + break; + } + case 2: { + message.username = reader.string(); + break; + } + case 3: { + message.port = reader.int32(); + break; + } + case 100: { + message.password = reader.string(); + break; + } + case 101: { + message.privateKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ForwardSshTunnelConnectivity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ForwardSshTunnelConnectivity} ForwardSshTunnelConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardSshTunnelConnectivity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForwardSshTunnelConnectivity message. + * @function verify + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForwardSshTunnelConnectivity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.password != null && message.hasOwnProperty("password")) { + properties.authenticationMethod = 1; + if (!$util.isString(message.password)) + return "password: string expected"; + } + if (message.privateKey != null && message.hasOwnProperty("privateKey")) { + if (properties.authenticationMethod === 1) + return "authenticationMethod: multiple values"; + properties.authenticationMethod = 1; + if (!$util.isString(message.privateKey)) + return "privateKey: string expected"; + } + return null; + }; + + /** + * Creates a ForwardSshTunnelConnectivity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ForwardSshTunnelConnectivity} ForwardSshTunnelConnectivity + */ + ForwardSshTunnelConnectivity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ForwardSshTunnelConnectivity) + return object; + var message = new $root.google.cloud.clouddms.v1.ForwardSshTunnelConnectivity(); + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.username != null) + message.username = String(object.username); + if (object.port != null) + message.port = object.port | 0; + if (object.password != null) + message.password = String(object.password); + if (object.privateKey != null) + message.privateKey = String(object.privateKey); + return message; + }; + + /** + * Creates a plain object from a ForwardSshTunnelConnectivity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @static + * @param {google.cloud.clouddms.v1.ForwardSshTunnelConnectivity} message ForwardSshTunnelConnectivity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForwardSshTunnelConnectivity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hostname = ""; + object.username = ""; + object.port = 0; + } + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.password != null && message.hasOwnProperty("password")) { + object.password = message.password; + if (options.oneofs) + object.authenticationMethod = "password"; + } + if (message.privateKey != null && message.hasOwnProperty("privateKey")) { + object.privateKey = message.privateKey; + if (options.oneofs) + object.authenticationMethod = "privateKey"; + } + return object; + }; + + /** + * Converts this ForwardSshTunnelConnectivity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @instance + * @returns {Object.} JSON object + */ + ForwardSshTunnelConnectivity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ForwardSshTunnelConnectivity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ForwardSshTunnelConnectivity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ForwardSshTunnelConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ForwardSshTunnelConnectivity"; + }; + + return ForwardSshTunnelConnectivity; + })(); + + v1.StaticServiceIpConnectivity = (function() { + + /** + * Properties of a StaticServiceIpConnectivity. + * @memberof google.cloud.clouddms.v1 + * @interface IStaticServiceIpConnectivity + */ + + /** + * Constructs a new StaticServiceIpConnectivity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a StaticServiceIpConnectivity. + * @implements IStaticServiceIpConnectivity + * @constructor + * @param {google.cloud.clouddms.v1.IStaticServiceIpConnectivity=} [properties] Properties to set + */ + function StaticServiceIpConnectivity(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 StaticServiceIpConnectivity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.StaticServiceIpConnectivity + * @static + * @param {google.cloud.clouddms.v1.IStaticServiceIpConnectivity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.StaticServiceIpConnectivity} StaticServiceIpConnectivity instance + */ + StaticServiceIpConnectivity.create = function create(properties) { + return new StaticServiceIpConnectivity(properties); + }; + + /** + * Encodes the specified StaticServiceIpConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.StaticServiceIpConnectivity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.StaticServiceIpConnectivity + * @static + * @param {google.cloud.clouddms.v1.IStaticServiceIpConnectivity} message StaticServiceIpConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StaticServiceIpConnectivity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified StaticServiceIpConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StaticServiceIpConnectivity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.StaticServiceIpConnectivity + * @static + * @param {google.cloud.clouddms.v1.IStaticServiceIpConnectivity} message StaticServiceIpConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StaticServiceIpConnectivity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StaticServiceIpConnectivity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.StaticServiceIpConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.StaticServiceIpConnectivity} StaticServiceIpConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StaticServiceIpConnectivity.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.clouddms.v1.StaticServiceIpConnectivity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StaticServiceIpConnectivity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.StaticServiceIpConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.StaticServiceIpConnectivity} StaticServiceIpConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StaticServiceIpConnectivity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StaticServiceIpConnectivity message. + * @function verify + * @memberof google.cloud.clouddms.v1.StaticServiceIpConnectivity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StaticServiceIpConnectivity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a StaticServiceIpConnectivity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.StaticServiceIpConnectivity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.StaticServiceIpConnectivity} StaticServiceIpConnectivity + */ + StaticServiceIpConnectivity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.StaticServiceIpConnectivity) + return object; + return new $root.google.cloud.clouddms.v1.StaticServiceIpConnectivity(); + }; + + /** + * Creates a plain object from a StaticServiceIpConnectivity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.StaticServiceIpConnectivity + * @static + * @param {google.cloud.clouddms.v1.StaticServiceIpConnectivity} message StaticServiceIpConnectivity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StaticServiceIpConnectivity.toObject = function toObject() { + return {}; + }; + + /** + * Converts this StaticServiceIpConnectivity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.StaticServiceIpConnectivity + * @instance + * @returns {Object.} JSON object + */ + StaticServiceIpConnectivity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StaticServiceIpConnectivity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.StaticServiceIpConnectivity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StaticServiceIpConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.StaticServiceIpConnectivity"; + }; + + return StaticServiceIpConnectivity; + })(); + + v1.PrivateConnectivity = (function() { + + /** + * Properties of a PrivateConnectivity. + * @memberof google.cloud.clouddms.v1 + * @interface IPrivateConnectivity + * @property {string|null} [privateConnection] PrivateConnectivity privateConnection + */ + + /** + * Constructs a new PrivateConnectivity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a PrivateConnectivity. + * @implements IPrivateConnectivity + * @constructor + * @param {google.cloud.clouddms.v1.IPrivateConnectivity=} [properties] Properties to set + */ + function PrivateConnectivity(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]]; + } + + /** + * PrivateConnectivity privateConnection. + * @member {string} privateConnection + * @memberof google.cloud.clouddms.v1.PrivateConnectivity + * @instance + */ + PrivateConnectivity.prototype.privateConnection = ""; + + /** + * Creates a new PrivateConnectivity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.PrivateConnectivity + * @static + * @param {google.cloud.clouddms.v1.IPrivateConnectivity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.PrivateConnectivity} PrivateConnectivity instance + */ + PrivateConnectivity.create = function create(properties) { + return new PrivateConnectivity(properties); + }; + + /** + * Encodes the specified PrivateConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.PrivateConnectivity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.PrivateConnectivity + * @static + * @param {google.cloud.clouddms.v1.IPrivateConnectivity} message PrivateConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateConnectivity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privateConnection != null && Object.hasOwnProperty.call(message, "privateConnection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateConnection); + return writer; + }; + + /** + * Encodes the specified PrivateConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PrivateConnectivity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.PrivateConnectivity + * @static + * @param {google.cloud.clouddms.v1.IPrivateConnectivity} message PrivateConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateConnectivity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivateConnectivity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.PrivateConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.PrivateConnectivity} PrivateConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateConnectivity.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.clouddms.v1.PrivateConnectivity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.privateConnection = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivateConnectivity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.PrivateConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.PrivateConnectivity} PrivateConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateConnectivity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivateConnectivity message. + * @function verify + * @memberof google.cloud.clouddms.v1.PrivateConnectivity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivateConnectivity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.privateConnection != null && message.hasOwnProperty("privateConnection")) + if (!$util.isString(message.privateConnection)) + return "privateConnection: string expected"; + return null; + }; + + /** + * Creates a PrivateConnectivity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.PrivateConnectivity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.PrivateConnectivity} PrivateConnectivity + */ + PrivateConnectivity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.PrivateConnectivity) + return object; + var message = new $root.google.cloud.clouddms.v1.PrivateConnectivity(); + if (object.privateConnection != null) + message.privateConnection = String(object.privateConnection); + return message; + }; + + /** + * Creates a plain object from a PrivateConnectivity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.PrivateConnectivity + * @static + * @param {google.cloud.clouddms.v1.PrivateConnectivity} message PrivateConnectivity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivateConnectivity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.privateConnection = ""; + if (message.privateConnection != null && message.hasOwnProperty("privateConnection")) + object.privateConnection = message.privateConnection; + return object; + }; + + /** + * Converts this PrivateConnectivity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.PrivateConnectivity + * @instance + * @returns {Object.} JSON object + */ + PrivateConnectivity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivateConnectivity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.PrivateConnectivity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivateConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.PrivateConnectivity"; + }; + + return PrivateConnectivity; + })(); + + v1.DatabaseType = (function() { + + /** + * Properties of a DatabaseType. + * @memberof google.cloud.clouddms.v1 + * @interface IDatabaseType + * @property {google.cloud.clouddms.v1.DatabaseProvider|null} [provider] DatabaseType provider + * @property {google.cloud.clouddms.v1.DatabaseEngine|null} [engine] DatabaseType engine + */ + + /** + * Constructs a new DatabaseType. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a DatabaseType. + * @implements IDatabaseType + * @constructor + * @param {google.cloud.clouddms.v1.IDatabaseType=} [properties] Properties to set + */ + function DatabaseType(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]]; + } + + /** + * DatabaseType provider. + * @member {google.cloud.clouddms.v1.DatabaseProvider} provider + * @memberof google.cloud.clouddms.v1.DatabaseType + * @instance + */ + DatabaseType.prototype.provider = 0; + + /** + * DatabaseType engine. + * @member {google.cloud.clouddms.v1.DatabaseEngine} engine + * @memberof google.cloud.clouddms.v1.DatabaseType + * @instance + */ + DatabaseType.prototype.engine = 0; + + /** + * Creates a new DatabaseType instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {google.cloud.clouddms.v1.IDatabaseType=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DatabaseType} DatabaseType instance + */ + DatabaseType.create = function create(properties) { + return new DatabaseType(properties); + }; + + /** + * Encodes the specified DatabaseType message. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseType.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {google.cloud.clouddms.v1.IDatabaseType} message DatabaseType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.provider != null && Object.hasOwnProperty.call(message, "provider")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.provider); + if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.engine); + return writer; + }; + + /** + * Encodes the specified DatabaseType message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {google.cloud.clouddms.v1.IDatabaseType} message DatabaseType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatabaseType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.DatabaseType} DatabaseType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseType.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.clouddms.v1.DatabaseType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.provider = reader.int32(); + break; + } + case 2: { + message.engine = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatabaseType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.DatabaseType} DatabaseType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatabaseType message. + * @function verify + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatabaseType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.provider != null && message.hasOwnProperty("provider")) + switch (message.provider) { + default: + return "provider: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.engine != null && message.hasOwnProperty("engine")) + switch (message.engine) { + default: + return "engine: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; + } + return null; + }; + + /** + * Creates a DatabaseType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.DatabaseType} DatabaseType + */ + DatabaseType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DatabaseType) + return object; + var message = new $root.google.cloud.clouddms.v1.DatabaseType(); + switch (object.provider) { + default: + if (typeof object.provider === "number") { + message.provider = object.provider; + break; + } + break; + case "DATABASE_PROVIDER_UNSPECIFIED": + case 0: + message.provider = 0; + break; + case "CLOUDSQL": + case 1: + message.provider = 1; + break; + case "RDS": + case 2: + message.provider = 2; + break; + case "AURORA": + case 3: + message.provider = 3; + break; + case "ALLOYDB": + case 4: + message.provider = 4; + break; + } + switch (object.engine) { + default: + if (typeof object.engine === "number") { + message.engine = object.engine; + break; + } + break; + case "DATABASE_ENGINE_UNSPECIFIED": + case 0: + message.engine = 0; + break; + case "MYSQL": + case 1: + message.engine = 1; + break; + case "POSTGRESQL": + case 2: + message.engine = 2; + break; + case "ORACLE": + case 4: + message.engine = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a DatabaseType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {google.cloud.clouddms.v1.DatabaseType} message DatabaseType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatabaseType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.provider = options.enums === String ? "DATABASE_PROVIDER_UNSPECIFIED" : 0; + object.engine = options.enums === String ? "DATABASE_ENGINE_UNSPECIFIED" : 0; + } + if (message.provider != null && message.hasOwnProperty("provider")) + object.provider = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseProvider[message.provider] === undefined ? message.provider : $root.google.cloud.clouddms.v1.DatabaseProvider[message.provider] : message.provider; + if (message.engine != null && message.hasOwnProperty("engine")) + object.engine = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseEngine[message.engine] === undefined ? message.engine : $root.google.cloud.clouddms.v1.DatabaseEngine[message.engine] : message.engine; + return object; + }; + + /** + * Converts this DatabaseType to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.DatabaseType + * @instance + * @returns {Object.} JSON object + */ + DatabaseType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatabaseType + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatabaseType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.DatabaseType"; + }; + + return DatabaseType; + })(); + + v1.MigrationJob = (function() { + + /** + * Properties of a MigrationJob. + * @memberof google.cloud.clouddms.v1 + * @interface IMigrationJob + * @property {string|null} [name] MigrationJob name + * @property {google.protobuf.ITimestamp|null} [createTime] MigrationJob createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] MigrationJob updateTime + * @property {Object.|null} [labels] MigrationJob labels + * @property {string|null} [displayName] MigrationJob displayName + * @property {google.cloud.clouddms.v1.MigrationJob.State|null} [state] MigrationJob state + * @property {google.cloud.clouddms.v1.MigrationJob.Phase|null} [phase] MigrationJob phase + * @property {google.cloud.clouddms.v1.MigrationJob.Type|null} [type] MigrationJob type + * @property {string|null} [dumpPath] MigrationJob dumpPath + * @property {google.cloud.clouddms.v1.MigrationJob.IDumpFlags|null} [dumpFlags] MigrationJob dumpFlags + * @property {string|null} [source] MigrationJob source + * @property {string|null} [destination] MigrationJob destination + * @property {google.cloud.clouddms.v1.IReverseSshConnectivity|null} [reverseSshConnectivity] MigrationJob reverseSshConnectivity + * @property {google.cloud.clouddms.v1.IVpcPeeringConnectivity|null} [vpcPeeringConnectivity] MigrationJob vpcPeeringConnectivity + * @property {google.cloud.clouddms.v1.IStaticIpConnectivity|null} [staticIpConnectivity] MigrationJob staticIpConnectivity + * @property {google.protobuf.IDuration|null} [duration] MigrationJob duration + * @property {google.rpc.IStatus|null} [error] MigrationJob error + * @property {google.cloud.clouddms.v1.IDatabaseType|null} [sourceDatabase] MigrationJob sourceDatabase + * @property {google.cloud.clouddms.v1.IDatabaseType|null} [destinationDatabase] MigrationJob destinationDatabase + * @property {google.protobuf.ITimestamp|null} [endTime] MigrationJob endTime + * @property {google.cloud.clouddms.v1.IConversionWorkspaceInfo|null} [conversionWorkspace] MigrationJob conversionWorkspace + * @property {string|null} [filter] MigrationJob filter + * @property {string|null} [cmekKeyName] MigrationJob cmekKeyName + */ + + /** + * Constructs a new MigrationJob. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a MigrationJob. + * @implements IMigrationJob + * @constructor + * @param {google.cloud.clouddms.v1.IMigrationJob=} [properties] Properties to set + */ + function MigrationJob(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MigrationJob name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.name = ""; + + /** + * MigrationJob createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.createTime = null; + + /** + * MigrationJob updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.updateTime = null; + + /** + * MigrationJob labels. + * @member {Object.} labels + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.labels = $util.emptyObject; + + /** + * MigrationJob displayName. + * @member {string} displayName + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.displayName = ""; + + /** + * MigrationJob state. + * @member {google.cloud.clouddms.v1.MigrationJob.State} state + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.state = 0; + + /** + * MigrationJob phase. + * @member {google.cloud.clouddms.v1.MigrationJob.Phase} phase + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.phase = 0; + + /** + * MigrationJob type. + * @member {google.cloud.clouddms.v1.MigrationJob.Type} type + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.type = 0; + + /** + * MigrationJob dumpPath. + * @member {string} dumpPath + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.dumpPath = ""; + + /** + * MigrationJob dumpFlags. + * @member {google.cloud.clouddms.v1.MigrationJob.IDumpFlags|null|undefined} dumpFlags + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.dumpFlags = null; + + /** + * MigrationJob source. + * @member {string} source + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.source = ""; + + /** + * MigrationJob destination. + * @member {string} destination + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.destination = ""; + + /** + * MigrationJob reverseSshConnectivity. + * @member {google.cloud.clouddms.v1.IReverseSshConnectivity|null|undefined} reverseSshConnectivity + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.reverseSshConnectivity = null; + + /** + * MigrationJob vpcPeeringConnectivity. + * @member {google.cloud.clouddms.v1.IVpcPeeringConnectivity|null|undefined} vpcPeeringConnectivity + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.vpcPeeringConnectivity = null; + + /** + * MigrationJob staticIpConnectivity. + * @member {google.cloud.clouddms.v1.IStaticIpConnectivity|null|undefined} staticIpConnectivity + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.staticIpConnectivity = null; + + /** + * MigrationJob duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.duration = null; + + /** + * MigrationJob error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.error = null; + + /** + * MigrationJob sourceDatabase. + * @member {google.cloud.clouddms.v1.IDatabaseType|null|undefined} sourceDatabase + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.sourceDatabase = null; + + /** + * MigrationJob destinationDatabase. + * @member {google.cloud.clouddms.v1.IDatabaseType|null|undefined} destinationDatabase + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.destinationDatabase = null; + + /** + * MigrationJob endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.endTime = null; + + /** + * MigrationJob conversionWorkspace. + * @member {google.cloud.clouddms.v1.IConversionWorkspaceInfo|null|undefined} conversionWorkspace + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.conversionWorkspace = null; + + /** + * MigrationJob filter. + * @member {string} filter + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.filter = ""; + + /** + * MigrationJob cmekKeyName. + * @member {string} cmekKeyName + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.cmekKeyName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MigrationJob connectivity. + * @member {"reverseSshConnectivity"|"vpcPeeringConnectivity"|"staticIpConnectivity"|undefined} connectivity + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + Object.defineProperty(MigrationJob.prototype, "connectivity", { + get: $util.oneOfGetter($oneOfFields = ["reverseSshConnectivity", "vpcPeeringConnectivity", "staticIpConnectivity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MigrationJob instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {google.cloud.clouddms.v1.IMigrationJob=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.MigrationJob} MigrationJob instance + */ + MigrationJob.create = function create(properties) { + return new MigrationJob(properties); + }; + + /** + * Encodes the specified MigrationJob message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {google.cloud.clouddms.v1.IMigrationJob} message MigrationJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationJob.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).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 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.phase != null && Object.hasOwnProperty.call(message, "phase")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.phase); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + if (message.dumpPath != null && Object.hasOwnProperty.call(message, "dumpPath")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.dumpPath); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.source); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.destination); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.sourceDatabase != null && Object.hasOwnProperty.call(message, "sourceDatabase")) + $root.google.cloud.clouddms.v1.DatabaseType.encode(message.sourceDatabase, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.destinationDatabase != null && Object.hasOwnProperty.call(message, "destinationDatabase")) + $root.google.cloud.clouddms.v1.DatabaseType.encode(message.destinationDatabase, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.dumpFlags != null && Object.hasOwnProperty.call(message, "dumpFlags")) + $root.google.cloud.clouddms.v1.MigrationJob.DumpFlags.encode(message.dumpFlags, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.conversionWorkspace != null && Object.hasOwnProperty.call(message, "conversionWorkspace")) + $root.google.cloud.clouddms.v1.ConversionWorkspaceInfo.encode(message.conversionWorkspace, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.filter); + if (message.cmekKeyName != null && Object.hasOwnProperty.call(message, "cmekKeyName")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.cmekKeyName); + if (message.reverseSshConnectivity != null && Object.hasOwnProperty.call(message, "reverseSshConnectivity")) + $root.google.cloud.clouddms.v1.ReverseSshConnectivity.encode(message.reverseSshConnectivity, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.vpcPeeringConnectivity != null && Object.hasOwnProperty.call(message, "vpcPeeringConnectivity")) + $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.encode(message.vpcPeeringConnectivity, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + if (message.staticIpConnectivity != null && Object.hasOwnProperty.call(message, "staticIpConnectivity")) + $root.google.cloud.clouddms.v1.StaticIpConnectivity.encode(message.staticIpConnectivity, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MigrationJob message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {google.cloud.clouddms.v1.IMigrationJob} message MigrationJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigrationJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.MigrationJob} MigrationJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationJob.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.clouddms.v1.MigrationJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + 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; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.phase = reader.int32(); + break; + } + case 8: { + message.type = reader.int32(); + break; + } + case 9: { + message.dumpPath = reader.string(); + break; + } + case 17: { + message.dumpFlags = $root.google.cloud.clouddms.v1.MigrationJob.DumpFlags.decode(reader, reader.uint32()); + break; + } + case 10: { + message.source = reader.string(); + break; + } + case 11: { + message.destination = reader.string(); + break; + } + case 101: { + message.reverseSshConnectivity = $root.google.cloud.clouddms.v1.ReverseSshConnectivity.decode(reader, reader.uint32()); + break; + } + case 102: { + message.vpcPeeringConnectivity = $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.decode(reader, reader.uint32()); + break; + } + case 103: { + message.staticIpConnectivity = $root.google.cloud.clouddms.v1.StaticIpConnectivity.decode(reader, reader.uint32()); + break; + } + case 12: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 13: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 14: { + message.sourceDatabase = $root.google.cloud.clouddms.v1.DatabaseType.decode(reader, reader.uint32()); + break; + } + case 15: { + message.destinationDatabase = $root.google.cloud.clouddms.v1.DatabaseType.decode(reader, reader.uint32()); + break; + } + case 16: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 18: { + message.conversionWorkspace = $root.google.cloud.clouddms.v1.ConversionWorkspaceInfo.decode(reader, reader.uint32()); + break; + } + case 20: { + message.filter = reader.string(); + break; + } + case 21: { + message.cmekKeyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigrationJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.MigrationJob} MigrationJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MigrationJob message. + * @function verify + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.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"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: 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: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.phase != null && message.hasOwnProperty("phase")) + switch (message.phase) { + default: + return "phase: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.dumpPath != null && message.hasOwnProperty("dumpPath")) + if (!$util.isString(message.dumpPath)) + return "dumpPath: string expected"; + if (message.dumpFlags != null && message.hasOwnProperty("dumpFlags")) { + var error = $root.google.cloud.clouddms.v1.MigrationJob.DumpFlags.verify(message.dumpFlags); + if (error) + return "dumpFlags." + error; + } + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.destination != null && message.hasOwnProperty("destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + if (message.reverseSshConnectivity != null && message.hasOwnProperty("reverseSshConnectivity")) { + properties.connectivity = 1; + { + var error = $root.google.cloud.clouddms.v1.ReverseSshConnectivity.verify(message.reverseSshConnectivity); + if (error) + return "reverseSshConnectivity." + error; + } + } + if (message.vpcPeeringConnectivity != null && message.hasOwnProperty("vpcPeeringConnectivity")) { + if (properties.connectivity === 1) + return "connectivity: multiple values"; + properties.connectivity = 1; + { + var error = $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.verify(message.vpcPeeringConnectivity); + if (error) + return "vpcPeeringConnectivity." + error; + } + } + if (message.staticIpConnectivity != null && message.hasOwnProperty("staticIpConnectivity")) { + if (properties.connectivity === 1) + return "connectivity: multiple values"; + properties.connectivity = 1; + { + var error = $root.google.cloud.clouddms.v1.StaticIpConnectivity.verify(message.staticIpConnectivity); + if (error) + return "staticIpConnectivity." + error; + } + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) { + var error = $root.google.cloud.clouddms.v1.DatabaseType.verify(message.sourceDatabase); + if (error) + return "sourceDatabase." + error; + } + if (message.destinationDatabase != null && message.hasOwnProperty("destinationDatabase")) { + var error = $root.google.cloud.clouddms.v1.DatabaseType.verify(message.destinationDatabase); + if (error) + return "destinationDatabase." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.conversionWorkspace != null && message.hasOwnProperty("conversionWorkspace")) { + var error = $root.google.cloud.clouddms.v1.ConversionWorkspaceInfo.verify(message.conversionWorkspace); + if (error) + return "conversionWorkspace." + error; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) + if (!$util.isString(message.cmekKeyName)) + return "cmekKeyName: string expected"; + return null; + }; + + /** + * Creates a MigrationJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.MigrationJob} MigrationJob + */ + MigrationJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.MigrationJob) + return object; + var message = new $root.google.cloud.clouddms.v1.MigrationJob(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.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.clouddms.v1.MigrationJob.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.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.displayName != null) + message.displayName = String(object.displayName); + 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 "MAINTENANCE": + case 1: + message.state = 1; + break; + case "DRAFT": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "NOT_STARTED": + case 4: + message.state = 4; + break; + case "RUNNING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "COMPLETED": + case 7: + message.state = 7; + break; + case "DELETING": + case 8: + message.state = 8; + break; + case "STOPPING": + case 9: + message.state = 9; + break; + case "STOPPED": + case 10: + message.state = 10; + break; + case "DELETED": + case 11: + message.state = 11; + break; + case "UPDATING": + case 12: + message.state = 12; + break; + case "STARTING": + case 13: + message.state = 13; + break; + case "RESTARTING": + case 14: + message.state = 14; + break; + case "RESUMING": + case 15: + message.state = 15; + break; + } + switch (object.phase) { + default: + if (typeof object.phase === "number") { + message.phase = object.phase; + break; + } + break; + case "PHASE_UNSPECIFIED": + case 0: + message.phase = 0; + break; + case "FULL_DUMP": + case 1: + message.phase = 1; + break; + case "CDC": + case 2: + message.phase = 2; + break; + case "PROMOTE_IN_PROGRESS": + case 3: + message.phase = 3; + break; + case "WAITING_FOR_SOURCE_WRITES_TO_STOP": + case 4: + message.phase = 4; + break; + case "PREPARING_THE_DUMP": + case 5: + message.phase = 5; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ONE_TIME": + case 1: + message.type = 1; + break; + case "CONTINUOUS": + case 2: + message.type = 2; + break; + } + if (object.dumpPath != null) + message.dumpPath = String(object.dumpPath); + if (object.dumpFlags != null) { + if (typeof object.dumpFlags !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.dumpFlags: object expected"); + message.dumpFlags = $root.google.cloud.clouddms.v1.MigrationJob.DumpFlags.fromObject(object.dumpFlags); + } + if (object.source != null) + message.source = String(object.source); + if (object.destination != null) + message.destination = String(object.destination); + if (object.reverseSshConnectivity != null) { + if (typeof object.reverseSshConnectivity !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.reverseSshConnectivity: object expected"); + message.reverseSshConnectivity = $root.google.cloud.clouddms.v1.ReverseSshConnectivity.fromObject(object.reverseSshConnectivity); + } + if (object.vpcPeeringConnectivity != null) { + if (typeof object.vpcPeeringConnectivity !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.vpcPeeringConnectivity: object expected"); + message.vpcPeeringConnectivity = $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.fromObject(object.vpcPeeringConnectivity); + } + if (object.staticIpConnectivity != null) { + if (typeof object.staticIpConnectivity !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.staticIpConnectivity: object expected"); + message.staticIpConnectivity = $root.google.cloud.clouddms.v1.StaticIpConnectivity.fromObject(object.staticIpConnectivity); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.sourceDatabase != null) { + if (typeof object.sourceDatabase !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.sourceDatabase: object expected"); + message.sourceDatabase = $root.google.cloud.clouddms.v1.DatabaseType.fromObject(object.sourceDatabase); + } + if (object.destinationDatabase != null) { + if (typeof object.destinationDatabase !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.destinationDatabase: object expected"); + message.destinationDatabase = $root.google.cloud.clouddms.v1.DatabaseType.fromObject(object.destinationDatabase); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.conversionWorkspace != null) { + if (typeof object.conversionWorkspace !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.conversionWorkspace: object expected"); + message.conversionWorkspace = $root.google.cloud.clouddms.v1.ConversionWorkspaceInfo.fromObject(object.conversionWorkspace); + } + if (object.filter != null) + message.filter = String(object.filter); + if (object.cmekKeyName != null) + message.cmekKeyName = String(object.cmekKeyName); + return message; + }; + + /** + * Creates a plain object from a MigrationJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {google.cloud.clouddms.v1.MigrationJob} message MigrationJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.phase = options.enums === String ? "PHASE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.dumpPath = ""; + object.source = ""; + object.destination = ""; + object.duration = null; + object.error = null; + object.sourceDatabase = null; + object.destinationDatabase = null; + object.endTime = null; + object.dumpFlags = null; + object.conversionWorkspace = null; + object.filter = ""; + object.cmekKeyName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.clouddms.v1.MigrationJob.State[message.state] === undefined ? message.state : $root.google.cloud.clouddms.v1.MigrationJob.State[message.state] : message.state; + if (message.phase != null && message.hasOwnProperty("phase")) + object.phase = options.enums === String ? $root.google.cloud.clouddms.v1.MigrationJob.Phase[message.phase] === undefined ? message.phase : $root.google.cloud.clouddms.v1.MigrationJob.Phase[message.phase] : message.phase; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.clouddms.v1.MigrationJob.Type[message.type] === undefined ? message.type : $root.google.cloud.clouddms.v1.MigrationJob.Type[message.type] : message.type; + if (message.dumpPath != null && message.hasOwnProperty("dumpPath")) + object.dumpPath = message.dumpPath; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = message.destination; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) + object.sourceDatabase = $root.google.cloud.clouddms.v1.DatabaseType.toObject(message.sourceDatabase, options); + if (message.destinationDatabase != null && message.hasOwnProperty("destinationDatabase")) + object.destinationDatabase = $root.google.cloud.clouddms.v1.DatabaseType.toObject(message.destinationDatabase, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.dumpFlags != null && message.hasOwnProperty("dumpFlags")) + object.dumpFlags = $root.google.cloud.clouddms.v1.MigrationJob.DumpFlags.toObject(message.dumpFlags, options); + if (message.conversionWorkspace != null && message.hasOwnProperty("conversionWorkspace")) + object.conversionWorkspace = $root.google.cloud.clouddms.v1.ConversionWorkspaceInfo.toObject(message.conversionWorkspace, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) + object.cmekKeyName = message.cmekKeyName; + if (message.reverseSshConnectivity != null && message.hasOwnProperty("reverseSshConnectivity")) { + object.reverseSshConnectivity = $root.google.cloud.clouddms.v1.ReverseSshConnectivity.toObject(message.reverseSshConnectivity, options); + if (options.oneofs) + object.connectivity = "reverseSshConnectivity"; + } + if (message.vpcPeeringConnectivity != null && message.hasOwnProperty("vpcPeeringConnectivity")) { + object.vpcPeeringConnectivity = $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.toObject(message.vpcPeeringConnectivity, options); + if (options.oneofs) + object.connectivity = "vpcPeeringConnectivity"; + } + if (message.staticIpConnectivity != null && message.hasOwnProperty("staticIpConnectivity")) { + object.staticIpConnectivity = $root.google.cloud.clouddms.v1.StaticIpConnectivity.toObject(message.staticIpConnectivity, options); + if (options.oneofs) + object.connectivity = "staticIpConnectivity"; + } + return object; + }; + + /** + * Converts this MigrationJob to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + * @returns {Object.} JSON object + */ + MigrationJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MigrationJob + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MigrationJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.MigrationJob"; + }; + + /** + * State enum. + * @name google.cloud.clouddms.v1.MigrationJob.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} MAINTENANCE=1 MAINTENANCE value + * @property {number} DRAFT=2 DRAFT value + * @property {number} CREATING=3 CREATING value + * @property {number} NOT_STARTED=4 NOT_STARTED value + * @property {number} RUNNING=5 RUNNING value + * @property {number} FAILED=6 FAILED value + * @property {number} COMPLETED=7 COMPLETED value + * @property {number} DELETING=8 DELETING value + * @property {number} STOPPING=9 STOPPING value + * @property {number} STOPPED=10 STOPPED value + * @property {number} DELETED=11 DELETED value + * @property {number} UPDATING=12 UPDATING value + * @property {number} STARTING=13 STARTING value + * @property {number} RESTARTING=14 RESTARTING value + * @property {number} RESUMING=15 RESUMING value + */ + MigrationJob.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MAINTENANCE"] = 1; + values[valuesById[2] = "DRAFT"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "NOT_STARTED"] = 4; + values[valuesById[5] = "RUNNING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "COMPLETED"] = 7; + values[valuesById[8] = "DELETING"] = 8; + values[valuesById[9] = "STOPPING"] = 9; + values[valuesById[10] = "STOPPED"] = 10; + values[valuesById[11] = "DELETED"] = 11; + values[valuesById[12] = "UPDATING"] = 12; + values[valuesById[13] = "STARTING"] = 13; + values[valuesById[14] = "RESTARTING"] = 14; + values[valuesById[15] = "RESUMING"] = 15; + return values; + })(); + + /** + * Phase enum. + * @name google.cloud.clouddms.v1.MigrationJob.Phase + * @enum {number} + * @property {number} PHASE_UNSPECIFIED=0 PHASE_UNSPECIFIED value + * @property {number} FULL_DUMP=1 FULL_DUMP value + * @property {number} CDC=2 CDC value + * @property {number} PROMOTE_IN_PROGRESS=3 PROMOTE_IN_PROGRESS value + * @property {number} WAITING_FOR_SOURCE_WRITES_TO_STOP=4 WAITING_FOR_SOURCE_WRITES_TO_STOP value + * @property {number} PREPARING_THE_DUMP=5 PREPARING_THE_DUMP value + */ + MigrationJob.Phase = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PHASE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL_DUMP"] = 1; + values[valuesById[2] = "CDC"] = 2; + values[valuesById[3] = "PROMOTE_IN_PROGRESS"] = 3; + values[valuesById[4] = "WAITING_FOR_SOURCE_WRITES_TO_STOP"] = 4; + values[valuesById[5] = "PREPARING_THE_DUMP"] = 5; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.clouddms.v1.MigrationJob.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ONE_TIME=1 ONE_TIME value + * @property {number} CONTINUOUS=2 CONTINUOUS value + */ + MigrationJob.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ONE_TIME"] = 1; + values[valuesById[2] = "CONTINUOUS"] = 2; + return values; + })(); + + MigrationJob.DumpFlag = (function() { + + /** + * Properties of a DumpFlag. + * @memberof google.cloud.clouddms.v1.MigrationJob + * @interface IDumpFlag + * @property {string|null} [name] DumpFlag name + * @property {string|null} [value] DumpFlag value + */ + + /** + * Constructs a new DumpFlag. + * @memberof google.cloud.clouddms.v1.MigrationJob + * @classdesc Represents a DumpFlag. + * @implements IDumpFlag + * @constructor + * @param {google.cloud.clouddms.v1.MigrationJob.IDumpFlag=} [properties] Properties to set + */ + function DumpFlag(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]]; + } + + /** + * DumpFlag name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlag + * @instance + */ + DumpFlag.prototype.name = ""; + + /** + * DumpFlag value. + * @member {string} value + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlag + * @instance + */ + DumpFlag.prototype.value = ""; + + /** + * Creates a new DumpFlag instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlag + * @static + * @param {google.cloud.clouddms.v1.MigrationJob.IDumpFlag=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.MigrationJob.DumpFlag} DumpFlag instance + */ + DumpFlag.create = function create(properties) { + return new DumpFlag(properties); + }; + + /** + * Encodes the specified DumpFlag message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.DumpFlag.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlag + * @static + * @param {google.cloud.clouddms.v1.MigrationJob.IDumpFlag} message DumpFlag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DumpFlag.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.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified DumpFlag message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.DumpFlag.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlag + * @static + * @param {google.cloud.clouddms.v1.MigrationJob.IDumpFlag} message DumpFlag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DumpFlag.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DumpFlag message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.MigrationJob.DumpFlag} DumpFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DumpFlag.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.clouddms.v1.MigrationJob.DumpFlag(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DumpFlag message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.MigrationJob.DumpFlag} DumpFlag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DumpFlag.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DumpFlag message. + * @function verify + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlag + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DumpFlag.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a DumpFlag message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlag + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.MigrationJob.DumpFlag} DumpFlag + */ + DumpFlag.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.MigrationJob.DumpFlag) + return object; + var message = new $root.google.cloud.clouddms.v1.MigrationJob.DumpFlag(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a DumpFlag message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlag + * @static + * @param {google.cloud.clouddms.v1.MigrationJob.DumpFlag} message DumpFlag + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DumpFlag.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this DumpFlag to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlag + * @instance + * @returns {Object.} JSON object + */ + DumpFlag.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DumpFlag + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlag + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DumpFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.MigrationJob.DumpFlag"; + }; + + return DumpFlag; + })(); + + MigrationJob.DumpFlags = (function() { + + /** + * Properties of a DumpFlags. + * @memberof google.cloud.clouddms.v1.MigrationJob + * @interface IDumpFlags + * @property {Array.|null} [dumpFlags] DumpFlags dumpFlags + */ + + /** + * Constructs a new DumpFlags. + * @memberof google.cloud.clouddms.v1.MigrationJob + * @classdesc Represents a DumpFlags. + * @implements IDumpFlags + * @constructor + * @param {google.cloud.clouddms.v1.MigrationJob.IDumpFlags=} [properties] Properties to set + */ + function DumpFlags(properties) { + this.dumpFlags = []; + 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]]; + } + + /** + * DumpFlags dumpFlags. + * @member {Array.} dumpFlags + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlags + * @instance + */ + DumpFlags.prototype.dumpFlags = $util.emptyArray; + + /** + * Creates a new DumpFlags instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlags + * @static + * @param {google.cloud.clouddms.v1.MigrationJob.IDumpFlags=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.MigrationJob.DumpFlags} DumpFlags instance + */ + DumpFlags.create = function create(properties) { + return new DumpFlags(properties); + }; + + /** + * Encodes the specified DumpFlags message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.DumpFlags.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlags + * @static + * @param {google.cloud.clouddms.v1.MigrationJob.IDumpFlags} message DumpFlags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DumpFlags.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dumpFlags != null && message.dumpFlags.length) + for (var i = 0; i < message.dumpFlags.length; ++i) + $root.google.cloud.clouddms.v1.MigrationJob.DumpFlag.encode(message.dumpFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DumpFlags message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.DumpFlags.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlags + * @static + * @param {google.cloud.clouddms.v1.MigrationJob.IDumpFlags} message DumpFlags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DumpFlags.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DumpFlags message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.MigrationJob.DumpFlags} DumpFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DumpFlags.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.clouddms.v1.MigrationJob.DumpFlags(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dumpFlags && message.dumpFlags.length)) + message.dumpFlags = []; + message.dumpFlags.push($root.google.cloud.clouddms.v1.MigrationJob.DumpFlag.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DumpFlags message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.MigrationJob.DumpFlags} DumpFlags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DumpFlags.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DumpFlags message. + * @function verify + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlags + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DumpFlags.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dumpFlags != null && message.hasOwnProperty("dumpFlags")) { + if (!Array.isArray(message.dumpFlags)) + return "dumpFlags: array expected"; + for (var i = 0; i < message.dumpFlags.length; ++i) { + var error = $root.google.cloud.clouddms.v1.MigrationJob.DumpFlag.verify(message.dumpFlags[i]); + if (error) + return "dumpFlags." + error; + } + } + return null; + }; + + /** + * Creates a DumpFlags message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlags + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.MigrationJob.DumpFlags} DumpFlags + */ + DumpFlags.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.MigrationJob.DumpFlags) + return object; + var message = new $root.google.cloud.clouddms.v1.MigrationJob.DumpFlags(); + if (object.dumpFlags) { + if (!Array.isArray(object.dumpFlags)) + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.DumpFlags.dumpFlags: array expected"); + message.dumpFlags = []; + for (var i = 0; i < object.dumpFlags.length; ++i) { + if (typeof object.dumpFlags[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.DumpFlags.dumpFlags: object expected"); + message.dumpFlags[i] = $root.google.cloud.clouddms.v1.MigrationJob.DumpFlag.fromObject(object.dumpFlags[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DumpFlags message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlags + * @static + * @param {google.cloud.clouddms.v1.MigrationJob.DumpFlags} message DumpFlags + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DumpFlags.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dumpFlags = []; + if (message.dumpFlags && message.dumpFlags.length) { + object.dumpFlags = []; + for (var j = 0; j < message.dumpFlags.length; ++j) + object.dumpFlags[j] = $root.google.cloud.clouddms.v1.MigrationJob.DumpFlag.toObject(message.dumpFlags[j], options); + } + return object; + }; + + /** + * Converts this DumpFlags to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlags + * @instance + * @returns {Object.} JSON object + */ + DumpFlags.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DumpFlags + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.MigrationJob.DumpFlags + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DumpFlags.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.MigrationJob.DumpFlags"; + }; + + return DumpFlags; + })(); + + return MigrationJob; + })(); + + v1.ConversionWorkspaceInfo = (function() { + + /** + * Properties of a ConversionWorkspaceInfo. + * @memberof google.cloud.clouddms.v1 + * @interface IConversionWorkspaceInfo + * @property {string|null} [name] ConversionWorkspaceInfo name + * @property {string|null} [commitId] ConversionWorkspaceInfo commitId + */ + + /** + * Constructs a new ConversionWorkspaceInfo. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ConversionWorkspaceInfo. + * @implements IConversionWorkspaceInfo + * @constructor + * @param {google.cloud.clouddms.v1.IConversionWorkspaceInfo=} [properties] Properties to set + */ + function ConversionWorkspaceInfo(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]]; + } + + /** + * ConversionWorkspaceInfo name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.ConversionWorkspaceInfo + * @instance + */ + ConversionWorkspaceInfo.prototype.name = ""; + + /** + * ConversionWorkspaceInfo commitId. + * @member {string} commitId + * @memberof google.cloud.clouddms.v1.ConversionWorkspaceInfo + * @instance + */ + ConversionWorkspaceInfo.prototype.commitId = ""; + + /** + * Creates a new ConversionWorkspaceInfo instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ConversionWorkspaceInfo + * @static + * @param {google.cloud.clouddms.v1.IConversionWorkspaceInfo=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ConversionWorkspaceInfo} ConversionWorkspaceInfo instance + */ + ConversionWorkspaceInfo.create = function create(properties) { + return new ConversionWorkspaceInfo(properties); + }; + + /** + * Encodes the specified ConversionWorkspaceInfo message. Does not implicitly {@link google.cloud.clouddms.v1.ConversionWorkspaceInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ConversionWorkspaceInfo + * @static + * @param {google.cloud.clouddms.v1.IConversionWorkspaceInfo} message ConversionWorkspaceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversionWorkspaceInfo.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.commitId != null && Object.hasOwnProperty.call(message, "commitId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.commitId); + return writer; + }; + + /** + * Encodes the specified ConversionWorkspaceInfo message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConversionWorkspaceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ConversionWorkspaceInfo + * @static + * @param {google.cloud.clouddms.v1.IConversionWorkspaceInfo} message ConversionWorkspaceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversionWorkspaceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversionWorkspaceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ConversionWorkspaceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ConversionWorkspaceInfo} ConversionWorkspaceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversionWorkspaceInfo.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.clouddms.v1.ConversionWorkspaceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.commitId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConversionWorkspaceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ConversionWorkspaceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ConversionWorkspaceInfo} ConversionWorkspaceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversionWorkspaceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversionWorkspaceInfo message. + * @function verify + * @memberof google.cloud.clouddms.v1.ConversionWorkspaceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversionWorkspaceInfo.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.commitId != null && message.hasOwnProperty("commitId")) + if (!$util.isString(message.commitId)) + return "commitId: string expected"; + return null; + }; + + /** + * Creates a ConversionWorkspaceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ConversionWorkspaceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ConversionWorkspaceInfo} ConversionWorkspaceInfo + */ + ConversionWorkspaceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ConversionWorkspaceInfo) + return object; + var message = new $root.google.cloud.clouddms.v1.ConversionWorkspaceInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.commitId != null) + message.commitId = String(object.commitId); + return message; + }; + + /** + * Creates a plain object from a ConversionWorkspaceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ConversionWorkspaceInfo + * @static + * @param {google.cloud.clouddms.v1.ConversionWorkspaceInfo} message ConversionWorkspaceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversionWorkspaceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.commitId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.commitId != null && message.hasOwnProperty("commitId")) + object.commitId = message.commitId; + return object; + }; + + /** + * Converts this ConversionWorkspaceInfo to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ConversionWorkspaceInfo + * @instance + * @returns {Object.} JSON object + */ + ConversionWorkspaceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConversionWorkspaceInfo + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ConversionWorkspaceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConversionWorkspaceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ConversionWorkspaceInfo"; + }; + + return ConversionWorkspaceInfo; + })(); + + v1.ConnectionProfile = (function() { + + /** + * Properties of a ConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @interface IConnectionProfile + * @property {string|null} [name] ConnectionProfile name + * @property {google.protobuf.ITimestamp|null} [createTime] ConnectionProfile createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ConnectionProfile updateTime + * @property {Object.|null} [labels] ConnectionProfile labels + * @property {google.cloud.clouddms.v1.ConnectionProfile.State|null} [state] ConnectionProfile state + * @property {string|null} [displayName] ConnectionProfile displayName + * @property {google.cloud.clouddms.v1.IMySqlConnectionProfile|null} [mysql] ConnectionProfile mysql + * @property {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile|null} [postgresql] ConnectionProfile postgresql + * @property {google.cloud.clouddms.v1.IOracleConnectionProfile|null} [oracle] ConnectionProfile oracle + * @property {google.cloud.clouddms.v1.ICloudSqlConnectionProfile|null} [cloudsql] ConnectionProfile cloudsql + * @property {google.cloud.clouddms.v1.IAlloyDbConnectionProfile|null} [alloydb] ConnectionProfile alloydb + * @property {google.rpc.IStatus|null} [error] ConnectionProfile error + * @property {google.cloud.clouddms.v1.DatabaseProvider|null} [provider] ConnectionProfile provider + */ + + /** + * Constructs a new ConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ConnectionProfile. + * @implements IConnectionProfile + * @constructor + * @param {google.cloud.clouddms.v1.IConnectionProfile=} [properties] Properties to set + */ + function ConnectionProfile(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionProfile name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.name = ""; + + /** + * ConnectionProfile createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.createTime = null; + + /** + * ConnectionProfile updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.updateTime = null; + + /** + * ConnectionProfile labels. + * @member {Object.} labels + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.labels = $util.emptyObject; + + /** + * ConnectionProfile state. + * @member {google.cloud.clouddms.v1.ConnectionProfile.State} state + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.state = 0; + + /** + * ConnectionProfile displayName. + * @member {string} displayName + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.displayName = ""; + + /** + * ConnectionProfile mysql. + * @member {google.cloud.clouddms.v1.IMySqlConnectionProfile|null|undefined} mysql + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.mysql = null; + + /** + * ConnectionProfile postgresql. + * @member {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile|null|undefined} postgresql + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.postgresql = null; + + /** + * ConnectionProfile oracle. + * @member {google.cloud.clouddms.v1.IOracleConnectionProfile|null|undefined} oracle + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.oracle = null; + + /** + * ConnectionProfile cloudsql. + * @member {google.cloud.clouddms.v1.ICloudSqlConnectionProfile|null|undefined} cloudsql + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.cloudsql = null; + + /** + * ConnectionProfile alloydb. + * @member {google.cloud.clouddms.v1.IAlloyDbConnectionProfile|null|undefined} alloydb + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.alloydb = null; + + /** + * ConnectionProfile error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.error = null; + + /** + * ConnectionProfile provider. + * @member {google.cloud.clouddms.v1.DatabaseProvider} provider + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.provider = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConnectionProfile connectionProfile. + * @member {"mysql"|"postgresql"|"oracle"|"cloudsql"|"alloydb"|undefined} connectionProfile + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + Object.defineProperty(ConnectionProfile.prototype, "connectionProfile", { + get: $util.oneOfGetter($oneOfFields = ["mysql", "postgresql", "oracle", "cloudsql", "alloydb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConnectionProfile instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IConnectionProfile=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ConnectionProfile} ConnectionProfile instance + */ + ConnectionProfile.create = function create(properties) { + return new ConnectionProfile(properties); + }; + + /** + * Encodes the specified ConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.ConnectionProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IConnectionProfile} message ConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionProfile.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).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 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.provider != null && Object.hasOwnProperty.call(message, "provider")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.provider); + if (message.mysql != null && Object.hasOwnProperty.call(message, "mysql")) + $root.google.cloud.clouddms.v1.MySqlConnectionProfile.encode(message.mysql, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.postgresql != null && Object.hasOwnProperty.call(message, "postgresql")) + $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.encode(message.postgresql, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.cloudsql != null && Object.hasOwnProperty.call(message, "cloudsql")) + $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.encode(message.cloudsql, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + if (message.oracle != null && Object.hasOwnProperty.call(message, "oracle")) + $root.google.cloud.clouddms.v1.OracleConnectionProfile.encode(message.oracle, writer.uint32(/* id 104, wireType 2 =*/834).fork()).ldelim(); + if (message.alloydb != null && Object.hasOwnProperty.call(message, "alloydb")) + $root.google.cloud.clouddms.v1.AlloyDbConnectionProfile.encode(message.alloydb, writer.uint32(/* id 105, wireType 2 =*/842).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConnectionProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IConnectionProfile} message ConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ConnectionProfile} ConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionProfile.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.clouddms.v1.ConnectionProfile(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + 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; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.displayName = reader.string(); + break; + } + case 100: { + message.mysql = $root.google.cloud.clouddms.v1.MySqlConnectionProfile.decode(reader, reader.uint32()); + break; + } + case 101: { + message.postgresql = $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.decode(reader, reader.uint32()); + break; + } + case 104: { + message.oracle = $root.google.cloud.clouddms.v1.OracleConnectionProfile.decode(reader, reader.uint32()); + break; + } + case 102: { + message.cloudsql = $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.decode(reader, reader.uint32()); + break; + } + case 105: { + message.alloydb = $root.google.cloud.clouddms.v1.AlloyDbConnectionProfile.decode(reader, reader.uint32()); + break; + } + case 7: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 8: { + message.provider = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ConnectionProfile} ConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionProfile message. + * @function verify + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.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"; + } + 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: + case 6: + case 7: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.mysql != null && message.hasOwnProperty("mysql")) { + properties.connectionProfile = 1; + { + var error = $root.google.cloud.clouddms.v1.MySqlConnectionProfile.verify(message.mysql); + if (error) + return "mysql." + error; + } + } + if (message.postgresql != null && message.hasOwnProperty("postgresql")) { + if (properties.connectionProfile === 1) + return "connectionProfile: multiple values"; + properties.connectionProfile = 1; + { + var error = $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify(message.postgresql); + if (error) + return "postgresql." + error; + } + } + if (message.oracle != null && message.hasOwnProperty("oracle")) { + if (properties.connectionProfile === 1) + return "connectionProfile: multiple values"; + properties.connectionProfile = 1; + { + var error = $root.google.cloud.clouddms.v1.OracleConnectionProfile.verify(message.oracle); + if (error) + return "oracle." + error; + } + } + if (message.cloudsql != null && message.hasOwnProperty("cloudsql")) { + if (properties.connectionProfile === 1) + return "connectionProfile: multiple values"; + properties.connectionProfile = 1; + { + var error = $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify(message.cloudsql); + if (error) + return "cloudsql." + error; + } + } + if (message.alloydb != null && message.hasOwnProperty("alloydb")) { + if (properties.connectionProfile === 1) + return "connectionProfile: multiple values"; + properties.connectionProfile = 1; + { + var error = $root.google.cloud.clouddms.v1.AlloyDbConnectionProfile.verify(message.alloydb); + if (error) + return "alloydb." + error; + } + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.provider != null && message.hasOwnProperty("provider")) + switch (message.provider) { + default: + return "provider: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a ConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ConnectionProfile} ConnectionProfile + */ + ConnectionProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ConnectionProfile) + return object; + var message = new $root.google.cloud.clouddms.v1.ConnectionProfile(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.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.clouddms.v1.ConnectionProfile.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.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]]); + } + 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 "DRAFT": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "READY": + case 3: + message.state = 3; + break; + case "UPDATING": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + case "DELETED": + case 6: + message.state = 6; + break; + case "FAILED": + case 7: + message.state = 7; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.mysql != null) { + if (typeof object.mysql !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.mysql: object expected"); + message.mysql = $root.google.cloud.clouddms.v1.MySqlConnectionProfile.fromObject(object.mysql); + } + if (object.postgresql != null) { + if (typeof object.postgresql !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.postgresql: object expected"); + message.postgresql = $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.fromObject(object.postgresql); + } + if (object.oracle != null) { + if (typeof object.oracle !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.oracle: object expected"); + message.oracle = $root.google.cloud.clouddms.v1.OracleConnectionProfile.fromObject(object.oracle); + } + if (object.cloudsql != null) { + if (typeof object.cloudsql !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.cloudsql: object expected"); + message.cloudsql = $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.fromObject(object.cloudsql); + } + if (object.alloydb != null) { + if (typeof object.alloydb !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.alloydb: object expected"); + message.alloydb = $root.google.cloud.clouddms.v1.AlloyDbConnectionProfile.fromObject(object.alloydb); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + switch (object.provider) { + default: + if (typeof object.provider === "number") { + message.provider = object.provider; + break; + } + break; + case "DATABASE_PROVIDER_UNSPECIFIED": + case 0: + message.provider = 0; + break; + case "CLOUDSQL": + case 1: + message.provider = 1; + break; + case "RDS": + case 2: + message.provider = 2; + break; + case "AURORA": + case 3: + message.provider = 3; + break; + case "ALLOYDB": + case 4: + message.provider = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a ConnectionProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.ConnectionProfile} message ConnectionProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.displayName = ""; + object.error = null; + object.provider = options.enums === String ? "DATABASE_PROVIDER_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.clouddms.v1.ConnectionProfile.State[message.state] === undefined ? message.state : $root.google.cloud.clouddms.v1.ConnectionProfile.State[message.state] : message.state; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.provider != null && message.hasOwnProperty("provider")) + object.provider = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseProvider[message.provider] === undefined ? message.provider : $root.google.cloud.clouddms.v1.DatabaseProvider[message.provider] : message.provider; + if (message.mysql != null && message.hasOwnProperty("mysql")) { + object.mysql = $root.google.cloud.clouddms.v1.MySqlConnectionProfile.toObject(message.mysql, options); + if (options.oneofs) + object.connectionProfile = "mysql"; + } + if (message.postgresql != null && message.hasOwnProperty("postgresql")) { + object.postgresql = $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.toObject(message.postgresql, options); + if (options.oneofs) + object.connectionProfile = "postgresql"; + } + if (message.cloudsql != null && message.hasOwnProperty("cloudsql")) { + object.cloudsql = $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.toObject(message.cloudsql, options); + if (options.oneofs) + object.connectionProfile = "cloudsql"; + } + if (message.oracle != null && message.hasOwnProperty("oracle")) { + object.oracle = $root.google.cloud.clouddms.v1.OracleConnectionProfile.toObject(message.oracle, options); + if (options.oneofs) + object.connectionProfile = "oracle"; + } + if (message.alloydb != null && message.hasOwnProperty("alloydb")) { + object.alloydb = $root.google.cloud.clouddms.v1.AlloyDbConnectionProfile.toObject(message.alloydb, options); + if (options.oneofs) + object.connectionProfile = "alloydb"; + } + return object; + }; + + /** + * Converts this ConnectionProfile to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + * @returns {Object.} JSON object + */ + ConnectionProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionProfile + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ConnectionProfile"; + }; + + /** + * State enum. + * @name google.cloud.clouddms.v1.ConnectionProfile.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} DRAFT=1 DRAFT value + * @property {number} CREATING=2 CREATING value + * @property {number} READY=3 READY value + * @property {number} UPDATING=4 UPDATING value + * @property {number} DELETING=5 DELETING value + * @property {number} DELETED=6 DELETED value + * @property {number} FAILED=7 FAILED value + */ + ConnectionProfile.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRAFT"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "READY"] = 3; + values[valuesById[4] = "UPDATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "DELETED"] = 6; + values[valuesById[7] = "FAILED"] = 7; + return values; + })(); + + return ConnectionProfile; + })(); + + v1.MigrationJobVerificationError = (function() { + + /** + * Properties of a MigrationJobVerificationError. + * @memberof google.cloud.clouddms.v1 + * @interface IMigrationJobVerificationError + * @property {google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode|null} [errorCode] MigrationJobVerificationError errorCode + * @property {string|null} [errorMessage] MigrationJobVerificationError errorMessage + * @property {string|null} [errorDetailMessage] MigrationJobVerificationError errorDetailMessage + */ + + /** + * Constructs a new MigrationJobVerificationError. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a MigrationJobVerificationError. + * @implements IMigrationJobVerificationError + * @constructor + * @param {google.cloud.clouddms.v1.IMigrationJobVerificationError=} [properties] Properties to set + */ + function MigrationJobVerificationError(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]]; + } + + /** + * MigrationJobVerificationError errorCode. + * @member {google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode} errorCode + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @instance + */ + MigrationJobVerificationError.prototype.errorCode = 0; + + /** + * MigrationJobVerificationError errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @instance + */ + MigrationJobVerificationError.prototype.errorMessage = ""; + + /** + * MigrationJobVerificationError errorDetailMessage. + * @member {string} errorDetailMessage + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @instance + */ + MigrationJobVerificationError.prototype.errorDetailMessage = ""; + + /** + * Creates a new MigrationJobVerificationError instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {google.cloud.clouddms.v1.IMigrationJobVerificationError=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.MigrationJobVerificationError} MigrationJobVerificationError instance + */ + MigrationJobVerificationError.create = function create(properties) { + return new MigrationJobVerificationError(properties); + }; + + /** + * Encodes the specified MigrationJobVerificationError message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJobVerificationError.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {google.cloud.clouddms.v1.IMigrationJobVerificationError} message MigrationJobVerificationError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationJobVerificationError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorCode); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); + if (message.errorDetailMessage != null && Object.hasOwnProperty.call(message, "errorDetailMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorDetailMessage); + return writer; + }; + + /** + * Encodes the specified MigrationJobVerificationError message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJobVerificationError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {google.cloud.clouddms.v1.IMigrationJobVerificationError} message MigrationJobVerificationError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationJobVerificationError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigrationJobVerificationError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.MigrationJobVerificationError} MigrationJobVerificationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationJobVerificationError.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.clouddms.v1.MigrationJobVerificationError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.errorCode = reader.int32(); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + case 3: { + message.errorDetailMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigrationJobVerificationError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.MigrationJobVerificationError} MigrationJobVerificationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationJobVerificationError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MigrationJobVerificationError message. + * @function verify + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationJobVerificationError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + switch (message.errorCode) { + default: + return "errorCode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 21: + case 24: + case 25: + case 26: + case 27: + case 28: + break; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + if (message.errorDetailMessage != null && message.hasOwnProperty("errorDetailMessage")) + if (!$util.isString(message.errorDetailMessage)) + return "errorDetailMessage: string expected"; + return null; + }; + + /** + * Creates a MigrationJobVerificationError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.MigrationJobVerificationError} MigrationJobVerificationError + */ + MigrationJobVerificationError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.MigrationJobVerificationError) + return object; + var message = new $root.google.cloud.clouddms.v1.MigrationJobVerificationError(); + switch (object.errorCode) { + default: + if (typeof object.errorCode === "number") { + message.errorCode = object.errorCode; + break; + } + break; + case "ERROR_CODE_UNSPECIFIED": + case 0: + message.errorCode = 0; + break; + case "CONNECTION_FAILURE": + case 1: + message.errorCode = 1; + break; + case "AUTHENTICATION_FAILURE": + case 2: + message.errorCode = 2; + break; + case "INVALID_CONNECTION_PROFILE_CONFIG": + case 3: + message.errorCode = 3; + break; + case "VERSION_INCOMPATIBILITY": + case 4: + message.errorCode = 4; + break; + case "CONNECTION_PROFILE_TYPES_INCOMPATIBILITY": + case 5: + message.errorCode = 5; + break; + case "NO_PGLOGICAL_INSTALLED": + case 7: + message.errorCode = 7; + break; + case "PGLOGICAL_NODE_ALREADY_EXISTS": + case 8: + message.errorCode = 8; + break; + case "INVALID_WAL_LEVEL": + case 9: + message.errorCode = 9; + break; + case "INVALID_SHARED_PRELOAD_LIBRARY": + case 10: + message.errorCode = 10; + break; + case "INSUFFICIENT_MAX_REPLICATION_SLOTS": + case 11: + message.errorCode = 11; + break; + case "INSUFFICIENT_MAX_WAL_SENDERS": + case 12: + message.errorCode = 12; + break; + case "INSUFFICIENT_MAX_WORKER_PROCESSES": + case 13: + message.errorCode = 13; + break; + case "UNSUPPORTED_EXTENSIONS": + case 14: + message.errorCode = 14; + break; + case "UNSUPPORTED_MIGRATION_TYPE": + case 15: + message.errorCode = 15; + break; + case "INVALID_RDS_LOGICAL_REPLICATION": + case 16: + message.errorCode = 16; + break; + case "UNSUPPORTED_GTID_MODE": + case 17: + message.errorCode = 17; + break; + case "UNSUPPORTED_TABLE_DEFINITION": + case 18: + message.errorCode = 18; + break; + case "UNSUPPORTED_DEFINER": + case 19: + message.errorCode = 19; + break; + case "CANT_RESTART_RUNNING_MIGRATION": + case 21: + message.errorCode = 21; + break; + case "TABLES_WITH_LIMITED_SUPPORT": + case 24: + message.errorCode = 24; + break; + case "UNSUPPORTED_DATABASE_LOCALE": + case 25: + message.errorCode = 25; + break; + case "UNSUPPORTED_DATABASE_FDW_CONFIG": + case 26: + message.errorCode = 26; + break; + case "ERROR_RDBMS": + case 27: + message.errorCode = 27; + break; + case "SOURCE_SIZE_EXCEEDS_THRESHOLD": + case 28: + message.errorCode = 28; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + if (object.errorDetailMessage != null) + message.errorDetailMessage = String(object.errorDetailMessage); + return message; + }; + + /** + * Creates a plain object from a MigrationJobVerificationError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {google.cloud.clouddms.v1.MigrationJobVerificationError} message MigrationJobVerificationError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationJobVerificationError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.errorCode = options.enums === String ? "ERROR_CODE_UNSPECIFIED" : 0; + object.errorMessage = ""; + object.errorDetailMessage = ""; + } + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + object.errorCode = options.enums === String ? $root.google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode[message.errorCode] === undefined ? message.errorCode : $root.google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode[message.errorCode] : message.errorCode; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + if (message.errorDetailMessage != null && message.hasOwnProperty("errorDetailMessage")) + object.errorDetailMessage = message.errorDetailMessage; + return object; + }; + + /** + * Converts this MigrationJobVerificationError to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @instance + * @returns {Object.} JSON object + */ + MigrationJobVerificationError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MigrationJobVerificationError + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MigrationJobVerificationError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.MigrationJobVerificationError"; + }; + + /** + * ErrorCode enum. + * @name google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode + * @enum {number} + * @property {number} ERROR_CODE_UNSPECIFIED=0 ERROR_CODE_UNSPECIFIED value + * @property {number} CONNECTION_FAILURE=1 CONNECTION_FAILURE value + * @property {number} AUTHENTICATION_FAILURE=2 AUTHENTICATION_FAILURE value + * @property {number} INVALID_CONNECTION_PROFILE_CONFIG=3 INVALID_CONNECTION_PROFILE_CONFIG value + * @property {number} VERSION_INCOMPATIBILITY=4 VERSION_INCOMPATIBILITY value + * @property {number} CONNECTION_PROFILE_TYPES_INCOMPATIBILITY=5 CONNECTION_PROFILE_TYPES_INCOMPATIBILITY value + * @property {number} NO_PGLOGICAL_INSTALLED=7 NO_PGLOGICAL_INSTALLED value + * @property {number} PGLOGICAL_NODE_ALREADY_EXISTS=8 PGLOGICAL_NODE_ALREADY_EXISTS value + * @property {number} INVALID_WAL_LEVEL=9 INVALID_WAL_LEVEL value + * @property {number} INVALID_SHARED_PRELOAD_LIBRARY=10 INVALID_SHARED_PRELOAD_LIBRARY value + * @property {number} INSUFFICIENT_MAX_REPLICATION_SLOTS=11 INSUFFICIENT_MAX_REPLICATION_SLOTS value + * @property {number} INSUFFICIENT_MAX_WAL_SENDERS=12 INSUFFICIENT_MAX_WAL_SENDERS value + * @property {number} INSUFFICIENT_MAX_WORKER_PROCESSES=13 INSUFFICIENT_MAX_WORKER_PROCESSES value + * @property {number} UNSUPPORTED_EXTENSIONS=14 UNSUPPORTED_EXTENSIONS value + * @property {number} UNSUPPORTED_MIGRATION_TYPE=15 UNSUPPORTED_MIGRATION_TYPE value + * @property {number} INVALID_RDS_LOGICAL_REPLICATION=16 INVALID_RDS_LOGICAL_REPLICATION value + * @property {number} UNSUPPORTED_GTID_MODE=17 UNSUPPORTED_GTID_MODE value + * @property {number} UNSUPPORTED_TABLE_DEFINITION=18 UNSUPPORTED_TABLE_DEFINITION value + * @property {number} UNSUPPORTED_DEFINER=19 UNSUPPORTED_DEFINER value + * @property {number} CANT_RESTART_RUNNING_MIGRATION=21 CANT_RESTART_RUNNING_MIGRATION value + * @property {number} TABLES_WITH_LIMITED_SUPPORT=24 TABLES_WITH_LIMITED_SUPPORT value + * @property {number} UNSUPPORTED_DATABASE_LOCALE=25 UNSUPPORTED_DATABASE_LOCALE value + * @property {number} UNSUPPORTED_DATABASE_FDW_CONFIG=26 UNSUPPORTED_DATABASE_FDW_CONFIG value + * @property {number} ERROR_RDBMS=27 ERROR_RDBMS value + * @property {number} SOURCE_SIZE_EXCEEDS_THRESHOLD=28 SOURCE_SIZE_EXCEEDS_THRESHOLD value + */ + MigrationJobVerificationError.ErrorCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONNECTION_FAILURE"] = 1; + values[valuesById[2] = "AUTHENTICATION_FAILURE"] = 2; + values[valuesById[3] = "INVALID_CONNECTION_PROFILE_CONFIG"] = 3; + values[valuesById[4] = "VERSION_INCOMPATIBILITY"] = 4; + values[valuesById[5] = "CONNECTION_PROFILE_TYPES_INCOMPATIBILITY"] = 5; + values[valuesById[7] = "NO_PGLOGICAL_INSTALLED"] = 7; + values[valuesById[8] = "PGLOGICAL_NODE_ALREADY_EXISTS"] = 8; + values[valuesById[9] = "INVALID_WAL_LEVEL"] = 9; + values[valuesById[10] = "INVALID_SHARED_PRELOAD_LIBRARY"] = 10; + values[valuesById[11] = "INSUFFICIENT_MAX_REPLICATION_SLOTS"] = 11; + values[valuesById[12] = "INSUFFICIENT_MAX_WAL_SENDERS"] = 12; + values[valuesById[13] = "INSUFFICIENT_MAX_WORKER_PROCESSES"] = 13; + values[valuesById[14] = "UNSUPPORTED_EXTENSIONS"] = 14; + values[valuesById[15] = "UNSUPPORTED_MIGRATION_TYPE"] = 15; + values[valuesById[16] = "INVALID_RDS_LOGICAL_REPLICATION"] = 16; + values[valuesById[17] = "UNSUPPORTED_GTID_MODE"] = 17; + values[valuesById[18] = "UNSUPPORTED_TABLE_DEFINITION"] = 18; + values[valuesById[19] = "UNSUPPORTED_DEFINER"] = 19; + values[valuesById[21] = "CANT_RESTART_RUNNING_MIGRATION"] = 21; + values[valuesById[24] = "TABLES_WITH_LIMITED_SUPPORT"] = 24; + values[valuesById[25] = "UNSUPPORTED_DATABASE_LOCALE"] = 25; + values[valuesById[26] = "UNSUPPORTED_DATABASE_FDW_CONFIG"] = 26; + values[valuesById[27] = "ERROR_RDBMS"] = 27; + values[valuesById[28] = "SOURCE_SIZE_EXCEEDS_THRESHOLD"] = 28; + return values; + })(); + + return MigrationJobVerificationError; + })(); + + /** + * DatabaseEngine enum. + * @name google.cloud.clouddms.v1.DatabaseEngine + * @enum {number} + * @property {number} DATABASE_ENGINE_UNSPECIFIED=0 DATABASE_ENGINE_UNSPECIFIED value + * @property {number} MYSQL=1 MYSQL value + * @property {number} POSTGRESQL=2 POSTGRESQL value + * @property {number} ORACLE=4 ORACLE value + */ + v1.DatabaseEngine = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_ENGINE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MYSQL"] = 1; + values[valuesById[2] = "POSTGRESQL"] = 2; + values[valuesById[4] = "ORACLE"] = 4; + return values; + })(); + + /** + * DatabaseProvider enum. + * @name google.cloud.clouddms.v1.DatabaseProvider + * @enum {number} + * @property {number} DATABASE_PROVIDER_UNSPECIFIED=0 DATABASE_PROVIDER_UNSPECIFIED value + * @property {number} CLOUDSQL=1 CLOUDSQL value + * @property {number} RDS=2 RDS value + * @property {number} AURORA=3 AURORA value + * @property {number} ALLOYDB=4 ALLOYDB value + */ + v1.DatabaseProvider = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_PROVIDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUDSQL"] = 1; + values[valuesById[2] = "RDS"] = 2; + values[valuesById[3] = "AURORA"] = 3; + values[valuesById[4] = "ALLOYDB"] = 4; + return values; + })(); + + v1.PrivateConnection = (function() { + + /** + * Properties of a PrivateConnection. + * @memberof google.cloud.clouddms.v1 + * @interface IPrivateConnection + * @property {string|null} [name] PrivateConnection name + * @property {google.protobuf.ITimestamp|null} [createTime] PrivateConnection createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] PrivateConnection updateTime + * @property {Object.|null} [labels] PrivateConnection labels + * @property {string|null} [displayName] PrivateConnection displayName + * @property {google.cloud.clouddms.v1.PrivateConnection.State|null} [state] PrivateConnection state + * @property {google.rpc.IStatus|null} [error] PrivateConnection error + * @property {google.cloud.clouddms.v1.IVpcPeeringConfig|null} [vpcPeeringConfig] PrivateConnection vpcPeeringConfig + */ + + /** + * Constructs a new PrivateConnection. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a PrivateConnection. + * @implements IPrivateConnection + * @constructor + * @param {google.cloud.clouddms.v1.IPrivateConnection=} [properties] Properties to set + */ + function PrivateConnection(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivateConnection name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @instance + */ + PrivateConnection.prototype.name = ""; + + /** + * PrivateConnection createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @instance + */ + PrivateConnection.prototype.createTime = null; + + /** + * PrivateConnection updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @instance + */ + PrivateConnection.prototype.updateTime = null; + + /** + * PrivateConnection labels. + * @member {Object.} labels + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @instance + */ + PrivateConnection.prototype.labels = $util.emptyObject; + + /** + * PrivateConnection displayName. + * @member {string} displayName + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @instance + */ + PrivateConnection.prototype.displayName = ""; + + /** + * PrivateConnection state. + * @member {google.cloud.clouddms.v1.PrivateConnection.State} state + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @instance + */ + PrivateConnection.prototype.state = 0; + + /** + * PrivateConnection error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @instance + */ + PrivateConnection.prototype.error = null; + + /** + * PrivateConnection vpcPeeringConfig. + * @member {google.cloud.clouddms.v1.IVpcPeeringConfig|null|undefined} vpcPeeringConfig + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @instance + */ + PrivateConnection.prototype.vpcPeeringConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PrivateConnection connectivity. + * @member {"vpcPeeringConfig"|undefined} connectivity + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @instance + */ + Object.defineProperty(PrivateConnection.prototype, "connectivity", { + get: $util.oneOfGetter($oneOfFields = ["vpcPeeringConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PrivateConnection instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @static + * @param {google.cloud.clouddms.v1.IPrivateConnection=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.PrivateConnection} PrivateConnection instance + */ + PrivateConnection.create = function create(properties) { + return new PrivateConnection(properties); + }; + + /** + * Encodes the specified PrivateConnection message. Does not implicitly {@link google.cloud.clouddms.v1.PrivateConnection.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @static + * @param {google.cloud.clouddms.v1.IPrivateConnection} message PrivateConnection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateConnection.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).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 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.vpcPeeringConfig != null && Object.hasOwnProperty.call(message, "vpcPeeringConfig")) + $root.google.cloud.clouddms.v1.VpcPeeringConfig.encode(message.vpcPeeringConfig, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrivateConnection message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PrivateConnection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @static + * @param {google.cloud.clouddms.v1.IPrivateConnection} message PrivateConnection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateConnection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivateConnection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.PrivateConnection} PrivateConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateConnection.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.clouddms.v1.PrivateConnection(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + 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; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 100: { + message.vpcPeeringConfig = $root.google.cloud.clouddms.v1.VpcPeeringConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivateConnection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.PrivateConnection} PrivateConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateConnection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivateConnection message. + * @function verify + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivateConnection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.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"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: 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: + case 6: + break; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.vpcPeeringConfig != null && message.hasOwnProperty("vpcPeeringConfig")) { + properties.connectivity = 1; + { + var error = $root.google.cloud.clouddms.v1.VpcPeeringConfig.verify(message.vpcPeeringConfig); + if (error) + return "vpcPeeringConfig." + error; + } + } + return null; + }; + + /** + * Creates a PrivateConnection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.PrivateConnection} PrivateConnection + */ + PrivateConnection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.PrivateConnection) + return object; + var message = new $root.google.cloud.clouddms.v1.PrivateConnection(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.PrivateConnection.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.clouddms.v1.PrivateConnection.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.clouddms.v1.PrivateConnection.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.displayName != null) + message.displayName = String(object.displayName); + 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 "CREATED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "FAILED_TO_DELETE": + case 5: + message.state = 5; + break; + case "DELETED": + case 6: + message.state = 6; + break; + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.clouddms.v1.PrivateConnection.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.vpcPeeringConfig != null) { + if (typeof object.vpcPeeringConfig !== "object") + throw TypeError(".google.cloud.clouddms.v1.PrivateConnection.vpcPeeringConfig: object expected"); + message.vpcPeeringConfig = $root.google.cloud.clouddms.v1.VpcPeeringConfig.fromObject(object.vpcPeeringConfig); + } + return message; + }; + + /** + * Creates a plain object from a PrivateConnection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @static + * @param {google.cloud.clouddms.v1.PrivateConnection} message PrivateConnection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivateConnection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.error = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.clouddms.v1.PrivateConnection.State[message.state] === undefined ? message.state : $root.google.cloud.clouddms.v1.PrivateConnection.State[message.state] : message.state; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.vpcPeeringConfig != null && message.hasOwnProperty("vpcPeeringConfig")) { + object.vpcPeeringConfig = $root.google.cloud.clouddms.v1.VpcPeeringConfig.toObject(message.vpcPeeringConfig, options); + if (options.oneofs) + object.connectivity = "vpcPeeringConfig"; + } + return object; + }; + + /** + * Converts this PrivateConnection to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @instance + * @returns {Object.} JSON object + */ + PrivateConnection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivateConnection + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.PrivateConnection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivateConnection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.PrivateConnection"; + }; + + /** + * State enum. + * @name google.cloud.clouddms.v1.PrivateConnection.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} CREATED=2 CREATED value + * @property {number} FAILED=3 FAILED value + * @property {number} DELETING=4 DELETING value + * @property {number} FAILED_TO_DELETE=5 FAILED_TO_DELETE value + * @property {number} DELETED=6 DELETED value + */ + PrivateConnection.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "CREATED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "FAILED_TO_DELETE"] = 5; + values[valuesById[6] = "DELETED"] = 6; + return values; + })(); + + return PrivateConnection; + })(); + + v1.VpcPeeringConfig = (function() { + + /** + * Properties of a VpcPeeringConfig. + * @memberof google.cloud.clouddms.v1 + * @interface IVpcPeeringConfig + * @property {string|null} [vpcName] VpcPeeringConfig vpcName + * @property {string|null} [subnet] VpcPeeringConfig subnet + */ + + /** + * Constructs a new VpcPeeringConfig. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a VpcPeeringConfig. + * @implements IVpcPeeringConfig + * @constructor + * @param {google.cloud.clouddms.v1.IVpcPeeringConfig=} [properties] Properties to set + */ + function VpcPeeringConfig(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]]; + } + + /** + * VpcPeeringConfig vpcName. + * @member {string} vpcName + * @memberof google.cloud.clouddms.v1.VpcPeeringConfig + * @instance + */ + VpcPeeringConfig.prototype.vpcName = ""; + + /** + * VpcPeeringConfig subnet. + * @member {string} subnet + * @memberof google.cloud.clouddms.v1.VpcPeeringConfig + * @instance + */ + VpcPeeringConfig.prototype.subnet = ""; + + /** + * Creates a new VpcPeeringConfig instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.VpcPeeringConfig + * @static + * @param {google.cloud.clouddms.v1.IVpcPeeringConfig=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.VpcPeeringConfig} VpcPeeringConfig instance + */ + VpcPeeringConfig.create = function create(properties) { + return new VpcPeeringConfig(properties); + }; + + /** + * Encodes the specified VpcPeeringConfig message. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.VpcPeeringConfig + * @static + * @param {google.cloud.clouddms.v1.IVpcPeeringConfig} message VpcPeeringConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcPeeringConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vpcName != null && Object.hasOwnProperty.call(message, "vpcName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vpcName); + if (message.subnet != null && Object.hasOwnProperty.call(message, "subnet")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnet); + return writer; + }; + + /** + * Encodes the specified VpcPeeringConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.VpcPeeringConfig + * @static + * @param {google.cloud.clouddms.v1.IVpcPeeringConfig} message VpcPeeringConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcPeeringConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcPeeringConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.VpcPeeringConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.VpcPeeringConfig} VpcPeeringConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcPeeringConfig.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.clouddms.v1.VpcPeeringConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vpcName = reader.string(); + break; + } + case 2: { + message.subnet = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcPeeringConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.VpcPeeringConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.VpcPeeringConfig} VpcPeeringConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcPeeringConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcPeeringConfig message. + * @function verify + * @memberof google.cloud.clouddms.v1.VpcPeeringConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcPeeringConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vpcName != null && message.hasOwnProperty("vpcName")) + if (!$util.isString(message.vpcName)) + return "vpcName: string expected"; + if (message.subnet != null && message.hasOwnProperty("subnet")) + if (!$util.isString(message.subnet)) + return "subnet: string expected"; + return null; + }; + + /** + * Creates a VpcPeeringConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.VpcPeeringConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.VpcPeeringConfig} VpcPeeringConfig + */ + VpcPeeringConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.VpcPeeringConfig) + return object; + var message = new $root.google.cloud.clouddms.v1.VpcPeeringConfig(); + if (object.vpcName != null) + message.vpcName = String(object.vpcName); + if (object.subnet != null) + message.subnet = String(object.subnet); + return message; + }; + + /** + * Creates a plain object from a VpcPeeringConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.VpcPeeringConfig + * @static + * @param {google.cloud.clouddms.v1.VpcPeeringConfig} message VpcPeeringConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcPeeringConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.vpcName = ""; + object.subnet = ""; + } + if (message.vpcName != null && message.hasOwnProperty("vpcName")) + object.vpcName = message.vpcName; + if (message.subnet != null && message.hasOwnProperty("subnet")) + object.subnet = message.subnet; + return object; + }; + + /** + * Converts this VpcPeeringConfig to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.VpcPeeringConfig + * @instance + * @returns {Object.} JSON object + */ + VpcPeeringConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcPeeringConfig + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.VpcPeeringConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcPeeringConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.VpcPeeringConfig"; + }; + + return VpcPeeringConfig; + })(); + + v1.DatabaseEngineInfo = (function() { + + /** + * Properties of a DatabaseEngineInfo. + * @memberof google.cloud.clouddms.v1 + * @interface IDatabaseEngineInfo + * @property {google.cloud.clouddms.v1.DatabaseEngine|null} [engine] DatabaseEngineInfo engine + * @property {string|null} [version] DatabaseEngineInfo version + */ + + /** + * Constructs a new DatabaseEngineInfo. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a DatabaseEngineInfo. + * @implements IDatabaseEngineInfo + * @constructor + * @param {google.cloud.clouddms.v1.IDatabaseEngineInfo=} [properties] Properties to set + */ + function DatabaseEngineInfo(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]]; + } + + /** + * DatabaseEngineInfo engine. + * @member {google.cloud.clouddms.v1.DatabaseEngine} engine + * @memberof google.cloud.clouddms.v1.DatabaseEngineInfo + * @instance + */ + DatabaseEngineInfo.prototype.engine = 0; + + /** + * DatabaseEngineInfo version. + * @member {string} version + * @memberof google.cloud.clouddms.v1.DatabaseEngineInfo + * @instance + */ + DatabaseEngineInfo.prototype.version = ""; + + /** + * Creates a new DatabaseEngineInfo instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.DatabaseEngineInfo + * @static + * @param {google.cloud.clouddms.v1.IDatabaseEngineInfo=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DatabaseEngineInfo} DatabaseEngineInfo instance + */ + DatabaseEngineInfo.create = function create(properties) { + return new DatabaseEngineInfo(properties); + }; + + /** + * Encodes the specified DatabaseEngineInfo message. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseEngineInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.DatabaseEngineInfo + * @static + * @param {google.cloud.clouddms.v1.IDatabaseEngineInfo} message DatabaseEngineInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseEngineInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.engine); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + return writer; + }; + + /** + * Encodes the specified DatabaseEngineInfo message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseEngineInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.DatabaseEngineInfo + * @static + * @param {google.cloud.clouddms.v1.IDatabaseEngineInfo} message DatabaseEngineInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseEngineInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatabaseEngineInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.DatabaseEngineInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.DatabaseEngineInfo} DatabaseEngineInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseEngineInfo.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.clouddms.v1.DatabaseEngineInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.engine = reader.int32(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatabaseEngineInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.DatabaseEngineInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.DatabaseEngineInfo} DatabaseEngineInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseEngineInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatabaseEngineInfo message. + * @function verify + * @memberof google.cloud.clouddms.v1.DatabaseEngineInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatabaseEngineInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.engine != null && message.hasOwnProperty("engine")) + switch (message.engine) { + default: + return "engine: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a DatabaseEngineInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.DatabaseEngineInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.DatabaseEngineInfo} DatabaseEngineInfo + */ + DatabaseEngineInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DatabaseEngineInfo) + return object; + var message = new $root.google.cloud.clouddms.v1.DatabaseEngineInfo(); + switch (object.engine) { + default: + if (typeof object.engine === "number") { + message.engine = object.engine; + break; + } + break; + case "DATABASE_ENGINE_UNSPECIFIED": + case 0: + message.engine = 0; + break; + case "MYSQL": + case 1: + message.engine = 1; + break; + case "POSTGRESQL": + case 2: + message.engine = 2; + break; + case "ORACLE": + case 4: + message.engine = 4; + break; + } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a DatabaseEngineInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.DatabaseEngineInfo + * @static + * @param {google.cloud.clouddms.v1.DatabaseEngineInfo} message DatabaseEngineInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatabaseEngineInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.engine = options.enums === String ? "DATABASE_ENGINE_UNSPECIFIED" : 0; + object.version = ""; + } + if (message.engine != null && message.hasOwnProperty("engine")) + object.engine = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseEngine[message.engine] === undefined ? message.engine : $root.google.cloud.clouddms.v1.DatabaseEngine[message.engine] : message.engine; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this DatabaseEngineInfo to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.DatabaseEngineInfo + * @instance + * @returns {Object.} JSON object + */ + DatabaseEngineInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatabaseEngineInfo + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.DatabaseEngineInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatabaseEngineInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.DatabaseEngineInfo"; + }; + + return DatabaseEngineInfo; + })(); + + v1.ConversionWorkspace = (function() { + + /** + * Properties of a ConversionWorkspace. + * @memberof google.cloud.clouddms.v1 + * @interface IConversionWorkspace + * @property {string|null} [name] ConversionWorkspace name + * @property {google.cloud.clouddms.v1.IDatabaseEngineInfo|null} [source] ConversionWorkspace source + * @property {google.cloud.clouddms.v1.IDatabaseEngineInfo|null} [destination] ConversionWorkspace destination + * @property {Object.|null} [globalSettings] ConversionWorkspace globalSettings + * @property {boolean|null} [hasUncommittedChanges] ConversionWorkspace hasUncommittedChanges + * @property {string|null} [latestCommitId] ConversionWorkspace latestCommitId + * @property {google.protobuf.ITimestamp|null} [latestCommitTime] ConversionWorkspace latestCommitTime + * @property {google.protobuf.ITimestamp|null} [createTime] ConversionWorkspace createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ConversionWorkspace updateTime + * @property {string|null} [displayName] ConversionWorkspace displayName + */ + + /** + * Constructs a new ConversionWorkspace. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ConversionWorkspace. + * @implements IConversionWorkspace + * @constructor + * @param {google.cloud.clouddms.v1.IConversionWorkspace=} [properties] Properties to set + */ + function ConversionWorkspace(properties) { + this.globalSettings = {}; + 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]]; + } + + /** + * ConversionWorkspace name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @instance + */ + ConversionWorkspace.prototype.name = ""; + + /** + * ConversionWorkspace source. + * @member {google.cloud.clouddms.v1.IDatabaseEngineInfo|null|undefined} source + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @instance + */ + ConversionWorkspace.prototype.source = null; + + /** + * ConversionWorkspace destination. + * @member {google.cloud.clouddms.v1.IDatabaseEngineInfo|null|undefined} destination + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @instance + */ + ConversionWorkspace.prototype.destination = null; + + /** + * ConversionWorkspace globalSettings. + * @member {Object.} globalSettings + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @instance + */ + ConversionWorkspace.prototype.globalSettings = $util.emptyObject; + + /** + * ConversionWorkspace hasUncommittedChanges. + * @member {boolean} hasUncommittedChanges + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @instance + */ + ConversionWorkspace.prototype.hasUncommittedChanges = false; + + /** + * ConversionWorkspace latestCommitId. + * @member {string} latestCommitId + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @instance + */ + ConversionWorkspace.prototype.latestCommitId = ""; + + /** + * ConversionWorkspace latestCommitTime. + * @member {google.protobuf.ITimestamp|null|undefined} latestCommitTime + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @instance + */ + ConversionWorkspace.prototype.latestCommitTime = null; + + /** + * ConversionWorkspace createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @instance + */ + ConversionWorkspace.prototype.createTime = null; + + /** + * ConversionWorkspace updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @instance + */ + ConversionWorkspace.prototype.updateTime = null; + + /** + * ConversionWorkspace displayName. + * @member {string} displayName + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @instance + */ + ConversionWorkspace.prototype.displayName = ""; + + /** + * Creates a new ConversionWorkspace instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @static + * @param {google.cloud.clouddms.v1.IConversionWorkspace=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ConversionWorkspace} ConversionWorkspace instance + */ + ConversionWorkspace.create = function create(properties) { + return new ConversionWorkspace(properties); + }; + + /** + * Encodes the specified ConversionWorkspace message. Does not implicitly {@link google.cloud.clouddms.v1.ConversionWorkspace.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @static + * @param {google.cloud.clouddms.v1.IConversionWorkspace} message ConversionWorkspace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversionWorkspace.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.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.clouddms.v1.DatabaseEngineInfo.encode(message.source, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + $root.google.cloud.clouddms.v1.DatabaseEngineInfo.encode(message.destination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.globalSettings != null && Object.hasOwnProperty.call(message, "globalSettings")) + for (var keys = Object.keys(message.globalSettings), 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.globalSettings[keys[i]]).ldelim(); + if (message.hasUncommittedChanges != null && Object.hasOwnProperty.call(message, "hasUncommittedChanges")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.hasUncommittedChanges); + if (message.latestCommitId != null && Object.hasOwnProperty.call(message, "latestCommitId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.latestCommitId); + if (message.latestCommitTime != null && Object.hasOwnProperty.call(message, "latestCommitTime")) + $root.google.protobuf.Timestamp.encode(message.latestCommitTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ConversionWorkspace message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConversionWorkspace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @static + * @param {google.cloud.clouddms.v1.IConversionWorkspace} message ConversionWorkspace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversionWorkspace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversionWorkspace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ConversionWorkspace} ConversionWorkspace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversionWorkspace.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.clouddms.v1.ConversionWorkspace(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.source = $root.google.cloud.clouddms.v1.DatabaseEngineInfo.decode(reader, reader.uint32()); + break; + } + case 3: { + message.destination = $root.google.cloud.clouddms.v1.DatabaseEngineInfo.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.globalSettings === $util.emptyObject) + message.globalSettings = {}; + 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.globalSettings[key] = value; + break; + } + case 5: { + message.hasUncommittedChanges = reader.bool(); + break; + } + case 6: { + message.latestCommitId = reader.string(); + break; + } + case 7: { + message.latestCommitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConversionWorkspace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ConversionWorkspace} ConversionWorkspace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversionWorkspace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversionWorkspace message. + * @function verify + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversionWorkspace.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.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.clouddms.v1.DatabaseEngineInfo.verify(message.source); + if (error) + return "source." + error; + } + if (message.destination != null && message.hasOwnProperty("destination")) { + var error = $root.google.cloud.clouddms.v1.DatabaseEngineInfo.verify(message.destination); + if (error) + return "destination." + error; + } + if (message.globalSettings != null && message.hasOwnProperty("globalSettings")) { + if (!$util.isObject(message.globalSettings)) + return "globalSettings: object expected"; + var key = Object.keys(message.globalSettings); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.globalSettings[key[i]])) + return "globalSettings: string{k:string} expected"; + } + if (message.hasUncommittedChanges != null && message.hasOwnProperty("hasUncommittedChanges")) + if (typeof message.hasUncommittedChanges !== "boolean") + return "hasUncommittedChanges: boolean expected"; + if (message.latestCommitId != null && message.hasOwnProperty("latestCommitId")) + if (!$util.isString(message.latestCommitId)) + return "latestCommitId: string expected"; + if (message.latestCommitTime != null && message.hasOwnProperty("latestCommitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.latestCommitTime); + if (error) + return "latestCommitTime." + error; + } + 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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a ConversionWorkspace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ConversionWorkspace} ConversionWorkspace + */ + ConversionWorkspace.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ConversionWorkspace) + return object; + var message = new $root.google.cloud.clouddms.v1.ConversionWorkspace(); + if (object.name != null) + message.name = String(object.name); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConversionWorkspace.source: object expected"); + message.source = $root.google.cloud.clouddms.v1.DatabaseEngineInfo.fromObject(object.source); + } + if (object.destination != null) { + if (typeof object.destination !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConversionWorkspace.destination: object expected"); + message.destination = $root.google.cloud.clouddms.v1.DatabaseEngineInfo.fromObject(object.destination); + } + if (object.globalSettings) { + if (typeof object.globalSettings !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConversionWorkspace.globalSettings: object expected"); + message.globalSettings = {}; + for (var keys = Object.keys(object.globalSettings), i = 0; i < keys.length; ++i) + message.globalSettings[keys[i]] = String(object.globalSettings[keys[i]]); + } + if (object.hasUncommittedChanges != null) + message.hasUncommittedChanges = Boolean(object.hasUncommittedChanges); + if (object.latestCommitId != null) + message.latestCommitId = String(object.latestCommitId); + if (object.latestCommitTime != null) { + if (typeof object.latestCommitTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConversionWorkspace.latestCommitTime: object expected"); + message.latestCommitTime = $root.google.protobuf.Timestamp.fromObject(object.latestCommitTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConversionWorkspace.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.clouddms.v1.ConversionWorkspace.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a ConversionWorkspace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @static + * @param {google.cloud.clouddms.v1.ConversionWorkspace} message ConversionWorkspace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversionWorkspace.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.globalSettings = {}; + if (options.defaults) { + object.name = ""; + object.source = null; + object.destination = null; + object.hasUncommittedChanges = false; + object.latestCommitId = ""; + object.latestCommitTime = null; + object.createTime = null; + object.updateTime = null; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.clouddms.v1.DatabaseEngineInfo.toObject(message.source, options); + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = $root.google.cloud.clouddms.v1.DatabaseEngineInfo.toObject(message.destination, options); + var keys2; + if (message.globalSettings && (keys2 = Object.keys(message.globalSettings)).length) { + object.globalSettings = {}; + for (var j = 0; j < keys2.length; ++j) + object.globalSettings[keys2[j]] = message.globalSettings[keys2[j]]; + } + if (message.hasUncommittedChanges != null && message.hasOwnProperty("hasUncommittedChanges")) + object.hasUncommittedChanges = message.hasUncommittedChanges; + if (message.latestCommitId != null && message.hasOwnProperty("latestCommitId")) + object.latestCommitId = message.latestCommitId; + if (message.latestCommitTime != null && message.hasOwnProperty("latestCommitTime")) + object.latestCommitTime = $root.google.protobuf.Timestamp.toObject(message.latestCommitTime, options); + 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); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ConversionWorkspace to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @instance + * @returns {Object.} JSON object + */ + ConversionWorkspace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConversionWorkspace + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ConversionWorkspace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConversionWorkspace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ConversionWorkspace"; + }; + + return ConversionWorkspace; + })(); + + v1.BackgroundJobLogEntry = (function() { + + /** + * Properties of a BackgroundJobLogEntry. + * @memberof google.cloud.clouddms.v1 + * @interface IBackgroundJobLogEntry + * @property {string|null} [id] BackgroundJobLogEntry id + * @property {google.cloud.clouddms.v1.BackgroundJobType|null} [jobType] BackgroundJobLogEntry jobType + * @property {google.protobuf.ITimestamp|null} [startTime] BackgroundJobLogEntry startTime + * @property {google.protobuf.ITimestamp|null} [finishTime] BackgroundJobLogEntry finishTime + * @property {google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState|null} [completionState] BackgroundJobLogEntry completionState + * @property {string|null} [completionComment] BackgroundJobLogEntry completionComment + * @property {boolean|null} [requestAutocommit] BackgroundJobLogEntry requestAutocommit + * @property {google.cloud.clouddms.v1.BackgroundJobLogEntry.ISeedJobDetails|null} [seedJobDetails] BackgroundJobLogEntry seedJobDetails + * @property {google.cloud.clouddms.v1.BackgroundJobLogEntry.IImportRulesJobDetails|null} [importRulesJobDetails] BackgroundJobLogEntry importRulesJobDetails + * @property {google.cloud.clouddms.v1.BackgroundJobLogEntry.IConvertJobDetails|null} [convertJobDetails] BackgroundJobLogEntry convertJobDetails + * @property {google.cloud.clouddms.v1.BackgroundJobLogEntry.IApplyJobDetails|null} [applyJobDetails] BackgroundJobLogEntry applyJobDetails + */ + + /** + * Constructs a new BackgroundJobLogEntry. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a BackgroundJobLogEntry. + * @implements IBackgroundJobLogEntry + * @constructor + * @param {google.cloud.clouddms.v1.IBackgroundJobLogEntry=} [properties] Properties to set + */ + function BackgroundJobLogEntry(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]]; + } + + /** + * BackgroundJobLogEntry id. + * @member {string} id + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + */ + BackgroundJobLogEntry.prototype.id = ""; + + /** + * BackgroundJobLogEntry jobType. + * @member {google.cloud.clouddms.v1.BackgroundJobType} jobType + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + */ + BackgroundJobLogEntry.prototype.jobType = 0; + + /** + * BackgroundJobLogEntry startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + */ + BackgroundJobLogEntry.prototype.startTime = null; + + /** + * BackgroundJobLogEntry finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + */ + BackgroundJobLogEntry.prototype.finishTime = null; + + /** + * BackgroundJobLogEntry completionState. + * @member {google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState} completionState + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + */ + BackgroundJobLogEntry.prototype.completionState = 0; + + /** + * BackgroundJobLogEntry completionComment. + * @member {string} completionComment + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + */ + BackgroundJobLogEntry.prototype.completionComment = ""; + + /** + * BackgroundJobLogEntry requestAutocommit. + * @member {boolean} requestAutocommit + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + */ + BackgroundJobLogEntry.prototype.requestAutocommit = false; + + /** + * BackgroundJobLogEntry seedJobDetails. + * @member {google.cloud.clouddms.v1.BackgroundJobLogEntry.ISeedJobDetails|null|undefined} seedJobDetails + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + */ + BackgroundJobLogEntry.prototype.seedJobDetails = null; + + /** + * BackgroundJobLogEntry importRulesJobDetails. + * @member {google.cloud.clouddms.v1.BackgroundJobLogEntry.IImportRulesJobDetails|null|undefined} importRulesJobDetails + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + */ + BackgroundJobLogEntry.prototype.importRulesJobDetails = null; + + /** + * BackgroundJobLogEntry convertJobDetails. + * @member {google.cloud.clouddms.v1.BackgroundJobLogEntry.IConvertJobDetails|null|undefined} convertJobDetails + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + */ + BackgroundJobLogEntry.prototype.convertJobDetails = null; + + /** + * BackgroundJobLogEntry applyJobDetails. + * @member {google.cloud.clouddms.v1.BackgroundJobLogEntry.IApplyJobDetails|null|undefined} applyJobDetails + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + */ + BackgroundJobLogEntry.prototype.applyJobDetails = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackgroundJobLogEntry jobDetails. + * @member {"seedJobDetails"|"importRulesJobDetails"|"convertJobDetails"|"applyJobDetails"|undefined} jobDetails + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + */ + Object.defineProperty(BackgroundJobLogEntry.prototype, "jobDetails", { + get: $util.oneOfGetter($oneOfFields = ["seedJobDetails", "importRulesJobDetails", "convertJobDetails", "applyJobDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackgroundJobLogEntry instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @static + * @param {google.cloud.clouddms.v1.IBackgroundJobLogEntry=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry} BackgroundJobLogEntry instance + */ + BackgroundJobLogEntry.create = function create(properties) { + return new BackgroundJobLogEntry(properties); + }; + + /** + * Encodes the specified BackgroundJobLogEntry message. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @static + * @param {google.cloud.clouddms.v1.IBackgroundJobLogEntry} message BackgroundJobLogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackgroundJobLogEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.jobType != null && Object.hasOwnProperty.call(message, "jobType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.jobType); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.completionState != null && Object.hasOwnProperty.call(message, "completionState")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.completionState); + if (message.completionComment != null && Object.hasOwnProperty.call(message, "completionComment")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.completionComment); + if (message.requestAutocommit != null && Object.hasOwnProperty.call(message, "requestAutocommit")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.requestAutocommit); + if (message.seedJobDetails != null && Object.hasOwnProperty.call(message, "seedJobDetails")) + $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails.encode(message.seedJobDetails, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.importRulesJobDetails != null && Object.hasOwnProperty.call(message, "importRulesJobDetails")) + $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails.encode(message.importRulesJobDetails, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.convertJobDetails != null && Object.hasOwnProperty.call(message, "convertJobDetails")) + $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails.encode(message.convertJobDetails, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + if (message.applyJobDetails != null && Object.hasOwnProperty.call(message, "applyJobDetails")) + $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails.encode(message.applyJobDetails, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackgroundJobLogEntry message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @static + * @param {google.cloud.clouddms.v1.IBackgroundJobLogEntry} message BackgroundJobLogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackgroundJobLogEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackgroundJobLogEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry} BackgroundJobLogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackgroundJobLogEntry.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.clouddms.v1.BackgroundJobLogEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.jobType = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.completionState = reader.int32(); + break; + } + case 6: { + message.completionComment = reader.string(); + break; + } + case 7: { + message.requestAutocommit = reader.bool(); + break; + } + case 100: { + message.seedJobDetails = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails.decode(reader, reader.uint32()); + break; + } + case 101: { + message.importRulesJobDetails = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails.decode(reader, reader.uint32()); + break; + } + case 102: { + message.convertJobDetails = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails.decode(reader, reader.uint32()); + break; + } + case 103: { + message.applyJobDetails = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackgroundJobLogEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry} BackgroundJobLogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackgroundJobLogEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackgroundJobLogEntry message. + * @function verify + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackgroundJobLogEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.jobType != null && message.hasOwnProperty("jobType")) + switch (message.jobType) { + default: + return "jobType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + if (message.completionState != null && message.hasOwnProperty("completionState")) + switch (message.completionState) { + default: + return "completionState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.completionComment != null && message.hasOwnProperty("completionComment")) + if (!$util.isString(message.completionComment)) + return "completionComment: string expected"; + if (message.requestAutocommit != null && message.hasOwnProperty("requestAutocommit")) + if (typeof message.requestAutocommit !== "boolean") + return "requestAutocommit: boolean expected"; + if (message.seedJobDetails != null && message.hasOwnProperty("seedJobDetails")) { + properties.jobDetails = 1; + { + var error = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails.verify(message.seedJobDetails); + if (error) + return "seedJobDetails." + error; + } + } + if (message.importRulesJobDetails != null && message.hasOwnProperty("importRulesJobDetails")) { + if (properties.jobDetails === 1) + return "jobDetails: multiple values"; + properties.jobDetails = 1; + { + var error = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails.verify(message.importRulesJobDetails); + if (error) + return "importRulesJobDetails." + error; + } + } + if (message.convertJobDetails != null && message.hasOwnProperty("convertJobDetails")) { + if (properties.jobDetails === 1) + return "jobDetails: multiple values"; + properties.jobDetails = 1; + { + var error = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails.verify(message.convertJobDetails); + if (error) + return "convertJobDetails." + error; + } + } + if (message.applyJobDetails != null && message.hasOwnProperty("applyJobDetails")) { + if (properties.jobDetails === 1) + return "jobDetails: multiple values"; + properties.jobDetails = 1; + { + var error = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails.verify(message.applyJobDetails); + if (error) + return "applyJobDetails." + error; + } + } + return null; + }; + + /** + * Creates a BackgroundJobLogEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry} BackgroundJobLogEntry + */ + BackgroundJobLogEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.BackgroundJobLogEntry) + return object; + var message = new $root.google.cloud.clouddms.v1.BackgroundJobLogEntry(); + if (object.id != null) + message.id = String(object.id); + switch (object.jobType) { + default: + if (typeof object.jobType === "number") { + message.jobType = object.jobType; + break; + } + break; + case "BACKGROUND_JOB_TYPE_UNSPECIFIED": + case 0: + message.jobType = 0; + break; + case "BACKGROUND_JOB_TYPE_SOURCE_SEED": + case 1: + message.jobType = 1; + break; + case "BACKGROUND_JOB_TYPE_CONVERT": + case 2: + message.jobType = 2; + break; + case "BACKGROUND_JOB_TYPE_APPLY_DESTINATION": + case 3: + message.jobType = 3; + break; + case "BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE": + case 5: + message.jobType = 5; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.BackgroundJobLogEntry.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.BackgroundJobLogEntry.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + switch (object.completionState) { + default: + if (typeof object.completionState === "number") { + message.completionState = object.completionState; + break; + } + break; + case "JOB_COMPLETION_STATE_UNSPECIFIED": + case 0: + message.completionState = 0; + break; + case "SUCCEEDED": + case 1: + message.completionState = 1; + break; + case "FAILED": + case 2: + message.completionState = 2; + break; + } + if (object.completionComment != null) + message.completionComment = String(object.completionComment); + if (object.requestAutocommit != null) + message.requestAutocommit = Boolean(object.requestAutocommit); + if (object.seedJobDetails != null) { + if (typeof object.seedJobDetails !== "object") + throw TypeError(".google.cloud.clouddms.v1.BackgroundJobLogEntry.seedJobDetails: object expected"); + message.seedJobDetails = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails.fromObject(object.seedJobDetails); + } + if (object.importRulesJobDetails != null) { + if (typeof object.importRulesJobDetails !== "object") + throw TypeError(".google.cloud.clouddms.v1.BackgroundJobLogEntry.importRulesJobDetails: object expected"); + message.importRulesJobDetails = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails.fromObject(object.importRulesJobDetails); + } + if (object.convertJobDetails != null) { + if (typeof object.convertJobDetails !== "object") + throw TypeError(".google.cloud.clouddms.v1.BackgroundJobLogEntry.convertJobDetails: object expected"); + message.convertJobDetails = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails.fromObject(object.convertJobDetails); + } + if (object.applyJobDetails != null) { + if (typeof object.applyJobDetails !== "object") + throw TypeError(".google.cloud.clouddms.v1.BackgroundJobLogEntry.applyJobDetails: object expected"); + message.applyJobDetails = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails.fromObject(object.applyJobDetails); + } + return message; + }; + + /** + * Creates a plain object from a BackgroundJobLogEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry} message BackgroundJobLogEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackgroundJobLogEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.jobType = options.enums === String ? "BACKGROUND_JOB_TYPE_UNSPECIFIED" : 0; + object.startTime = null; + object.finishTime = null; + object.completionState = options.enums === String ? "JOB_COMPLETION_STATE_UNSPECIFIED" : 0; + object.completionComment = ""; + object.requestAutocommit = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.jobType != null && message.hasOwnProperty("jobType")) + object.jobType = options.enums === String ? $root.google.cloud.clouddms.v1.BackgroundJobType[message.jobType] === undefined ? message.jobType : $root.google.cloud.clouddms.v1.BackgroundJobType[message.jobType] : message.jobType; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + if (message.completionState != null && message.hasOwnProperty("completionState")) + object.completionState = options.enums === String ? $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState[message.completionState] === undefined ? message.completionState : $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState[message.completionState] : message.completionState; + if (message.completionComment != null && message.hasOwnProperty("completionComment")) + object.completionComment = message.completionComment; + if (message.requestAutocommit != null && message.hasOwnProperty("requestAutocommit")) + object.requestAutocommit = message.requestAutocommit; + if (message.seedJobDetails != null && message.hasOwnProperty("seedJobDetails")) { + object.seedJobDetails = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails.toObject(message.seedJobDetails, options); + if (options.oneofs) + object.jobDetails = "seedJobDetails"; + } + if (message.importRulesJobDetails != null && message.hasOwnProperty("importRulesJobDetails")) { + object.importRulesJobDetails = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails.toObject(message.importRulesJobDetails, options); + if (options.oneofs) + object.jobDetails = "importRulesJobDetails"; + } + if (message.convertJobDetails != null && message.hasOwnProperty("convertJobDetails")) { + object.convertJobDetails = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails.toObject(message.convertJobDetails, options); + if (options.oneofs) + object.jobDetails = "convertJobDetails"; + } + if (message.applyJobDetails != null && message.hasOwnProperty("applyJobDetails")) { + object.applyJobDetails = $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails.toObject(message.applyJobDetails, options); + if (options.oneofs) + object.jobDetails = "applyJobDetails"; + } + return object; + }; + + /** + * Converts this BackgroundJobLogEntry to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @instance + * @returns {Object.} JSON object + */ + BackgroundJobLogEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackgroundJobLogEntry + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackgroundJobLogEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.BackgroundJobLogEntry"; + }; + + /** + * JobCompletionState enum. + * @name google.cloud.clouddms.v1.BackgroundJobLogEntry.JobCompletionState + * @enum {number} + * @property {number} JOB_COMPLETION_STATE_UNSPECIFIED=0 JOB_COMPLETION_STATE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + */ + BackgroundJobLogEntry.JobCompletionState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_COMPLETION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + return values; + })(); + + BackgroundJobLogEntry.SeedJobDetails = (function() { + + /** + * Properties of a SeedJobDetails. + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @interface ISeedJobDetails + * @property {string|null} [connectionProfile] SeedJobDetails connectionProfile + */ + + /** + * Constructs a new SeedJobDetails. + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @classdesc Represents a SeedJobDetails. + * @implements ISeedJobDetails + * @constructor + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.ISeedJobDetails=} [properties] Properties to set + */ + function SeedJobDetails(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]]; + } + + /** + * SeedJobDetails connectionProfile. + * @member {string} connectionProfile + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails + * @instance + */ + SeedJobDetails.prototype.connectionProfile = ""; + + /** + * Creates a new SeedJobDetails instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.ISeedJobDetails=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails} SeedJobDetails instance + */ + SeedJobDetails.create = function create(properties) { + return new SeedJobDetails(properties); + }; + + /** + * Encodes the specified SeedJobDetails message. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.ISeedJobDetails} message SeedJobDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeedJobDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionProfile != null && Object.hasOwnProperty.call(message, "connectionProfile")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionProfile); + return writer; + }; + + /** + * Encodes the specified SeedJobDetails message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.ISeedJobDetails} message SeedJobDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeedJobDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SeedJobDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails} SeedJobDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeedJobDetails.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.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.connectionProfile = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SeedJobDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails} SeedJobDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeedJobDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SeedJobDetails message. + * @function verify + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SeedJobDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) + if (!$util.isString(message.connectionProfile)) + return "connectionProfile: string expected"; + return null; + }; + + /** + * Creates a SeedJobDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails} SeedJobDetails + */ + SeedJobDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails) + return object; + var message = new $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails(); + if (object.connectionProfile != null) + message.connectionProfile = String(object.connectionProfile); + return message; + }; + + /** + * Creates a plain object from a SeedJobDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails} message SeedJobDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SeedJobDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.connectionProfile = ""; + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) + object.connectionProfile = message.connectionProfile; + return object; + }; + + /** + * Converts this SeedJobDetails to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails + * @instance + * @returns {Object.} JSON object + */ + SeedJobDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SeedJobDetails + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SeedJobDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.BackgroundJobLogEntry.SeedJobDetails"; + }; + + return SeedJobDetails; + })(); + + BackgroundJobLogEntry.ImportRulesJobDetails = (function() { + + /** + * Properties of an ImportRulesJobDetails. + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @interface IImportRulesJobDetails + * @property {Array.|null} [files] ImportRulesJobDetails files + * @property {google.cloud.clouddms.v1.ImportRulesFileFormat|null} [fileFormat] ImportRulesJobDetails fileFormat + */ + + /** + * Constructs a new ImportRulesJobDetails. + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @classdesc Represents an ImportRulesJobDetails. + * @implements IImportRulesJobDetails + * @constructor + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.IImportRulesJobDetails=} [properties] Properties to set + */ + function ImportRulesJobDetails(properties) { + this.files = []; + 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]]; + } + + /** + * ImportRulesJobDetails files. + * @member {Array.} files + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails + * @instance + */ + ImportRulesJobDetails.prototype.files = $util.emptyArray; + + /** + * ImportRulesJobDetails fileFormat. + * @member {google.cloud.clouddms.v1.ImportRulesFileFormat} fileFormat + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails + * @instance + */ + ImportRulesJobDetails.prototype.fileFormat = 0; + + /** + * Creates a new ImportRulesJobDetails instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.IImportRulesJobDetails=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails} ImportRulesJobDetails instance + */ + ImportRulesJobDetails.create = function create(properties) { + return new ImportRulesJobDetails(properties); + }; + + /** + * Encodes the specified ImportRulesJobDetails message. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.IImportRulesJobDetails} message ImportRulesJobDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportRulesJobDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.files != null && message.files.length) + for (var i = 0; i < message.files.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.files[i]); + if (message.fileFormat != null && Object.hasOwnProperty.call(message, "fileFormat")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.fileFormat); + return writer; + }; + + /** + * Encodes the specified ImportRulesJobDetails message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.IImportRulesJobDetails} message ImportRulesJobDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportRulesJobDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportRulesJobDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails} ImportRulesJobDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportRulesJobDetails.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.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.files && message.files.length)) + message.files = []; + message.files.push(reader.string()); + break; + } + case 2: { + message.fileFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportRulesJobDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails} ImportRulesJobDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportRulesJobDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportRulesJobDetails message. + * @function verify + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportRulesJobDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.files != null && message.hasOwnProperty("files")) { + if (!Array.isArray(message.files)) + return "files: array expected"; + for (var i = 0; i < message.files.length; ++i) + if (!$util.isString(message.files[i])) + return "files: string[] expected"; + } + if (message.fileFormat != null && message.hasOwnProperty("fileFormat")) + switch (message.fileFormat) { + default: + return "fileFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ImportRulesJobDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails} ImportRulesJobDetails + */ + ImportRulesJobDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails) + return object; + var message = new $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails(); + if (object.files) { + if (!Array.isArray(object.files)) + throw TypeError(".google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails.files: array expected"); + message.files = []; + for (var i = 0; i < object.files.length; ++i) + message.files[i] = String(object.files[i]); + } + switch (object.fileFormat) { + default: + if (typeof object.fileFormat === "number") { + message.fileFormat = object.fileFormat; + break; + } + break; + case "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED": + case 0: + message.fileFormat = 0; + break; + case "IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE": + case 1: + message.fileFormat = 1; + break; + case "IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE": + case 2: + message.fileFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImportRulesJobDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails} message ImportRulesJobDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportRulesJobDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.files = []; + if (options.defaults) + object.fileFormat = options.enums === String ? "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED" : 0; + if (message.files && message.files.length) { + object.files = []; + for (var j = 0; j < message.files.length; ++j) + object.files[j] = message.files[j]; + } + if (message.fileFormat != null && message.hasOwnProperty("fileFormat")) + object.fileFormat = options.enums === String ? $root.google.cloud.clouddms.v1.ImportRulesFileFormat[message.fileFormat] === undefined ? message.fileFormat : $root.google.cloud.clouddms.v1.ImportRulesFileFormat[message.fileFormat] : message.fileFormat; + return object; + }; + + /** + * Converts this ImportRulesJobDetails to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails + * @instance + * @returns {Object.} JSON object + */ + ImportRulesJobDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportRulesJobDetails + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportRulesJobDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.BackgroundJobLogEntry.ImportRulesJobDetails"; + }; + + return ImportRulesJobDetails; + })(); + + BackgroundJobLogEntry.ConvertJobDetails = (function() { + + /** + * Properties of a ConvertJobDetails. + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @interface IConvertJobDetails + * @property {string|null} [filter] ConvertJobDetails filter + */ + + /** + * Constructs a new ConvertJobDetails. + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @classdesc Represents a ConvertJobDetails. + * @implements IConvertJobDetails + * @constructor + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.IConvertJobDetails=} [properties] Properties to set + */ + function ConvertJobDetails(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]]; + } + + /** + * ConvertJobDetails filter. + * @member {string} filter + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails + * @instance + */ + ConvertJobDetails.prototype.filter = ""; + + /** + * Creates a new ConvertJobDetails instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.IConvertJobDetails=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails} ConvertJobDetails instance + */ + ConvertJobDetails.create = function create(properties) { + return new ConvertJobDetails(properties); + }; + + /** + * Encodes the specified ConvertJobDetails message. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.IConvertJobDetails} message ConvertJobDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConvertJobDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ConvertJobDetails message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.IConvertJobDetails} message ConvertJobDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConvertJobDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConvertJobDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails} ConvertJobDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConvertJobDetails.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.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConvertJobDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails} ConvertJobDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConvertJobDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConvertJobDetails message. + * @function verify + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConvertJobDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ConvertJobDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails} ConvertJobDetails + */ + ConvertJobDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails) + return object; + var message = new $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails(); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ConvertJobDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails} message ConvertJobDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConvertJobDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.filter = ""; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ConvertJobDetails to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails + * @instance + * @returns {Object.} JSON object + */ + ConvertJobDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConvertJobDetails + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConvertJobDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.BackgroundJobLogEntry.ConvertJobDetails"; + }; + + return ConvertJobDetails; + })(); + + BackgroundJobLogEntry.ApplyJobDetails = (function() { + + /** + * Properties of an ApplyJobDetails. + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @interface IApplyJobDetails + * @property {string|null} [connectionProfile] ApplyJobDetails connectionProfile + * @property {string|null} [filter] ApplyJobDetails filter + */ + + /** + * Constructs a new ApplyJobDetails. + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry + * @classdesc Represents an ApplyJobDetails. + * @implements IApplyJobDetails + * @constructor + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.IApplyJobDetails=} [properties] Properties to set + */ + function ApplyJobDetails(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]]; + } + + /** + * ApplyJobDetails connectionProfile. + * @member {string} connectionProfile + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails + * @instance + */ + ApplyJobDetails.prototype.connectionProfile = ""; + + /** + * ApplyJobDetails filter. + * @member {string} filter + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails + * @instance + */ + ApplyJobDetails.prototype.filter = ""; + + /** + * Creates a new ApplyJobDetails instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.IApplyJobDetails=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails} ApplyJobDetails instance + */ + ApplyJobDetails.create = function create(properties) { + return new ApplyJobDetails(properties); + }; + + /** + * Encodes the specified ApplyJobDetails message. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.IApplyJobDetails} message ApplyJobDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyJobDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionProfile != null && Object.hasOwnProperty.call(message, "connectionProfile")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.connectionProfile); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ApplyJobDetails message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.IApplyJobDetails} message ApplyJobDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyJobDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplyJobDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails} ApplyJobDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyJobDetails.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.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.connectionProfile = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplyJobDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails} ApplyJobDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyJobDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplyJobDetails message. + * @function verify + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplyJobDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) + if (!$util.isString(message.connectionProfile)) + return "connectionProfile: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates an ApplyJobDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails} ApplyJobDetails + */ + ApplyJobDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails) + return object; + var message = new $root.google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails(); + if (object.connectionProfile != null) + message.connectionProfile = String(object.connectionProfile); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from an ApplyJobDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails + * @static + * @param {google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails} message ApplyJobDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplyJobDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.connectionProfile = ""; + object.filter = ""; + } + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) + object.connectionProfile = message.connectionProfile; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ApplyJobDetails to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails + * @instance + * @returns {Object.} JSON object + */ + ApplyJobDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplyJobDetails + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplyJobDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.BackgroundJobLogEntry.ApplyJobDetails"; + }; + + return ApplyJobDetails; + })(); + + return BackgroundJobLogEntry; + })(); + + v1.DatabaseEntity = (function() { + + /** + * Properties of a DatabaseEntity. + * @memberof google.cloud.clouddms.v1 + * @interface IDatabaseEntity + * @property {string|null} [shortName] DatabaseEntity shortName + * @property {string|null} [parentEntity] DatabaseEntity parentEntity + * @property {google.cloud.clouddms.v1.DatabaseEntity.TreeType|null} [tree] DatabaseEntity tree + * @property {google.cloud.clouddms.v1.DatabaseEntityType|null} [entityType] DatabaseEntity entityType + * @property {Array.|null} [mappings] DatabaseEntity mappings + * @property {google.cloud.clouddms.v1.ISchemaEntity|null} [schema] DatabaseEntity schema + * @property {google.cloud.clouddms.v1.ITableEntity|null} [table] DatabaseEntity table + * @property {google.cloud.clouddms.v1.IViewEntity|null} [view] DatabaseEntity view + * @property {google.cloud.clouddms.v1.ISequenceEntity|null} [sequence] DatabaseEntity sequence + * @property {google.cloud.clouddms.v1.IStoredProcedureEntity|null} [storedProcedure] DatabaseEntity storedProcedure + * @property {google.cloud.clouddms.v1.IFunctionEntity|null} [databaseFunction] DatabaseEntity databaseFunction + * @property {google.cloud.clouddms.v1.ISynonymEntity|null} [synonym] DatabaseEntity synonym + * @property {google.cloud.clouddms.v1.IPackageEntity|null} [databasePackage] DatabaseEntity databasePackage + */ + + /** + * Constructs a new DatabaseEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a DatabaseEntity. + * @implements IDatabaseEntity + * @constructor + * @param {google.cloud.clouddms.v1.IDatabaseEntity=} [properties] Properties to set + */ + function DatabaseEntity(properties) { + this.mappings = []; + 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]]; + } + + /** + * DatabaseEntity shortName. + * @member {string} shortName + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.shortName = ""; + + /** + * DatabaseEntity parentEntity. + * @member {string} parentEntity + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.parentEntity = ""; + + /** + * DatabaseEntity tree. + * @member {google.cloud.clouddms.v1.DatabaseEntity.TreeType} tree + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.tree = 0; + + /** + * DatabaseEntity entityType. + * @member {google.cloud.clouddms.v1.DatabaseEntityType} entityType + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.entityType = 0; + + /** + * DatabaseEntity mappings. + * @member {Array.} mappings + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.mappings = $util.emptyArray; + + /** + * DatabaseEntity schema. + * @member {google.cloud.clouddms.v1.ISchemaEntity|null|undefined} schema + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.schema = null; + + /** + * DatabaseEntity table. + * @member {google.cloud.clouddms.v1.ITableEntity|null|undefined} table + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.table = null; + + /** + * DatabaseEntity view. + * @member {google.cloud.clouddms.v1.IViewEntity|null|undefined} view + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.view = null; + + /** + * DatabaseEntity sequence. + * @member {google.cloud.clouddms.v1.ISequenceEntity|null|undefined} sequence + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.sequence = null; + + /** + * DatabaseEntity storedProcedure. + * @member {google.cloud.clouddms.v1.IStoredProcedureEntity|null|undefined} storedProcedure + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.storedProcedure = null; + + /** + * DatabaseEntity databaseFunction. + * @member {google.cloud.clouddms.v1.IFunctionEntity|null|undefined} databaseFunction + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.databaseFunction = null; + + /** + * DatabaseEntity synonym. + * @member {google.cloud.clouddms.v1.ISynonymEntity|null|undefined} synonym + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.synonym = null; + + /** + * DatabaseEntity databasePackage. + * @member {google.cloud.clouddms.v1.IPackageEntity|null|undefined} databasePackage + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + DatabaseEntity.prototype.databasePackage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DatabaseEntity entityBody. + * @member {"schema"|"table"|"view"|"sequence"|"storedProcedure"|"databaseFunction"|"synonym"|"databasePackage"|undefined} entityBody + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + */ + Object.defineProperty(DatabaseEntity.prototype, "entityBody", { + get: $util.oneOfGetter($oneOfFields = ["schema", "table", "view", "sequence", "storedProcedure", "databaseFunction", "synonym", "databasePackage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DatabaseEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @static + * @param {google.cloud.clouddms.v1.IDatabaseEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DatabaseEntity} DatabaseEntity instance + */ + DatabaseEntity.create = function create(properties) { + return new DatabaseEntity(properties); + }; + + /** + * Encodes the specified DatabaseEntity message. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @static + * @param {google.cloud.clouddms.v1.IDatabaseEntity} message DatabaseEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.shortName != null && Object.hasOwnProperty.call(message, "shortName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.shortName); + if (message.parentEntity != null && Object.hasOwnProperty.call(message, "parentEntity")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parentEntity); + if (message.tree != null && Object.hasOwnProperty.call(message, "tree")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.tree); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.entityType); + if (message.mappings != null && message.mappings.length) + for (var i = 0; i < message.mappings.length; ++i) + $root.google.cloud.clouddms.v1.EntityMapping.encode(message.mappings[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.clouddms.v1.SchemaEntity.encode(message.schema, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.google.cloud.clouddms.v1.TableEntity.encode(message.table, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + $root.google.cloud.clouddms.v1.ViewEntity.encode(message.view, writer.uint32(/* id 104, wireType 2 =*/834).fork()).ldelim(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + $root.google.cloud.clouddms.v1.SequenceEntity.encode(message.sequence, writer.uint32(/* id 105, wireType 2 =*/842).fork()).ldelim(); + if (message.storedProcedure != null && Object.hasOwnProperty.call(message, "storedProcedure")) + $root.google.cloud.clouddms.v1.StoredProcedureEntity.encode(message.storedProcedure, writer.uint32(/* id 106, wireType 2 =*/850).fork()).ldelim(); + if (message.databaseFunction != null && Object.hasOwnProperty.call(message, "databaseFunction")) + $root.google.cloud.clouddms.v1.FunctionEntity.encode(message.databaseFunction, writer.uint32(/* id 107, wireType 2 =*/858).fork()).ldelim(); + if (message.synonym != null && Object.hasOwnProperty.call(message, "synonym")) + $root.google.cloud.clouddms.v1.SynonymEntity.encode(message.synonym, writer.uint32(/* id 108, wireType 2 =*/866).fork()).ldelim(); + if (message.databasePackage != null && Object.hasOwnProperty.call(message, "databasePackage")) + $root.google.cloud.clouddms.v1.PackageEntity.encode(message.databasePackage, writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DatabaseEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @static + * @param {google.cloud.clouddms.v1.IDatabaseEntity} message DatabaseEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatabaseEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.DatabaseEntity} DatabaseEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseEntity.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.clouddms.v1.DatabaseEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.shortName = reader.string(); + break; + } + case 2: { + message.parentEntity = reader.string(); + break; + } + case 3: { + message.tree = reader.int32(); + break; + } + case 4: { + message.entityType = reader.int32(); + break; + } + case 5: { + if (!(message.mappings && message.mappings.length)) + message.mappings = []; + message.mappings.push($root.google.cloud.clouddms.v1.EntityMapping.decode(reader, reader.uint32())); + break; + } + case 102: { + message.schema = $root.google.cloud.clouddms.v1.SchemaEntity.decode(reader, reader.uint32()); + break; + } + case 103: { + message.table = $root.google.cloud.clouddms.v1.TableEntity.decode(reader, reader.uint32()); + break; + } + case 104: { + message.view = $root.google.cloud.clouddms.v1.ViewEntity.decode(reader, reader.uint32()); + break; + } + case 105: { + message.sequence = $root.google.cloud.clouddms.v1.SequenceEntity.decode(reader, reader.uint32()); + break; + } + case 106: { + message.storedProcedure = $root.google.cloud.clouddms.v1.StoredProcedureEntity.decode(reader, reader.uint32()); + break; + } + case 107: { + message.databaseFunction = $root.google.cloud.clouddms.v1.FunctionEntity.decode(reader, reader.uint32()); + break; + } + case 108: { + message.synonym = $root.google.cloud.clouddms.v1.SynonymEntity.decode(reader, reader.uint32()); + break; + } + case 109: { + message.databasePackage = $root.google.cloud.clouddms.v1.PackageEntity.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatabaseEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.DatabaseEntity} DatabaseEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatabaseEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatabaseEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.shortName != null && message.hasOwnProperty("shortName")) + if (!$util.isString(message.shortName)) + return "shortName: string expected"; + if (message.parentEntity != null && message.hasOwnProperty("parentEntity")) + if (!$util.isString(message.parentEntity)) + return "parentEntity: string expected"; + if (message.tree != null && message.hasOwnProperty("tree")) + switch (message.tree) { + default: + return "tree: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.entityType != null && message.hasOwnProperty("entityType")) + switch (message.entityType) { + default: + return "entityType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.mappings != null && message.hasOwnProperty("mappings")) { + if (!Array.isArray(message.mappings)) + return "mappings: array expected"; + for (var i = 0; i < message.mappings.length; ++i) { + var error = $root.google.cloud.clouddms.v1.EntityMapping.verify(message.mappings[i]); + if (error) + return "mappings." + error; + } + } + if (message.schema != null && message.hasOwnProperty("schema")) { + properties.entityBody = 1; + { + var error = $root.google.cloud.clouddms.v1.SchemaEntity.verify(message.schema); + if (error) + return "schema." + error; + } + } + if (message.table != null && message.hasOwnProperty("table")) { + if (properties.entityBody === 1) + return "entityBody: multiple values"; + properties.entityBody = 1; + { + var error = $root.google.cloud.clouddms.v1.TableEntity.verify(message.table); + if (error) + return "table." + error; + } + } + if (message.view != null && message.hasOwnProperty("view")) { + if (properties.entityBody === 1) + return "entityBody: multiple values"; + properties.entityBody = 1; + { + var error = $root.google.cloud.clouddms.v1.ViewEntity.verify(message.view); + if (error) + return "view." + error; + } + } + if (message.sequence != null && message.hasOwnProperty("sequence")) { + if (properties.entityBody === 1) + return "entityBody: multiple values"; + properties.entityBody = 1; + { + var error = $root.google.cloud.clouddms.v1.SequenceEntity.verify(message.sequence); + if (error) + return "sequence." + error; + } + } + if (message.storedProcedure != null && message.hasOwnProperty("storedProcedure")) { + if (properties.entityBody === 1) + return "entityBody: multiple values"; + properties.entityBody = 1; + { + var error = $root.google.cloud.clouddms.v1.StoredProcedureEntity.verify(message.storedProcedure); + if (error) + return "storedProcedure." + error; + } + } + if (message.databaseFunction != null && message.hasOwnProperty("databaseFunction")) { + if (properties.entityBody === 1) + return "entityBody: multiple values"; + properties.entityBody = 1; + { + var error = $root.google.cloud.clouddms.v1.FunctionEntity.verify(message.databaseFunction); + if (error) + return "databaseFunction." + error; + } + } + if (message.synonym != null && message.hasOwnProperty("synonym")) { + if (properties.entityBody === 1) + return "entityBody: multiple values"; + properties.entityBody = 1; + { + var error = $root.google.cloud.clouddms.v1.SynonymEntity.verify(message.synonym); + if (error) + return "synonym." + error; + } + } + if (message.databasePackage != null && message.hasOwnProperty("databasePackage")) { + if (properties.entityBody === 1) + return "entityBody: multiple values"; + properties.entityBody = 1; + { + var error = $root.google.cloud.clouddms.v1.PackageEntity.verify(message.databasePackage); + if (error) + return "databasePackage." + error; + } + } + return null; + }; + + /** + * Creates a DatabaseEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.DatabaseEntity} DatabaseEntity + */ + DatabaseEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DatabaseEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.DatabaseEntity(); + if (object.shortName != null) + message.shortName = String(object.shortName); + if (object.parentEntity != null) + message.parentEntity = String(object.parentEntity); + switch (object.tree) { + default: + if (typeof object.tree === "number") { + message.tree = object.tree; + break; + } + break; + case "TREE_TYPE_UNSPECIFIED": + case 0: + message.tree = 0; + break; + case "SOURCE": + case 1: + message.tree = 1; + break; + case "DRAFT": + case 2: + message.tree = 2; + break; + case "DESTINATION": + case 3: + message.tree = 3; + break; + } + switch (object.entityType) { + default: + if (typeof object.entityType === "number") { + message.entityType = object.entityType; + break; + } + break; + case "DATABASE_ENTITY_TYPE_UNSPECIFIED": + case 0: + message.entityType = 0; + break; + case "DATABASE_ENTITY_TYPE_SCHEMA": + case 1: + message.entityType = 1; + break; + case "DATABASE_ENTITY_TYPE_TABLE": + case 2: + message.entityType = 2; + break; + case "DATABASE_ENTITY_TYPE_COLUMN": + case 3: + message.entityType = 3; + break; + case "DATABASE_ENTITY_TYPE_CONSTRAINT": + case 4: + message.entityType = 4; + break; + case "DATABASE_ENTITY_TYPE_INDEX": + case 5: + message.entityType = 5; + break; + case "DATABASE_ENTITY_TYPE_TRIGGER": + case 6: + message.entityType = 6; + break; + case "DATABASE_ENTITY_TYPE_VIEW": + case 7: + message.entityType = 7; + break; + case "DATABASE_ENTITY_TYPE_SEQUENCE": + case 8: + message.entityType = 8; + break; + case "DATABASE_ENTITY_TYPE_STORED_PROCEDURE": + case 9: + message.entityType = 9; + break; + case "DATABASE_ENTITY_TYPE_FUNCTION": + case 10: + message.entityType = 10; + break; + case "DATABASE_ENTITY_TYPE_SYNONYM": + case 11: + message.entityType = 11; + break; + case "DATABASE_ENTITY_TYPE_DATABASE_PACKAGE": + case 12: + message.entityType = 12; + break; + case "DATABASE_ENTITY_TYPE_UDT": + case 13: + message.entityType = 13; + break; + case "DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW": + case 14: + message.entityType = 14; + break; + case "DATABASE_ENTITY_TYPE_DATABASE": + case 15: + message.entityType = 15; + break; + } + if (object.mappings) { + if (!Array.isArray(object.mappings)) + throw TypeError(".google.cloud.clouddms.v1.DatabaseEntity.mappings: array expected"); + message.mappings = []; + for (var i = 0; i < object.mappings.length; ++i) { + if (typeof object.mappings[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.DatabaseEntity.mappings: object expected"); + message.mappings[i] = $root.google.cloud.clouddms.v1.EntityMapping.fromObject(object.mappings[i]); + } + } + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.cloud.clouddms.v1.DatabaseEntity.schema: object expected"); + message.schema = $root.google.cloud.clouddms.v1.SchemaEntity.fromObject(object.schema); + } + if (object.table != null) { + if (typeof object.table !== "object") + throw TypeError(".google.cloud.clouddms.v1.DatabaseEntity.table: object expected"); + message.table = $root.google.cloud.clouddms.v1.TableEntity.fromObject(object.table); + } + if (object.view != null) { + if (typeof object.view !== "object") + throw TypeError(".google.cloud.clouddms.v1.DatabaseEntity.view: object expected"); + message.view = $root.google.cloud.clouddms.v1.ViewEntity.fromObject(object.view); + } + if (object.sequence != null) { + if (typeof object.sequence !== "object") + throw TypeError(".google.cloud.clouddms.v1.DatabaseEntity.sequence: object expected"); + message.sequence = $root.google.cloud.clouddms.v1.SequenceEntity.fromObject(object.sequence); + } + if (object.storedProcedure != null) { + if (typeof object.storedProcedure !== "object") + throw TypeError(".google.cloud.clouddms.v1.DatabaseEntity.storedProcedure: object expected"); + message.storedProcedure = $root.google.cloud.clouddms.v1.StoredProcedureEntity.fromObject(object.storedProcedure); + } + if (object.databaseFunction != null) { + if (typeof object.databaseFunction !== "object") + throw TypeError(".google.cloud.clouddms.v1.DatabaseEntity.databaseFunction: object expected"); + message.databaseFunction = $root.google.cloud.clouddms.v1.FunctionEntity.fromObject(object.databaseFunction); + } + if (object.synonym != null) { + if (typeof object.synonym !== "object") + throw TypeError(".google.cloud.clouddms.v1.DatabaseEntity.synonym: object expected"); + message.synonym = $root.google.cloud.clouddms.v1.SynonymEntity.fromObject(object.synonym); + } + if (object.databasePackage != null) { + if (typeof object.databasePackage !== "object") + throw TypeError(".google.cloud.clouddms.v1.DatabaseEntity.databasePackage: object expected"); + message.databasePackage = $root.google.cloud.clouddms.v1.PackageEntity.fromObject(object.databasePackage); + } + return message; + }; + + /** + * Creates a plain object from a DatabaseEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @static + * @param {google.cloud.clouddms.v1.DatabaseEntity} message DatabaseEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatabaseEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mappings = []; + if (options.defaults) { + object.shortName = ""; + object.parentEntity = ""; + object.tree = options.enums === String ? "TREE_TYPE_UNSPECIFIED" : 0; + object.entityType = options.enums === String ? "DATABASE_ENTITY_TYPE_UNSPECIFIED" : 0; + } + if (message.shortName != null && message.hasOwnProperty("shortName")) + object.shortName = message.shortName; + if (message.parentEntity != null && message.hasOwnProperty("parentEntity")) + object.parentEntity = message.parentEntity; + if (message.tree != null && message.hasOwnProperty("tree")) + object.tree = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseEntity.TreeType[message.tree] === undefined ? message.tree : $root.google.cloud.clouddms.v1.DatabaseEntity.TreeType[message.tree] : message.tree; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseEntityType[message.entityType] === undefined ? message.entityType : $root.google.cloud.clouddms.v1.DatabaseEntityType[message.entityType] : message.entityType; + if (message.mappings && message.mappings.length) { + object.mappings = []; + for (var j = 0; j < message.mappings.length; ++j) + object.mappings[j] = $root.google.cloud.clouddms.v1.EntityMapping.toObject(message.mappings[j], options); + } + if (message.schema != null && message.hasOwnProperty("schema")) { + object.schema = $root.google.cloud.clouddms.v1.SchemaEntity.toObject(message.schema, options); + if (options.oneofs) + object.entityBody = "schema"; + } + if (message.table != null && message.hasOwnProperty("table")) { + object.table = $root.google.cloud.clouddms.v1.TableEntity.toObject(message.table, options); + if (options.oneofs) + object.entityBody = "table"; + } + if (message.view != null && message.hasOwnProperty("view")) { + object.view = $root.google.cloud.clouddms.v1.ViewEntity.toObject(message.view, options); + if (options.oneofs) + object.entityBody = "view"; + } + if (message.sequence != null && message.hasOwnProperty("sequence")) { + object.sequence = $root.google.cloud.clouddms.v1.SequenceEntity.toObject(message.sequence, options); + if (options.oneofs) + object.entityBody = "sequence"; + } + if (message.storedProcedure != null && message.hasOwnProperty("storedProcedure")) { + object.storedProcedure = $root.google.cloud.clouddms.v1.StoredProcedureEntity.toObject(message.storedProcedure, options); + if (options.oneofs) + object.entityBody = "storedProcedure"; + } + if (message.databaseFunction != null && message.hasOwnProperty("databaseFunction")) { + object.databaseFunction = $root.google.cloud.clouddms.v1.FunctionEntity.toObject(message.databaseFunction, options); + if (options.oneofs) + object.entityBody = "databaseFunction"; + } + if (message.synonym != null && message.hasOwnProperty("synonym")) { + object.synonym = $root.google.cloud.clouddms.v1.SynonymEntity.toObject(message.synonym, options); + if (options.oneofs) + object.entityBody = "synonym"; + } + if (message.databasePackage != null && message.hasOwnProperty("databasePackage")) { + object.databasePackage = $root.google.cloud.clouddms.v1.PackageEntity.toObject(message.databasePackage, options); + if (options.oneofs) + object.entityBody = "databasePackage"; + } + return object; + }; + + /** + * Converts this DatabaseEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @instance + * @returns {Object.} JSON object + */ + DatabaseEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatabaseEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.DatabaseEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatabaseEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.DatabaseEntity"; + }; + + /** + * TreeType enum. + * @name google.cloud.clouddms.v1.DatabaseEntity.TreeType + * @enum {number} + * @property {number} TREE_TYPE_UNSPECIFIED=0 TREE_TYPE_UNSPECIFIED value + * @property {number} SOURCE=1 SOURCE value + * @property {number} DRAFT=2 DRAFT value + * @property {number} DESTINATION=3 DESTINATION value + */ + DatabaseEntity.TreeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TREE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SOURCE"] = 1; + values[valuesById[2] = "DRAFT"] = 2; + values[valuesById[3] = "DESTINATION"] = 3; + return values; + })(); + + return DatabaseEntity; + })(); + + v1.SchemaEntity = (function() { + + /** + * Properties of a SchemaEntity. + * @memberof google.cloud.clouddms.v1 + * @interface ISchemaEntity + * @property {google.protobuf.IStruct|null} [customFeatures] SchemaEntity customFeatures + */ + + /** + * Constructs a new SchemaEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SchemaEntity. + * @implements ISchemaEntity + * @constructor + * @param {google.cloud.clouddms.v1.ISchemaEntity=} [properties] Properties to set + */ + function SchemaEntity(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]]; + } + + /** + * SchemaEntity customFeatures. + * @member {google.protobuf.IStruct|null|undefined} customFeatures + * @memberof google.cloud.clouddms.v1.SchemaEntity + * @instance + */ + SchemaEntity.prototype.customFeatures = null; + + /** + * Creates a new SchemaEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SchemaEntity + * @static + * @param {google.cloud.clouddms.v1.ISchemaEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SchemaEntity} SchemaEntity instance + */ + SchemaEntity.create = function create(properties) { + return new SchemaEntity(properties); + }; + + /** + * Encodes the specified SchemaEntity message. Does not implicitly {@link google.cloud.clouddms.v1.SchemaEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SchemaEntity + * @static + * @param {google.cloud.clouddms.v1.ISchemaEntity} message SchemaEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customFeatures != null && Object.hasOwnProperty.call(message, "customFeatures")) + $root.google.protobuf.Struct.encode(message.customFeatures, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SchemaEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SchemaEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SchemaEntity + * @static + * @param {google.cloud.clouddms.v1.ISchemaEntity} message SchemaEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchemaEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchemaEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SchemaEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SchemaEntity} SchemaEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaEntity.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.clouddms.v1.SchemaEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.customFeatures = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchemaEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SchemaEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SchemaEntity} SchemaEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchemaEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchemaEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.SchemaEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchemaEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + var error = $root.google.protobuf.Struct.verify(message.customFeatures); + if (error) + return "customFeatures." + error; + } + return null; + }; + + /** + * Creates a SchemaEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SchemaEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SchemaEntity} SchemaEntity + */ + SchemaEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SchemaEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.SchemaEntity(); + if (object.customFeatures != null) { + if (typeof object.customFeatures !== "object") + throw TypeError(".google.cloud.clouddms.v1.SchemaEntity.customFeatures: object expected"); + message.customFeatures = $root.google.protobuf.Struct.fromObject(object.customFeatures); + } + return message; + }; + + /** + * Creates a plain object from a SchemaEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SchemaEntity + * @static + * @param {google.cloud.clouddms.v1.SchemaEntity} message SchemaEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchemaEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.customFeatures = null; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) + object.customFeatures = $root.google.protobuf.Struct.toObject(message.customFeatures, options); + return object; + }; + + /** + * Converts this SchemaEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SchemaEntity + * @instance + * @returns {Object.} JSON object + */ + SchemaEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchemaEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SchemaEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchemaEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SchemaEntity"; + }; + + return SchemaEntity; + })(); + + v1.TableEntity = (function() { + + /** + * Properties of a TableEntity. + * @memberof google.cloud.clouddms.v1 + * @interface ITableEntity + * @property {Array.|null} [columns] TableEntity columns + * @property {Array.|null} [constraints] TableEntity constraints + * @property {Array.|null} [indices] TableEntity indices + * @property {Array.|null} [triggers] TableEntity triggers + * @property {google.protobuf.IStruct|null} [customFeatures] TableEntity customFeatures + * @property {string|null} [comment] TableEntity comment + */ + + /** + * Constructs a new TableEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a TableEntity. + * @implements ITableEntity + * @constructor + * @param {google.cloud.clouddms.v1.ITableEntity=} [properties] Properties to set + */ + function TableEntity(properties) { + this.columns = []; + this.constraints = []; + this.indices = []; + this.triggers = []; + 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]]; + } + + /** + * TableEntity columns. + * @member {Array.} columns + * @memberof google.cloud.clouddms.v1.TableEntity + * @instance + */ + TableEntity.prototype.columns = $util.emptyArray; + + /** + * TableEntity constraints. + * @member {Array.} constraints + * @memberof google.cloud.clouddms.v1.TableEntity + * @instance + */ + TableEntity.prototype.constraints = $util.emptyArray; + + /** + * TableEntity indices. + * @member {Array.} indices + * @memberof google.cloud.clouddms.v1.TableEntity + * @instance + */ + TableEntity.prototype.indices = $util.emptyArray; + + /** + * TableEntity triggers. + * @member {Array.} triggers + * @memberof google.cloud.clouddms.v1.TableEntity + * @instance + */ + TableEntity.prototype.triggers = $util.emptyArray; + + /** + * TableEntity customFeatures. + * @member {google.protobuf.IStruct|null|undefined} customFeatures + * @memberof google.cloud.clouddms.v1.TableEntity + * @instance + */ + TableEntity.prototype.customFeatures = null; + + /** + * TableEntity comment. + * @member {string} comment + * @memberof google.cloud.clouddms.v1.TableEntity + * @instance + */ + TableEntity.prototype.comment = ""; + + /** + * Creates a new TableEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.TableEntity + * @static + * @param {google.cloud.clouddms.v1.ITableEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.TableEntity} TableEntity instance + */ + TableEntity.create = function create(properties) { + return new TableEntity(properties); + }; + + /** + * Encodes the specified TableEntity message. Does not implicitly {@link google.cloud.clouddms.v1.TableEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.TableEntity + * @static + * @param {google.cloud.clouddms.v1.ITableEntity} message TableEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.google.cloud.clouddms.v1.ColumnEntity.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.constraints != null && message.constraints.length) + for (var i = 0; i < message.constraints.length; ++i) + $root.google.cloud.clouddms.v1.ConstraintEntity.encode(message.constraints[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.indices != null && message.indices.length) + for (var i = 0; i < message.indices.length; ++i) + $root.google.cloud.clouddms.v1.IndexEntity.encode(message.indices[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.triggers != null && message.triggers.length) + for (var i = 0; i < message.triggers.length; ++i) + $root.google.cloud.clouddms.v1.TriggerEntity.encode(message.triggers[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.customFeatures != null && Object.hasOwnProperty.call(message, "customFeatures")) + $root.google.protobuf.Struct.encode(message.customFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.comment); + return writer; + }; + + /** + * Encodes the specified TableEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.TableEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.TableEntity + * @static + * @param {google.cloud.clouddms.v1.ITableEntity} message TableEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.TableEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.TableEntity} TableEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableEntity.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.clouddms.v1.TableEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.cloud.clouddms.v1.ColumnEntity.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.constraints && message.constraints.length)) + message.constraints = []; + message.constraints.push($root.google.cloud.clouddms.v1.ConstraintEntity.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.indices && message.indices.length)) + message.indices = []; + message.indices.push($root.google.cloud.clouddms.v1.IndexEntity.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.triggers && message.triggers.length)) + message.triggers = []; + message.triggers.push($root.google.cloud.clouddms.v1.TriggerEntity.decode(reader, reader.uint32())); + break; + } + case 5: { + message.customFeatures = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.comment = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.TableEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.TableEntity} TableEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.TableEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.google.cloud.clouddms.v1.ColumnEntity.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + if (message.constraints != null && message.hasOwnProperty("constraints")) { + if (!Array.isArray(message.constraints)) + return "constraints: array expected"; + for (var i = 0; i < message.constraints.length; ++i) { + var error = $root.google.cloud.clouddms.v1.ConstraintEntity.verify(message.constraints[i]); + if (error) + return "constraints." + error; + } + } + if (message.indices != null && message.hasOwnProperty("indices")) { + if (!Array.isArray(message.indices)) + return "indices: array expected"; + for (var i = 0; i < message.indices.length; ++i) { + var error = $root.google.cloud.clouddms.v1.IndexEntity.verify(message.indices[i]); + if (error) + return "indices." + error; + } + } + if (message.triggers != null && message.hasOwnProperty("triggers")) { + if (!Array.isArray(message.triggers)) + return "triggers: array expected"; + for (var i = 0; i < message.triggers.length; ++i) { + var error = $root.google.cloud.clouddms.v1.TriggerEntity.verify(message.triggers[i]); + if (error) + return "triggers." + error; + } + } + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + var error = $root.google.protobuf.Struct.verify(message.customFeatures); + if (error) + return "customFeatures." + error; + } + if (message.comment != null && message.hasOwnProperty("comment")) + if (!$util.isString(message.comment)) + return "comment: string expected"; + return null; + }; + + /** + * Creates a TableEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.TableEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.TableEntity} TableEntity + */ + TableEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.TableEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.TableEntity(); + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".google.cloud.clouddms.v1.TableEntity.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.TableEntity.columns: object expected"); + message.columns[i] = $root.google.cloud.clouddms.v1.ColumnEntity.fromObject(object.columns[i]); + } + } + if (object.constraints) { + if (!Array.isArray(object.constraints)) + throw TypeError(".google.cloud.clouddms.v1.TableEntity.constraints: array expected"); + message.constraints = []; + for (var i = 0; i < object.constraints.length; ++i) { + if (typeof object.constraints[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.TableEntity.constraints: object expected"); + message.constraints[i] = $root.google.cloud.clouddms.v1.ConstraintEntity.fromObject(object.constraints[i]); + } + } + if (object.indices) { + if (!Array.isArray(object.indices)) + throw TypeError(".google.cloud.clouddms.v1.TableEntity.indices: array expected"); + message.indices = []; + for (var i = 0; i < object.indices.length; ++i) { + if (typeof object.indices[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.TableEntity.indices: object expected"); + message.indices[i] = $root.google.cloud.clouddms.v1.IndexEntity.fromObject(object.indices[i]); + } + } + if (object.triggers) { + if (!Array.isArray(object.triggers)) + throw TypeError(".google.cloud.clouddms.v1.TableEntity.triggers: array expected"); + message.triggers = []; + for (var i = 0; i < object.triggers.length; ++i) { + if (typeof object.triggers[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.TableEntity.triggers: object expected"); + message.triggers[i] = $root.google.cloud.clouddms.v1.TriggerEntity.fromObject(object.triggers[i]); + } + } + if (object.customFeatures != null) { + if (typeof object.customFeatures !== "object") + throw TypeError(".google.cloud.clouddms.v1.TableEntity.customFeatures: object expected"); + message.customFeatures = $root.google.protobuf.Struct.fromObject(object.customFeatures); + } + if (object.comment != null) + message.comment = String(object.comment); + return message; + }; + + /** + * Creates a plain object from a TableEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.TableEntity + * @static + * @param {google.cloud.clouddms.v1.TableEntity} message TableEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.columns = []; + object.constraints = []; + object.indices = []; + object.triggers = []; + } + if (options.defaults) { + object.customFeatures = null; + object.comment = ""; + } + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.google.cloud.clouddms.v1.ColumnEntity.toObject(message.columns[j], options); + } + if (message.constraints && message.constraints.length) { + object.constraints = []; + for (var j = 0; j < message.constraints.length; ++j) + object.constraints[j] = $root.google.cloud.clouddms.v1.ConstraintEntity.toObject(message.constraints[j], options); + } + if (message.indices && message.indices.length) { + object.indices = []; + for (var j = 0; j < message.indices.length; ++j) + object.indices[j] = $root.google.cloud.clouddms.v1.IndexEntity.toObject(message.indices[j], options); + } + if (message.triggers && message.triggers.length) { + object.triggers = []; + for (var j = 0; j < message.triggers.length; ++j) + object.triggers[j] = $root.google.cloud.clouddms.v1.TriggerEntity.toObject(message.triggers[j], options); + } + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) + object.customFeatures = $root.google.protobuf.Struct.toObject(message.customFeatures, options); + if (message.comment != null && message.hasOwnProperty("comment")) + object.comment = message.comment; + return object; + }; + + /** + * Converts this TableEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.TableEntity + * @instance + * @returns {Object.} JSON object + */ + TableEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.TableEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.TableEntity"; + }; + + return TableEntity; + })(); + + v1.ColumnEntity = (function() { + + /** + * Properties of a ColumnEntity. + * @memberof google.cloud.clouddms.v1 + * @interface IColumnEntity + * @property {string|null} [name] ColumnEntity name + * @property {string|null} [dataType] ColumnEntity dataType + * @property {string|null} [charset] ColumnEntity charset + * @property {string|null} [collation] ColumnEntity collation + * @property {number|Long|null} [length] ColumnEntity length + * @property {number|null} [precision] ColumnEntity precision + * @property {number|null} [scale] ColumnEntity scale + * @property {number|null} [fractionalSecondsPrecision] ColumnEntity fractionalSecondsPrecision + * @property {boolean|null} [array] ColumnEntity array + * @property {number|null} [arrayLength] ColumnEntity arrayLength + * @property {boolean|null} [nullable] ColumnEntity nullable + * @property {boolean|null} [autoGenerated] ColumnEntity autoGenerated + * @property {boolean|null} [udt] ColumnEntity udt + * @property {google.protobuf.IStruct|null} [customFeatures] ColumnEntity customFeatures + * @property {Array.|null} [setValues] ColumnEntity setValues + * @property {string|null} [comment] ColumnEntity comment + * @property {number|null} [ordinalPosition] ColumnEntity ordinalPosition + * @property {string|null} [defaultValue] ColumnEntity defaultValue + */ + + /** + * Constructs a new ColumnEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ColumnEntity. + * @implements IColumnEntity + * @constructor + * @param {google.cloud.clouddms.v1.IColumnEntity=} [properties] Properties to set + */ + function ColumnEntity(properties) { + this.setValues = []; + 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]]; + } + + /** + * ColumnEntity name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.name = ""; + + /** + * ColumnEntity dataType. + * @member {string} dataType + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.dataType = ""; + + /** + * ColumnEntity charset. + * @member {string} charset + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.charset = ""; + + /** + * ColumnEntity collation. + * @member {string} collation + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.collation = ""; + + /** + * ColumnEntity length. + * @member {number|Long} length + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.length = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ColumnEntity precision. + * @member {number} precision + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.precision = 0; + + /** + * ColumnEntity scale. + * @member {number} scale + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.scale = 0; + + /** + * ColumnEntity fractionalSecondsPrecision. + * @member {number} fractionalSecondsPrecision + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.fractionalSecondsPrecision = 0; + + /** + * ColumnEntity array. + * @member {boolean} array + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.array = false; + + /** + * ColumnEntity arrayLength. + * @member {number} arrayLength + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.arrayLength = 0; + + /** + * ColumnEntity nullable. + * @member {boolean} nullable + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.nullable = false; + + /** + * ColumnEntity autoGenerated. + * @member {boolean} autoGenerated + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.autoGenerated = false; + + /** + * ColumnEntity udt. + * @member {boolean} udt + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.udt = false; + + /** + * ColumnEntity customFeatures. + * @member {google.protobuf.IStruct|null|undefined} customFeatures + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.customFeatures = null; + + /** + * ColumnEntity setValues. + * @member {Array.} setValues + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.setValues = $util.emptyArray; + + /** + * ColumnEntity comment. + * @member {string} comment + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.comment = ""; + + /** + * ColumnEntity ordinalPosition. + * @member {number} ordinalPosition + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.ordinalPosition = 0; + + /** + * ColumnEntity defaultValue. + * @member {string} defaultValue + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + */ + ColumnEntity.prototype.defaultValue = ""; + + /** + * Creates a new ColumnEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @static + * @param {google.cloud.clouddms.v1.IColumnEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ColumnEntity} ColumnEntity instance + */ + ColumnEntity.create = function create(properties) { + return new ColumnEntity(properties); + }; + + /** + * Encodes the specified ColumnEntity message. Does not implicitly {@link google.cloud.clouddms.v1.ColumnEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @static + * @param {google.cloud.clouddms.v1.IColumnEntity} message ColumnEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnEntity.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.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataType); + if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.charset); + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.collation); + if (message.length != null && Object.hasOwnProperty.call(message, "length")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.length); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.precision); + if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.scale); + if (message.fractionalSecondsPrecision != null && Object.hasOwnProperty.call(message, "fractionalSecondsPrecision")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.fractionalSecondsPrecision); + if (message.array != null && Object.hasOwnProperty.call(message, "array")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.array); + if (message.arrayLength != null && Object.hasOwnProperty.call(message, "arrayLength")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.arrayLength); + if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.nullable); + if (message.autoGenerated != null && Object.hasOwnProperty.call(message, "autoGenerated")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.autoGenerated); + if (message.udt != null && Object.hasOwnProperty.call(message, "udt")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.udt); + if (message.customFeatures != null && Object.hasOwnProperty.call(message, "customFeatures")) + $root.google.protobuf.Struct.encode(message.customFeatures, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.setValues != null && message.setValues.length) + for (var i = 0; i < message.setValues.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.setValues[i]); + if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.comment); + if (message.ordinalPosition != null && Object.hasOwnProperty.call(message, "ordinalPosition")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.ordinalPosition); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.defaultValue); + return writer; + }; + + /** + * Encodes the specified ColumnEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ColumnEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @static + * @param {google.cloud.clouddms.v1.IColumnEntity} message ColumnEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ColumnEntity} ColumnEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnEntity.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.clouddms.v1.ColumnEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.dataType = reader.string(); + break; + } + case 3: { + message.charset = reader.string(); + break; + } + case 4: { + message.collation = reader.string(); + break; + } + case 5: { + message.length = reader.int64(); + break; + } + case 6: { + message.precision = reader.int32(); + break; + } + case 7: { + message.scale = reader.int32(); + break; + } + case 8: { + message.fractionalSecondsPrecision = reader.int32(); + break; + } + case 9: { + message.array = reader.bool(); + break; + } + case 10: { + message.arrayLength = reader.int32(); + break; + } + case 11: { + message.nullable = reader.bool(); + break; + } + case 12: { + message.autoGenerated = reader.bool(); + break; + } + case 13: { + message.udt = reader.bool(); + break; + } + case 14: { + message.customFeatures = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 15: { + if (!(message.setValues && message.setValues.length)) + message.setValues = []; + message.setValues.push(reader.string()); + break; + } + case 16: { + message.comment = reader.string(); + break; + } + case 17: { + message.ordinalPosition = reader.int32(); + break; + } + case 18: { + message.defaultValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ColumnEntity} ColumnEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnEntity.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.dataType != null && message.hasOwnProperty("dataType")) + if (!$util.isString(message.dataType)) + return "dataType: string expected"; + if (message.charset != null && message.hasOwnProperty("charset")) + if (!$util.isString(message.charset)) + return "charset: string expected"; + if (message.collation != null && message.hasOwnProperty("collation")) + if (!$util.isString(message.collation)) + return "collation: string expected"; + if (message.length != null && message.hasOwnProperty("length")) + if (!$util.isInteger(message.length) && !(message.length && $util.isInteger(message.length.low) && $util.isInteger(message.length.high))) + return "length: integer|Long expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (!$util.isInteger(message.precision)) + return "precision: integer expected"; + if (message.scale != null && message.hasOwnProperty("scale")) + if (!$util.isInteger(message.scale)) + return "scale: integer expected"; + if (message.fractionalSecondsPrecision != null && message.hasOwnProperty("fractionalSecondsPrecision")) + if (!$util.isInteger(message.fractionalSecondsPrecision)) + return "fractionalSecondsPrecision: integer expected"; + if (message.array != null && message.hasOwnProperty("array")) + if (typeof message.array !== "boolean") + return "array: boolean expected"; + if (message.arrayLength != null && message.hasOwnProperty("arrayLength")) + if (!$util.isInteger(message.arrayLength)) + return "arrayLength: integer expected"; + if (message.nullable != null && message.hasOwnProperty("nullable")) + if (typeof message.nullable !== "boolean") + return "nullable: boolean expected"; + if (message.autoGenerated != null && message.hasOwnProperty("autoGenerated")) + if (typeof message.autoGenerated !== "boolean") + return "autoGenerated: boolean expected"; + if (message.udt != null && message.hasOwnProperty("udt")) + if (typeof message.udt !== "boolean") + return "udt: boolean expected"; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + var error = $root.google.protobuf.Struct.verify(message.customFeatures); + if (error) + return "customFeatures." + error; + } + if (message.setValues != null && message.hasOwnProperty("setValues")) { + if (!Array.isArray(message.setValues)) + return "setValues: array expected"; + for (var i = 0; i < message.setValues.length; ++i) + if (!$util.isString(message.setValues[i])) + return "setValues: string[] expected"; + } + if (message.comment != null && message.hasOwnProperty("comment")) + if (!$util.isString(message.comment)) + return "comment: string expected"; + if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) + if (!$util.isInteger(message.ordinalPosition)) + return "ordinalPosition: integer expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + return null; + }; + + /** + * Creates a ColumnEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ColumnEntity} ColumnEntity + */ + ColumnEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ColumnEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.ColumnEntity(); + if (object.name != null) + message.name = String(object.name); + if (object.dataType != null) + message.dataType = String(object.dataType); + if (object.charset != null) + message.charset = String(object.charset); + if (object.collation != null) + message.collation = String(object.collation); + if (object.length != null) + if ($util.Long) + (message.length = $util.Long.fromValue(object.length)).unsigned = false; + else if (typeof object.length === "string") + message.length = parseInt(object.length, 10); + else if (typeof object.length === "number") + message.length = object.length; + else if (typeof object.length === "object") + message.length = new $util.LongBits(object.length.low >>> 0, object.length.high >>> 0).toNumber(); + if (object.precision != null) + message.precision = object.precision | 0; + if (object.scale != null) + message.scale = object.scale | 0; + if (object.fractionalSecondsPrecision != null) + message.fractionalSecondsPrecision = object.fractionalSecondsPrecision | 0; + if (object.array != null) + message.array = Boolean(object.array); + if (object.arrayLength != null) + message.arrayLength = object.arrayLength | 0; + if (object.nullable != null) + message.nullable = Boolean(object.nullable); + if (object.autoGenerated != null) + message.autoGenerated = Boolean(object.autoGenerated); + if (object.udt != null) + message.udt = Boolean(object.udt); + if (object.customFeatures != null) { + if (typeof object.customFeatures !== "object") + throw TypeError(".google.cloud.clouddms.v1.ColumnEntity.customFeatures: object expected"); + message.customFeatures = $root.google.protobuf.Struct.fromObject(object.customFeatures); + } + if (object.setValues) { + if (!Array.isArray(object.setValues)) + throw TypeError(".google.cloud.clouddms.v1.ColumnEntity.setValues: array expected"); + message.setValues = []; + for (var i = 0; i < object.setValues.length; ++i) + message.setValues[i] = String(object.setValues[i]); + } + if (object.comment != null) + message.comment = String(object.comment); + if (object.ordinalPosition != null) + message.ordinalPosition = object.ordinalPosition | 0; + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + return message; + }; + + /** + * Creates a plain object from a ColumnEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @static + * @param {google.cloud.clouddms.v1.ColumnEntity} message ColumnEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.setValues = []; + if (options.defaults) { + object.name = ""; + object.dataType = ""; + object.charset = ""; + object.collation = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.length = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.length = options.longs === String ? "0" : 0; + object.precision = 0; + object.scale = 0; + object.fractionalSecondsPrecision = 0; + object.array = false; + object.arrayLength = 0; + object.nullable = false; + object.autoGenerated = false; + object.udt = false; + object.customFeatures = null; + object.comment = ""; + object.ordinalPosition = 0; + object.defaultValue = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = message.dataType; + if (message.charset != null && message.hasOwnProperty("charset")) + object.charset = message.charset; + if (message.collation != null && message.hasOwnProperty("collation")) + object.collation = message.collation; + if (message.length != null && message.hasOwnProperty("length")) + if (typeof message.length === "number") + object.length = options.longs === String ? String(message.length) : message.length; + else + object.length = options.longs === String ? $util.Long.prototype.toString.call(message.length) : options.longs === Number ? new $util.LongBits(message.length.low >>> 0, message.length.high >>> 0).toNumber() : message.length; + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = message.precision; + if (message.scale != null && message.hasOwnProperty("scale")) + object.scale = message.scale; + if (message.fractionalSecondsPrecision != null && message.hasOwnProperty("fractionalSecondsPrecision")) + object.fractionalSecondsPrecision = message.fractionalSecondsPrecision; + if (message.array != null && message.hasOwnProperty("array")) + object.array = message.array; + if (message.arrayLength != null && message.hasOwnProperty("arrayLength")) + object.arrayLength = message.arrayLength; + if (message.nullable != null && message.hasOwnProperty("nullable")) + object.nullable = message.nullable; + if (message.autoGenerated != null && message.hasOwnProperty("autoGenerated")) + object.autoGenerated = message.autoGenerated; + if (message.udt != null && message.hasOwnProperty("udt")) + object.udt = message.udt; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) + object.customFeatures = $root.google.protobuf.Struct.toObject(message.customFeatures, options); + if (message.setValues && message.setValues.length) { + object.setValues = []; + for (var j = 0; j < message.setValues.length; ++j) + object.setValues[j] = message.setValues[j]; + } + if (message.comment != null && message.hasOwnProperty("comment")) + object.comment = message.comment; + if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) + object.ordinalPosition = message.ordinalPosition; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + return object; + }; + + /** + * Converts this ColumnEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @instance + * @returns {Object.} JSON object + */ + ColumnEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ColumnEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ColumnEntity"; + }; + + return ColumnEntity; + })(); + + v1.ConstraintEntity = (function() { + + /** + * Properties of a ConstraintEntity. + * @memberof google.cloud.clouddms.v1 + * @interface IConstraintEntity + * @property {string|null} [name] ConstraintEntity name + * @property {string|null} [type] ConstraintEntity type + * @property {Array.|null} [tableColumns] ConstraintEntity tableColumns + * @property {google.protobuf.IStruct|null} [customFeatures] ConstraintEntity customFeatures + * @property {Array.|null} [referenceColumns] ConstraintEntity referenceColumns + * @property {string|null} [referenceTable] ConstraintEntity referenceTable + * @property {string|null} [tableName] ConstraintEntity tableName + */ + + /** + * Constructs a new ConstraintEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ConstraintEntity. + * @implements IConstraintEntity + * @constructor + * @param {google.cloud.clouddms.v1.IConstraintEntity=} [properties] Properties to set + */ + function ConstraintEntity(properties) { + this.tableColumns = []; + this.referenceColumns = []; + 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]]; + } + + /** + * ConstraintEntity name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @instance + */ + ConstraintEntity.prototype.name = ""; + + /** + * ConstraintEntity type. + * @member {string} type + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @instance + */ + ConstraintEntity.prototype.type = ""; + + /** + * ConstraintEntity tableColumns. + * @member {Array.} tableColumns + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @instance + */ + ConstraintEntity.prototype.tableColumns = $util.emptyArray; + + /** + * ConstraintEntity customFeatures. + * @member {google.protobuf.IStruct|null|undefined} customFeatures + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @instance + */ + ConstraintEntity.prototype.customFeatures = null; + + /** + * ConstraintEntity referenceColumns. + * @member {Array.} referenceColumns + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @instance + */ + ConstraintEntity.prototype.referenceColumns = $util.emptyArray; + + /** + * ConstraintEntity referenceTable. + * @member {string} referenceTable + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @instance + */ + ConstraintEntity.prototype.referenceTable = ""; + + /** + * ConstraintEntity tableName. + * @member {string} tableName + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @instance + */ + ConstraintEntity.prototype.tableName = ""; + + /** + * Creates a new ConstraintEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @static + * @param {google.cloud.clouddms.v1.IConstraintEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ConstraintEntity} ConstraintEntity instance + */ + ConstraintEntity.create = function create(properties) { + return new ConstraintEntity(properties); + }; + + /** + * Encodes the specified ConstraintEntity message. Does not implicitly {@link google.cloud.clouddms.v1.ConstraintEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @static + * @param {google.cloud.clouddms.v1.IConstraintEntity} message ConstraintEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConstraintEntity.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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.tableColumns != null && message.tableColumns.length) + for (var i = 0; i < message.tableColumns.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableColumns[i]); + if (message.customFeatures != null && Object.hasOwnProperty.call(message, "customFeatures")) + $root.google.protobuf.Struct.encode(message.customFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.referenceColumns != null && message.referenceColumns.length) + for (var i = 0; i < message.referenceColumns.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.referenceColumns[i]); + if (message.referenceTable != null && Object.hasOwnProperty.call(message, "referenceTable")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.referenceTable); + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.tableName); + return writer; + }; + + /** + * Encodes the specified ConstraintEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConstraintEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @static + * @param {google.cloud.clouddms.v1.IConstraintEntity} message ConstraintEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConstraintEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConstraintEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ConstraintEntity} ConstraintEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConstraintEntity.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.clouddms.v1.ConstraintEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + if (!(message.tableColumns && message.tableColumns.length)) + message.tableColumns = []; + message.tableColumns.push(reader.string()); + break; + } + case 4: { + message.customFeatures = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.referenceColumns && message.referenceColumns.length)) + message.referenceColumns = []; + message.referenceColumns.push(reader.string()); + break; + } + case 6: { + message.referenceTable = reader.string(); + break; + } + case 7: { + message.tableName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConstraintEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ConstraintEntity} ConstraintEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConstraintEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConstraintEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConstraintEntity.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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.tableColumns != null && message.hasOwnProperty("tableColumns")) { + if (!Array.isArray(message.tableColumns)) + return "tableColumns: array expected"; + for (var i = 0; i < message.tableColumns.length; ++i) + if (!$util.isString(message.tableColumns[i])) + return "tableColumns: string[] expected"; + } + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + var error = $root.google.protobuf.Struct.verify(message.customFeatures); + if (error) + return "customFeatures." + error; + } + if (message.referenceColumns != null && message.hasOwnProperty("referenceColumns")) { + if (!Array.isArray(message.referenceColumns)) + return "referenceColumns: array expected"; + for (var i = 0; i < message.referenceColumns.length; ++i) + if (!$util.isString(message.referenceColumns[i])) + return "referenceColumns: string[] expected"; + } + if (message.referenceTable != null && message.hasOwnProperty("referenceTable")) + if (!$util.isString(message.referenceTable)) + return "referenceTable: string expected"; + if (message.tableName != null && message.hasOwnProperty("tableName")) + if (!$util.isString(message.tableName)) + return "tableName: string expected"; + return null; + }; + + /** + * Creates a ConstraintEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ConstraintEntity} ConstraintEntity + */ + ConstraintEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ConstraintEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.ConstraintEntity(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.tableColumns) { + if (!Array.isArray(object.tableColumns)) + throw TypeError(".google.cloud.clouddms.v1.ConstraintEntity.tableColumns: array expected"); + message.tableColumns = []; + for (var i = 0; i < object.tableColumns.length; ++i) + message.tableColumns[i] = String(object.tableColumns[i]); + } + if (object.customFeatures != null) { + if (typeof object.customFeatures !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConstraintEntity.customFeatures: object expected"); + message.customFeatures = $root.google.protobuf.Struct.fromObject(object.customFeatures); + } + if (object.referenceColumns) { + if (!Array.isArray(object.referenceColumns)) + throw TypeError(".google.cloud.clouddms.v1.ConstraintEntity.referenceColumns: array expected"); + message.referenceColumns = []; + for (var i = 0; i < object.referenceColumns.length; ++i) + message.referenceColumns[i] = String(object.referenceColumns[i]); + } + if (object.referenceTable != null) + message.referenceTable = String(object.referenceTable); + if (object.tableName != null) + message.tableName = String(object.tableName); + return message; + }; + + /** + * Creates a plain object from a ConstraintEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @static + * @param {google.cloud.clouddms.v1.ConstraintEntity} message ConstraintEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConstraintEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tableColumns = []; + object.referenceColumns = []; + } + if (options.defaults) { + object.name = ""; + object.type = ""; + object.customFeatures = null; + object.referenceTable = ""; + object.tableName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.tableColumns && message.tableColumns.length) { + object.tableColumns = []; + for (var j = 0; j < message.tableColumns.length; ++j) + object.tableColumns[j] = message.tableColumns[j]; + } + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) + object.customFeatures = $root.google.protobuf.Struct.toObject(message.customFeatures, options); + if (message.referenceColumns && message.referenceColumns.length) { + object.referenceColumns = []; + for (var j = 0; j < message.referenceColumns.length; ++j) + object.referenceColumns[j] = message.referenceColumns[j]; + } + if (message.referenceTable != null && message.hasOwnProperty("referenceTable")) + object.referenceTable = message.referenceTable; + if (message.tableName != null && message.hasOwnProperty("tableName")) + object.tableName = message.tableName; + return object; + }; + + /** + * Converts this ConstraintEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @instance + * @returns {Object.} JSON object + */ + ConstraintEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConstraintEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ConstraintEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConstraintEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ConstraintEntity"; + }; + + return ConstraintEntity; + })(); + + v1.IndexEntity = (function() { + + /** + * Properties of an IndexEntity. + * @memberof google.cloud.clouddms.v1 + * @interface IIndexEntity + * @property {string|null} [name] IndexEntity name + * @property {string|null} [type] IndexEntity type + * @property {Array.|null} [tableColumns] IndexEntity tableColumns + * @property {boolean|null} [unique] IndexEntity unique + * @property {google.protobuf.IStruct|null} [customFeatures] IndexEntity customFeatures + */ + + /** + * Constructs a new IndexEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents an IndexEntity. + * @implements IIndexEntity + * @constructor + * @param {google.cloud.clouddms.v1.IIndexEntity=} [properties] Properties to set + */ + function IndexEntity(properties) { + this.tableColumns = []; + 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]]; + } + + /** + * IndexEntity name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.IndexEntity + * @instance + */ + IndexEntity.prototype.name = ""; + + /** + * IndexEntity type. + * @member {string} type + * @memberof google.cloud.clouddms.v1.IndexEntity + * @instance + */ + IndexEntity.prototype.type = ""; + + /** + * IndexEntity tableColumns. + * @member {Array.} tableColumns + * @memberof google.cloud.clouddms.v1.IndexEntity + * @instance + */ + IndexEntity.prototype.tableColumns = $util.emptyArray; + + /** + * IndexEntity unique. + * @member {boolean} unique + * @memberof google.cloud.clouddms.v1.IndexEntity + * @instance + */ + IndexEntity.prototype.unique = false; + + /** + * IndexEntity customFeatures. + * @member {google.protobuf.IStruct|null|undefined} customFeatures + * @memberof google.cloud.clouddms.v1.IndexEntity + * @instance + */ + IndexEntity.prototype.customFeatures = null; + + /** + * Creates a new IndexEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.IndexEntity + * @static + * @param {google.cloud.clouddms.v1.IIndexEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.IndexEntity} IndexEntity instance + */ + IndexEntity.create = function create(properties) { + return new IndexEntity(properties); + }; + + /** + * Encodes the specified IndexEntity message. Does not implicitly {@link google.cloud.clouddms.v1.IndexEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.IndexEntity + * @static + * @param {google.cloud.clouddms.v1.IIndexEntity} message IndexEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexEntity.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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.tableColumns != null && message.tableColumns.length) + for (var i = 0; i < message.tableColumns.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableColumns[i]); + if (message.unique != null && Object.hasOwnProperty.call(message, "unique")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.unique); + if (message.customFeatures != null && Object.hasOwnProperty.call(message, "customFeatures")) + $root.google.protobuf.Struct.encode(message.customFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IndexEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.IndexEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.IndexEntity + * @static + * @param {google.cloud.clouddms.v1.IIndexEntity} message IndexEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndexEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.IndexEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.IndexEntity} IndexEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexEntity.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.clouddms.v1.IndexEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + if (!(message.tableColumns && message.tableColumns.length)) + message.tableColumns = []; + message.tableColumns.push(reader.string()); + break; + } + case 4: { + message.unique = reader.bool(); + break; + } + case 5: { + message.customFeatures = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndexEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.IndexEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.IndexEntity} IndexEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndexEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.IndexEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndexEntity.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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.tableColumns != null && message.hasOwnProperty("tableColumns")) { + if (!Array.isArray(message.tableColumns)) + return "tableColumns: array expected"; + for (var i = 0; i < message.tableColumns.length; ++i) + if (!$util.isString(message.tableColumns[i])) + return "tableColumns: string[] expected"; + } + if (message.unique != null && message.hasOwnProperty("unique")) + if (typeof message.unique !== "boolean") + return "unique: boolean expected"; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + var error = $root.google.protobuf.Struct.verify(message.customFeatures); + if (error) + return "customFeatures." + error; + } + return null; + }; + + /** + * Creates an IndexEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.IndexEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.IndexEntity} IndexEntity + */ + IndexEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.IndexEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.IndexEntity(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.tableColumns) { + if (!Array.isArray(object.tableColumns)) + throw TypeError(".google.cloud.clouddms.v1.IndexEntity.tableColumns: array expected"); + message.tableColumns = []; + for (var i = 0; i < object.tableColumns.length; ++i) + message.tableColumns[i] = String(object.tableColumns[i]); + } + if (object.unique != null) + message.unique = Boolean(object.unique); + if (object.customFeatures != null) { + if (typeof object.customFeatures !== "object") + throw TypeError(".google.cloud.clouddms.v1.IndexEntity.customFeatures: object expected"); + message.customFeatures = $root.google.protobuf.Struct.fromObject(object.customFeatures); + } + return message; + }; + + /** + * Creates a plain object from an IndexEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.IndexEntity + * @static + * @param {google.cloud.clouddms.v1.IndexEntity} message IndexEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tableColumns = []; + if (options.defaults) { + object.name = ""; + object.type = ""; + object.unique = false; + object.customFeatures = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.tableColumns && message.tableColumns.length) { + object.tableColumns = []; + for (var j = 0; j < message.tableColumns.length; ++j) + object.tableColumns[j] = message.tableColumns[j]; + } + if (message.unique != null && message.hasOwnProperty("unique")) + object.unique = message.unique; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) + object.customFeatures = $root.google.protobuf.Struct.toObject(message.customFeatures, options); + return object; + }; + + /** + * Converts this IndexEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.IndexEntity + * @instance + * @returns {Object.} JSON object + */ + IndexEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndexEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.IndexEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndexEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.IndexEntity"; + }; + + return IndexEntity; + })(); + + v1.TriggerEntity = (function() { + + /** + * Properties of a TriggerEntity. + * @memberof google.cloud.clouddms.v1 + * @interface ITriggerEntity + * @property {string|null} [name] TriggerEntity name + * @property {Array.|null} [triggeringEvents] TriggerEntity triggeringEvents + * @property {string|null} [triggerType] TriggerEntity triggerType + * @property {string|null} [sqlCode] TriggerEntity sqlCode + * @property {google.protobuf.IStruct|null} [customFeatures] TriggerEntity customFeatures + */ + + /** + * Constructs a new TriggerEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a TriggerEntity. + * @implements ITriggerEntity + * @constructor + * @param {google.cloud.clouddms.v1.ITriggerEntity=} [properties] Properties to set + */ + function TriggerEntity(properties) { + this.triggeringEvents = []; + 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]]; + } + + /** + * TriggerEntity name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @instance + */ + TriggerEntity.prototype.name = ""; + + /** + * TriggerEntity triggeringEvents. + * @member {Array.} triggeringEvents + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @instance + */ + TriggerEntity.prototype.triggeringEvents = $util.emptyArray; + + /** + * TriggerEntity triggerType. + * @member {string} triggerType + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @instance + */ + TriggerEntity.prototype.triggerType = ""; + + /** + * TriggerEntity sqlCode. + * @member {string} sqlCode + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @instance + */ + TriggerEntity.prototype.sqlCode = ""; + + /** + * TriggerEntity customFeatures. + * @member {google.protobuf.IStruct|null|undefined} customFeatures + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @instance + */ + TriggerEntity.prototype.customFeatures = null; + + /** + * Creates a new TriggerEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @static + * @param {google.cloud.clouddms.v1.ITriggerEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.TriggerEntity} TriggerEntity instance + */ + TriggerEntity.create = function create(properties) { + return new TriggerEntity(properties); + }; + + /** + * Encodes the specified TriggerEntity message. Does not implicitly {@link google.cloud.clouddms.v1.TriggerEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @static + * @param {google.cloud.clouddms.v1.ITriggerEntity} message TriggerEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerEntity.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.triggeringEvents != null && message.triggeringEvents.length) + for (var i = 0; i < message.triggeringEvents.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.triggeringEvents[i]); + if (message.triggerType != null && Object.hasOwnProperty.call(message, "triggerType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.triggerType); + if (message.sqlCode != null && Object.hasOwnProperty.call(message, "sqlCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sqlCode); + if (message.customFeatures != null && Object.hasOwnProperty.call(message, "customFeatures")) + $root.google.protobuf.Struct.encode(message.customFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TriggerEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.TriggerEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @static + * @param {google.cloud.clouddms.v1.ITriggerEntity} message TriggerEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TriggerEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.TriggerEntity} TriggerEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerEntity.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.clouddms.v1.TriggerEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.triggeringEvents && message.triggeringEvents.length)) + message.triggeringEvents = []; + message.triggeringEvents.push(reader.string()); + break; + } + case 3: { + message.triggerType = reader.string(); + break; + } + case 4: { + message.sqlCode = reader.string(); + break; + } + case 5: { + message.customFeatures = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TriggerEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.TriggerEntity} TriggerEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TriggerEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TriggerEntity.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.triggeringEvents != null && message.hasOwnProperty("triggeringEvents")) { + if (!Array.isArray(message.triggeringEvents)) + return "triggeringEvents: array expected"; + for (var i = 0; i < message.triggeringEvents.length; ++i) + if (!$util.isString(message.triggeringEvents[i])) + return "triggeringEvents: string[] expected"; + } + if (message.triggerType != null && message.hasOwnProperty("triggerType")) + if (!$util.isString(message.triggerType)) + return "triggerType: string expected"; + if (message.sqlCode != null && message.hasOwnProperty("sqlCode")) + if (!$util.isString(message.sqlCode)) + return "sqlCode: string expected"; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + var error = $root.google.protobuf.Struct.verify(message.customFeatures); + if (error) + return "customFeatures." + error; + } + return null; + }; + + /** + * Creates a TriggerEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.TriggerEntity} TriggerEntity + */ + TriggerEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.TriggerEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.TriggerEntity(); + if (object.name != null) + message.name = String(object.name); + if (object.triggeringEvents) { + if (!Array.isArray(object.triggeringEvents)) + throw TypeError(".google.cloud.clouddms.v1.TriggerEntity.triggeringEvents: array expected"); + message.triggeringEvents = []; + for (var i = 0; i < object.triggeringEvents.length; ++i) + message.triggeringEvents[i] = String(object.triggeringEvents[i]); + } + if (object.triggerType != null) + message.triggerType = String(object.triggerType); + if (object.sqlCode != null) + message.sqlCode = String(object.sqlCode); + if (object.customFeatures != null) { + if (typeof object.customFeatures !== "object") + throw TypeError(".google.cloud.clouddms.v1.TriggerEntity.customFeatures: object expected"); + message.customFeatures = $root.google.protobuf.Struct.fromObject(object.customFeatures); + } + return message; + }; + + /** + * Creates a plain object from a TriggerEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @static + * @param {google.cloud.clouddms.v1.TriggerEntity} message TriggerEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TriggerEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.triggeringEvents = []; + if (options.defaults) { + object.name = ""; + object.triggerType = ""; + object.sqlCode = ""; + object.customFeatures = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.triggeringEvents && message.triggeringEvents.length) { + object.triggeringEvents = []; + for (var j = 0; j < message.triggeringEvents.length; ++j) + object.triggeringEvents[j] = message.triggeringEvents[j]; + } + if (message.triggerType != null && message.hasOwnProperty("triggerType")) + object.triggerType = message.triggerType; + if (message.sqlCode != null && message.hasOwnProperty("sqlCode")) + object.sqlCode = message.sqlCode; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) + object.customFeatures = $root.google.protobuf.Struct.toObject(message.customFeatures, options); + return object; + }; + + /** + * Converts this TriggerEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @instance + * @returns {Object.} JSON object + */ + TriggerEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TriggerEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.TriggerEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TriggerEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.TriggerEntity"; + }; + + return TriggerEntity; + })(); + + v1.ViewEntity = (function() { + + /** + * Properties of a ViewEntity. + * @memberof google.cloud.clouddms.v1 + * @interface IViewEntity + * @property {string|null} [sqlCode] ViewEntity sqlCode + * @property {google.protobuf.IStruct|null} [customFeatures] ViewEntity customFeatures + * @property {Array.|null} [constraints] ViewEntity constraints + */ + + /** + * Constructs a new ViewEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ViewEntity. + * @implements IViewEntity + * @constructor + * @param {google.cloud.clouddms.v1.IViewEntity=} [properties] Properties to set + */ + function ViewEntity(properties) { + this.constraints = []; + 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]]; + } + + /** + * ViewEntity sqlCode. + * @member {string} sqlCode + * @memberof google.cloud.clouddms.v1.ViewEntity + * @instance + */ + ViewEntity.prototype.sqlCode = ""; + + /** + * ViewEntity customFeatures. + * @member {google.protobuf.IStruct|null|undefined} customFeatures + * @memberof google.cloud.clouddms.v1.ViewEntity + * @instance + */ + ViewEntity.prototype.customFeatures = null; + + /** + * ViewEntity constraints. + * @member {Array.} constraints + * @memberof google.cloud.clouddms.v1.ViewEntity + * @instance + */ + ViewEntity.prototype.constraints = $util.emptyArray; + + /** + * Creates a new ViewEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ViewEntity + * @static + * @param {google.cloud.clouddms.v1.IViewEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ViewEntity} ViewEntity instance + */ + ViewEntity.create = function create(properties) { + return new ViewEntity(properties); + }; + + /** + * Encodes the specified ViewEntity message. Does not implicitly {@link google.cloud.clouddms.v1.ViewEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ViewEntity + * @static + * @param {google.cloud.clouddms.v1.IViewEntity} message ViewEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViewEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sqlCode != null && Object.hasOwnProperty.call(message, "sqlCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sqlCode); + if (message.customFeatures != null && Object.hasOwnProperty.call(message, "customFeatures")) + $root.google.protobuf.Struct.encode(message.customFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.constraints != null && message.constraints.length) + for (var i = 0; i < message.constraints.length; ++i) + $root.google.cloud.clouddms.v1.ConstraintEntity.encode(message.constraints[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ViewEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ViewEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ViewEntity + * @static + * @param {google.cloud.clouddms.v1.IViewEntity} message ViewEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViewEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ViewEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ViewEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ViewEntity} ViewEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViewEntity.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.clouddms.v1.ViewEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sqlCode = reader.string(); + break; + } + case 2: { + message.customFeatures = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.constraints && message.constraints.length)) + message.constraints = []; + message.constraints.push($root.google.cloud.clouddms.v1.ConstraintEntity.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ViewEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ViewEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ViewEntity} ViewEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViewEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ViewEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.ViewEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ViewEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sqlCode != null && message.hasOwnProperty("sqlCode")) + if (!$util.isString(message.sqlCode)) + return "sqlCode: string expected"; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + var error = $root.google.protobuf.Struct.verify(message.customFeatures); + if (error) + return "customFeatures." + error; + } + if (message.constraints != null && message.hasOwnProperty("constraints")) { + if (!Array.isArray(message.constraints)) + return "constraints: array expected"; + for (var i = 0; i < message.constraints.length; ++i) { + var error = $root.google.cloud.clouddms.v1.ConstraintEntity.verify(message.constraints[i]); + if (error) + return "constraints." + error; + } + } + return null; + }; + + /** + * Creates a ViewEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ViewEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ViewEntity} ViewEntity + */ + ViewEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ViewEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.ViewEntity(); + if (object.sqlCode != null) + message.sqlCode = String(object.sqlCode); + if (object.customFeatures != null) { + if (typeof object.customFeatures !== "object") + throw TypeError(".google.cloud.clouddms.v1.ViewEntity.customFeatures: object expected"); + message.customFeatures = $root.google.protobuf.Struct.fromObject(object.customFeatures); + } + if (object.constraints) { + if (!Array.isArray(object.constraints)) + throw TypeError(".google.cloud.clouddms.v1.ViewEntity.constraints: array expected"); + message.constraints = []; + for (var i = 0; i < object.constraints.length; ++i) { + if (typeof object.constraints[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.ViewEntity.constraints: object expected"); + message.constraints[i] = $root.google.cloud.clouddms.v1.ConstraintEntity.fromObject(object.constraints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ViewEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ViewEntity + * @static + * @param {google.cloud.clouddms.v1.ViewEntity} message ViewEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ViewEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.constraints = []; + if (options.defaults) { + object.sqlCode = ""; + object.customFeatures = null; + } + if (message.sqlCode != null && message.hasOwnProperty("sqlCode")) + object.sqlCode = message.sqlCode; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) + object.customFeatures = $root.google.protobuf.Struct.toObject(message.customFeatures, options); + if (message.constraints && message.constraints.length) { + object.constraints = []; + for (var j = 0; j < message.constraints.length; ++j) + object.constraints[j] = $root.google.cloud.clouddms.v1.ConstraintEntity.toObject(message.constraints[j], options); + } + return object; + }; + + /** + * Converts this ViewEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ViewEntity + * @instance + * @returns {Object.} JSON object + */ + ViewEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ViewEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ViewEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ViewEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ViewEntity"; + }; + + return ViewEntity; + })(); + + v1.SequenceEntity = (function() { + + /** + * Properties of a SequenceEntity. + * @memberof google.cloud.clouddms.v1 + * @interface ISequenceEntity + * @property {number|Long|null} [increment] SequenceEntity increment + * @property {Uint8Array|null} [startValue] SequenceEntity startValue + * @property {Uint8Array|null} [maxValue] SequenceEntity maxValue + * @property {Uint8Array|null} [minValue] SequenceEntity minValue + * @property {boolean|null} [cycle] SequenceEntity cycle + * @property {number|Long|null} [cache] SequenceEntity cache + * @property {google.protobuf.IStruct|null} [customFeatures] SequenceEntity customFeatures + */ + + /** + * Constructs a new SequenceEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SequenceEntity. + * @implements ISequenceEntity + * @constructor + * @param {google.cloud.clouddms.v1.ISequenceEntity=} [properties] Properties to set + */ + function SequenceEntity(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]]; + } + + /** + * SequenceEntity increment. + * @member {number|Long} increment + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @instance + */ + SequenceEntity.prototype.increment = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SequenceEntity startValue. + * @member {Uint8Array} startValue + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @instance + */ + SequenceEntity.prototype.startValue = $util.newBuffer([]); + + /** + * SequenceEntity maxValue. + * @member {Uint8Array} maxValue + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @instance + */ + SequenceEntity.prototype.maxValue = $util.newBuffer([]); + + /** + * SequenceEntity minValue. + * @member {Uint8Array} minValue + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @instance + */ + SequenceEntity.prototype.minValue = $util.newBuffer([]); + + /** + * SequenceEntity cycle. + * @member {boolean} cycle + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @instance + */ + SequenceEntity.prototype.cycle = false; + + /** + * SequenceEntity cache. + * @member {number|Long} cache + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @instance + */ + SequenceEntity.prototype.cache = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SequenceEntity customFeatures. + * @member {google.protobuf.IStruct|null|undefined} customFeatures + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @instance + */ + SequenceEntity.prototype.customFeatures = null; + + /** + * Creates a new SequenceEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @static + * @param {google.cloud.clouddms.v1.ISequenceEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SequenceEntity} SequenceEntity instance + */ + SequenceEntity.create = function create(properties) { + return new SequenceEntity(properties); + }; + + /** + * Encodes the specified SequenceEntity message. Does not implicitly {@link google.cloud.clouddms.v1.SequenceEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @static + * @param {google.cloud.clouddms.v1.ISequenceEntity} message SequenceEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SequenceEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.increment != null && Object.hasOwnProperty.call(message, "increment")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.increment); + if (message.startValue != null && Object.hasOwnProperty.call(message, "startValue")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.startValue); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.maxValue); + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.minValue); + if (message.cycle != null && Object.hasOwnProperty.call(message, "cycle")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.cycle); + if (message.cache != null && Object.hasOwnProperty.call(message, "cache")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.cache); + if (message.customFeatures != null && Object.hasOwnProperty.call(message, "customFeatures")) + $root.google.protobuf.Struct.encode(message.customFeatures, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SequenceEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SequenceEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @static + * @param {google.cloud.clouddms.v1.ISequenceEntity} message SequenceEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SequenceEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SequenceEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SequenceEntity} SequenceEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SequenceEntity.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.clouddms.v1.SequenceEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.increment = reader.int64(); + break; + } + case 2: { + message.startValue = reader.bytes(); + break; + } + case 3: { + message.maxValue = reader.bytes(); + break; + } + case 4: { + message.minValue = reader.bytes(); + break; + } + case 5: { + message.cycle = reader.bool(); + break; + } + case 6: { + message.cache = reader.int64(); + break; + } + case 7: { + message.customFeatures = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SequenceEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SequenceEntity} SequenceEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SequenceEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SequenceEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SequenceEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.increment != null && message.hasOwnProperty("increment")) + if (!$util.isInteger(message.increment) && !(message.increment && $util.isInteger(message.increment.low) && $util.isInteger(message.increment.high))) + return "increment: integer|Long expected"; + if (message.startValue != null && message.hasOwnProperty("startValue")) + if (!(message.startValue && typeof message.startValue.length === "number" || $util.isString(message.startValue))) + return "startValue: buffer expected"; + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + if (!(message.maxValue && typeof message.maxValue.length === "number" || $util.isString(message.maxValue))) + return "maxValue: buffer expected"; + if (message.minValue != null && message.hasOwnProperty("minValue")) + if (!(message.minValue && typeof message.minValue.length === "number" || $util.isString(message.minValue))) + return "minValue: buffer expected"; + if (message.cycle != null && message.hasOwnProperty("cycle")) + if (typeof message.cycle !== "boolean") + return "cycle: boolean expected"; + if (message.cache != null && message.hasOwnProperty("cache")) + if (!$util.isInteger(message.cache) && !(message.cache && $util.isInteger(message.cache.low) && $util.isInteger(message.cache.high))) + return "cache: integer|Long expected"; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + var error = $root.google.protobuf.Struct.verify(message.customFeatures); + if (error) + return "customFeatures." + error; + } + return null; + }; + + /** + * Creates a SequenceEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SequenceEntity} SequenceEntity + */ + SequenceEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SequenceEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.SequenceEntity(); + if (object.increment != null) + if ($util.Long) + (message.increment = $util.Long.fromValue(object.increment)).unsigned = false; + else if (typeof object.increment === "string") + message.increment = parseInt(object.increment, 10); + else if (typeof object.increment === "number") + message.increment = object.increment; + else if (typeof object.increment === "object") + message.increment = new $util.LongBits(object.increment.low >>> 0, object.increment.high >>> 0).toNumber(); + if (object.startValue != null) + if (typeof object.startValue === "string") + $util.base64.decode(object.startValue, message.startValue = $util.newBuffer($util.base64.length(object.startValue)), 0); + else if (object.startValue.length >= 0) + message.startValue = object.startValue; + if (object.maxValue != null) + if (typeof object.maxValue === "string") + $util.base64.decode(object.maxValue, message.maxValue = $util.newBuffer($util.base64.length(object.maxValue)), 0); + else if (object.maxValue.length >= 0) + message.maxValue = object.maxValue; + if (object.minValue != null) + if (typeof object.minValue === "string") + $util.base64.decode(object.minValue, message.minValue = $util.newBuffer($util.base64.length(object.minValue)), 0); + else if (object.minValue.length >= 0) + message.minValue = object.minValue; + if (object.cycle != null) + message.cycle = Boolean(object.cycle); + if (object.cache != null) + if ($util.Long) + (message.cache = $util.Long.fromValue(object.cache)).unsigned = false; + else if (typeof object.cache === "string") + message.cache = parseInt(object.cache, 10); + else if (typeof object.cache === "number") + message.cache = object.cache; + else if (typeof object.cache === "object") + message.cache = new $util.LongBits(object.cache.low >>> 0, object.cache.high >>> 0).toNumber(); + if (object.customFeatures != null) { + if (typeof object.customFeatures !== "object") + throw TypeError(".google.cloud.clouddms.v1.SequenceEntity.customFeatures: object expected"); + message.customFeatures = $root.google.protobuf.Struct.fromObject(object.customFeatures); + } + return message; + }; + + /** + * Creates a plain object from a SequenceEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @static + * @param {google.cloud.clouddms.v1.SequenceEntity} message SequenceEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SequenceEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.increment = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.increment = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.startValue = ""; + else { + object.startValue = []; + if (options.bytes !== Array) + object.startValue = $util.newBuffer(object.startValue); + } + if (options.bytes === String) + object.maxValue = ""; + else { + object.maxValue = []; + if (options.bytes !== Array) + object.maxValue = $util.newBuffer(object.maxValue); + } + if (options.bytes === String) + object.minValue = ""; + else { + object.minValue = []; + if (options.bytes !== Array) + object.minValue = $util.newBuffer(object.minValue); + } + object.cycle = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.cache = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.cache = options.longs === String ? "0" : 0; + object.customFeatures = null; + } + if (message.increment != null && message.hasOwnProperty("increment")) + if (typeof message.increment === "number") + object.increment = options.longs === String ? String(message.increment) : message.increment; + else + object.increment = options.longs === String ? $util.Long.prototype.toString.call(message.increment) : options.longs === Number ? new $util.LongBits(message.increment.low >>> 0, message.increment.high >>> 0).toNumber() : message.increment; + if (message.startValue != null && message.hasOwnProperty("startValue")) + object.startValue = options.bytes === String ? $util.base64.encode(message.startValue, 0, message.startValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.startValue) : message.startValue; + if (message.maxValue != null && message.hasOwnProperty("maxValue")) + object.maxValue = options.bytes === String ? $util.base64.encode(message.maxValue, 0, message.maxValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.maxValue) : message.maxValue; + if (message.minValue != null && message.hasOwnProperty("minValue")) + object.minValue = options.bytes === String ? $util.base64.encode(message.minValue, 0, message.minValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.minValue) : message.minValue; + if (message.cycle != null && message.hasOwnProperty("cycle")) + object.cycle = message.cycle; + if (message.cache != null && message.hasOwnProperty("cache")) + if (typeof message.cache === "number") + object.cache = options.longs === String ? String(message.cache) : message.cache; + else + object.cache = options.longs === String ? $util.Long.prototype.toString.call(message.cache) : options.longs === Number ? new $util.LongBits(message.cache.low >>> 0, message.cache.high >>> 0).toNumber() : message.cache; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) + object.customFeatures = $root.google.protobuf.Struct.toObject(message.customFeatures, options); + return object; + }; + + /** + * Converts this SequenceEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @instance + * @returns {Object.} JSON object + */ + SequenceEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SequenceEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SequenceEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SequenceEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SequenceEntity"; + }; + + return SequenceEntity; + })(); + + v1.StoredProcedureEntity = (function() { + + /** + * Properties of a StoredProcedureEntity. + * @memberof google.cloud.clouddms.v1 + * @interface IStoredProcedureEntity + * @property {string|null} [sqlCode] StoredProcedureEntity sqlCode + * @property {google.protobuf.IStruct|null} [customFeatures] StoredProcedureEntity customFeatures + */ + + /** + * Constructs a new StoredProcedureEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a StoredProcedureEntity. + * @implements IStoredProcedureEntity + * @constructor + * @param {google.cloud.clouddms.v1.IStoredProcedureEntity=} [properties] Properties to set + */ + function StoredProcedureEntity(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]]; + } + + /** + * StoredProcedureEntity sqlCode. + * @member {string} sqlCode + * @memberof google.cloud.clouddms.v1.StoredProcedureEntity + * @instance + */ + StoredProcedureEntity.prototype.sqlCode = ""; + + /** + * StoredProcedureEntity customFeatures. + * @member {google.protobuf.IStruct|null|undefined} customFeatures + * @memberof google.cloud.clouddms.v1.StoredProcedureEntity + * @instance + */ + StoredProcedureEntity.prototype.customFeatures = null; + + /** + * Creates a new StoredProcedureEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.StoredProcedureEntity + * @static + * @param {google.cloud.clouddms.v1.IStoredProcedureEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.StoredProcedureEntity} StoredProcedureEntity instance + */ + StoredProcedureEntity.create = function create(properties) { + return new StoredProcedureEntity(properties); + }; + + /** + * Encodes the specified StoredProcedureEntity message. Does not implicitly {@link google.cloud.clouddms.v1.StoredProcedureEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.StoredProcedureEntity + * @static + * @param {google.cloud.clouddms.v1.IStoredProcedureEntity} message StoredProcedureEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredProcedureEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sqlCode != null && Object.hasOwnProperty.call(message, "sqlCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sqlCode); + if (message.customFeatures != null && Object.hasOwnProperty.call(message, "customFeatures")) + $root.google.protobuf.Struct.encode(message.customFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StoredProcedureEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StoredProcedureEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.StoredProcedureEntity + * @static + * @param {google.cloud.clouddms.v1.IStoredProcedureEntity} message StoredProcedureEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoredProcedureEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StoredProcedureEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.StoredProcedureEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.StoredProcedureEntity} StoredProcedureEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredProcedureEntity.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.clouddms.v1.StoredProcedureEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sqlCode = reader.string(); + break; + } + case 2: { + message.customFeatures = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StoredProcedureEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.StoredProcedureEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.StoredProcedureEntity} StoredProcedureEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoredProcedureEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StoredProcedureEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.StoredProcedureEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StoredProcedureEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sqlCode != null && message.hasOwnProperty("sqlCode")) + if (!$util.isString(message.sqlCode)) + return "sqlCode: string expected"; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + var error = $root.google.protobuf.Struct.verify(message.customFeatures); + if (error) + return "customFeatures." + error; + } + return null; + }; + + /** + * Creates a StoredProcedureEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.StoredProcedureEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.StoredProcedureEntity} StoredProcedureEntity + */ + StoredProcedureEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.StoredProcedureEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.StoredProcedureEntity(); + if (object.sqlCode != null) + message.sqlCode = String(object.sqlCode); + if (object.customFeatures != null) { + if (typeof object.customFeatures !== "object") + throw TypeError(".google.cloud.clouddms.v1.StoredProcedureEntity.customFeatures: object expected"); + message.customFeatures = $root.google.protobuf.Struct.fromObject(object.customFeatures); + } + return message; + }; + + /** + * Creates a plain object from a StoredProcedureEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.StoredProcedureEntity + * @static + * @param {google.cloud.clouddms.v1.StoredProcedureEntity} message StoredProcedureEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StoredProcedureEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sqlCode = ""; + object.customFeatures = null; + } + if (message.sqlCode != null && message.hasOwnProperty("sqlCode")) + object.sqlCode = message.sqlCode; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) + object.customFeatures = $root.google.protobuf.Struct.toObject(message.customFeatures, options); + return object; + }; + + /** + * Converts this StoredProcedureEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.StoredProcedureEntity + * @instance + * @returns {Object.} JSON object + */ + StoredProcedureEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StoredProcedureEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.StoredProcedureEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StoredProcedureEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.StoredProcedureEntity"; + }; + + return StoredProcedureEntity; + })(); + + v1.FunctionEntity = (function() { + + /** + * Properties of a FunctionEntity. + * @memberof google.cloud.clouddms.v1 + * @interface IFunctionEntity + * @property {string|null} [sqlCode] FunctionEntity sqlCode + * @property {google.protobuf.IStruct|null} [customFeatures] FunctionEntity customFeatures + */ + + /** + * Constructs a new FunctionEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a FunctionEntity. + * @implements IFunctionEntity + * @constructor + * @param {google.cloud.clouddms.v1.IFunctionEntity=} [properties] Properties to set + */ + function FunctionEntity(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]]; + } + + /** + * FunctionEntity sqlCode. + * @member {string} sqlCode + * @memberof google.cloud.clouddms.v1.FunctionEntity + * @instance + */ + FunctionEntity.prototype.sqlCode = ""; + + /** + * FunctionEntity customFeatures. + * @member {google.protobuf.IStruct|null|undefined} customFeatures + * @memberof google.cloud.clouddms.v1.FunctionEntity + * @instance + */ + FunctionEntity.prototype.customFeatures = null; + + /** + * Creates a new FunctionEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.FunctionEntity + * @static + * @param {google.cloud.clouddms.v1.IFunctionEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.FunctionEntity} FunctionEntity instance + */ + FunctionEntity.create = function create(properties) { + return new FunctionEntity(properties); + }; + + /** + * Encodes the specified FunctionEntity message. Does not implicitly {@link google.cloud.clouddms.v1.FunctionEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.FunctionEntity + * @static + * @param {google.cloud.clouddms.v1.IFunctionEntity} message FunctionEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sqlCode != null && Object.hasOwnProperty.call(message, "sqlCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sqlCode); + if (message.customFeatures != null && Object.hasOwnProperty.call(message, "customFeatures")) + $root.google.protobuf.Struct.encode(message.customFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunctionEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.FunctionEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.FunctionEntity + * @static + * @param {google.cloud.clouddms.v1.IFunctionEntity} message FunctionEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunctionEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.FunctionEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.FunctionEntity} FunctionEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionEntity.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.clouddms.v1.FunctionEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sqlCode = reader.string(); + break; + } + case 2: { + message.customFeatures = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunctionEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.FunctionEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.FunctionEntity} FunctionEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunctionEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.FunctionEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunctionEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sqlCode != null && message.hasOwnProperty("sqlCode")) + if (!$util.isString(message.sqlCode)) + return "sqlCode: string expected"; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + var error = $root.google.protobuf.Struct.verify(message.customFeatures); + if (error) + return "customFeatures." + error; + } + return null; + }; + + /** + * Creates a FunctionEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.FunctionEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.FunctionEntity} FunctionEntity + */ + FunctionEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.FunctionEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.FunctionEntity(); + if (object.sqlCode != null) + message.sqlCode = String(object.sqlCode); + if (object.customFeatures != null) { + if (typeof object.customFeatures !== "object") + throw TypeError(".google.cloud.clouddms.v1.FunctionEntity.customFeatures: object expected"); + message.customFeatures = $root.google.protobuf.Struct.fromObject(object.customFeatures); + } + return message; + }; + + /** + * Creates a plain object from a FunctionEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.FunctionEntity + * @static + * @param {google.cloud.clouddms.v1.FunctionEntity} message FunctionEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunctionEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sqlCode = ""; + object.customFeatures = null; + } + if (message.sqlCode != null && message.hasOwnProperty("sqlCode")) + object.sqlCode = message.sqlCode; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) + object.customFeatures = $root.google.protobuf.Struct.toObject(message.customFeatures, options); + return object; + }; + + /** + * Converts this FunctionEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.FunctionEntity + * @instance + * @returns {Object.} JSON object + */ + FunctionEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunctionEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.FunctionEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunctionEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.FunctionEntity"; + }; + + return FunctionEntity; + })(); + + v1.SynonymEntity = (function() { + + /** + * Properties of a SynonymEntity. + * @memberof google.cloud.clouddms.v1 + * @interface ISynonymEntity + * @property {string|null} [sourceEntity] SynonymEntity sourceEntity + * @property {google.cloud.clouddms.v1.DatabaseEntityType|null} [sourceType] SynonymEntity sourceType + * @property {google.protobuf.IStruct|null} [customFeatures] SynonymEntity customFeatures + */ + + /** + * Constructs a new SynonymEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SynonymEntity. + * @implements ISynonymEntity + * @constructor + * @param {google.cloud.clouddms.v1.ISynonymEntity=} [properties] Properties to set + */ + function SynonymEntity(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]]; + } + + /** + * SynonymEntity sourceEntity. + * @member {string} sourceEntity + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @instance + */ + SynonymEntity.prototype.sourceEntity = ""; + + /** + * SynonymEntity sourceType. + * @member {google.cloud.clouddms.v1.DatabaseEntityType} sourceType + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @instance + */ + SynonymEntity.prototype.sourceType = 0; + + /** + * SynonymEntity customFeatures. + * @member {google.protobuf.IStruct|null|undefined} customFeatures + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @instance + */ + SynonymEntity.prototype.customFeatures = null; + + /** + * Creates a new SynonymEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @static + * @param {google.cloud.clouddms.v1.ISynonymEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SynonymEntity} SynonymEntity instance + */ + SynonymEntity.create = function create(properties) { + return new SynonymEntity(properties); + }; + + /** + * Encodes the specified SynonymEntity message. Does not implicitly {@link google.cloud.clouddms.v1.SynonymEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @static + * @param {google.cloud.clouddms.v1.ISynonymEntity} message SynonymEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynonymEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceEntity != null && Object.hasOwnProperty.call(message, "sourceEntity")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceEntity); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sourceType); + if (message.customFeatures != null && Object.hasOwnProperty.call(message, "customFeatures")) + $root.google.protobuf.Struct.encode(message.customFeatures, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SynonymEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SynonymEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @static + * @param {google.cloud.clouddms.v1.ISynonymEntity} message SynonymEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynonymEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SynonymEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SynonymEntity} SynonymEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynonymEntity.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.clouddms.v1.SynonymEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceEntity = reader.string(); + break; + } + case 2: { + message.sourceType = reader.int32(); + break; + } + case 3: { + message.customFeatures = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SynonymEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SynonymEntity} SynonymEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynonymEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SynonymEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SynonymEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceEntity != null && message.hasOwnProperty("sourceEntity")) + if (!$util.isString(message.sourceEntity)) + return "sourceEntity: string expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + var error = $root.google.protobuf.Struct.verify(message.customFeatures); + if (error) + return "customFeatures." + error; + } + return null; + }; + + /** + * Creates a SynonymEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SynonymEntity} SynonymEntity + */ + SynonymEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SynonymEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.SynonymEntity(); + if (object.sourceEntity != null) + message.sourceEntity = String(object.sourceEntity); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "DATABASE_ENTITY_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "DATABASE_ENTITY_TYPE_SCHEMA": + case 1: + message.sourceType = 1; + break; + case "DATABASE_ENTITY_TYPE_TABLE": + case 2: + message.sourceType = 2; + break; + case "DATABASE_ENTITY_TYPE_COLUMN": + case 3: + message.sourceType = 3; + break; + case "DATABASE_ENTITY_TYPE_CONSTRAINT": + case 4: + message.sourceType = 4; + break; + case "DATABASE_ENTITY_TYPE_INDEX": + case 5: + message.sourceType = 5; + break; + case "DATABASE_ENTITY_TYPE_TRIGGER": + case 6: + message.sourceType = 6; + break; + case "DATABASE_ENTITY_TYPE_VIEW": + case 7: + message.sourceType = 7; + break; + case "DATABASE_ENTITY_TYPE_SEQUENCE": + case 8: + message.sourceType = 8; + break; + case "DATABASE_ENTITY_TYPE_STORED_PROCEDURE": + case 9: + message.sourceType = 9; + break; + case "DATABASE_ENTITY_TYPE_FUNCTION": + case 10: + message.sourceType = 10; + break; + case "DATABASE_ENTITY_TYPE_SYNONYM": + case 11: + message.sourceType = 11; + break; + case "DATABASE_ENTITY_TYPE_DATABASE_PACKAGE": + case 12: + message.sourceType = 12; + break; + case "DATABASE_ENTITY_TYPE_UDT": + case 13: + message.sourceType = 13; + break; + case "DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW": + case 14: + message.sourceType = 14; + break; + case "DATABASE_ENTITY_TYPE_DATABASE": + case 15: + message.sourceType = 15; + break; + } + if (object.customFeatures != null) { + if (typeof object.customFeatures !== "object") + throw TypeError(".google.cloud.clouddms.v1.SynonymEntity.customFeatures: object expected"); + message.customFeatures = $root.google.protobuf.Struct.fromObject(object.customFeatures); + } + return message; + }; + + /** + * Creates a plain object from a SynonymEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @static + * @param {google.cloud.clouddms.v1.SynonymEntity} message SynonymEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SynonymEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceEntity = ""; + object.sourceType = options.enums === String ? "DATABASE_ENTITY_TYPE_UNSPECIFIED" : 0; + object.customFeatures = null; + } + if (message.sourceEntity != null && message.hasOwnProperty("sourceEntity")) + object.sourceEntity = message.sourceEntity; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseEntityType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.clouddms.v1.DatabaseEntityType[message.sourceType] : message.sourceType; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) + object.customFeatures = $root.google.protobuf.Struct.toObject(message.customFeatures, options); + return object; + }; + + /** + * Converts this SynonymEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @instance + * @returns {Object.} JSON object + */ + SynonymEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SynonymEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SynonymEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SynonymEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SynonymEntity"; + }; + + return SynonymEntity; + })(); + + v1.PackageEntity = (function() { + + /** + * Properties of a PackageEntity. + * @memberof google.cloud.clouddms.v1 + * @interface IPackageEntity + * @property {string|null} [packageSqlCode] PackageEntity packageSqlCode + * @property {string|null} [packageBody] PackageEntity packageBody + * @property {google.protobuf.IStruct|null} [customFeatures] PackageEntity customFeatures + */ + + /** + * Constructs a new PackageEntity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a PackageEntity. + * @implements IPackageEntity + * @constructor + * @param {google.cloud.clouddms.v1.IPackageEntity=} [properties] Properties to set + */ + function PackageEntity(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]]; + } + + /** + * PackageEntity packageSqlCode. + * @member {string} packageSqlCode + * @memberof google.cloud.clouddms.v1.PackageEntity + * @instance + */ + PackageEntity.prototype.packageSqlCode = ""; + + /** + * PackageEntity packageBody. + * @member {string} packageBody + * @memberof google.cloud.clouddms.v1.PackageEntity + * @instance + */ + PackageEntity.prototype.packageBody = ""; + + /** + * PackageEntity customFeatures. + * @member {google.protobuf.IStruct|null|undefined} customFeatures + * @memberof google.cloud.clouddms.v1.PackageEntity + * @instance + */ + PackageEntity.prototype.customFeatures = null; + + /** + * Creates a new PackageEntity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.PackageEntity + * @static + * @param {google.cloud.clouddms.v1.IPackageEntity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.PackageEntity} PackageEntity instance + */ + PackageEntity.create = function create(properties) { + return new PackageEntity(properties); + }; + + /** + * Encodes the specified PackageEntity message. Does not implicitly {@link google.cloud.clouddms.v1.PackageEntity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.PackageEntity + * @static + * @param {google.cloud.clouddms.v1.IPackageEntity} message PackageEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PackageEntity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packageSqlCode != null && Object.hasOwnProperty.call(message, "packageSqlCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.packageSqlCode); + if (message.packageBody != null && Object.hasOwnProperty.call(message, "packageBody")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.packageBody); + if (message.customFeatures != null && Object.hasOwnProperty.call(message, "customFeatures")) + $root.google.protobuf.Struct.encode(message.customFeatures, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PackageEntity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PackageEntity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.PackageEntity + * @static + * @param {google.cloud.clouddms.v1.IPackageEntity} message PackageEntity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PackageEntity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PackageEntity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.PackageEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.PackageEntity} PackageEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PackageEntity.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.clouddms.v1.PackageEntity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.packageSqlCode = reader.string(); + break; + } + case 2: { + message.packageBody = reader.string(); + break; + } + case 3: { + message.customFeatures = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PackageEntity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.PackageEntity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.PackageEntity} PackageEntity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PackageEntity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PackageEntity message. + * @function verify + * @memberof google.cloud.clouddms.v1.PackageEntity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PackageEntity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packageSqlCode != null && message.hasOwnProperty("packageSqlCode")) + if (!$util.isString(message.packageSqlCode)) + return "packageSqlCode: string expected"; + if (message.packageBody != null && message.hasOwnProperty("packageBody")) + if (!$util.isString(message.packageBody)) + return "packageBody: string expected"; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + var error = $root.google.protobuf.Struct.verify(message.customFeatures); + if (error) + return "customFeatures." + error; + } + return null; + }; + + /** + * Creates a PackageEntity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.PackageEntity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.PackageEntity} PackageEntity + */ + PackageEntity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.PackageEntity) + return object; + var message = new $root.google.cloud.clouddms.v1.PackageEntity(); + if (object.packageSqlCode != null) + message.packageSqlCode = String(object.packageSqlCode); + if (object.packageBody != null) + message.packageBody = String(object.packageBody); + if (object.customFeatures != null) { + if (typeof object.customFeatures !== "object") + throw TypeError(".google.cloud.clouddms.v1.PackageEntity.customFeatures: object expected"); + message.customFeatures = $root.google.protobuf.Struct.fromObject(object.customFeatures); + } + return message; + }; + + /** + * Creates a plain object from a PackageEntity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.PackageEntity + * @static + * @param {google.cloud.clouddms.v1.PackageEntity} message PackageEntity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PackageEntity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.packageSqlCode = ""; + object.packageBody = ""; + object.customFeatures = null; + } + if (message.packageSqlCode != null && message.hasOwnProperty("packageSqlCode")) + object.packageSqlCode = message.packageSqlCode; + if (message.packageBody != null && message.hasOwnProperty("packageBody")) + object.packageBody = message.packageBody; + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) + object.customFeatures = $root.google.protobuf.Struct.toObject(message.customFeatures, options); + return object; + }; + + /** + * Converts this PackageEntity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.PackageEntity + * @instance + * @returns {Object.} JSON object + */ + PackageEntity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PackageEntity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.PackageEntity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PackageEntity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.PackageEntity"; + }; + + return PackageEntity; + })(); + + v1.EntityMapping = (function() { + + /** + * Properties of an EntityMapping. + * @memberof google.cloud.clouddms.v1 + * @interface IEntityMapping + * @property {string|null} [sourceEntity] EntityMapping sourceEntity + * @property {string|null} [draftEntity] EntityMapping draftEntity + * @property {google.cloud.clouddms.v1.DatabaseEntityType|null} [sourceType] EntityMapping sourceType + * @property {google.cloud.clouddms.v1.DatabaseEntityType|null} [draftType] EntityMapping draftType + * @property {Array.|null} [mappingLog] EntityMapping mappingLog + */ + + /** + * Constructs a new EntityMapping. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents an EntityMapping. + * @implements IEntityMapping + * @constructor + * @param {google.cloud.clouddms.v1.IEntityMapping=} [properties] Properties to set + */ + function EntityMapping(properties) { + this.mappingLog = []; + 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]]; + } + + /** + * EntityMapping sourceEntity. + * @member {string} sourceEntity + * @memberof google.cloud.clouddms.v1.EntityMapping + * @instance + */ + EntityMapping.prototype.sourceEntity = ""; + + /** + * EntityMapping draftEntity. + * @member {string} draftEntity + * @memberof google.cloud.clouddms.v1.EntityMapping + * @instance + */ + EntityMapping.prototype.draftEntity = ""; + + /** + * EntityMapping sourceType. + * @member {google.cloud.clouddms.v1.DatabaseEntityType} sourceType + * @memberof google.cloud.clouddms.v1.EntityMapping + * @instance + */ + EntityMapping.prototype.sourceType = 0; + + /** + * EntityMapping draftType. + * @member {google.cloud.clouddms.v1.DatabaseEntityType} draftType + * @memberof google.cloud.clouddms.v1.EntityMapping + * @instance + */ + EntityMapping.prototype.draftType = 0; + + /** + * EntityMapping mappingLog. + * @member {Array.} mappingLog + * @memberof google.cloud.clouddms.v1.EntityMapping + * @instance + */ + EntityMapping.prototype.mappingLog = $util.emptyArray; + + /** + * Creates a new EntityMapping instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.EntityMapping + * @static + * @param {google.cloud.clouddms.v1.IEntityMapping=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.EntityMapping} EntityMapping instance + */ + EntityMapping.create = function create(properties) { + return new EntityMapping(properties); + }; + + /** + * Encodes the specified EntityMapping message. Does not implicitly {@link google.cloud.clouddms.v1.EntityMapping.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.EntityMapping + * @static + * @param {google.cloud.clouddms.v1.IEntityMapping} message EntityMapping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityMapping.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceEntity != null && Object.hasOwnProperty.call(message, "sourceEntity")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceEntity); + if (message.draftEntity != null && Object.hasOwnProperty.call(message, "draftEntity")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.draftEntity); + if (message.mappingLog != null && message.mappingLog.length) + for (var i = 0; i < message.mappingLog.length; ++i) + $root.google.cloud.clouddms.v1.EntityMappingLogEntry.encode(message.mappingLog[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.sourceType); + if (message.draftType != null && Object.hasOwnProperty.call(message, "draftType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.draftType); + return writer; + }; + + /** + * Encodes the specified EntityMapping message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.EntityMapping.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.EntityMapping + * @static + * @param {google.cloud.clouddms.v1.IEntityMapping} message EntityMapping message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityMapping.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityMapping message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.EntityMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.EntityMapping} EntityMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityMapping.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.clouddms.v1.EntityMapping(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceEntity = reader.string(); + break; + } + case 2: { + message.draftEntity = reader.string(); + break; + } + case 4: { + message.sourceType = reader.int32(); + break; + } + case 5: { + message.draftType = reader.int32(); + break; + } + case 3: { + if (!(message.mappingLog && message.mappingLog.length)) + message.mappingLog = []; + message.mappingLog.push($root.google.cloud.clouddms.v1.EntityMappingLogEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityMapping message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.EntityMapping + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.EntityMapping} EntityMapping + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityMapping.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityMapping message. + * @function verify + * @memberof google.cloud.clouddms.v1.EntityMapping + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityMapping.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceEntity != null && message.hasOwnProperty("sourceEntity")) + if (!$util.isString(message.sourceEntity)) + return "sourceEntity: string expected"; + if (message.draftEntity != null && message.hasOwnProperty("draftEntity")) + if (!$util.isString(message.draftEntity)) + return "draftEntity: string expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.draftType != null && message.hasOwnProperty("draftType")) + switch (message.draftType) { + default: + return "draftType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.mappingLog != null && message.hasOwnProperty("mappingLog")) { + if (!Array.isArray(message.mappingLog)) + return "mappingLog: array expected"; + for (var i = 0; i < message.mappingLog.length; ++i) { + var error = $root.google.cloud.clouddms.v1.EntityMappingLogEntry.verify(message.mappingLog[i]); + if (error) + return "mappingLog." + error; + } + } + return null; + }; + + /** + * Creates an EntityMapping message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.EntityMapping + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.EntityMapping} EntityMapping + */ + EntityMapping.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.EntityMapping) + return object; + var message = new $root.google.cloud.clouddms.v1.EntityMapping(); + if (object.sourceEntity != null) + message.sourceEntity = String(object.sourceEntity); + if (object.draftEntity != null) + message.draftEntity = String(object.draftEntity); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "DATABASE_ENTITY_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "DATABASE_ENTITY_TYPE_SCHEMA": + case 1: + message.sourceType = 1; + break; + case "DATABASE_ENTITY_TYPE_TABLE": + case 2: + message.sourceType = 2; + break; + case "DATABASE_ENTITY_TYPE_COLUMN": + case 3: + message.sourceType = 3; + break; + case "DATABASE_ENTITY_TYPE_CONSTRAINT": + case 4: + message.sourceType = 4; + break; + case "DATABASE_ENTITY_TYPE_INDEX": + case 5: + message.sourceType = 5; + break; + case "DATABASE_ENTITY_TYPE_TRIGGER": + case 6: + message.sourceType = 6; + break; + case "DATABASE_ENTITY_TYPE_VIEW": + case 7: + message.sourceType = 7; + break; + case "DATABASE_ENTITY_TYPE_SEQUENCE": + case 8: + message.sourceType = 8; + break; + case "DATABASE_ENTITY_TYPE_STORED_PROCEDURE": + case 9: + message.sourceType = 9; + break; + case "DATABASE_ENTITY_TYPE_FUNCTION": + case 10: + message.sourceType = 10; + break; + case "DATABASE_ENTITY_TYPE_SYNONYM": + case 11: + message.sourceType = 11; + break; + case "DATABASE_ENTITY_TYPE_DATABASE_PACKAGE": + case 12: + message.sourceType = 12; + break; + case "DATABASE_ENTITY_TYPE_UDT": + case 13: + message.sourceType = 13; + break; + case "DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW": + case 14: + message.sourceType = 14; + break; + case "DATABASE_ENTITY_TYPE_DATABASE": + case 15: + message.sourceType = 15; + break; + } + switch (object.draftType) { + default: + if (typeof object.draftType === "number") { + message.draftType = object.draftType; + break; + } + break; + case "DATABASE_ENTITY_TYPE_UNSPECIFIED": + case 0: + message.draftType = 0; + break; + case "DATABASE_ENTITY_TYPE_SCHEMA": + case 1: + message.draftType = 1; + break; + case "DATABASE_ENTITY_TYPE_TABLE": + case 2: + message.draftType = 2; + break; + case "DATABASE_ENTITY_TYPE_COLUMN": + case 3: + message.draftType = 3; + break; + case "DATABASE_ENTITY_TYPE_CONSTRAINT": + case 4: + message.draftType = 4; + break; + case "DATABASE_ENTITY_TYPE_INDEX": + case 5: + message.draftType = 5; + break; + case "DATABASE_ENTITY_TYPE_TRIGGER": + case 6: + message.draftType = 6; + break; + case "DATABASE_ENTITY_TYPE_VIEW": + case 7: + message.draftType = 7; + break; + case "DATABASE_ENTITY_TYPE_SEQUENCE": + case 8: + message.draftType = 8; + break; + case "DATABASE_ENTITY_TYPE_STORED_PROCEDURE": + case 9: + message.draftType = 9; + break; + case "DATABASE_ENTITY_TYPE_FUNCTION": + case 10: + message.draftType = 10; + break; + case "DATABASE_ENTITY_TYPE_SYNONYM": + case 11: + message.draftType = 11; + break; + case "DATABASE_ENTITY_TYPE_DATABASE_PACKAGE": + case 12: + message.draftType = 12; + break; + case "DATABASE_ENTITY_TYPE_UDT": + case 13: + message.draftType = 13; + break; + case "DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW": + case 14: + message.draftType = 14; + break; + case "DATABASE_ENTITY_TYPE_DATABASE": + case 15: + message.draftType = 15; + break; + } + if (object.mappingLog) { + if (!Array.isArray(object.mappingLog)) + throw TypeError(".google.cloud.clouddms.v1.EntityMapping.mappingLog: array expected"); + message.mappingLog = []; + for (var i = 0; i < object.mappingLog.length; ++i) { + if (typeof object.mappingLog[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.EntityMapping.mappingLog: object expected"); + message.mappingLog[i] = $root.google.cloud.clouddms.v1.EntityMappingLogEntry.fromObject(object.mappingLog[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EntityMapping message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.EntityMapping + * @static + * @param {google.cloud.clouddms.v1.EntityMapping} message EntityMapping + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityMapping.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mappingLog = []; + if (options.defaults) { + object.sourceEntity = ""; + object.draftEntity = ""; + object.sourceType = options.enums === String ? "DATABASE_ENTITY_TYPE_UNSPECIFIED" : 0; + object.draftType = options.enums === String ? "DATABASE_ENTITY_TYPE_UNSPECIFIED" : 0; + } + if (message.sourceEntity != null && message.hasOwnProperty("sourceEntity")) + object.sourceEntity = message.sourceEntity; + if (message.draftEntity != null && message.hasOwnProperty("draftEntity")) + object.draftEntity = message.draftEntity; + if (message.mappingLog && message.mappingLog.length) { + object.mappingLog = []; + for (var j = 0; j < message.mappingLog.length; ++j) + object.mappingLog[j] = $root.google.cloud.clouddms.v1.EntityMappingLogEntry.toObject(message.mappingLog[j], options); + } + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseEntityType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.clouddms.v1.DatabaseEntityType[message.sourceType] : message.sourceType; + if (message.draftType != null && message.hasOwnProperty("draftType")) + object.draftType = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseEntityType[message.draftType] === undefined ? message.draftType : $root.google.cloud.clouddms.v1.DatabaseEntityType[message.draftType] : message.draftType; + return object; + }; + + /** + * Converts this EntityMapping to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.EntityMapping + * @instance + * @returns {Object.} JSON object + */ + EntityMapping.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityMapping + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.EntityMapping + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityMapping.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.EntityMapping"; + }; + + return EntityMapping; + })(); + + v1.EntityMappingLogEntry = (function() { + + /** + * Properties of an EntityMappingLogEntry. + * @memberof google.cloud.clouddms.v1 + * @interface IEntityMappingLogEntry + * @property {string|null} [ruleId] EntityMappingLogEntry ruleId + * @property {string|null} [ruleRevisionId] EntityMappingLogEntry ruleRevisionId + * @property {string|null} [mappingComment] EntityMappingLogEntry mappingComment + */ + + /** + * Constructs a new EntityMappingLogEntry. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents an EntityMappingLogEntry. + * @implements IEntityMappingLogEntry + * @constructor + * @param {google.cloud.clouddms.v1.IEntityMappingLogEntry=} [properties] Properties to set + */ + function EntityMappingLogEntry(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]]; + } + + /** + * EntityMappingLogEntry ruleId. + * @member {string} ruleId + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @instance + */ + EntityMappingLogEntry.prototype.ruleId = ""; + + /** + * EntityMappingLogEntry ruleRevisionId. + * @member {string} ruleRevisionId + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @instance + */ + EntityMappingLogEntry.prototype.ruleRevisionId = ""; + + /** + * EntityMappingLogEntry mappingComment. + * @member {string} mappingComment + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @instance + */ + EntityMappingLogEntry.prototype.mappingComment = ""; + + /** + * Creates a new EntityMappingLogEntry instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @static + * @param {google.cloud.clouddms.v1.IEntityMappingLogEntry=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.EntityMappingLogEntry} EntityMappingLogEntry instance + */ + EntityMappingLogEntry.create = function create(properties) { + return new EntityMappingLogEntry(properties); + }; + + /** + * Encodes the specified EntityMappingLogEntry message. Does not implicitly {@link google.cloud.clouddms.v1.EntityMappingLogEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @static + * @param {google.cloud.clouddms.v1.IEntityMappingLogEntry} message EntityMappingLogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityMappingLogEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleId); + if (message.ruleRevisionId != null && Object.hasOwnProperty.call(message, "ruleRevisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ruleRevisionId); + if (message.mappingComment != null && Object.hasOwnProperty.call(message, "mappingComment")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mappingComment); + return writer; + }; + + /** + * Encodes the specified EntityMappingLogEntry message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.EntityMappingLogEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @static + * @param {google.cloud.clouddms.v1.IEntityMappingLogEntry} message EntityMappingLogEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityMappingLogEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityMappingLogEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.EntityMappingLogEntry} EntityMappingLogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityMappingLogEntry.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.clouddms.v1.EntityMappingLogEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ruleId = reader.string(); + break; + } + case 2: { + message.ruleRevisionId = reader.string(); + break; + } + case 3: { + message.mappingComment = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityMappingLogEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.EntityMappingLogEntry} EntityMappingLogEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityMappingLogEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityMappingLogEntry message. + * @function verify + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityMappingLogEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.ruleRevisionId != null && message.hasOwnProperty("ruleRevisionId")) + if (!$util.isString(message.ruleRevisionId)) + return "ruleRevisionId: string expected"; + if (message.mappingComment != null && message.hasOwnProperty("mappingComment")) + if (!$util.isString(message.mappingComment)) + return "mappingComment: string expected"; + return null; + }; + + /** + * Creates an EntityMappingLogEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.EntityMappingLogEntry} EntityMappingLogEntry + */ + EntityMappingLogEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.EntityMappingLogEntry) + return object; + var message = new $root.google.cloud.clouddms.v1.EntityMappingLogEntry(); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + if (object.ruleRevisionId != null) + message.ruleRevisionId = String(object.ruleRevisionId); + if (object.mappingComment != null) + message.mappingComment = String(object.mappingComment); + return message; + }; + + /** + * Creates a plain object from an EntityMappingLogEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @static + * @param {google.cloud.clouddms.v1.EntityMappingLogEntry} message EntityMappingLogEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityMappingLogEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ruleId = ""; + object.ruleRevisionId = ""; + object.mappingComment = ""; + } + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.ruleRevisionId != null && message.hasOwnProperty("ruleRevisionId")) + object.ruleRevisionId = message.ruleRevisionId; + if (message.mappingComment != null && message.hasOwnProperty("mappingComment")) + object.mappingComment = message.mappingComment; + return object; + }; + + /** + * Converts this EntityMappingLogEntry to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @instance + * @returns {Object.} JSON object + */ + EntityMappingLogEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityMappingLogEntry + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.EntityMappingLogEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityMappingLogEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.EntityMappingLogEntry"; + }; + + return EntityMappingLogEntry; + })(); + + /** + * DatabaseEntityType enum. + * @name google.cloud.clouddms.v1.DatabaseEntityType + * @enum {number} + * @property {number} DATABASE_ENTITY_TYPE_UNSPECIFIED=0 DATABASE_ENTITY_TYPE_UNSPECIFIED value + * @property {number} DATABASE_ENTITY_TYPE_SCHEMA=1 DATABASE_ENTITY_TYPE_SCHEMA value + * @property {number} DATABASE_ENTITY_TYPE_TABLE=2 DATABASE_ENTITY_TYPE_TABLE value + * @property {number} DATABASE_ENTITY_TYPE_COLUMN=3 DATABASE_ENTITY_TYPE_COLUMN value + * @property {number} DATABASE_ENTITY_TYPE_CONSTRAINT=4 DATABASE_ENTITY_TYPE_CONSTRAINT value + * @property {number} DATABASE_ENTITY_TYPE_INDEX=5 DATABASE_ENTITY_TYPE_INDEX value + * @property {number} DATABASE_ENTITY_TYPE_TRIGGER=6 DATABASE_ENTITY_TYPE_TRIGGER value + * @property {number} DATABASE_ENTITY_TYPE_VIEW=7 DATABASE_ENTITY_TYPE_VIEW value + * @property {number} DATABASE_ENTITY_TYPE_SEQUENCE=8 DATABASE_ENTITY_TYPE_SEQUENCE value + * @property {number} DATABASE_ENTITY_TYPE_STORED_PROCEDURE=9 DATABASE_ENTITY_TYPE_STORED_PROCEDURE value + * @property {number} DATABASE_ENTITY_TYPE_FUNCTION=10 DATABASE_ENTITY_TYPE_FUNCTION value + * @property {number} DATABASE_ENTITY_TYPE_SYNONYM=11 DATABASE_ENTITY_TYPE_SYNONYM value + * @property {number} DATABASE_ENTITY_TYPE_DATABASE_PACKAGE=12 DATABASE_ENTITY_TYPE_DATABASE_PACKAGE value + * @property {number} DATABASE_ENTITY_TYPE_UDT=13 DATABASE_ENTITY_TYPE_UDT value + * @property {number} DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW=14 DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW value + * @property {number} DATABASE_ENTITY_TYPE_DATABASE=15 DATABASE_ENTITY_TYPE_DATABASE value + */ + v1.DatabaseEntityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_ENTITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DATABASE_ENTITY_TYPE_SCHEMA"] = 1; + values[valuesById[2] = "DATABASE_ENTITY_TYPE_TABLE"] = 2; + values[valuesById[3] = "DATABASE_ENTITY_TYPE_COLUMN"] = 3; + values[valuesById[4] = "DATABASE_ENTITY_TYPE_CONSTRAINT"] = 4; + values[valuesById[5] = "DATABASE_ENTITY_TYPE_INDEX"] = 5; + values[valuesById[6] = "DATABASE_ENTITY_TYPE_TRIGGER"] = 6; + values[valuesById[7] = "DATABASE_ENTITY_TYPE_VIEW"] = 7; + values[valuesById[8] = "DATABASE_ENTITY_TYPE_SEQUENCE"] = 8; + values[valuesById[9] = "DATABASE_ENTITY_TYPE_STORED_PROCEDURE"] = 9; + values[valuesById[10] = "DATABASE_ENTITY_TYPE_FUNCTION"] = 10; + values[valuesById[11] = "DATABASE_ENTITY_TYPE_SYNONYM"] = 11; + values[valuesById[12] = "DATABASE_ENTITY_TYPE_DATABASE_PACKAGE"] = 12; + values[valuesById[13] = "DATABASE_ENTITY_TYPE_UDT"] = 13; + values[valuesById[14] = "DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW"] = 14; + values[valuesById[15] = "DATABASE_ENTITY_TYPE_DATABASE"] = 15; + return values; + })(); + + /** + * BackgroundJobType enum. + * @name google.cloud.clouddms.v1.BackgroundJobType + * @enum {number} + * @property {number} BACKGROUND_JOB_TYPE_UNSPECIFIED=0 BACKGROUND_JOB_TYPE_UNSPECIFIED value + * @property {number} BACKGROUND_JOB_TYPE_SOURCE_SEED=1 BACKGROUND_JOB_TYPE_SOURCE_SEED value + * @property {number} BACKGROUND_JOB_TYPE_CONVERT=2 BACKGROUND_JOB_TYPE_CONVERT value + * @property {number} BACKGROUND_JOB_TYPE_APPLY_DESTINATION=3 BACKGROUND_JOB_TYPE_APPLY_DESTINATION value + * @property {number} BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE=5 BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE value + */ + v1.BackgroundJobType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKGROUND_JOB_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKGROUND_JOB_TYPE_SOURCE_SEED"] = 1; + values[valuesById[2] = "BACKGROUND_JOB_TYPE_CONVERT"] = 2; + values[valuesById[3] = "BACKGROUND_JOB_TYPE_APPLY_DESTINATION"] = 3; + values[valuesById[5] = "BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE"] = 5; + return values; + })(); + + /** + * ImportRulesFileFormat enum. + * @name google.cloud.clouddms.v1.ImportRulesFileFormat + * @enum {number} + * @property {number} IMPORT_RULES_FILE_FORMAT_UNSPECIFIED=0 IMPORT_RULES_FILE_FORMAT_UNSPECIFIED value + * @property {number} IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE=1 IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE value + * @property {number} IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE=2 IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE value + */ + v1.ImportRulesFileFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE"] = 1; + values[valuesById[2] = "IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE"] = 2; + return values; + })(); + + return v1; + })(); + + return clouddms; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { message.responseBody = reader.string(); break; } @@ -20302,11 +40433,263 @@ message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } @@ -20314,26 +40697,22 @@ }; /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumOptions.toObject = function toObject(message, options) { + EnumValueOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; + if (options.defaults) object.deprecated = false; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { @@ -20345,53 +40724,55 @@ }; /** - * Converts this EnumOptions to JSON. + * Converts this EnumValueOptions to JSON. * @function toJSON - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @instance * @returns {Object.} JSON object */ - EnumOptions.prototype.toJSON = function toJSON() { + EnumValueOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumOptions + * Gets the default type url for EnumValueOptions * @function getTypeUrl - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.EnumValueOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; }; - return EnumOptions; + return EnumValueOptions; })(); - protobuf.EnumValueOptions = (function() { + protobuf.ServiceOptions = (function() { /** - * Properties of an EnumValueOptions. + * Properties of a ServiceOptions. * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes */ /** - * Constructs a new EnumValueOptions. + * Constructs a new ServiceOptions. * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ - function EnumValueOptions(properties) { + function ServiceOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -20400,85 +40781,105 @@ } /** - * EnumValueOptions deprecated. + * ServiceOptions deprecated. * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumValueOptions.prototype.deprecated = false; + ServiceOptions.prototype.deprecated = false; /** - * EnumValueOptions uninterpretedOption. + * ServiceOptions uninterpretedOption. * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new EnumValueOptions instance using the specified properties. + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. * @function create - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); }; /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encode = function encode(message, writer) { + ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer. + * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnumValueOptions.decode = function decode(reader, length) { + ServiceOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { + case 33: { message.deprecated = reader.bool(); break; } @@ -20488,6 +40889,14 @@ message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -20497,30 +40906,30 @@ }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.ServiceOptions} ServiceOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueOptions message. + * Verifies a ServiceOptions message. * @function verify - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EnumValueOptions.verify = function verify(message) { + ServiceOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) @@ -20535,53 +40944,66 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; return null; }; /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.ServiceOptions} ServiceOptions */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) return object; - var message = new $root.google.protobuf.EnumValueOptions(); + var message = new $root.google.protobuf.ServiceOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); return message; }; /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueOptions.toObject = function toObject(message, options) { + ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; - if (options.defaults) + if (options.defaults) { object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.uninterpretedOption && message.uninterpretedOption.length) { @@ -20589,60 +41011,67 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; return object; }; /** - * Converts this EnumValueOptions to JSON. + * Converts this ServiceOptions to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ - EnumValueOptions.prototype.toJSON = function toJSON() { + ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumValueOptions + * Gets the default type url for ServiceOptions * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; }; - return EnumValueOptions; + return ServiceOptions; })(); - protobuf.ServiceOptions = (function() { + protobuf.MethodOptions = (function() { /** - * Properties of a ServiceOptions. + * Properties of a MethodOptions. * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo */ /** - * Constructs a new ServiceOptions. + * Constructs a new MethodOptions. * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ - function ServiceOptions(properties) { + function MethodOptions(properties) { this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20650,101 +41079,122 @@ } /** - * ServiceOptions deprecated. + * MethodOptions deprecated. * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions * @instance */ - ServiceOptions.prototype.deprecated = false; + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions * @instance */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + MethodOptions.prototype[".google.api.http"] = null; /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions * @instance */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions * @instance */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; /** - * Creates a new ServiceOptions instance using the specified properties. + * Creates a new MethodOptions instance using the specified properties. * @function create - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); }; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encode = function encode(message, writer) { + MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * Decodes a MethodOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServiceOptions.decode = function decode(reader, length) { + MethodOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -20752,18 +41202,28 @@ message.deprecated = reader.bool(); break; } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } case 999: { if (!(message.uninterpretedOption && message.uninterpretedOption.length)) message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); break; } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); break; } default: @@ -20775,35 +41235,44 @@ }; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.MethodOptions} MethodOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + MethodOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceOptions message. + * Verifies a MethodOptions message. * @function verify - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ServiceOptions.verify = function verify(message) { + MethodOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; @@ -20813,134 +41282,204 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } return null; }; /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.MethodOptions} MethodOptions */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) return object; - var message = new $root.google.protobuf.ServiceOptions(); + var message = new $root.google.protobuf.MethodOptions(); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); message.uninterpretedOption = []; for (var i = 0; i < object.uninterpretedOption.length; ++i) { if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } return message; }; /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceOptions.toObject = function toObject(message, options) { + MethodOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } if (options.defaults) { object.deprecated = false; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; } if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); return object; }; /** - * Converts this ServiceOptions to JSON. + * Converts this MethodOptions to JSON. * @function toJSON - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ - ServiceOptions.prototype.toJSON = function toJSON() { + MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ServiceOptions + * Gets the default type url for MethodOptions * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.MethodOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); - return ServiceOptions; + return MethodOptions; })(); - protobuf.MethodOptions = (function() { + protobuf.UninterpretedOption = (function() { /** - * Properties of a MethodOptions. + * Properties of an UninterpretedOption. * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue */ /** - * Constructs a new MethodOptions. + * Constructs a new UninterpretedOption. * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; + function UninterpretedOption(properties) { + this.name = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20948,151 +41487,162 @@ } /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodOptions.prototype.deprecated = false; + UninterpretedOption.prototype.name = $util.emptyArray; /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodOptions.prototype.idempotencyLevel = 0; + UninterpretedOption.prototype.identifierValue = ""; /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodOptions.prototype[".google.api.http"] = null; + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + UninterpretedOption.prototype.doubleValue = 0; /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); /** - * Creates a new MethodOptions instance using the specified properties. + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. * @function create - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); }; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encode - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encode = function encode(message, writer) { + UninterpretedOption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MethodOptions.decode = function decode(reader, length) { + UninterpretedOption.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); break; } - case 34: { - message.idempotencyLevel = reader.int32(); + case 3: { + message.identifierValue = reader.string(); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 4: { + message.positiveIntValue = reader.uint64(); break; } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + case 5: { + message.negativeIntValue = reader.int64(); break; } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); + case 6: { + message.doubleValue = reader.double(); break; } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); break; } default: @@ -21104,414 +41654,533 @@ }; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodOptions message. + * Verifies an UninterpretedOption message. * @function verify - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MethodOptions.verify = function verify(message) { + UninterpretedOption.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; return null; }; /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); } } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); return message; }; /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodOptions.toObject = function toObject(message, options) { + UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } + if (options.arrays || options.defaults) + object.name = []; if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; return object; }; - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; - return MethodOptions; - })(); + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - protobuf.UninterpretedOption = (function() { + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; + return NamePart; + })(); - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + return UninterpretedOption; + })(); - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + protobuf.SourceCodeInfo = (function() { /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location */ - UninterpretedOption.prototype.doubleValue = 0; /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo * @instance */ - UninterpretedOption.prototype.aggregateValue = ""; + SourceCodeInfo.prototype.location = $util.emptyArray; /** - * Creates a new UninterpretedOption instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); }; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encode = function encode(message, writer) { + SourceCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * Decodes a SourceCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UninterpretedOption.decode = function decode(reader, length) { + SourceCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); break; } default: @@ -21523,224 +42192,143 @@ }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UninterpretedOption message. + * Verifies a SourceCodeInfo message. * @function verify - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UninterpretedOption.verify = function verify(message) { + SourceCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); if (error) - return "name." + error; + return "location." + error; } } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; return null; }; /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); } } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); return message; }; /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UninterpretedOption.toObject = function toObject(message, options) { + SourceCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; return object; }; /** - * Converts this UninterpretedOption to JSON. + * Converts this SourceCodeInfo to JSON. * @function toJSON - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @instance * @returns {Object.} JSON object */ - UninterpretedOption.prototype.toJSON = function toJSON() { + SourceCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UninterpretedOption + * Gets the default type url for SourceCodeInfo * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.SourceCodeInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; }; - UninterpretedOption.NamePart = (function() { + SourceCodeInfo.Location = (function() { /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments */ /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set */ - function NamePart(properties) { + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21748,87 +42336,156 @@ } /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - NamePart.prototype.namePart = ""; + Location.prototype.path = $util.emptyArray; /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - NamePart.prototype.isExtension = false; + Location.prototype.span = $util.emptyArray; /** - * Creates a new NamePart instance using the specified properties. + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance */ - NamePart.create = function create(properties) { - return new NamePart(properties); + Location.create = function create(properties) { + return new Location(properties); }; /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NamePart.encode = function encode(message, writer) { + Location.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); return writer; }; /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { + Location.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NamePart message from the specified reader or buffer. + * Decodes a Location message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @returns {google.protobuf.SourceCodeInfo.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NamePart.decode = function decode(reader, length) { + Location.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.namePart = reader.string(); + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); break; } case 2: { - message.isExtension = reader.bool(); + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); break; } default: @@ -21836,141 +42493,201 @@ break; } } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); return message; }; /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. + * Decodes a Location message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @returns {google.protobuf.SourceCodeInfo.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NamePart.decodeDelimited = function decodeDelimited(reader) { + Location.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NamePart message. + * Verifies a Location message. * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NamePart.verify = function verify(message) { + Location.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } return null; }; /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * Creates a Location message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @returns {google.protobuf.SourceCodeInfo.Location} Location */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } return message; }; /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * Creates a plain object from a Location message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {google.protobuf.SourceCodeInfo.Location} message Location * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NamePart.toObject = function toObject(message, options) { + Location.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } if (options.defaults) { - object.namePart = ""; - object.isExtension = false; + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; return object; }; /** - * Converts this NamePart to JSON. + * Converts this Location to JSON. * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @instance * @returns {Object.} JSON object */ - NamePart.prototype.toJSON = function toJSON() { + Location.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NamePart + * Gets the default type url for Location * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; }; - return NamePart; + return Location; })(); - return UninterpretedOption; + return SourceCodeInfo; })(); - protobuf.SourceCodeInfo = (function() { + protobuf.GeneratedCodeInfo = (function() { /** - * Properties of a SourceCodeInfo. + * Properties of a GeneratedCodeInfo. * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ /** - * Constructs a new SourceCodeInfo. + * Constructs a new GeneratedCodeInfo. * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ - function SourceCodeInfo(properties) { - this.location = []; + function GeneratedCodeInfo(properties) { + this.annotation = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21978,78 +42695,78 @@ } /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo * @instance */ - SourceCodeInfo.prototype.location = $util.emptyArray; + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** - * Creates a new SourceCodeInfo instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); }; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encode = function encode(message, writer) { + GeneratedCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SourceCodeInfo.decode = function decode(reader, length) { + GeneratedCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); break; } default: @@ -22061,143 +42778,141 @@ }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SourceCodeInfo message. + * Verifies a GeneratedCodeInfo message. * @function verify - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SourceCodeInfo.verify = function verify(message) { + GeneratedCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); if (error) - return "location." + error; + return "annotation." + error; } } return null; }; /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); } } return message; }; /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SourceCodeInfo.toObject = function toObject(message, options) { + GeneratedCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); } return object; }; /** - * Converts this SourceCodeInfo to JSON. + * Converts this GeneratedCodeInfo to JSON. * @function toJSON - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @instance * @returns {Object.} JSON object */ - SourceCodeInfo.prototype.toJSON = function toJSON() { + GeneratedCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SourceCodeInfo + * Gets the default type url for GeneratedCodeInfo * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; }; - SourceCodeInfo.Location = (function() { + GeneratedCodeInfo.Annotation = (function() { /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic */ /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set */ - function Location(properties) { + function Annotation(properties) { this.path = []; - this.span = []; - this.leadingDetachedComments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22205,67 +42920,67 @@ } /** - * Location path. + * Annotation path. * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - Location.prototype.path = $util.emptyArray; + Annotation.prototype.path = $util.emptyArray; /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - Location.prototype.span = $util.emptyArray; + Annotation.prototype.sourceFile = ""; /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - Location.prototype.leadingComments = ""; + Annotation.prototype.begin = 0; /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - Location.prototype.trailingComments = ""; + Annotation.prototype.end = 0; /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - Location.prototype.leadingDetachedComments = $util.emptyArray; + Annotation.prototype.semantic = 0; /** - * Creates a new Location instance using the specified properties. + * Creates a new Annotation instance using the specified properties. * @function create - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance */ - Location.create = function create(properties) { - return new Location(properties); + Annotation.create = function create(properties) { + return new Annotation(properties); }; /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encode = function encode(message, writer) { + Annotation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.path != null && message.path.length) { @@ -22274,50 +42989,45 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); return writer; }; /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encodeDelimited = function encodeDelimited(message, writer) { + Annotation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Location message from the specified reader or buffer. + * Decodes an Annotation message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Location.decode = function decode(reader, length) { + Annotation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -22333,28 +43043,19 @@ break; } case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); + message.sourceFile = reader.string(); break; } case 3: { - message.leadingComments = reader.string(); + message.begin = reader.int32(); break; } case 4: { - message.trailingComments = reader.string(); + message.end = reader.int32(); break; } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); + case 5: { + message.semantic = reader.int32(); break; } default: @@ -22366,30 +43067,30 @@ }; /** - * Decodes a Location message from the specified reader or buffer, length delimited. + * Decodes an Annotation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Location.decodeDelimited = function decodeDelimited(reader) { + Annotation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Location message. + * Verifies an Annotation message. * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Location.verify = function verify(message) { + Annotation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.path != null && message.hasOwnProperty("path")) { @@ -22399,164 +43100,420 @@ if (!$util.isInteger(message.path[i])) return "path: integer[] expected"; } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; } return message; }; /** - * Creates a plain object from a Location message. Also converts values to other types if specified. + * Creates a plain object from an Annotation message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Location.toObject = function toObject(message, options) { + Annotation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { + if (options.arrays || options.defaults) object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; for (var j = 0; j < message.path.length; ++j) object.path[j] = message.path[j]; } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) return object; - }; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Location; - })(); + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; - return SourceCodeInfo; + return Duration; })(); - protobuf.GeneratedCodeInfo = (function() { + protobuf.Timestamp = (function() { /** - * Properties of a GeneratedCodeInfo. + * Properties of a Timestamp. * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos */ /** - * Constructs a new GeneratedCodeInfo. + * Constructs a new Timestamp. * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo + * @classdesc Represents a Timestamp. + * @implements ITimestamp * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ - function GeneratedCodeInfo(properties) { - this.annotation = []; + function Timestamp(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22564,78 +43521,89 @@ } /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp * @instance */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new GeneratedCodeInfo instance using the specified properties. + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. * @function create - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); + Timestamp.create = function create(properties) { + return new Timestamp(properties); }; /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encode - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encode = function encode(message, writer) { + Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * Decodes a Timestamp message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @returns {google.protobuf.Timestamp} Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GeneratedCodeInfo.decode = function decode(reader, length) { + Timestamp.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); break; } default: @@ -22647,501 +43615,348 @@ }; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @returns {google.protobuf.Timestamp} Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + Timestamp.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GeneratedCodeInfo message. + * Verifies a Timestamp message. * @function verify - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Timestamp * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GeneratedCodeInfo.verify = function verify(message) { + Timestamp.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; return null; }; /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Timestamp * @static * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @returns {google.protobuf.Timestamp} Timestamp */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; return message; }; /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {google.protobuf.Timestamp} message Timestamp * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GeneratedCodeInfo.toObject = function toObject(message, options) { + Timestamp.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; return object; }; /** - * Converts this GeneratedCodeInfo to JSON. + * Converts this Timestamp to JSON. * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { + Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GeneratedCodeInfo + * Gets the default type url for Timestamp * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Timestamp * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + return typeUrlPrefix + "/google.protobuf.Timestamp"; }; - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; + return Timestamp; + })(); - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; + protobuf.DoubleValue = (function() { - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(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]]; + } - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); break; } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; + default: + reader.skipType(tag & 7); break; } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Annotation; - })(); + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; - return GeneratedCodeInfo; + return DoubleValue; })(); - protobuf.Duration = (function() { + protobuf.FloatValue = (function() { /** - * Properties of a Duration. + * Properties of a FloatValue. * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos + * @interface IFloatValue + * @property {number|null} [value] FloatValue value */ /** - * Constructs a new Duration. + * Constructs a new FloatValue. * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration + * @classdesc Represents a FloatValue. + * @implements IFloatValue * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set + * @param {google.protobuf.IFloatValue=} [properties] Properties to set */ - function Duration(properties) { + function FloatValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23149,89 +43964,75 @@ } /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue * @instance */ - Duration.prototype.nanos = 0; + FloatValue.prototype.value = 0; /** - * Creates a new Duration instance using the specified properties. + * Creates a new FloatValue instance using the specified properties. * @function create - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FloatValue * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance */ - Duration.create = function create(properties) { - return new Duration(properties); + FloatValue.create = function create(properties) { + return new FloatValue(properties); }; /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. * @function encode - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FloatValue * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encode = function encode(message, writer) { + FloatValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); return writer; }; /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FloatValue * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Duration message from the specified reader or buffer. + * Decodes a FloatValue message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FloatValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration + * @returns {google.protobuf.FloatValue} FloatValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Duration.decode = function decode(reader, length) { + FloatValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); + message.value = reader.float(); break; } default: @@ -23243,146 +44044,122 @@ }; /** - * Decodes a Duration message from the specified reader or buffer, length delimited. + * Decodes a FloatValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FloatValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration + * @returns {google.protobuf.FloatValue} FloatValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Duration.decodeDelimited = function decodeDelimited(reader) { + FloatValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Duration message. + * Verifies a FloatValue message. * @function verify - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FloatValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Duration.verify = function verify(message) { + FloatValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; return null; }; /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FloatValue * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration + * @returns {google.protobuf.FloatValue} FloatValue */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); return message; }; /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FloatValue * @static - * @param {google.protobuf.Duration} message Duration + * @param {google.protobuf.FloatValue} message FloatValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Duration.toObject = function toObject(message, options) { + FloatValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; return object; }; /** - * Converts this Duration to JSON. + * Converts this FloatValue to JSON. * @function toJSON - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FloatValue * @instance * @returns {Object.} JSON object */ - Duration.prototype.toJSON = function toJSON() { + FloatValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Duration + * Gets the default type url for FloatValue * @function getTypeUrl - * @memberof google.protobuf.Duration + * @memberof google.protobuf.FloatValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Duration"; + return typeUrlPrefix + "/google.protobuf.FloatValue"; }; - return Duration; + return FloatValue; })(); - protobuf.Timestamp = (function() { + protobuf.Int64Value = (function() { /** - * Properties of a Timestamp. + * Properties of an Int64Value. * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value */ /** - * Constructs a new Timestamp. + * Constructs a new Int64Value. * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp + * @classdesc Represents an Int64Value. + * @implements IInt64Value * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @param {google.protobuf.IInt64Value=} [properties] Properties to set */ - function Timestamp(properties) { + function Int64Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23390,89 +44167,75 @@ } /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value * @instance */ - Timestamp.prototype.nanos = 0; + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new Int64Value instance using the specified properties. * @function create - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Int64Value * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); + Int64Value.create = function create(properties) { + return new Int64Value(properties); }; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. * @function encode - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Int64Value * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encode = function encode(message, writer) { + Int64Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); return writer; }; /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Int64Value * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Timestamp message from the specified reader or buffer. + * Decodes an Int64Value message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Int64Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Int64Value} Int64Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Timestamp.decode = function decode(reader, length) { + Int64Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); + message.value = reader.int64(); break; } default: @@ -23484,145 +44247,136 @@ }; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes an Int64Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Int64Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Int64Value} Int64Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { + Int64Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Timestamp message. + * Verifies an Int64Value message. * @function verify - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Int64Value * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Timestamp.verify = function verify(message) { + Int64Value.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; return null; }; /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Int64Value * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Int64Value} Int64Value */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Int64Value * @static - * @param {google.protobuf.Timestamp} message Timestamp + * @param {google.protobuf.Int64Value} message Int64Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Timestamp.toObject = function toObject(message, options) { + Int64Value.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) if ($util.Long) { var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; return object; }; /** - * Converts this Timestamp to JSON. + * Converts this Int64Value to JSON. * @function toJSON - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Int64Value * @instance * @returns {Object.} JSON object */ - Timestamp.prototype.toJSON = function toJSON() { + Int64Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Timestamp + * Gets the default type url for Int64Value * @function getTypeUrl - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Int64Value * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Timestamp"; + return typeUrlPrefix + "/google.protobuf.Int64Value"; }; - return Timestamp; + return Int64Value; })(); - protobuf.DoubleValue = (function() { + protobuf.UInt64Value = (function() { /** - * Properties of a DoubleValue. + * Properties of a UInt64Value. * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value */ /** - * Constructs a new DoubleValue. + * Constructs a new UInt64Value. * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set */ - function DoubleValue(properties) { + function UInt64Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23630,75 +44384,75 @@ } /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value * @instance */ - DoubleValue.prototype.value = 0; + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new DoubleValue instance using the specified properties. + * Creates a new UInt64Value instance using the specified properties. * @function create - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.UInt64Value * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); }; /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. * @function encode - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.UInt64Value * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DoubleValue.encode = function encode(message, writer) { + UInt64Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); return writer; }; /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.UInt64Value * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DoubleValue message from the specified reader or buffer. + * Decodes a UInt64Value message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.UInt64Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue + * @returns {google.protobuf.UInt64Value} UInt64Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DoubleValue.decode = function decode(reader, length) { + UInt64Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.double(); + message.value = reader.uint64(); break; } default: @@ -23710,122 +44464,136 @@ }; /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.UInt64Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue + * @returns {google.protobuf.UInt64Value} UInt64Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { + UInt64Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DoubleValue message. + * Verifies a UInt64Value message. * @function verify - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.UInt64Value * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DoubleValue.verify = function verify(message) { + UInt64Value.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; return null; }; /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.UInt64Value * @static * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue + * @returns {google.protobuf.UInt64Value} UInt64Value */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) return object; - var message = new $root.google.protobuf.DoubleValue(); + var message = new $root.google.protobuf.UInt64Value(); if (object.value != null) - message.value = Number(object.value); + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.UInt64Value * @static - * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {google.protobuf.UInt64Value} message UInt64Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DoubleValue.toObject = function toObject(message, options) { + UInt64Value.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.value = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; return object; }; /** - * Converts this DoubleValue to JSON. + * Converts this UInt64Value to JSON. * @function toJSON - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.UInt64Value * @instance * @returns {Object.} JSON object */ - DoubleValue.prototype.toJSON = function toJSON() { + UInt64Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DoubleValue + * Gets the default type url for UInt64Value * @function getTypeUrl - * @memberof google.protobuf.DoubleValue + * @memberof google.protobuf.UInt64Value * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.DoubleValue"; + return typeUrlPrefix + "/google.protobuf.UInt64Value"; }; - return DoubleValue; + return UInt64Value; })(); - protobuf.FloatValue = (function() { + protobuf.Int32Value = (function() { /** - * Properties of a FloatValue. + * Properties of an Int32Value. * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value + * @interface IInt32Value + * @property {number|null} [value] Int32Value value */ /** - * Constructs a new FloatValue. + * Constructs a new Int32Value. * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue + * @classdesc Represents an Int32Value. + * @implements IInt32Value * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @param {google.protobuf.IInt32Value=} [properties] Properties to set */ - function FloatValue(properties) { + function Int32Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23833,75 +44601,75 @@ } /** - * FloatValue value. + * Int32Value value. * @member {number} value - * @memberof google.protobuf.FloatValue + * @memberof google.protobuf.Int32Value * @instance */ - FloatValue.prototype.value = 0; + Int32Value.prototype.value = 0; /** - * Creates a new FloatValue instance using the specified properties. + * Creates a new Int32Value instance using the specified properties. * @function create - * @memberof google.protobuf.FloatValue + * @memberof google.protobuf.Int32Value * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); + Int32Value.create = function create(properties) { + return new Int32Value(properties); }; /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. * @function encode - * @memberof google.protobuf.FloatValue + * @memberof google.protobuf.Int32Value * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FloatValue.encode = function encode(message, writer) { + Int32Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); return writer; }; /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FloatValue + * @memberof google.protobuf.Int32Value * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FloatValue message from the specified reader or buffer. + * Decodes an Int32Value message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FloatValue + * @memberof google.protobuf.Int32Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue + * @returns {google.protobuf.Int32Value} Int32Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FloatValue.decode = function decode(reader, length) { + Int32Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.float(); + message.value = reader.int32(); break; } default: @@ -23913,122 +44681,122 @@ }; /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * Decodes an Int32Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FloatValue + * @memberof google.protobuf.Int32Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue + * @returns {google.protobuf.Int32Value} Int32Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { + Int32Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FloatValue message. + * Verifies an Int32Value message. * @function verify - * @memberof google.protobuf.FloatValue + * @memberof google.protobuf.Int32Value * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FloatValue.verify = function verify(message) { + Int32Value.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; + if (!$util.isInteger(message.value)) + return "value: integer expected"; return null; }; /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FloatValue + * @memberof google.protobuf.Int32Value * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue + * @returns {google.protobuf.Int32Value} Int32Value */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) return object; - var message = new $root.google.protobuf.FloatValue(); + var message = new $root.google.protobuf.Int32Value(); if (object.value != null) - message.value = Number(object.value); + message.value = object.value | 0; return message; }; /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FloatValue + * @memberof google.protobuf.Int32Value * @static - * @param {google.protobuf.FloatValue} message FloatValue + * @param {google.protobuf.Int32Value} message Int32Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FloatValue.toObject = function toObject(message, options) { + Int32Value.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) object.value = 0; if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + object.value = message.value; return object; }; /** - * Converts this FloatValue to JSON. + * Converts this Int32Value to JSON. * @function toJSON - * @memberof google.protobuf.FloatValue + * @memberof google.protobuf.Int32Value * @instance * @returns {Object.} JSON object */ - FloatValue.prototype.toJSON = function toJSON() { + Int32Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FloatValue + * Gets the default type url for Int32Value * @function getTypeUrl - * @memberof google.protobuf.FloatValue + * @memberof google.protobuf.Int32Value * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FloatValue"; + return typeUrlPrefix + "/google.protobuf.Int32Value"; }; - return FloatValue; + return Int32Value; })(); - protobuf.Int64Value = (function() { + protobuf.UInt32Value = (function() { /** - * Properties of an Int64Value. + * Properties of a UInt32Value. * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value */ /** - * Constructs a new Int64Value. + * Constructs a new UInt32Value. * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set */ - function Int64Value(properties) { + function UInt32Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24036,75 +44804,75 @@ } /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value * @instance */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + UInt32Value.prototype.value = 0; /** - * Creates a new Int64Value instance using the specified properties. + * Creates a new UInt32Value instance using the specified properties. * @function create - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.UInt32Value * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); }; /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. * @function encode - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.UInt32Value * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Int64Value.encode = function encode(message, writer) { + UInt32Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); return writer; }; /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.UInt32Value * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Int64Value message from the specified reader or buffer. + * Decodes a UInt32Value message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.UInt32Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value + * @returns {google.protobuf.UInt32Value} UInt32Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Int64Value.decode = function decode(reader, length) { + UInt32Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.int64(); + message.value = reader.uint32(); break; } default: @@ -24116,136 +44884,122 @@ }; /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.UInt32Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value + * @returns {google.protobuf.UInt32Value} UInt32Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { + UInt32Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Int64Value message. + * Verifies a UInt32Value message. * @function verify - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.UInt32Value * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Int64Value.verify = function verify(message) { + UInt32Value.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; + if (!$util.isInteger(message.value)) + return "value: integer expected"; return null; }; /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.UInt32Value * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value + * @returns {google.protobuf.UInt32Value} UInt32Value */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) return object; - var message = new $root.google.protobuf.Int64Value(); + var message = new $root.google.protobuf.UInt32Value(); if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + message.value = object.value >>> 0; return message; }; /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.UInt32Value * @static - * @param {google.protobuf.Int64Value} message Int64Value + * @param {google.protobuf.UInt32Value} message UInt32Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Int64Value.toObject = function toObject(message, options) { + UInt32Value.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; + object.value = 0; if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + object.value = message.value; return object; }; /** - * Converts this Int64Value to JSON. + * Converts this UInt32Value to JSON. * @function toJSON - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.UInt32Value * @instance * @returns {Object.} JSON object */ - Int64Value.prototype.toJSON = function toJSON() { + UInt32Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Int64Value + * Gets the default type url for UInt32Value * @function getTypeUrl - * @memberof google.protobuf.Int64Value + * @memberof google.protobuf.UInt32Value * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Int64Value"; + return typeUrlPrefix + "/google.protobuf.UInt32Value"; }; - return Int64Value; + return UInt32Value; })(); - protobuf.UInt64Value = (function() { + protobuf.BoolValue = (function() { /** - * Properties of a UInt64Value. + * Properties of a BoolValue. * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value */ /** - * Constructs a new UInt64Value. + * Constructs a new BoolValue. * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value + * @classdesc Represents a BoolValue. + * @implements IBoolValue * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @param {google.protobuf.IBoolValue=} [properties] Properties to set */ - function UInt64Value(properties) { + function BoolValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24253,75 +45007,75 @@ } /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue * @instance */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + BoolValue.prototype.value = false; /** - * Creates a new UInt64Value instance using the specified properties. + * Creates a new BoolValue instance using the specified properties. * @function create - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.BoolValue * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); + BoolValue.create = function create(properties) { + return new BoolValue(properties); }; /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. * @function encode - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.BoolValue * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UInt64Value.encode = function encode(message, writer) { + BoolValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); return writer; }; /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.BoolValue * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UInt64Value message from the specified reader or buffer. + * Decodes a BoolValue message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.BoolValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value + * @returns {google.protobuf.BoolValue} BoolValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UInt64Value.decode = function decode(reader, length) { + BoolValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.uint64(); + message.value = reader.bool(); break; } default: @@ -24333,136 +45087,122 @@ }; /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * Decodes a BoolValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.BoolValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value + * @returns {google.protobuf.BoolValue} BoolValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { + BoolValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UInt64Value message. + * Verifies a BoolValue message. * @function verify - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.BoolValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UInt64Value.verify = function verify(message) { + BoolValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; + if (typeof message.value !== "boolean") + return "value: boolean expected"; return null; }; /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.BoolValue * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value + * @returns {google.protobuf.BoolValue} BoolValue */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) return object; - var message = new $root.google.protobuf.UInt64Value(); + var message = new $root.google.protobuf.BoolValue(); if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + message.value = Boolean(object.value); return message; }; /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.BoolValue * @static - * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {google.protobuf.BoolValue} message BoolValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UInt64Value.toObject = function toObject(message, options) { + BoolValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; + object.value = false; if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + object.value = message.value; return object; }; /** - * Converts this UInt64Value to JSON. + * Converts this BoolValue to JSON. * @function toJSON - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.BoolValue * @instance * @returns {Object.} JSON object */ - UInt64Value.prototype.toJSON = function toJSON() { + BoolValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UInt64Value + * Gets the default type url for BoolValue * @function getTypeUrl - * @memberof google.protobuf.UInt64Value + * @memberof google.protobuf.BoolValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UInt64Value"; + return typeUrlPrefix + "/google.protobuf.BoolValue"; }; - return UInt64Value; + return BoolValue; })(); - protobuf.Int32Value = (function() { + protobuf.StringValue = (function() { /** - * Properties of an Int32Value. + * Properties of a StringValue. * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value + * @interface IStringValue + * @property {string|null} [value] StringValue value */ /** - * Constructs a new Int32Value. + * Constructs a new StringValue. * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value + * @classdesc Represents a StringValue. + * @implements IStringValue * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @param {google.protobuf.IStringValue=} [properties] Properties to set */ - function Int32Value(properties) { + function StringValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24470,75 +45210,75 @@ } /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue * @instance */ - Int32Value.prototype.value = 0; + StringValue.prototype.value = ""; /** - * Creates a new Int32Value instance using the specified properties. + * Creates a new StringValue instance using the specified properties. * @function create - * @memberof google.protobuf.Int32Value + * @memberof google.protobuf.StringValue * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); + StringValue.create = function create(properties) { + return new StringValue(properties); }; /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. * @function encode - * @memberof google.protobuf.Int32Value + * @memberof google.protobuf.StringValue * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Int32Value.encode = function encode(message, writer) { + StringValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); return writer; }; /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Int32Value + * @memberof google.protobuf.StringValue * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + StringValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Int32Value message from the specified reader or buffer. + * Decodes a StringValue message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Int32Value + * @memberof google.protobuf.StringValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value + * @returns {google.protobuf.StringValue} StringValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Int32Value.decode = function decode(reader, length) { + StringValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.int32(); + message.value = reader.string(); break; } default: @@ -24550,122 +45290,122 @@ }; /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * Decodes a StringValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Int32Value + * @memberof google.protobuf.StringValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value + * @returns {google.protobuf.StringValue} StringValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { + StringValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Int32Value message. + * Verifies a StringValue message. * @function verify - * @memberof google.protobuf.Int32Value + * @memberof google.protobuf.StringValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Int32Value.verify = function verify(message) { + StringValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; + if (!$util.isString(message.value)) + return "value: string expected"; return null; }; /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Int32Value + * @memberof google.protobuf.StringValue * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value + * @returns {google.protobuf.StringValue} StringValue */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) return object; - var message = new $root.google.protobuf.Int32Value(); + var message = new $root.google.protobuf.StringValue(); if (object.value != null) - message.value = object.value | 0; + message.value = String(object.value); return message; }; /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * Creates a plain object from a StringValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Int32Value + * @memberof google.protobuf.StringValue * @static - * @param {google.protobuf.Int32Value} message Int32Value + * @param {google.protobuf.StringValue} message StringValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Int32Value.toObject = function toObject(message, options) { + StringValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.value = 0; + object.value = ""; if (message.value != null && message.hasOwnProperty("value")) object.value = message.value; return object; }; /** - * Converts this Int32Value to JSON. + * Converts this StringValue to JSON. * @function toJSON - * @memberof google.protobuf.Int32Value + * @memberof google.protobuf.StringValue * @instance * @returns {Object.} JSON object */ - Int32Value.prototype.toJSON = function toJSON() { + StringValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Int32Value + * Gets the default type url for StringValue * @function getTypeUrl - * @memberof google.protobuf.Int32Value + * @memberof google.protobuf.StringValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Int32Value"; + return typeUrlPrefix + "/google.protobuf.StringValue"; }; - return Int32Value; + return StringValue; })(); - protobuf.UInt32Value = (function() { + protobuf.BytesValue = (function() { /** - * Properties of a UInt32Value. + * Properties of a BytesValue. * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value */ /** - * Constructs a new UInt32Value. + * Constructs a new BytesValue. * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value + * @classdesc Represents a BytesValue. + * @implements IBytesValue * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @param {google.protobuf.IBytesValue=} [properties] Properties to set */ - function UInt32Value(properties) { + function BytesValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24673,75 +45413,75 @@ } /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue * @instance */ - UInt32Value.prototype.value = 0; + BytesValue.prototype.value = $util.newBuffer([]); /** - * Creates a new UInt32Value instance using the specified properties. + * Creates a new BytesValue instance using the specified properties. * @function create - * @memberof google.protobuf.UInt32Value + * @memberof google.protobuf.BytesValue * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); + BytesValue.create = function create(properties) { + return new BytesValue(properties); }; /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. * @function encode - * @memberof google.protobuf.UInt32Value + * @memberof google.protobuf.BytesValue * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UInt32Value.encode = function encode(message, writer) { + BytesValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); return writer; }; /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UInt32Value + * @memberof google.protobuf.BytesValue * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UInt32Value message from the specified reader or buffer. + * Decodes a BytesValue message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UInt32Value + * @memberof google.protobuf.BytesValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value + * @returns {google.protobuf.BytesValue} BytesValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UInt32Value.decode = function decode(reader, length) { + BytesValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.uint32(); + message.value = reader.bytes(); break; } default: @@ -24753,122 +45493,132 @@ }; /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * Decodes a BytesValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UInt32Value + * @memberof google.protobuf.BytesValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value + * @returns {google.protobuf.BytesValue} BytesValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { + BytesValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UInt32Value message. + * Verifies a BytesValue message. * @function verify - * @memberof google.protobuf.UInt32Value + * @memberof google.protobuf.BytesValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UInt32Value.verify = function verify(message) { + BytesValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; return null; }; /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UInt32Value + * @memberof google.protobuf.BytesValue * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value + * @returns {google.protobuf.BytesValue} BytesValue */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) return object; - var message = new $root.google.protobuf.UInt32Value(); + var message = new $root.google.protobuf.BytesValue(); if (object.value != null) - message.value = object.value >>> 0; + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; return message; }; /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UInt32Value + * @memberof google.protobuf.BytesValue * @static - * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {google.protobuf.BytesValue} message BytesValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UInt32Value.toObject = function toObject(message, options) { + BytesValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.value = 0; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; /** - * Converts this UInt32Value to JSON. + * Converts this BytesValue to JSON. * @function toJSON - * @memberof google.protobuf.UInt32Value + * @memberof google.protobuf.BytesValue * @instance * @returns {Object.} JSON object */ - UInt32Value.prototype.toJSON = function toJSON() { + BytesValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UInt32Value + * Gets the default type url for BytesValue * @function getTypeUrl - * @memberof google.protobuf.UInt32Value + * @memberof google.protobuf.BytesValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UInt32Value"; + return typeUrlPrefix + "/google.protobuf.BytesValue"; }; - return UInt32Value; + return BytesValue; })(); - protobuf.BoolValue = (function() { + protobuf.Any = (function() { /** - * Properties of a BoolValue. + * Properties of an Any. * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value */ /** - * Constructs a new BoolValue. + * Constructs a new Any. * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue + * @classdesc Represents an Any. + * @implements IAny * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @param {google.protobuf.IAny=} [properties] Properties to set */ - function BoolValue(properties) { + function Any(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24876,75 +45626,89 @@ } /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any * @instance */ - BoolValue.prototype.value = false; + Any.prototype.type_url = ""; /** - * Creates a new BoolValue instance using the specified properties. + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. * @function create - * @memberof google.protobuf.BoolValue + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); + Any.create = function create(properties) { + return new Any(properties); }; /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encode - * @memberof google.protobuf.BoolValue + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BoolValue.encode = function encode(message, writer) { + Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.BoolValue + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + Any.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BoolValue message from the specified reader or buffer. + * Decodes an Any message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.BoolValue + * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue + * @returns {google.protobuf.Any} Any * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BoolValue.decode = function decode(reader, length) { + Any.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.bool(); + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); break; } default: @@ -24956,122 +45720,141 @@ }; /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.BoolValue + * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue + * @returns {google.protobuf.Any} Any * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { + Any.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BoolValue message. + * Verifies an Any message. * @function verify - * @memberof google.protobuf.BoolValue + * @memberof google.protobuf.Any * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BoolValue.verify = function verify(message) { + Any.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; return null; }; /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.BoolValue + * @memberof google.protobuf.Any * @static * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue + * @returns {google.protobuf.Any} Any */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) return object; - var message = new $root.google.protobuf.BoolValue(); + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); if (object.value != null) - message.value = Boolean(object.value); + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; return message; }; /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * Creates a plain object from an Any message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.BoolValue + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.BoolValue} message BoolValue + * @param {google.protobuf.Any} message Any * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BoolValue.toObject = function toObject(message, options) { + Any.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.value = false; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; /** - * Converts this BoolValue to JSON. + * Converts this Any to JSON. * @function toJSON - * @memberof google.protobuf.BoolValue + * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ - BoolValue.prototype.toJSON = function toJSON() { + Any.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BoolValue + * Gets the default type url for Any * @function getTypeUrl - * @memberof google.protobuf.BoolValue + * @memberof google.protobuf.Any * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.BoolValue"; + return typeUrlPrefix + "/google.protobuf.Any"; }; - return BoolValue; + return Any; })(); - protobuf.StringValue = (function() { + protobuf.Struct = (function() { /** - * Properties of a StringValue. + * Properties of a Struct. * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value + * @interface IStruct + * @property {Object.|null} [fields] Struct fields */ /** - * Constructs a new StringValue. + * Constructs a new Struct. * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue + * @classdesc Represents a Struct. + * @implements IStruct * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @param {google.protobuf.IStruct=} [properties] Properties to set */ - function StringValue(properties) { + function Struct(properties) { + this.fields = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25079,75 +45862,97 @@ } /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct * @instance */ - StringValue.prototype.value = ""; + Struct.prototype.fields = $util.emptyObject; /** - * Creates a new StringValue instance using the specified properties. + * Creates a new Struct instance using the specified properties. * @function create - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance */ - StringValue.create = function create(properties) { - return new StringValue(properties); + Struct.create = function create(properties) { + return new Struct(properties); }; /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. * @function encode - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {google.protobuf.IStruct} message Struct message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StringValue.encode = function encode(message, writer) { + Struct.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.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {google.protobuf.IStruct} message Struct message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { + Struct.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StringValue message from the specified reader or buffer. + * Decodes a Struct message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.Struct * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue + * @returns {google.protobuf.Struct} Struct * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StringValue.decode = function decode(reader, length) { + Struct.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.string(); + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; break; } default: @@ -25159,198 +45964,306 @@ }; /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. + * Decodes a Struct message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.Struct * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue + * @returns {google.protobuf.Struct} Struct * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StringValue.decodeDelimited = function decodeDelimited(reader) { + Struct.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StringValue message. + * Verifies a Struct message. * @function verify - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.Struct * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StringValue.verify = function verify(message) { + Struct.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.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } return null; }; /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * Creates a Struct message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.Struct * @static * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue + * @returns {google.protobuf.Struct} Struct */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } return message; }; /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * Creates a plain object from a Struct message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.Struct * @static - * @param {google.protobuf.StringValue} message StringValue + * @param {google.protobuf.Struct} message Struct * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StringValue.toObject = function toObject(message, options) { + Struct.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } return object; }; /** - * Converts this StringValue to JSON. + * Converts this Struct to JSON. * @function toJSON - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.Struct * @instance * @returns {Object.} JSON object */ - StringValue.prototype.toJSON = function toJSON() { + Struct.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for StringValue + * Gets the default type url for Struct * @function getTypeUrl - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.Struct * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.StringValue"; + return typeUrlPrefix + "/google.protobuf.Struct"; }; - return StringValue; + return Struct; })(); - protobuf.BytesValue = (function() { + protobuf.Value = (function() { /** - * Properties of a BytesValue. + * Properties of a Value. * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(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]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance */ + Value.prototype.boolValue = null; /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance */ - function BytesValue(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]]; - } + Value.prototype.structValue = null; /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value * @instance */ - BytesValue.prototype.value = $util.newBuffer([]); + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new BytesValue instance using the specified properties. + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. * @function create - * @memberof google.protobuf.BytesValue + * @memberof google.protobuf.Value * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); + Value.create = function create(properties) { + return new Value(properties); }; /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. * @function encode - * @memberof google.protobuf.BytesValue + * @memberof google.protobuf.Value * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {google.protobuf.IValue} message Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BytesValue.encode = function encode(message, writer) { + Value.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).bytes(message.value); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.BytesValue + * @memberof google.protobuf.Value * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {google.protobuf.IValue} message Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BytesValue message from the specified reader or buffer. + * Decodes a Value message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.BytesValue + * @memberof google.protobuf.Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue + * @returns {google.protobuf.Value} Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BytesValue.decode = function decode(reader, length) { + Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.bytes(); + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); break; } default: @@ -25362,132 +46275,235 @@ }; /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * Decodes a Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.BytesValue + * @memberof google.protobuf.Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue + * @returns {google.protobuf.Value} Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { + Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BytesValue message. + * Verifies a Value message. * @function verify - * @memberof google.protobuf.BytesValue + * @memberof google.protobuf.Value * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BytesValue.verify = function verify(message) { + Value.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } return null; }; /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * Creates a Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.BytesValue + * @memberof google.protobuf.Value * @static * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue + * @returns {google.protobuf.Value} Value */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } return message; }; /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * Creates a plain object from a Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.BytesValue + * @memberof google.protobuf.Value * @static - * @param {google.protobuf.BytesValue} message BytesValue + * @param {google.protobuf.Value} message Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BytesValue.toObject = function toObject(message, options) { + Value.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } return object; }; /** - * Converts this BytesValue to JSON. + * Converts this Value to JSON. * @function toJSON - * @memberof google.protobuf.BytesValue + * @memberof google.protobuf.Value * @instance * @returns {Object.} JSON object */ - BytesValue.prototype.toJSON = function toJSON() { + Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BytesValue + * Gets the default type url for Value * @function getTypeUrl - * @memberof google.protobuf.BytesValue + * @memberof google.protobuf.Value * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.BytesValue"; + return typeUrlPrefix + "/google.protobuf.Value"; }; - return BytesValue; + return Value; })(); - protobuf.Any = (function() { + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { /** - * Properties of an Any. + * Properties of a ListValue. * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value + * @interface IListValue + * @property {Array.|null} [values] ListValue values */ /** - * Constructs a new Any. + * Constructs a new ListValue. * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny + * @classdesc Represents a ListValue. + * @implements IListValue * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set + * @param {google.protobuf.IListValue=} [properties] Properties to set */ - function Any(properties) { + function ListValue(properties) { + this.values = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25495,89 +46511,78 @@ } /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue * @instance */ - Any.prototype.value = $util.newBuffer([]); + ListValue.prototype.values = $util.emptyArray; /** - * Creates a new Any instance using the specified properties. + * Creates a new ListValue instance using the specified properties. * @function create - * @memberof google.protobuf.Any + * @memberof google.protobuf.ListValue * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance */ - Any.create = function create(properties) { - return new Any(properties); + ListValue.create = function create(properties) { + return new ListValue(properties); }; /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. * @function encode - * @memberof google.protobuf.Any + * @memberof google.protobuf.ListValue * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Any.encode = function encode(message, writer) { + ListValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Any + * @memberof google.protobuf.ListValue * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Any.encodeDelimited = function encodeDelimited(message, writer) { + ListValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Any message from the specified reader or buffer. + * Decodes a ListValue message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Any + * @memberof google.protobuf.ListValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any + * @returns {google.protobuf.ListValue} ListValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Any.decode = function decode(reader, length) { + ListValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); break; } default: @@ -25589,120 +46594,119 @@ }; /** - * Decodes an Any message from the specified reader or buffer, length delimited. + * Decodes a ListValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Any + * @memberof google.protobuf.ListValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any + * @returns {google.protobuf.ListValue} ListValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Any.decodeDelimited = function decodeDelimited(reader) { + ListValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Any message. + * Verifies a ListValue message. * @function verify - * @memberof google.protobuf.Any + * @memberof google.protobuf.ListValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Any.verify = function verify(message) { + ListValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } return null; }; /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Any + * @memberof google.protobuf.ListValue * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any + * @returns {google.protobuf.ListValue} ListValue */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } return message; }; /** - * Creates a plain object from an Any message. Also converts values to other types if specified. + * Creates a plain object from a ListValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Any + * @memberof google.protobuf.ListValue * @static - * @param {google.protobuf.Any} message Any + * @param {google.protobuf.ListValue} message ListValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Any.toObject = function toObject(message, options) { + ListValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; /** - * Converts this Any to JSON. + * Converts this ListValue to JSON. * @function toJSON - * @memberof google.protobuf.Any + * @memberof google.protobuf.ListValue * @instance * @returns {Object.} JSON object */ - Any.prototype.toJSON = function toJSON() { + ListValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Any + * Gets the default type url for ListValue * @function getTypeUrl - * @memberof google.protobuf.Any + * @memberof google.protobuf.ListValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Any"; + return typeUrlPrefix + "/google.protobuf.ListValue"; }; - return Any; + return ListValue; })(); protobuf.Empty = (function() { diff --git a/packages/google-cloud-clouddms/protos/protos.json b/packages/google-cloud-clouddms/protos/protos.json index e6e150c50fc..7039076e446 100644 --- a/packages/google-cloud-clouddms/protos/protos.json +++ b/packages/google-cloud-clouddms/protos/protos.json @@ -11,10 +11,12 @@ "csharp_namespace": "Google.Cloud.CloudDms.V1", "go_package": "cloud.google.com/go/clouddms/apiv1/clouddmspb;clouddmspb", "java_multiple_files": true, - "java_outer_classname": "ClouddmsResourcesProto", + "java_outer_classname": "ConversionWorkspaceResourcesProto", "java_package": "com.google.cloud.clouddms.v1", "php_namespace": "Google\\Cloud\\CloudDms\\V1", - "ruby_package": "Google::Cloud::CloudDMS::V1" + "ruby_package": "Google::Cloud::CloudDMS::V1", + "(google.api.resource_definition).type": "compute.googleapis.com/Networks", + "(google.api.resource_definition).pattern": "projects/{project}/global/networks/{network}" }, "nested": { "DataMigrationService": { @@ -418,265 +420,2136 @@ } } ] + }, + "CreatePrivateConnection": { + "requestType": "CreatePrivateConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/privateConnections", + "(google.api.http).body": "private_connection", + "(google.api.method_signature)": "parent,private_connection,private_connection_id", + "(google.longrunning.operation_info).response_type": "PrivateConnection", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/privateConnections", + "body": "private_connection" + } + }, + { + "(google.api.method_signature)": "parent,private_connection,private_connection_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PrivateConnection", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetPrivateConnection": { + "requestType": "GetPrivateConnectionRequest", + "responseType": "PrivateConnection", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/privateConnections/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/privateConnections/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPrivateConnections": { + "requestType": "ListPrivateConnectionsRequest", + "responseType": "ListPrivateConnectionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/privateConnections", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/privateConnections" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeletePrivateConnection": { + "requestType": "DeletePrivateConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/privateConnections/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/privateConnections/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetConversionWorkspace": { + "requestType": "GetConversionWorkspaceRequest", + "responseType": "ConversionWorkspace", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListConversionWorkspaces": { + "requestType": "ListConversionWorkspacesRequest", + "responseType": "ListConversionWorkspacesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/conversionWorkspaces", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/conversionWorkspaces" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateConversionWorkspace": { + "requestType": "CreateConversionWorkspaceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/conversionWorkspaces", + "(google.api.http).body": "conversion_workspace", + "(google.api.method_signature)": "parent,conversion_workspace,conversion_workspace_id", + "(google.longrunning.operation_info).response_type": "ConversionWorkspace", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/conversionWorkspaces", + "body": "conversion_workspace" + } + }, + { + "(google.api.method_signature)": "parent,conversion_workspace,conversion_workspace_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ConversionWorkspace", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateConversionWorkspace": { + "requestType": "UpdateConversionWorkspaceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{conversion_workspace.name=projects/*/locations/*/conversionWorkspaces/*}", + "(google.api.http).body": "conversion_workspace", + "(google.api.method_signature)": "conversion_workspace,update_mask", + "(google.longrunning.operation_info).response_type": "ConversionWorkspace", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{conversion_workspace.name=projects/*/locations/*/conversionWorkspaces/*}", + "body": "conversion_workspace" + } + }, + { + "(google.api.method_signature)": "conversion_workspace,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ConversionWorkspace", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteConversionWorkspace": { + "requestType": "DeleteConversionWorkspaceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "SeedConversionWorkspace": { + "requestType": "SeedConversionWorkspaceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:seed", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ConversionWorkspace", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:seed", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ConversionWorkspace", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ImportMappingRules": { + "requestType": "ImportMappingRulesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/conversionWorkspaces/*}/mappingRules:import", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ConversionWorkspace", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/conversionWorkspaces/*}/mappingRules:import", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ConversionWorkspace", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ConvertConversionWorkspace": { + "requestType": "ConvertConversionWorkspaceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:convert", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ConversionWorkspace", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:convert", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ConversionWorkspace", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CommitConversionWorkspace": { + "requestType": "CommitConversionWorkspaceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:commit", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ConversionWorkspace", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:commit", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ConversionWorkspace", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RollbackConversionWorkspace": { + "requestType": "RollbackConversionWorkspaceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:rollback", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ConversionWorkspace", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:rollback", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ConversionWorkspace", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ApplyConversionWorkspace": { + "requestType": "ApplyConversionWorkspaceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:apply", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ConversionWorkspace", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/conversionWorkspaces/*}:apply", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ConversionWorkspace", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DescribeDatabaseEntities": { + "requestType": "DescribeDatabaseEntitiesRequest", + "responseType": "DescribeDatabaseEntitiesResponse", + "options": { + "(google.api.http).get": "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:describeDatabaseEntities" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:describeDatabaseEntities" + } + } + ] + }, + "SearchBackgroundJobs": { + "requestType": "SearchBackgroundJobsRequest", + "responseType": "SearchBackgroundJobsResponse", + "options": { + "(google.api.http).get": "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:searchBackgroundJobs" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:searchBackgroundJobs" + } + } + ] + }, + "DescribeConversionWorkspaceRevisions": { + "requestType": "DescribeConversionWorkspaceRevisionsRequest", + "responseType": "DescribeConversionWorkspaceRevisionsResponse", + "options": { + "(google.api.http).get": "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:describeConversionWorkspaceRevisions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{conversion_workspace=projects/*/locations/*/conversionWorkspaces/*}:describeConversionWorkspaceRevisions" + } + } + ] + }, + "FetchStaticIps": { + "requestType": "FetchStaticIpsRequest", + "responseType": "FetchStaticIpsResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*}:fetchStaticIps", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*}:fetchStaticIps" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListMigrationJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamigration.googleapis.com/MigrationJob" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListMigrationJobsResponse": { + "fields": { + "migrationJobs": { + "rule": "repeated", + "type": "MigrationJob", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "CreateMigrationJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamigration.googleapis.com/MigrationJob" + } + }, + "migrationJobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "migrationJob": { + "type": "MigrationJob", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "UpdateMigrationJobRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "migrationJob": { + "type": "MigrationJob", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3 + } + } + }, + "DeleteMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + }, + "requestId": { + "type": "string", + "id": 2 + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "StartMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "StopMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "ResumeMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "PromoteMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "VerifyMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "RestartMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "GenerateSshScriptRequest": { + "oneofs": { + "vmConfig": { + "oneof": [ + "vmCreationConfig", + "vmSelectionConfig" + ] + } + }, + "fields": { + "migrationJob": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + }, + "vm": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vmCreationConfig": { + "type": "VmCreationConfig", + "id": 100 + }, + "vmSelectionConfig": { + "type": "VmSelectionConfig", + "id": 101 + }, + "vmPort": { + "type": "int32", + "id": 3 + } + } + }, + "VmCreationConfig": { + "fields": { + "vmMachineType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vmZone": { + "type": "string", + "id": 2 + }, + "subnet": { + "type": "string", + "id": 3 + } + } + }, + "VmSelectionConfig": { + "fields": { + "vmZone": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SshScript": { + "fields": { + "script": { + "type": "string", + "id": 1 + } + } + }, + "ListConnectionProfilesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamigration.googleapis.com/ConnectionProfile" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListConnectionProfilesResponse": { + "fields": { + "connectionProfiles": { + "rule": "repeated", + "type": "ConnectionProfile", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetConnectionProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConnectionProfile" + } + } + } + }, + "CreateConnectionProfileRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConnectionProfile" + } + }, + "connectionProfileId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "connectionProfile": { + "type": "ConnectionProfile", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "skipValidation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateConnectionProfileRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "connectionProfile": { + "type": "ConnectionProfile", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "skipValidation": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteConnectionProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConnectionProfile" + } + }, + "requestId": { + "type": "string", + "id": 2 + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "CreatePrivateConnectionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamigration.googleapis.com/PrivateConnection" + } + }, + "privateConnectionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "privateConnection": { + "type": "PrivateConnection", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "skipValidation": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListPrivateConnectionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamigration.googleapis.com/PrivateConnection" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListPrivateConnectionsResponse": { + "fields": { + "privateConnections": { + "rule": "repeated", + "type": "PrivateConnection", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "DeletePrivateConnectionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/PrivateConnection" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetPrivateConnectionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/PrivateConnection" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListConversionWorkspacesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamigration.googleapis.com/ConversionWorkspace" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListConversionWorkspacesResponse": { + "fields": { + "conversionWorkspaces": { + "rule": "repeated", + "type": "ConversionWorkspace", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetConversionWorkspaceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConversionWorkspace" + } + } + } + }, + "CreateConversionWorkspaceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamigration.googleapis.com/ConversionWorkspace" + } + }, + "conversionWorkspaceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "conversionWorkspace": { + "type": "ConversionWorkspace", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "UpdateConversionWorkspaceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "conversionWorkspace": { + "type": "ConversionWorkspace", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3 + } + } + }, + "DeleteConversionWorkspaceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConversionWorkspace" + } + }, + "requestId": { + "type": "string", + "id": 2 + } + } + }, + "CommitConversionWorkspaceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConversionWorkspace" + } + }, + "commitName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RollbackConversionWorkspaceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConversionWorkspace" + } + } + } + }, + "ApplyConversionWorkspaceRequest": { + "oneofs": { + "destination": { + "oneof": [ + "connectionProfile" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConversionWorkspace" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "connectionProfile": { + "type": "string", + "id": 100 + } + } + }, + "SeedConversionWorkspaceRequest": { + "oneofs": { + "seedFrom": { + "oneof": [ + "sourceConnectionProfile", + "destinationConnectionProfile" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConversionWorkspace" + } + }, + "autoCommit": { + "type": "bool", + "id": 2 + }, + "sourceConnectionProfile": { + "type": "string", + "id": 100 + }, + "destinationConnectionProfile": { + "type": "string", + "id": 101 + } + } + }, + "ConvertConversionWorkspaceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConversionWorkspace" + } + }, + "autoCommit": { + "type": "bool", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + } + } + }, + "ImportMappingRulesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConversionWorkspace" + } + }, + "rulesFormat": { + "type": "ImportRulesFileFormat", + "id": 2 + }, + "rulesFiles": { + "rule": "repeated", + "type": "RulesFile", + "id": 3 + }, + "autoCommit": { + "type": "bool", + "id": 6 + } + }, + "nested": { + "RulesFile": { + "fields": { + "rulesSourceFilename": { + "type": "string", + "id": 1 + }, + "rulesContent": { + "type": "string", + "id": 2 + } + } + } + } + }, + "DescribeDatabaseEntitiesRequest": { + "fields": { + "conversionWorkspace": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConversionWorkspace" + } + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "tree": { + "type": "DBTreeType", + "id": 6 + }, + "uncommitted": { + "type": "bool", + "id": 11 + }, + "commitId": { + "type": "string", + "id": 12 + }, + "filter": { + "type": "string", + "id": 13 + } + }, + "nested": { + "DBTreeType": { + "values": { + "DB_TREE_TYPE_UNSPECIFIED": 0, + "SOURCE_TREE": 1, + "DRAFT_TREE": 2, + "DESTINATION_TREE": 3 + } + } + } + }, + "DescribeDatabaseEntitiesResponse": { + "fields": { + "databaseEntities": { + "rule": "repeated", + "type": "DatabaseEntity", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchBackgroundJobsRequest": { + "fields": { + "conversionWorkspace": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConversionWorkspace" + } + }, + "returnMostRecentPerJobType": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "completedUntilTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchBackgroundJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "BackgroundJobLogEntry", + "id": 1 + } + } + }, + "DescribeConversionWorkspaceRevisionsRequest": { + "fields": { + "conversionWorkspace": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConversionWorkspace" + } + }, + "commitId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DescribeConversionWorkspaceRevisionsResponse": { + "fields": { + "revisions": { + "rule": "repeated", + "type": "ConversionWorkspace", + "id": 1 + } + } + }, + "FetchStaticIpsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "FetchStaticIpsResponse": { + "fields": { + "staticIps": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SslConfig": { + "fields": { + "type": { + "type": "SslType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clientKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "clientCertificate": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "caCertificate": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SslType": { + "values": { + "SSL_TYPE_UNSPECIFIED": 0, + "SERVER_ONLY": 1, + "SERVER_CLIENT": 2 + } + } + } + }, + "MySqlConnectionProfile": { + "fields": { + "host": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "port": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "username": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "password": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "passwordSet": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ssl": { + "type": "SslConfig", + "id": 6 + }, + "cloudSqlId": { + "type": "string", + "id": 7 + } + } + }, + "NetworkArchitecture": { + "values": { + "NETWORK_ARCHITECTURE_UNSPECIFIED": 0, + "NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER": 1, + "NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER": 2 + } + }, + "PostgreSqlConnectionProfile": { + "oneofs": { + "connectivity": { + "oneof": [ + "staticIpConnectivity", + "privateServiceConnectConnectivity" + ] + } + }, + "fields": { + "host": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "port": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "username": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "password": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "passwordSet": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ssl": { + "type": "SslConfig", + "id": 6 + }, + "cloudSqlId": { + "type": "string", + "id": 7 + }, + "networkArchitecture": { + "type": "NetworkArchitecture", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "staticIpConnectivity": { + "type": "StaticIpConnectivity", + "id": 100 + }, + "privateServiceConnectConnectivity": { + "type": "PrivateServiceConnectConnectivity", + "id": 101 + } + } + }, + "OracleConnectionProfile": { + "oneofs": { + "connectivity": { + "oneof": [ + "staticServiceIpConnectivity", + "forwardSshConnectivity", + "privateConnectivity" + ] + } + }, + "fields": { + "host": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "port": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "username": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "password": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "passwordSet": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseService": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "staticServiceIpConnectivity": { + "type": "StaticServiceIpConnectivity", + "id": 100 + }, + "forwardSshConnectivity": { + "type": "ForwardSshTunnelConnectivity", + "id": 101 + }, + "privateConnectivity": { + "type": "PrivateConnectivity", + "id": 102 } } }, - "ListMigrationJobsRequest": { + "CloudSqlConnectionProfile": { "fields": { - "parent": { + "cloudSqlId": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "datamigration.googleapis.com/MigrationJob" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "pageSize": { - "type": "int32", - "id": 2 + "settings": { + "type": "CloudSqlSettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } }, - "pageToken": { + "privateIp": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "filter": { + "publicIp": { "type": "string", - "id": 4 + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "orderBy": { + "additionalPublicIp": { "type": "string", - "id": 5 + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, - "ListMigrationJobsResponse": { + "AlloyDbConnectionProfile": { "fields": { - "migrationJobs": { - "rule": "repeated", - "type": "MigrationJob", - "id": 1 - }, - "nextPageToken": { + "clusterId": { "type": "string", - "id": 2 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 + "settings": { + "type": "AlloyDbSettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } } }, - "GetMigrationJobRequest": { + "SqlAclEntry": { + "oneofs": { + "expiration": { + "oneof": [ + "expireTime", + "ttl" + ] + } + }, "fields": { - "name": { + "value": { "type": "string", - "id": 1, + "id": 1 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 11, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + "(google.api.field_behavior)": "INPUT_ONLY" } + }, + "label": { + "type": "string", + "id": 3 } } }, - "CreateMigrationJobRequest": { + "SqlIpConfig": { "fields": { - "parent": { + "enableIpv4": { + "type": "google.protobuf.BoolValue", + "id": 1 + }, + "privateNetwork": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "datamigration.googleapis.com/MigrationJob" - } + "id": 2 }, - "migrationJobId": { + "allocatedIpRange": { "type": "string", - "id": 2, + "id": 5, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } }, - "migrationJob": { - "type": "MigrationJob", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "requireSsl": { + "type": "google.protobuf.BoolValue", + "id": 3 }, - "requestId": { - "type": "string", + "authorizedNetworks": { + "rule": "repeated", + "type": "SqlAclEntry", "id": 4 } } }, - "UpdateMigrationJobRequest": { + "CloudSqlSettings": { "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "databaseVersion": { + "type": "SqlDatabaseVersion", + "id": 1 }, - "migrationJob": { - "type": "MigrationJob", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "userLabels": { + "keyType": "string", + "type": "string", + "id": 2 }, - "requestId": { + "tier": { "type": "string", "id": 3 - } - } - }, - "DeleteMigrationJobRequest": { - "fields": { - "name": { + }, + "storageAutoResizeLimit": { + "type": "google.protobuf.Int64Value", + "id": 4 + }, + "activationPolicy": { + "type": "SqlActivationPolicy", + "id": 5 + }, + "ipConfig": { + "type": "SqlIpConfig", + "id": 6 + }, + "autoStorageIncrease": { + "type": "google.protobuf.BoolValue", + "id": 7 + }, + "databaseFlags": { + "keyType": "string", "type": "string", - "id": 1, + "id": 8 + }, + "dataDiskType": { + "type": "SqlDataDiskType", + "id": 9 + }, + "dataDiskSizeGb": { + "type": "google.protobuf.Int64Value", + "id": 10 + }, + "zone": { + "type": "string", + "id": 11 + }, + "secondaryZone": { + "type": "string", + "id": 18, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + "(google.api.field_behavior)": "OPTIONAL" } }, - "requestId": { + "sourceId": { "type": "string", - "id": 2 + "id": 12 }, - "force": { + "rootPassword": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "rootPasswordSet": { "type": "bool", - "id": 3 - } - } - }, - "StartMigrationJobRequest": { - "fields": { - "name": { + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "collation": { "type": "string", - "id": 1, + "id": 15 + }, + "cmekKeyName": { + "type": "string", + "id": 16 + }, + "availabilityType": { + "type": "SqlAvailabilityType", + "id": 17, "options": { - "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SqlActivationPolicy": { + "values": { + "SQL_ACTIVATION_POLICY_UNSPECIFIED": 0, + "ALWAYS": 1, + "NEVER": 2 + } + }, + "SqlDataDiskType": { + "values": { + "SQL_DATA_DISK_TYPE_UNSPECIFIED": 0, + "PD_SSD": 1, + "PD_HDD": 2 + } + }, + "SqlDatabaseVersion": { + "values": { + "SQL_DATABASE_VERSION_UNSPECIFIED": 0, + "MYSQL_5_6": 1, + "MYSQL_5_7": 2, + "POSTGRES_9_6": 3, + "POSTGRES_11": 4, + "POSTGRES_10": 5, + "MYSQL_8_0": 6, + "POSTGRES_12": 7, + "POSTGRES_13": 8, + "POSTGRES_14": 17 + } + }, + "SqlAvailabilityType": { + "values": { + "SQL_AVAILABILITY_TYPE_UNSPECIFIED": 0, + "ZONAL": 1, + "REGIONAL": 2 } } } }, - "StopMigrationJobRequest": { + "AlloyDbSettings": { "fields": { - "name": { - "type": "string", + "initialUser": { + "type": "UserPassword", "id": 1, "options": { - "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + "(google.api.field_behavior)": "INPUT_ONLY" } - } - } - }, - "ResumeMigrationJobRequest": { - "fields": { - "name": { + }, + "vpcNetwork": { "type": "string", - "id": 1, + "id": 2, "options": { - "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + "(google.api.field_behavior)": "REQUIRED" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "primaryInstanceSettings": { + "type": "PrimaryInstanceSettings", + "id": 4 + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "UserPassword": { + "fields": { + "user": { + "type": "string", + "id": 1 + }, + "password": { + "type": "string", + "id": 2 + }, + "passwordSet": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PrimaryInstanceSettings": { + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "machineConfig": { + "type": "MachineConfig", + "id": 2 + }, + "databaseFlags": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "privateIp": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "MachineConfig": { + "fields": { + "cpuCount": { + "type": "int32", + "id": 1 + } + } + } + } + }, + "EncryptionConfig": { + "fields": { + "kmsKeyName": { + "type": "string", + "id": 1 + } } } } }, - "PromoteMigrationJobRequest": { + "StaticIpConnectivity": { + "fields": {} + }, + "PrivateServiceConnectConnectivity": { "fields": { - "name": { + "serviceAttachment": { "type": "string", "id": 1, "options": { - "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + "(google.api.field_behavior)": "REQUIRED" } } } }, - "VerifyMigrationJobRequest": { + "ReverseSshConnectivity": { "fields": { - "name": { + "vmIp": { "type": "string", "id": 1, "options": { - "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vmPort": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" } + }, + "vm": { + "type": "string", + "id": 3 + }, + "vpc": { + "type": "string", + "id": 4 } } }, - "RestartMigrationJobRequest": { + "VpcPeeringConnectivity": { "fields": { - "name": { + "vpc": { "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" - } + "id": 1 } } }, - "GenerateSshScriptRequest": { + "ForwardSshTunnelConnectivity": { "oneofs": { - "vmConfig": { + "authenticationMethod": { "oneof": [ - "vmCreationConfig", - "vmSelectionConfig" + "password", + "privateKey" ] } }, "fields": { - "migrationJob": { + "hostname": { "type": "string", "id": 1, "options": { - "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + "(google.api.field_behavior)": "REQUIRED" } }, - "vm": { + "username": { "type": "string", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "vmCreationConfig": { - "type": "VmCreationConfig", - "id": 100 - }, - "vmSelectionConfig": { - "type": "VmSelectionConfig", - "id": 101 - }, - "vmPort": { + "port": { "type": "int32", "id": 3 - } - } - }, - "VmCreationConfig": { - "fields": { - "vmMachineType": { + }, + "password": { "type": "string", - "id": 1, + "id": 100, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "INPUT_ONLY" } }, - "vmZone": { - "type": "string", - "id": 2 - }, - "subnet": { + "privateKey": { "type": "string", - "id": 3 + "id": 101, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } } } }, - "VmSelectionConfig": { + "StaticServiceIpConnectivity": { + "fields": {} + }, + "PrivateConnectivity": { "fields": { - "vmZone": { + "privateConnection": { "type": "string", "id": 1, "options": { @@ -685,874 +2558,1145 @@ } } }, - "SshScript": { + "DatabaseType": { "fields": { - "script": { - "type": "string", + "provider": { + "type": "DatabaseProvider", "id": 1 + }, + "engine": { + "type": "DatabaseEngine", + "id": 2 } } }, - "ListConnectionProfilesRequest": { + "MigrationJob": { + "options": { + "(google.api.resource).type": "datamigration.googleapis.com/MigrationJob", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/migrationJobs/{migration_job}" + }, + "oneofs": { + "connectivity": { + "oneof": [ + "reverseSshConnectivity", + "vpcPeeringConnectivity", + "staticIpConnectivity" + ] + } + }, "fields": { - "parent": { + "name": { "type": "string", - "id": 1, + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "datamigration.googleapis.com/ConnectionProfile" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "filter": { + "labels": { + "keyType": "string", "type": "string", "id": 4 }, - "orderBy": { + "displayName": { "type": "string", "id": 5 - } - } - }, - "ListConnectionProfilesResponse": { - "fields": { - "connectionProfiles": { - "rule": "repeated", - "type": "ConnectionProfile", - "id": 1 }, - "nextPageToken": { - "type": "string", - "id": 2 + "state": { + "type": "State", + "id": 6 }, - "unreachable": { - "rule": "repeated", + "phase": { + "type": "Phase", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dumpPath": { "type": "string", - "id": 3 - } - } - }, - "GetConnectionProfileRequest": { - "fields": { - "name": { + "id": 9 + }, + "dumpFlags": { + "type": "DumpFlags", + "id": 17 + }, + "source": { "type": "string", - "id": 1, + "id": 10, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "datamigration.googleapis.com/ConnectionProfile" + "(google.api.field_behavior)": "REQUIRED" } - } - } - }, - "CreateConnectionProfileRequest": { - "fields": { - "parent": { + }, + "destination": { "type": "string", - "id": 1, + "id": 11, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "reverseSshConnectivity": { + "type": "ReverseSshConnectivity", + "id": 101 + }, + "vpcPeeringConnectivity": { + "type": "VpcPeeringConnectivity", + "id": 102 + }, + "staticIpConnectivity": { + "type": "StaticIpConnectivity", + "id": 103 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 12, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "datamigration.googleapis.com/ConnectionProfile" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "connectionProfileId": { - "type": "string", - "id": 2, + "error": { + "type": "google.rpc.Status", + "id": 13, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "connectionProfile": { - "type": "ConnectionProfile", - "id": 3, + "sourceDatabase": { + "type": "DatabaseType", + "id": 14 + }, + "destinationDatabase": { + "type": "DatabaseType", + "id": 15 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 16, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "requestId": { + "conversionWorkspace": { + "type": "ConversionWorkspaceInfo", + "id": 18 + }, + "filter": { "type": "string", - "id": 4 + "id": 20 + }, + "cmekKeyName": { + "type": "string", + "id": 21 } - } - }, - "UpdateConnectionProfileRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "MAINTENANCE": 1, + "DRAFT": 2, + "CREATING": 3, + "NOT_STARTED": 4, + "RUNNING": 5, + "FAILED": 6, + "COMPLETED": 7, + "DELETING": 8, + "STOPPING": 9, + "STOPPED": 10, + "DELETED": 11, + "UPDATING": 12, + "STARTING": 13, + "RESTARTING": 14, + "RESUMING": 15 } }, - "connectionProfile": { - "type": "ConnectionProfile", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "Phase": { + "values": { + "PHASE_UNSPECIFIED": 0, + "FULL_DUMP": 1, + "CDC": 2, + "PROMOTE_IN_PROGRESS": 3, + "WAITING_FOR_SOURCE_WRITES_TO_STOP": 4, + "PREPARING_THE_DUMP": 5 } }, - "requestId": { - "type": "string", - "id": 3 + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ONE_TIME": 1, + "CONTINUOUS": 2 + } + }, + "DumpFlag": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + }, + "DumpFlags": { + "fields": { + "dumpFlags": { + "rule": "repeated", + "type": "DumpFlag", + "id": 1 + } + } } } }, - "DeleteConnectionProfileRequest": { + "ConversionWorkspaceInfo": { "fields": { "name": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "datamigration.googleapis.com/ConnectionProfile" - } + "id": 1 }, - "requestId": { + "commitId": { "type": "string", "id": 2 - }, - "force": { - "type": "bool", - "id": 3 } } }, - "OperationMetadata": { + "ConnectionProfile": { + "options": { + "(google.api.resource).type": "datamigration.googleapis.com/ConnectionProfile", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}" + }, + "oneofs": { + "connectionProfile": { + "oneof": [ + "mysql", + "postgresql", + "oracle", + "cloudsql", + "alloydb" + ] + } + }, "fields": { + "name": { + "type": "string", + "id": 1 + }, "createTime": { "type": "google.protobuf.Timestamp", - "id": 1, + "id": 2, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "endTime": { + "updateTime": { "type": "google.protobuf.Timestamp", - "id": 2, + "id": 3, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "target": { + "labels": { + "keyType": "string", "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "id": 4 }, - "verb": { + "state": { + "type": "State", + "id": 5 + }, + "displayName": { "type": "string", - "id": 4, + "id": 6 + }, + "mysql": { + "type": "MySqlConnectionProfile", + "id": 100 + }, + "postgresql": { + "type": "PostgreSqlConnectionProfile", + "id": 101 + }, + "oracle": { + "type": "OracleConnectionProfile", + "id": 104 + }, + "cloudsql": { + "type": "CloudSqlConnectionProfile", + "id": 102 + }, + "alloydb": { + "type": "AlloyDbConnectionProfile", + "id": 105 + }, + "error": { + "type": "google.rpc.Status", + "id": 7, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "statusMessage": { - "type": "string", - "id": 5, + "provider": { + "type": "DatabaseProvider", + "id": 8 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "DRAFT": 1, + "CREATING": 2, + "READY": 3, + "UPDATING": 4, + "DELETING": 5, + "DELETED": 6, + "FAILED": 7 + } + } + } + }, + "MigrationJobVerificationError": { + "fields": { + "errorCode": { + "type": "ErrorCode", + "id": 1, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "requestedCancellation": { - "type": "bool", - "id": 6, + "errorMessage": { + "type": "string", + "id": 2, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "apiVersion": { + "errorDetailMessage": { "type": "string", - "id": 7, + "id": 3, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } } + }, + "nested": { + "ErrorCode": { + "values": { + "ERROR_CODE_UNSPECIFIED": 0, + "CONNECTION_FAILURE": 1, + "AUTHENTICATION_FAILURE": 2, + "INVALID_CONNECTION_PROFILE_CONFIG": 3, + "VERSION_INCOMPATIBILITY": 4, + "CONNECTION_PROFILE_TYPES_INCOMPATIBILITY": 5, + "NO_PGLOGICAL_INSTALLED": 7, + "PGLOGICAL_NODE_ALREADY_EXISTS": 8, + "INVALID_WAL_LEVEL": 9, + "INVALID_SHARED_PRELOAD_LIBRARY": 10, + "INSUFFICIENT_MAX_REPLICATION_SLOTS": 11, + "INSUFFICIENT_MAX_WAL_SENDERS": 12, + "INSUFFICIENT_MAX_WORKER_PROCESSES": 13, + "UNSUPPORTED_EXTENSIONS": 14, + "UNSUPPORTED_MIGRATION_TYPE": 15, + "INVALID_RDS_LOGICAL_REPLICATION": 16, + "UNSUPPORTED_GTID_MODE": 17, + "UNSUPPORTED_TABLE_DEFINITION": 18, + "UNSUPPORTED_DEFINER": 19, + "CANT_RESTART_RUNNING_MIGRATION": 21, + "TABLES_WITH_LIMITED_SUPPORT": 24, + "UNSUPPORTED_DATABASE_LOCALE": 25, + "UNSUPPORTED_DATABASE_FDW_CONFIG": 26, + "ERROR_RDBMS": 27, + "SOURCE_SIZE_EXCEEDS_THRESHOLD": 28 + } + } } }, - "SslConfig": { + "DatabaseEngine": { + "values": { + "DATABASE_ENGINE_UNSPECIFIED": 0, + "MYSQL": 1, + "POSTGRESQL": 2, + "ORACLE": 4 + } + }, + "DatabaseProvider": { + "values": { + "DATABASE_PROVIDER_UNSPECIFIED": 0, + "CLOUDSQL": 1, + "RDS": 2, + "AURORA": 3, + "ALLOYDB": 4 + } + }, + "PrivateConnection": { + "options": { + "(google.api.resource).type": "datamigration.googleapis.com/PrivateConnection", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/privateConnections/{private_connection}" + }, + "oneofs": { + "connectivity": { + "oneof": [ + "vpcPeeringConfig" + ] + } + }, "fields": { - "type": { - "type": "SslType", - "id": 1, + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "clientKey": { - "type": "string", - "id": 2, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, "options": { - "(google.api.field_behavior)": "INPUT_ONLY" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "clientCertificate": { + "labels": { + "keyType": "string", "type": "string", - "id": 3, + "id": 4 + }, + "displayName": { + "type": "string", + "id": 5 + }, + "state": { + "type": "State", + "id": 6, "options": { - "(google.api.field_behavior)": "INPUT_ONLY" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "caCertificate": { - "type": "string", - "id": 4, + "error": { + "type": "google.rpc.Status", + "id": 7, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "vpcPeeringConfig": { + "type": "VpcPeeringConfig", + "id": 100 } }, "nested": { - "SslType": { + "State": { "values": { - "SSL_TYPE_UNSPECIFIED": 0, - "SERVER_ONLY": 1, - "SERVER_CLIENT": 2 + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "CREATED": 2, + "FAILED": 3, + "DELETING": 4, + "FAILED_TO_DELETE": 5, + "DELETED": 6 } } } }, - "MySqlConnectionProfile": { + "VpcPeeringConfig": { "fields": { - "host": { + "vpcName": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Networks" } }, - "port": { - "type": "int32", + "subnet": { + "type": "string", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } - }, - "username": { - "type": "string", - "id": 3, + } + } + }, + "DatabaseEngineInfo": { + "fields": { + "engine": { + "type": "DatabaseEngine", + "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "password": { + "version": { "type": "string", - "id": 4, + "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } - }, - "passwordSet": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "ssl": { - "type": "SslConfig", - "id": 6 - }, - "cloudSqlId": { - "type": "string", - "id": 7 } } }, - "PostgreSqlConnectionProfile": { + "ConversionWorkspace": { + "options": { + "(google.api.resource).type": "datamigration.googleapis.com/ConversionWorkspace", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}" + }, "fields": { - "host": { + "name": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 1 }, - "port": { - "type": "int32", + "source": { + "type": "DatabaseEngineInfo", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "username": { - "type": "string", + "destination": { + "type": "DatabaseEngineInfo", "id": 3, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "password": { + "globalSettings": { + "keyType": "string", "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 4 }, - "passwordSet": { + "hasUncommittedChanges": { "type": "bool", "id": 5, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "ssl": { - "type": "SslConfig", - "id": 6 - }, - "cloudSqlId": { - "type": "string", - "id": 7 - } - } - }, - "CloudSqlConnectionProfile": { - "fields": { - "cloudSqlId": { + "latestCommitId": { "type": "string", - "id": 1, + "id": 6, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "settings": { - "type": "CloudSqlSettings", - "id": 2, + "latestCommitTime": { + "type": "google.protobuf.Timestamp", + "id": 7, "options": { - "(google.api.field_behavior)": "IMMUTABLE" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "privateIp": { - "type": "string", - "id": 3, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "publicIp": { - "type": "string", - "id": 4, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "displayName": { + "type": "string", + "id": 11 } } }, - "SqlAclEntry": { + "BackgroundJobLogEntry": { "oneofs": { - "expiration": { + "jobDetails": { "oneof": [ - "expireTime", - "ttl" + "seedJobDetails", + "importRulesJobDetails", + "convertJobDetails", + "applyJobDetails" ] } }, "fields": { - "value": { - "type": "string", - "id": 1 - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 10 - }, - "ttl": { - "type": "google.protobuf.Duration", - "id": 11, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - }, - "label": { - "type": "string", - "id": 3 - } - } - }, - "SqlIpConfig": { - "fields": { - "enableIpv4": { - "type": "google.protobuf.BoolValue", - "id": 1 - }, - "privateNetwork": { + "id": { "type": "string", - "id": 2 - }, - "requireSsl": { - "type": "google.protobuf.BoolValue", - "id": 3 - }, - "authorizedNetworks": { - "rule": "repeated", - "type": "SqlAclEntry", - "id": 4 - } - } - }, - "CloudSqlSettings": { - "fields": { - "databaseVersion": { - "type": "SqlDatabaseVersion", "id": 1 }, - "userLabels": { - "keyType": "string", - "type": "string", + "jobType": { + "type": "BackgroundJobType", "id": 2 }, - "tier": { - "type": "string", + "startTime": { + "type": "google.protobuf.Timestamp", "id": 3 }, - "storageAutoResizeLimit": { - "type": "google.protobuf.Int64Value", + "finishTime": { + "type": "google.protobuf.Timestamp", "id": 4 }, - "activationPolicy": { - "type": "SqlActivationPolicy", + "completionState": { + "type": "JobCompletionState", "id": 5 }, - "ipConfig": { - "type": "SqlIpConfig", + "completionComment": { + "type": "string", "id": 6 }, - "autoStorageIncrease": { - "type": "google.protobuf.BoolValue", + "requestAutocommit": { + "type": "bool", "id": 7 }, - "databaseFlags": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "dataDiskType": { - "type": "SqlDataDiskType", - "id": 9 - }, - "dataDiskSizeGb": { - "type": "google.protobuf.Int64Value", - "id": 10 - }, - "zone": { - "type": "string", - "id": 11 - }, - "sourceId": { - "type": "string", - "id": 12 + "seedJobDetails": { + "type": "SeedJobDetails", + "id": 100 }, - "rootPassword": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } + "importRulesJobDetails": { + "type": "ImportRulesJobDetails", + "id": 101 }, - "rootPasswordSet": { - "type": "bool", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "convertJobDetails": { + "type": "ConvertJobDetails", + "id": 102 }, - "collation": { - "type": "string", - "id": 15 + "applyJobDetails": { + "type": "ApplyJobDetails", + "id": 103 } }, "nested": { - "SqlActivationPolicy": { + "JobCompletionState": { "values": { - "SQL_ACTIVATION_POLICY_UNSPECIFIED": 0, - "ALWAYS": 1, - "NEVER": 2 + "JOB_COMPLETION_STATE_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2 + } + }, + "SeedJobDetails": { + "fields": { + "connectionProfile": { + "type": "string", + "id": 1 + } + } + }, + "ImportRulesJobDetails": { + "fields": { + "files": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "fileFormat": { + "type": "ImportRulesFileFormat", + "id": 2 + } } }, - "SqlDataDiskType": { - "values": { - "SQL_DATA_DISK_TYPE_UNSPECIFIED": 0, - "PD_SSD": 1, - "PD_HDD": 2 + "ConvertJobDetails": { + "fields": { + "filter": { + "type": "string", + "id": 1 + } } }, - "SqlDatabaseVersion": { - "values": { - "SQL_DATABASE_VERSION_UNSPECIFIED": 0, - "MYSQL_5_6": 1, - "MYSQL_5_7": 2, - "POSTGRES_9_6": 3, - "POSTGRES_11": 4, - "POSTGRES_10": 5, - "MYSQL_8_0": 6, - "POSTGRES_12": 7, - "POSTGRES_13": 8 + "ApplyJobDetails": { + "fields": { + "connectionProfile": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + } } } } }, - "StaticIpConnectivity": { - "fields": {} - }, - "ReverseSshConnectivity": { + "DatabaseEntity": { + "oneofs": { + "entityBody": { + "oneof": [ + "schema", + "table", + "view", + "sequence", + "storedProcedure", + "databaseFunction", + "synonym", + "databasePackage" + ] + } + }, "fields": { - "vmIp": { + "shortName": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "vmPort": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 1 }, - "vm": { + "parentEntity": { "type": "string", + "id": 2 + }, + "tree": { + "type": "TreeType", "id": 3 }, - "vpc": { - "type": "string", + "entityType": { + "type": "DatabaseEntityType", "id": 4 + }, + "mappings": { + "rule": "repeated", + "type": "EntityMapping", + "id": 5 + }, + "schema": { + "type": "SchemaEntity", + "id": 102 + }, + "table": { + "type": "TableEntity", + "id": 103 + }, + "view": { + "type": "ViewEntity", + "id": 104 + }, + "sequence": { + "type": "SequenceEntity", + "id": 105 + }, + "storedProcedure": { + "type": "StoredProcedureEntity", + "id": 106 + }, + "databaseFunction": { + "type": "FunctionEntity", + "id": 107 + }, + "synonym": { + "type": "SynonymEntity", + "id": 108 + }, + "databasePackage": { + "type": "PackageEntity", + "id": 109 + } + }, + "nested": { + "TreeType": { + "values": { + "TREE_TYPE_UNSPECIFIED": 0, + "SOURCE": 1, + "DRAFT": 2, + "DESTINATION": 3 + } } } }, - "VpcPeeringConnectivity": { + "SchemaEntity": { "fields": { - "vpc": { - "type": "string", + "customFeatures": { + "type": "google.protobuf.Struct", "id": 1 } } }, - "DatabaseType": { + "TableEntity": { "fields": { - "provider": { - "type": "DatabaseProvider", + "columns": { + "rule": "repeated", + "type": "ColumnEntity", "id": 1 }, - "engine": { - "type": "DatabaseEngine", + "constraints": { + "rule": "repeated", + "type": "ConstraintEntity", "id": 2 + }, + "indices": { + "rule": "repeated", + "type": "IndexEntity", + "id": 3 + }, + "triggers": { + "rule": "repeated", + "type": "TriggerEntity", + "id": 4 + }, + "customFeatures": { + "type": "google.protobuf.Struct", + "id": 5 + }, + "comment": { + "type": "string", + "id": 6 } } }, - "MigrationJob": { - "options": { - "(google.api.resource).type": "datamigration.googleapis.com/MigrationJob", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/migrationJobs/{migration_job}" - }, - "oneofs": { - "connectivity": { - "oneof": [ - "reverseSshConnectivity", - "vpcPeeringConnectivity", - "staticIpConnectivity" - ] - } - }, + "ColumnEntity": { "fields": { "name": { "type": "string", "id": 1 }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "dataType": { + "type": "string", + "id": 2 }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "charset": { + "type": "string", + "id": 3 }, - "labels": { - "keyType": "string", + "collation": { "type": "string", "id": 4 }, - "displayName": { - "type": "string", + "length": { + "type": "int64", "id": 5 }, - "state": { - "type": "State", + "precision": { + "type": "int32", "id": 6 }, - "phase": { - "type": "Phase", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "scale": { + "type": "int32", + "id": 7 }, - "type": { - "type": "Type", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "fractionalSecondsPrecision": { + "type": "int32", + "id": 8 }, - "dumpPath": { - "type": "string", + "array": { + "type": "bool", "id": 9 }, - "source": { + "arrayLength": { + "type": "int32", + "id": 10 + }, + "nullable": { + "type": "bool", + "id": 11 + }, + "autoGenerated": { + "type": "bool", + "id": 12 + }, + "udt": { + "type": "bool", + "id": 13 + }, + "customFeatures": { + "type": "google.protobuf.Struct", + "id": 14 + }, + "setValues": { + "rule": "repeated", "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 15 }, - "destination": { + "comment": { "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 16 }, - "reverseSshConnectivity": { - "type": "ReverseSshConnectivity", - "id": 101 + "ordinalPosition": { + "type": "int32", + "id": 17 }, - "vpcPeeringConnectivity": { - "type": "VpcPeeringConnectivity", - "id": 102 + "defaultValue": { + "type": "string", + "id": 18 + } + } + }, + "ConstraintEntity": { + "fields": { + "name": { + "type": "string", + "id": 1 }, - "staticIpConnectivity": { - "type": "StaticIpConnectivity", - "id": 103 + "type": { + "type": "string", + "id": 2 }, - "duration": { - "type": "google.protobuf.Duration", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "tableColumns": { + "rule": "repeated", + "type": "string", + "id": 3 }, - "error": { - "type": "google.rpc.Status", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "customFeatures": { + "type": "google.protobuf.Struct", + "id": 4 }, - "sourceDatabase": { - "type": "DatabaseType", - "id": 14 + "referenceColumns": { + "rule": "repeated", + "type": "string", + "id": 5 }, - "destinationDatabase": { - "type": "DatabaseType", - "id": 15 + "referenceTable": { + "type": "string", + "id": 6 }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "tableName": { + "type": "string", + "id": 7 } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "MAINTENANCE": 1, - "DRAFT": 2, - "CREATING": 3, - "NOT_STARTED": 4, - "RUNNING": 5, - "FAILED": 6, - "COMPLETED": 7, - "DELETING": 8, - "STOPPING": 9, - "STOPPED": 10, - "DELETED": 11, - "UPDATING": 12, - "STARTING": 13, - "RESTARTING": 14, - "RESUMING": 15 - } + } + }, + "IndexEntity": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + }, + "tableColumns": { + "rule": "repeated", + "type": "string", + "id": 3 }, - "Phase": { - "values": { - "PHASE_UNSPECIFIED": 0, - "FULL_DUMP": 1, - "CDC": 2, - "PROMOTE_IN_PROGRESS": 3, - "WAITING_FOR_SOURCE_WRITES_TO_STOP": 4, - "PREPARING_THE_DUMP": 5 - } + "unique": { + "type": "bool", + "id": 4 }, - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "ONE_TIME": 1, - "CONTINUOUS": 2 - } + "customFeatures": { + "type": "google.protobuf.Struct", + "id": 5 } } }, - "ConnectionProfile": { - "options": { - "(google.api.resource).type": "datamigration.googleapis.com/ConnectionProfile", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}" - }, - "oneofs": { - "connectionProfile": { - "oneof": [ - "mysql", - "postgresql", - "cloudsql" - ] - } - }, + "TriggerEntity": { "fields": { "name": { "type": "string", "id": 1 }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "triggeringEvents": { + "rule": "repeated", + "type": "string", + "id": 2 }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "triggerType": { + "type": "string", + "id": 3 }, - "labels": { - "keyType": "string", + "sqlCode": { "type": "string", "id": 4 }, - "state": { - "type": "State", + "customFeatures": { + "type": "google.protobuf.Struct", "id": 5 - }, - "displayName": { + } + } + }, + "ViewEntity": { + "fields": { + "sqlCode": { "type": "string", - "id": 6 + "id": 1 }, - "mysql": { - "type": "MySqlConnectionProfile", - "id": 100 + "customFeatures": { + "type": "google.protobuf.Struct", + "id": 2 }, - "postgresql": { - "type": "PostgreSqlConnectionProfile", - "id": 101 + "constraints": { + "rule": "repeated", + "type": "ConstraintEntity", + "id": 3 + } + } + }, + "SequenceEntity": { + "fields": { + "increment": { + "type": "int64", + "id": 1 }, - "cloudsql": { - "type": "CloudSqlConnectionProfile", - "id": 102 + "startValue": { + "type": "bytes", + "id": 2 }, - "error": { - "type": "google.rpc.Status", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "maxValue": { + "type": "bytes", + "id": 3 }, - "provider": { - "type": "DatabaseProvider", - "id": 8 + "minValue": { + "type": "bytes", + "id": 4 + }, + "cycle": { + "type": "bool", + "id": 5 + }, + "cache": { + "type": "int64", + "id": 6 + }, + "customFeatures": { + "type": "google.protobuf.Struct", + "id": 7 } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "DRAFT": 1, - "CREATING": 2, - "READY": 3, - "UPDATING": 4, - "DELETING": 5, - "DELETED": 6, - "FAILED": 7 - } + } + }, + "StoredProcedureEntity": { + "fields": { + "sqlCode": { + "type": "string", + "id": 1 + }, + "customFeatures": { + "type": "google.protobuf.Struct", + "id": 2 } } }, - "MigrationJobVerificationError": { + "FunctionEntity": { "fields": { - "errorCode": { - "type": "ErrorCode", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "sqlCode": { + "type": "string", + "id": 1 }, - "errorMessage": { + "customFeatures": { + "type": "google.protobuf.Struct", + "id": 2 + } + } + }, + "SynonymEntity": { + "fields": { + "sourceEntity": { "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "id": 1 }, - "errorDetailMessage": { + "sourceType": { + "type": "DatabaseEntityType", + "id": 2 + }, + "customFeatures": { + "type": "google.protobuf.Struct", + "id": 3 + } + } + }, + "PackageEntity": { + "fields": { + "packageSqlCode": { "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "id": 1 + }, + "packageBody": { + "type": "string", + "id": 2 + }, + "customFeatures": { + "type": "google.protobuf.Struct", + "id": 3 } - }, - "nested": { - "ErrorCode": { - "values": { - "ERROR_CODE_UNSPECIFIED": 0, - "CONNECTION_FAILURE": 1, - "AUTHENTICATION_FAILURE": 2, - "INVALID_CONNECTION_PROFILE_CONFIG": 3, - "VERSION_INCOMPATIBILITY": 4, - "CONNECTION_PROFILE_TYPES_INCOMPATIBILITY": 5, - "NO_PGLOGICAL_INSTALLED": 7, - "PGLOGICAL_NODE_ALREADY_EXISTS": 8, - "INVALID_WAL_LEVEL": 9, - "INVALID_SHARED_PRELOAD_LIBRARY": 10, - "INSUFFICIENT_MAX_REPLICATION_SLOTS": 11, - "INSUFFICIENT_MAX_WAL_SENDERS": 12, - "INSUFFICIENT_MAX_WORKER_PROCESSES": 13, - "UNSUPPORTED_EXTENSIONS": 14, - "UNSUPPORTED_MIGRATION_TYPE": 15, - "INVALID_RDS_LOGICAL_REPLICATION": 16, - "UNSUPPORTED_GTID_MODE": 17, - "UNSUPPORTED_TABLE_DEFINITION": 18, - "UNSUPPORTED_DEFINER": 19, - "CANT_RESTART_RUNNING_MIGRATION": 21 - } + } + }, + "EntityMapping": { + "fields": { + "sourceEntity": { + "type": "string", + "id": 1 + }, + "draftEntity": { + "type": "string", + "id": 2 + }, + "sourceType": { + "type": "DatabaseEntityType", + "id": 4 + }, + "draftType": { + "type": "DatabaseEntityType", + "id": 5 + }, + "mappingLog": { + "rule": "repeated", + "type": "EntityMappingLogEntry", + "id": 3 } } }, - "DatabaseEngine": { + "EntityMappingLogEntry": { + "fields": { + "ruleId": { + "type": "string", + "id": 1 + }, + "ruleRevisionId": { + "type": "string", + "id": 2 + }, + "mappingComment": { + "type": "string", + "id": 3 + } + } + }, + "DatabaseEntityType": { "values": { - "DATABASE_ENGINE_UNSPECIFIED": 0, - "MYSQL": 1, - "POSTGRESQL": 2 + "DATABASE_ENTITY_TYPE_UNSPECIFIED": 0, + "DATABASE_ENTITY_TYPE_SCHEMA": 1, + "DATABASE_ENTITY_TYPE_TABLE": 2, + "DATABASE_ENTITY_TYPE_COLUMN": 3, + "DATABASE_ENTITY_TYPE_CONSTRAINT": 4, + "DATABASE_ENTITY_TYPE_INDEX": 5, + "DATABASE_ENTITY_TYPE_TRIGGER": 6, + "DATABASE_ENTITY_TYPE_VIEW": 7, + "DATABASE_ENTITY_TYPE_SEQUENCE": 8, + "DATABASE_ENTITY_TYPE_STORED_PROCEDURE": 9, + "DATABASE_ENTITY_TYPE_FUNCTION": 10, + "DATABASE_ENTITY_TYPE_SYNONYM": 11, + "DATABASE_ENTITY_TYPE_DATABASE_PACKAGE": 12, + "DATABASE_ENTITY_TYPE_UDT": 13, + "DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW": 14, + "DATABASE_ENTITY_TYPE_DATABASE": 15 } }, - "DatabaseProvider": { + "BackgroundJobType": { "values": { - "DATABASE_PROVIDER_UNSPECIFIED": 0, - "CLOUDSQL": 1, - "RDS": 2 + "BACKGROUND_JOB_TYPE_UNSPECIFIED": 0, + "BACKGROUND_JOB_TYPE_SOURCE_SEED": 1, + "BACKGROUND_JOB_TYPE_CONVERT": 2, + "BACKGROUND_JOB_TYPE_APPLY_DESTINATION": 3, + "BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE": 5 + } + }, + "ImportRulesFileFormat": { + "values": { + "IMPORT_RULES_FILE_FORMAT_UNSPECIFIED": 0, + "IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE": 1, + "IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE": 2 } } } @@ -2810,6 +4954,69 @@ } } }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, "Empty": { "fields": {} }, diff --git a/packages/google-cloud-clouddms/samples/README.md b/packages/google-cloud-clouddms/samples/README.md index 3b56625fba6..9592b8641c7 100644 --- a/packages/google-cloud-clouddms/samples/README.md +++ b/packages/google-cloud-clouddms/samples/README.md @@ -12,25 +12,43 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Data_migration_service.apply_conversion_workspace](#data_migration_service.apply_conversion_workspace) + * [Data_migration_service.commit_conversion_workspace](#data_migration_service.commit_conversion_workspace) + * [Data_migration_service.convert_conversion_workspace](#data_migration_service.convert_conversion_workspace) * [Data_migration_service.create_connection_profile](#data_migration_service.create_connection_profile) + * [Data_migration_service.create_conversion_workspace](#data_migration_service.create_conversion_workspace) * [Data_migration_service.create_migration_job](#data_migration_service.create_migration_job) + * [Data_migration_service.create_private_connection](#data_migration_service.create_private_connection) * [Data_migration_service.delete_connection_profile](#data_migration_service.delete_connection_profile) + * [Data_migration_service.delete_conversion_workspace](#data_migration_service.delete_conversion_workspace) * [Data_migration_service.delete_migration_job](#data_migration_service.delete_migration_job) + * [Data_migration_service.delete_private_connection](#data_migration_service.delete_private_connection) + * [Data_migration_service.describe_conversion_workspace_revisions](#data_migration_service.describe_conversion_workspace_revisions) + * [Data_migration_service.describe_database_entities](#data_migration_service.describe_database_entities) + * [Data_migration_service.fetch_static_ips](#data_migration_service.fetch_static_ips) * [Data_migration_service.generate_ssh_script](#data_migration_service.generate_ssh_script) * [Data_migration_service.get_connection_profile](#data_migration_service.get_connection_profile) + * [Data_migration_service.get_conversion_workspace](#data_migration_service.get_conversion_workspace) * [Data_migration_service.get_migration_job](#data_migration_service.get_migration_job) + * [Data_migration_service.get_private_connection](#data_migration_service.get_private_connection) + * [Data_migration_service.import_mapping_rules](#data_migration_service.import_mapping_rules) * [Data_migration_service.list_connection_profiles](#data_migration_service.list_connection_profiles) + * [Data_migration_service.list_conversion_workspaces](#data_migration_service.list_conversion_workspaces) * [Data_migration_service.list_migration_jobs](#data_migration_service.list_migration_jobs) + * [Data_migration_service.list_private_connections](#data_migration_service.list_private_connections) * [Data_migration_service.promote_migration_job](#data_migration_service.promote_migration_job) * [Data_migration_service.restart_migration_job](#data_migration_service.restart_migration_job) * [Data_migration_service.resume_migration_job](#data_migration_service.resume_migration_job) + * [Data_migration_service.rollback_conversion_workspace](#data_migration_service.rollback_conversion_workspace) + * [Data_migration_service.search_background_jobs](#data_migration_service.search_background_jobs) + * [Data_migration_service.seed_conversion_workspace](#data_migration_service.seed_conversion_workspace) * [Data_migration_service.start_migration_job](#data_migration_service.start_migration_job) * [Data_migration_service.stop_migration_job](#data_migration_service.stop_migration_job) * [Data_migration_service.update_connection_profile](#data_migration_service.update_connection_profile) + * [Data_migration_service.update_conversion_workspace](#data_migration_service.update_conversion_workspace) * [Data_migration_service.update_migration_job](#data_migration_service.update_migration_job) * [Data_migration_service.verify_migration_job](#data_migration_service.verify_migration_job) * [Quickstart](#quickstart) - * [Quickstart](#quickstart) ## Before you begin @@ -47,6 +65,57 @@ Before running the samples, make sure you've followed the steps outlined in +### Data_migration_service.apply_conversion_workspace + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.apply_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.apply_conversion_workspace.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.apply_conversion_workspace.js` + + +----- + + + + +### Data_migration_service.commit_conversion_workspace + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.commit_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.commit_conversion_workspace.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.commit_conversion_workspace.js` + + +----- + + + + +### Data_migration_service.convert_conversion_workspace + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.convert_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.convert_conversion_workspace.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.convert_conversion_workspace.js` + + +----- + + + + ### Data_migration_service.create_connection_profile View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js). @@ -64,6 +133,23 @@ __Usage:__ +### Data_migration_service.create_conversion_workspace + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.create_conversion_workspace.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_conversion_workspace.js` + + +----- + + + + ### Data_migration_service.create_migration_job View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js). @@ -81,6 +167,23 @@ __Usage:__ +### Data_migration_service.create_private_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_private_connection.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-clouddms/samples/generated/v1/data_migration_service.create_private_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_private_connection.js` + + +----- + + + + ### Data_migration_service.delete_connection_profile View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js). @@ -98,6 +201,23 @@ __Usage:__ +### Data_migration_service.delete_conversion_workspace + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.delete_conversion_workspace.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_conversion_workspace.js` + + +----- + + + + ### Data_migration_service.delete_migration_job View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js). @@ -115,6 +235,74 @@ __Usage:__ +### Data_migration_service.delete_private_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_private_connection.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-clouddms/samples/generated/v1/data_migration_service.delete_private_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_private_connection.js` + + +----- + + + + +### Data_migration_service.describe_conversion_workspace_revisions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.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-clouddms/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js` + + +----- + + + + +### Data_migration_service.describe_database_entities + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_database_entities.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-clouddms/samples/generated/v1/data_migration_service.describe_database_entities.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_database_entities.js` + + +----- + + + + +### Data_migration_service.fetch_static_ips + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.fetch_static_ips.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-clouddms/samples/generated/v1/data_migration_service.fetch_static_ips.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.fetch_static_ips.js` + + +----- + + + + ### Data_migration_service.generate_ssh_script View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js). @@ -149,6 +337,23 @@ __Usage:__ +### Data_migration_service.get_conversion_workspace + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.get_conversion_workspace.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_conversion_workspace.js` + + +----- + + + + ### Data_migration_service.get_migration_job View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js). @@ -166,6 +371,40 @@ __Usage:__ +### Data_migration_service.get_private_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_private_connection.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-clouddms/samples/generated/v1/data_migration_service.get_private_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_private_connection.js` + + +----- + + + + +### Data_migration_service.import_mapping_rules + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.import_mapping_rules.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-clouddms/samples/generated/v1/data_migration_service.import_mapping_rules.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.import_mapping_rules.js` + + +----- + + + + ### Data_migration_service.list_connection_profiles View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js). @@ -183,6 +422,23 @@ __Usage:__ +### Data_migration_service.list_conversion_workspaces + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_conversion_workspaces.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-clouddms/samples/generated/v1/data_migration_service.list_conversion_workspaces.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_conversion_workspaces.js` + + +----- + + + + ### Data_migration_service.list_migration_jobs View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js). @@ -200,6 +456,23 @@ __Usage:__ +### Data_migration_service.list_private_connections + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_private_connections.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-clouddms/samples/generated/v1/data_migration_service.list_private_connections.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_private_connections.js` + + +----- + + + + ### Data_migration_service.promote_migration_job View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js). @@ -251,6 +524,57 @@ __Usage:__ +### Data_migration_service.rollback_conversion_workspace + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.rollback_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js` + + +----- + + + + +### Data_migration_service.search_background_jobs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.search_background_jobs.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-clouddms/samples/generated/v1/data_migration_service.search_background_jobs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.search_background_jobs.js` + + +----- + + + + +### Data_migration_service.seed_conversion_workspace + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.seed_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.seed_conversion_workspace.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.seed_conversion_workspace.js` + + +----- + + + + ### Data_migration_service.start_migration_job View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js). @@ -302,16 +626,16 @@ __Usage:__ -### Data_migration_service.update_migration_job +### Data_migration_service.update_conversion_workspace -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_conversion_workspace.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-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_conversion_workspace.js,samples/README.md) __Usage:__ -`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js` +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_conversion_workspace.js` ----- @@ -319,16 +643,16 @@ __Usage:__ -### Data_migration_service.verify_migration_job +### Data_migration_service.update_migration_job -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.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-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js,samples/README.md) __Usage:__ -`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js` +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js` ----- @@ -336,16 +660,16 @@ __Usage:__ -### Quickstart +### Data_migration_service.verify_migration_job -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.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-clouddms/samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js,samples/README.md) __Usage:__ -`node packages/google-cloud-clouddms/samples/quickstart.js` +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js` ----- @@ -355,14 +679,14 @@ __Usage:__ ### Quickstart -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/test/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/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-clouddms/samples/test/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/quickstart.js,samples/README.md) __Usage:__ -`node packages/google-cloud-clouddms/samples/test/quickstart.js` +`node packages/google-cloud-clouddms/samples/quickstart.js` diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.apply_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.apply_conversion_workspace.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.apply_conversion_workspace.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.apply_conversion_workspace.js diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.commit_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.commit_conversion_workspace.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.commit_conversion_workspace.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.commit_conversion_workspace.js diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.convert_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.convert_conversion_workspace.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.convert_conversion_workspace.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.convert_conversion_workspace.js diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js index 475e2685aba..8580dab4f6a 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js @@ -29,7 +29,7 @@ function main(parent, connectionProfileId, connectionProfile) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, which owns this collection of connection profiles. + * Required. The parent which owns this collection of connection profiles. */ // const parent = 'abc123' /** @@ -41,13 +41,25 @@ function main(parent, connectionProfileId, connectionProfile) { */ // const connectionProfile = {} /** - * A unique id used to identify the request. If the server receives two - * requests with the same id, then the second request will be ignored. + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. * It is recommended to always set this value to a UUID. - * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores * (_), and hyphens (-). The maximum length is 40 characters. */ // const requestId = 'abc123' + /** + * Optional. Only validate the connection profile, but don't create any + * resources. The default is false. Only supported for Oracle connection + * profiles. + */ + // const validateOnly = true + /** + * Optional. Create the connection profile without validating it. + * The default is false. + * Only supported for Oracle connection profiles. + */ + // const skipValidation = true // Imports the Clouddms library const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_conversion_workspace.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_conversion_workspace.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_conversion_workspace.js diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js index 43daeb5cb79..58f2117f811 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js @@ -29,7 +29,7 @@ function main(parent, migrationJobId, migrationJob) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, which owns this collection of migration jobs. + * Required. The parent which owns this collection of migration jobs. */ // const parent = 'abc123' /** @@ -43,10 +43,10 @@ function main(parent, migrationJobId, migrationJob) { */ // const migrationJob = {} /** - * A unique id used to identify the request. If the server receives two - * requests with the same id, then the second request will be ignored. + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. * It is recommended to always set this value to a UUID. - * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores * (_), and hyphens (-). The maximum length is 40 characters. */ // const requestId = 'abc123' diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_private_connection.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_private_connection.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.create_private_connection.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_private_connection.js diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js index 063f474fd9a..1cfb2661d82 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js @@ -33,10 +33,10 @@ function main(name) { */ // const name = 'abc123' /** - * A unique id used to identify the request. If the server receives two - * requests with the same id, then the second request will be ignored. + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. * It is recommended to always set this value to a UUID. - * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores * (_), and hyphens (-). The maximum length is 40 characters. */ // const requestId = 'abc123' diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_conversion_workspace.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_conversion_workspace.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_conversion_workspace.js diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js index 5cb329bef03..1269bfb4e20 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js @@ -33,10 +33,10 @@ function main(name) { */ // const name = 'abc123' /** - * A unique id used to identify the request. If the server receives two - * requests with the same id, then the second request will be ignored. + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. * It is recommended to always set this value to a UUID. - * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores * (_), and hyphens (-). The maximum length is 40 characters. */ // const requestId = 'abc123' diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_private_connection.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_private_connection.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.delete_private_connection.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_private_connection.js diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.describe_database_entities.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_database_entities.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.describe_database_entities.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_database_entities.js diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.fetch_static_ips.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.fetch_static_ips.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.fetch_static_ips.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.fetch_static_ips.js diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js index b9aa11f44b2..41c49068a4d 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js @@ -45,7 +45,7 @@ function main(vm) { */ // const vmSelectionConfig = {} /** - * The port that will be open on the bastion host + * The port that will be open on the bastion host. */ // const vmPort = 1234 diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_conversion_workspace.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_conversion_workspace.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_conversion_workspace.js diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_private_connection.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_private_connection.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.get_private_connection.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_private_connection.js diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.import_mapping_rules.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.import_mapping_rules.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.import_mapping_rules.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.import_mapping_rules.js diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js index f7e26c97fc9..6ef17632e23 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js @@ -29,13 +29,13 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, which owns this collection of connection profiles. + * Required. The parent which owns this collection of connection profiles. */ // const parent = 'abc123' /** * The maximum number of connection profiles to return. The service may return * fewer than this value. If unspecified, at most 50 connection profiles will - * be returned. The maximum value is 1000; values above 1000 will be coerced + * be returned. The maximum value is 1000; values above 1000 are coerced * to 1000. */ // const pageSize = 1234 @@ -59,7 +59,7 @@ function main(parent) { */ // const filter = 'abc123' /** - * the order by fields for the result. + * A comma-separated list of fields to order results according to. */ // const orderBy = 'abc123' diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_conversion_workspaces.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_conversion_workspaces.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_conversion_workspaces.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_conversion_workspaces.js diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js index ed6e4df3b56..35f88731cbf 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js @@ -29,13 +29,13 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent, which owns this collection of migrationJobs. + * Required. The parent which owns this collection of migrationJobs. */ // const parent = 'abc123' /** * The maximum number of migration jobs to return. The service may return * fewer than this value. If unspecified, at most 50 migration jobs will be - * returned. The maximum value is 1000; values above 1000 will be coerced to + * returned. The maximum value is 1000; values above 1000 are coerced to * 1000. */ // const pageSize = 1234 diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_private_connections.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_private_connections.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.list_private_connections.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_private_connections.js diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.search_background_jobs.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.search_background_jobs.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.search_background_jobs.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.search_background_jobs.js diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.seed_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.seed_conversion_workspace.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.seed_conversion_workspace.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.seed_conversion_workspace.js diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js index 0085459adb9..5cd2c736cdc 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js @@ -29,8 +29,8 @@ function main(updateMask, connectionProfile) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Field mask is used to specify the fields to be overwritten in the - * connection profile resource by the update. + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the conversion workspace resource. */ // const updateMask = {} /** @@ -38,13 +38,25 @@ function main(updateMask, connectionProfile) { */ // const connectionProfile = {} /** - * A unique id used to identify the request. If the server receives two - * requests with the same id, then the second request will be ignored. + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. * It is recommended to always set this value to a UUID. - * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores * (_), and hyphens (-). The maximum length is 40 characters. */ // const requestId = 'abc123' + /** + * Optional. Only validate the connection profile, but don't update any + * resources. The default is false. Only supported for Oracle connection + * profiles. + */ + // const validateOnly = true + /** + * Optional. Update the connection profile without validating it. + * The default is false. + * Only supported for Oracle connection profiles. + */ + // const skipValidation = true // Imports the Clouddms library const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; diff --git a/owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_conversion_workspace.js similarity index 100% rename from owl-bot-staging/google-cloud-clouddms/v1/samples/generated/v1/data_migration_service.update_conversion_workspace.js rename to packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_conversion_workspace.js diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js index f898c3c6c6a..894a974f424 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js @@ -29,8 +29,8 @@ function main(updateMask, migrationJob) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Field mask is used to specify the fields to be overwritten in the - * migration job resource by the update. + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the conversion workspace resource. */ // const updateMask = {} /** @@ -38,10 +38,10 @@ function main(updateMask, migrationJob) { */ // const migrationJob = {} /** - * A unique id used to identify the request. If the server receives two - * requests with the same id, then the second request will be ignored. + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. * It is recommended to always set this value to a UUID. - * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores * (_), and hyphens (-). The maximum length is 40 characters. */ // const requestId = 'abc123' diff --git a/packages/google-cloud-clouddms/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json b/packages/google-cloud-clouddms/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json index fb947b49d95..17b4e83ade9 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json +++ b/packages/google-cloud-clouddms/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-clouddms", - "version": "2.2.1", + "version": "2.2.2", "language": "TYPESCRIPT", "apis": [ { @@ -555,7 +555,7 @@ "regionTag": "datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_async", "title": "DataMigrationService listConnectionProfiles Sample", "origin": "API_DEFINITION", - "description": " Retrieve a list of all connection profiles in a given project and location.", + "description": " Retrieves a list of all connection profiles in a given project and location.", "canonical": true, "file": "data_migration_service.list_connection_profiles.js", "language": "JAVASCRIPT", @@ -658,7 +658,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 84, "type": "FULL" } ], @@ -682,6 +682,14 @@ { "name": "request_id", "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "skip_validation", + "type": "TYPE_BOOL" } ], "resultType": ".google.longrunning.Operation", @@ -710,7 +718,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 80, "type": "FULL" } ], @@ -730,6 +738,14 @@ { "name": "request_id", "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "skip_validation", + "type": "TYPE_BOOL" } ], "resultType": ".google.longrunning.Operation", @@ -794,6 +810,930 @@ } } } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_CreatePrivateConnection_async", + "title": "DataMigrationService createPrivateConnection Sample", + "origin": "API_DEFINITION", + "description": " Creates a new private connection in a given project and location.", + "canonical": true, + "file": "data_migration_service.create_private_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePrivateConnection", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreatePrivateConnection", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "private_connection_id", + "type": "TYPE_STRING" + }, + { + "name": "private_connection", + "type": ".google.cloud.clouddms.v1.PrivateConnection" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "skip_validation", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "CreatePrivateConnection", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreatePrivateConnection", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_GetPrivateConnection_async", + "title": "DataMigrationService getPrivateConnection Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single private connection.", + "canonical": true, + "file": "data_migration_service.get_private_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPrivateConnection", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetPrivateConnection", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.PrivateConnection", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "GetPrivateConnection", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetPrivateConnection", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ListPrivateConnections_async", + "title": "DataMigrationService listPrivateConnections Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a list of private connections in a given project and location.", + "canonical": true, + "file": "data_migration_service.list_private_connections.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPrivateConnections", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListPrivateConnections", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.ListPrivateConnectionsResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ListPrivateConnections", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListPrivateConnections", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_DeletePrivateConnection_async", + "title": "DataMigrationService deletePrivateConnection Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Database Migration Service private connection.", + "canonical": true, + "file": "data_migration_service.delete_private_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePrivateConnection", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeletePrivateConnection", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "DeletePrivateConnection", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeletePrivateConnection", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_GetConversionWorkspace_async", + "title": "DataMigrationService getConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single conversion workspace.", + "canonical": true, + "file": "data_migration_service.get_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.ConversionWorkspace", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "GetConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ListConversionWorkspaces_async", + "title": "DataMigrationService listConversionWorkspaces Sample", + "origin": "API_DEFINITION", + "description": " Lists conversion workspaces in a given project and location.", + "canonical": true, + "file": "data_migration_service.list_conversion_workspaces.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConversionWorkspaces", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListConversionWorkspaces", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.ListConversionWorkspacesResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ListConversionWorkspaces", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListConversionWorkspaces", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_CreateConversionWorkspace_async", + "title": "DataMigrationService createConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Creates a new conversion workspace in a given project and location.", + "canonical": true, + "file": "data_migration_service.create_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "conversion_workspace_id", + "type": "TYPE_STRING" + }, + { + "name": "conversion_workspace", + "type": ".google.cloud.clouddms.v1.ConversionWorkspace" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "CreateConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_UpdateConversionWorkspace_async", + "title": "DataMigrationService updateConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single conversion workspace.", + "canonical": true, + "file": "data_migration_service.update_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "conversion_workspace", + "type": ".google.cloud.clouddms.v1.ConversionWorkspace" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "UpdateConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_DeleteConversionWorkspace_async", + "title": "DataMigrationService deleteConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single conversion workspace.", + "canonical": true, + "file": "data_migration_service.delete_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "DeleteConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_SeedConversionWorkspace_async", + "title": "DataMigrationService seedConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Imports a snapshot of the source database into the conversion workspace.", + "canonical": true, + "file": "data_migration_service.seed_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SeedConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.SeedConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "auto_commit", + "type": "TYPE_BOOL" + }, + { + "name": "source_connection_profile", + "type": "TYPE_STRING" + }, + { + "name": "destination_connection_profile", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "SeedConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.SeedConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ImportMappingRules_async", + "title": "DataMigrationService importMappingRules Sample", + "origin": "API_DEFINITION", + "description": " Imports the mapping rules for a given conversion workspace. Supports various formats of external rules files.", + "canonical": true, + "file": "data_migration_service.import_mapping_rules.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportMappingRules", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ImportMappingRules", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "rules_format", + "type": ".google.cloud.clouddms.v1.ImportRulesFileFormat" + }, + { + "name": "rules_files", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "auto_commit", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ImportMappingRules", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ImportMappingRules", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ConvertConversionWorkspace_async", + "title": "DataMigrationService convertConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Creates a draft tree schema for the destination database.", + "canonical": true, + "file": "data_migration_service.convert_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ConvertConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ConvertConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "auto_commit", + "type": "TYPE_BOOL" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ConvertConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ConvertConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_CommitConversionWorkspace_async", + "title": "DataMigrationService commitConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Marks all the data in the conversion workspace as committed.", + "canonical": true, + "file": "data_migration_service.commit_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CommitConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CommitConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "commit_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "CommitConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CommitConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_RollbackConversionWorkspace_async", + "title": "DataMigrationService rollbackConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Rolls back a conversion workspace to the last committed snapshot.", + "canonical": true, + "file": "data_migration_service.rollback_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.RollbackConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "RollbackConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.RollbackConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ApplyConversionWorkspace_async", + "title": "DataMigrationService applyConversionWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Applies draft tree onto a specific destination database.", + "canonical": true, + "file": "data_migration_service.apply_conversion_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApplyConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ApplyConversionWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "connection_profile", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ApplyConversionWorkspace", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ApplyConversionWorkspace", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_DescribeDatabaseEntities_async", + "title": "DataMigrationService describeDatabaseEntities Sample", + "origin": "API_DEFINITION", + "description": " Describes the database entities tree for a specific conversion workspace and a specific tree type. Database entities are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are simple data objects describing the structure of the client database.", + "canonical": true, + "file": "data_migration_service.describe_database_entities.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 89, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DescribeDatabaseEntities", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DescribeDatabaseEntities", + "async": true, + "parameters": [ + { + "name": "conversion_workspace", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "tree", + "type": ".google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType" + }, + { + "name": "uncommitted", + "type": "TYPE_BOOL" + }, + { + "name": "commit_id", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.DescribeDatabaseEntitiesResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "DescribeDatabaseEntities", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DescribeDatabaseEntities", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_SearchBackgroundJobs_async", + "title": "DataMigrationService searchBackgroundJobs Sample", + "origin": "API_DEFINITION", + "description": " Searches/lists the background jobs for a specific conversion workspace. The background jobs are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are a way to expose the data plane jobs log.", + "canonical": true, + "file": "data_migration_service.search_background_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchBackgroundJobs", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.SearchBackgroundJobs", + "async": true, + "parameters": [ + { + "name": "conversion_workspace", + "type": "TYPE_STRING" + }, + { + "name": "return_most_recent_per_job_type", + "type": "TYPE_BOOL" + }, + { + "name": "max_size", + "type": "TYPE_INT32" + }, + { + "name": "completed_until_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.clouddms.v1.SearchBackgroundJobsResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "SearchBackgroundJobs", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.SearchBackgroundJobs", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_DescribeConversionWorkspaceRevisions_async", + "title": "DataMigrationService describeConversionWorkspaceRevisions Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a list of committed revisions of a specific conversion workspace.", + "canonical": true, + "file": "data_migration_service.describe_conversion_workspace_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DescribeConversionWorkspaceRevisions", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DescribeConversionWorkspaceRevisions", + "async": true, + "parameters": [ + { + "name": "conversion_workspace", + "type": "TYPE_STRING" + }, + { + "name": "commit_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "DescribeConversionWorkspaceRevisions", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DescribeConversionWorkspaceRevisions", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_FetchStaticIps_async", + "title": "DataMigrationService fetchStaticIps Sample", + "origin": "API_DEFINITION", + "description": " Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.", + "canonical": true, + "file": "data_migration_service.fetch_static_ips.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchStaticIps", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.FetchStaticIps", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.FetchStaticIpsResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "FetchStaticIps", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.FetchStaticIps", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts b/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts index 605e3579efc..828c19396e0 100644 --- a/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts +++ b/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts @@ -27,6 +27,10 @@ import type { LROperation, PaginationCallback, GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, } from 'google-gax'; import {Transform} from 'stream'; import * as protos from '../../protos/protos'; @@ -61,6 +65,8 @@ export class DataMigrationServiceClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; dataMigrationServiceStub?: Promise<{[name: string]: Function}>; @@ -158,6 +164,12 @@ export class DataMigrationServiceClient { if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; @@ -184,12 +196,18 @@ export class DataMigrationServiceClient { connectionProfilePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/connectionProfiles/{connection_profile}' ), + conversionWorkspacePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}' + ), locationPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), migrationJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/migrationJobs/{migration_job}' ), + privateConnectionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/privateConnections/{private_connection}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -209,6 +227,26 @@ export class DataMigrationServiceClient { 'nextPageToken', 'connectionProfiles' ), + listPrivateConnections: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'privateConnections' + ), + listConversionWorkspaces: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'conversionWorkspaces' + ), + describeDatabaseEntities: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'databaseEntities' + ), + fetchStaticIps: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'staticIps' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -237,6 +275,12 @@ export class DataMigrationServiceClient { { get: '/v1/{resource=projects/*/locations/*/migrationJobs/*}:getIamPolicy', }, + { + get: '/v1/{resource=projects/*/locations/*/conversionWorkspaces/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/privateConnections/*}:getIamPolicy', + }, ], }, { @@ -248,6 +292,14 @@ export class DataMigrationServiceClient { post: '/v1/{resource=projects/*/locations/*/migrationJobs/*}:setIamPolicy', body: '*', }, + { + post: '/v1/{resource=projects/*/locations/*/conversionWorkspaces/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/privateConnections/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -259,6 +311,14 @@ export class DataMigrationServiceClient { post: '/v1/{resource=projects/*/locations/*/connectionProfiles/*}:testIamPermissions', body: '*', }, + { + post: '/v1/{resource=projects/*/locations/*/conversionWorkspaces/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/privateConnections/*}:testIamPermissions', + body: '*', + }, ], }, { @@ -355,6 +415,72 @@ export class DataMigrationServiceClient { const deleteConnectionProfileMetadata = protoFilesRoot.lookup( '.google.cloud.clouddms.v1.OperationMetadata' ) as gax.protobuf.Type; + const createPrivateConnectionResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.PrivateConnection' + ) as gax.protobuf.Type; + const createPrivateConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deletePrivateConnectionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deletePrivateConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace' + ) as gax.protobuf.Type; + const createConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace' + ) as gax.protobuf.Type; + const updateConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const seedConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace' + ) as gax.protobuf.Type; + const seedConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const importMappingRulesResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace' + ) as gax.protobuf.Type; + const importMappingRulesMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const convertConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace' + ) as gax.protobuf.Type; + const convertConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const commitConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace' + ) as gax.protobuf.Type; + const commitConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const rollbackConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace' + ) as gax.protobuf.Type; + const rollbackConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const applyConversionWorkspaceResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConversionWorkspace' + ) as gax.protobuf.Type; + const applyConversionWorkspaceMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createMigrationJob: new this._gaxModule.LongrunningDescriptor( @@ -429,6 +555,101 @@ export class DataMigrationServiceClient { deleteConnectionProfileMetadata ) ), + createPrivateConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createPrivateConnectionResponse.decode.bind( + createPrivateConnectionResponse + ), + createPrivateConnectionMetadata.decode.bind( + createPrivateConnectionMetadata + ) + ), + deletePrivateConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deletePrivateConnectionResponse.decode.bind( + deletePrivateConnectionResponse + ), + deletePrivateConnectionMetadata.decode.bind( + deletePrivateConnectionMetadata + ) + ), + createConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createConversionWorkspaceResponse.decode.bind( + createConversionWorkspaceResponse + ), + createConversionWorkspaceMetadata.decode.bind( + createConversionWorkspaceMetadata + ) + ), + updateConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateConversionWorkspaceResponse.decode.bind( + updateConversionWorkspaceResponse + ), + updateConversionWorkspaceMetadata.decode.bind( + updateConversionWorkspaceMetadata + ) + ), + deleteConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteConversionWorkspaceResponse.decode.bind( + deleteConversionWorkspaceResponse + ), + deleteConversionWorkspaceMetadata.decode.bind( + deleteConversionWorkspaceMetadata + ) + ), + seedConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + seedConversionWorkspaceResponse.decode.bind( + seedConversionWorkspaceResponse + ), + seedConversionWorkspaceMetadata.decode.bind( + seedConversionWorkspaceMetadata + ) + ), + importMappingRules: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importMappingRulesResponse.decode.bind(importMappingRulesResponse), + importMappingRulesMetadata.decode.bind(importMappingRulesMetadata) + ), + convertConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + convertConversionWorkspaceResponse.decode.bind( + convertConversionWorkspaceResponse + ), + convertConversionWorkspaceMetadata.decode.bind( + convertConversionWorkspaceMetadata + ) + ), + commitConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + commitConversionWorkspaceResponse.decode.bind( + commitConversionWorkspaceResponse + ), + commitConversionWorkspaceMetadata.decode.bind( + commitConversionWorkspaceMetadata + ) + ), + rollbackConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + rollbackConversionWorkspaceResponse.decode.bind( + rollbackConversionWorkspaceResponse + ), + rollbackConversionWorkspaceMetadata.decode.bind( + rollbackConversionWorkspaceMetadata + ) + ), + applyConversionWorkspace: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + applyConversionWorkspaceResponse.decode.bind( + applyConversionWorkspaceResponse + ), + applyConversionWorkspaceMetadata.decode.bind( + applyConversionWorkspaceMetadata + ) + ), }; // Put together the default options sent with requests. @@ -498,6 +719,25 @@ export class DataMigrationServiceClient { 'createConnectionProfile', 'updateConnectionProfile', 'deleteConnectionProfile', + 'createPrivateConnection', + 'getPrivateConnection', + 'listPrivateConnections', + 'deletePrivateConnection', + 'getConversionWorkspace', + 'listConversionWorkspaces', + 'createConversionWorkspace', + 'updateConversionWorkspace', + 'deleteConversionWorkspace', + 'seedConversionWorkspace', + 'importMappingRules', + 'convertConversionWorkspace', + 'commitConversionWorkspace', + 'rollbackConversionWorkspace', + 'applyConversionWorkspace', + 'describeDatabaseEntities', + 'searchBackgroundJobs', + 'describeConversionWorkspaceRevisions', + 'fetchStaticIps', ]; for (const methodName of dataMigrationServiceStubMethods) { const callPromise = this.dataMigrationServiceStub.then( @@ -690,7 +930,7 @@ export class DataMigrationServiceClient { * @param {google.cloud.clouddms.v1.VmSelectionConfig} request.vmSelectionConfig * The VM selection configuration * @param {number} request.vmPort - * The port that will be open on the bastion host + * The port that will be open on the bastion host. * @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. @@ -866,103 +1106,76 @@ export class DataMigrationServiceClient { this.initialize(); return this.innerApiCalls.getConnectionProfile(request, options, callback); } - /** - * Creates a new migration job in a given project and location. + * Gets details of a single private connection. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of migration jobs. - * @param {string} request.migrationJobId - * Required. The ID of the instance to create. - * @param {google.cloud.clouddms.v1.MigrationJob} request.migrationJob - * Required. Represents a [migration - * job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) - * object. - * @param {string} request.requestId - * A unique id used to identify the request. If the server receives two - * requests with the same id, then the second request will be ignored. - * - * It is recommended to always set this value to a UUID. - * - * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. + * @param {string} request.name + * Required. The name of the private connection to get. * @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. + * The first element of the array is an object representing {@link google.cloud.clouddms.v1.PrivateConnection | PrivateConnection}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/data_migration_service.create_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.get_private_connection.js + * region_tag:datamigration_v1_generated_DataMigrationService_GetPrivateConnection_async */ - createMigrationJob( - request?: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, + getPrivateConnection( + request?: protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest, options?: CallOptions ): Promise< [ - LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest | undefined, {} | undefined ] >; - createMigrationJob( - request: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, + getPrivateConnection( + request: protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest, options: CallOptions, callback: Callback< - LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection, + | protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest + | null + | undefined, {} | null | undefined > ): void; - createMigrationJob( - request: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, + getPrivateConnection( + request: protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest, callback: Callback< - LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection, + | protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest + | null + | undefined, {} | null | undefined > ): void; - createMigrationJob( - request?: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, + getPrivateConnection( + request?: protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest, optionsOrCallback?: | CallOptions | Callback< - LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection, + | protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest + | null + | undefined, {} | null | undefined >, callback?: Callback< - LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection, + | protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest + | null + | undefined, {} | null | undefined > ): Promise< [ - LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest | undefined, {} | undefined ] > | void { @@ -979,139 +1192,87 @@ export class DataMigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.createMigrationJob(request, options, callback); - } - /** - * Check the status of the long running operation returned by `createMigrationJob()`. - * @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/data_migration_service.create_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async - */ - async checkCreateMigrationJobProgress( - name: string - ): Promise< - LROperation< - protos.google.cloud.clouddms.v1.MigrationJob, - protos.google.cloud.clouddms.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.createMigrationJob, - this._gaxModule.createDefaultBackoffSettings() - ); - return decodeOperation as LROperation< - protos.google.cloud.clouddms.v1.MigrationJob, - protos.google.cloud.clouddms.v1.OperationMetadata - >; + return this.innerApiCalls.getPrivateConnection(request, options, callback); } /** - * Updates the parameters of a single migration job. + * Gets details of a single conversion workspace. * * @param {Object} request * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * migration job resource by the update. - * @param {google.cloud.clouddms.v1.MigrationJob} request.migrationJob - * Required. The migration job parameters to update. - * @param {string} request.requestId - * A unique id used to identify the request. If the server receives two - * requests with the same id, then the second request will be ignored. - * - * It is recommended to always set this value to a UUID. - * - * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. + * @param {string} request.name + * Required. Name of the conversion workspace resource to get. * @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. + * The first element of the array is an object representing {@link google.cloud.clouddms.v1.ConversionWorkspace | ConversionWorkspace}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/data_migration_service.update_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.get_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_GetConversionWorkspace_async */ - updateMigrationJob( - request?: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, + getConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, options?: CallOptions ): Promise< [ - LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace, + ( + | protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest + | undefined + ), {} | undefined ] >; - updateMigrationJob( - request: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, + getConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, options: CallOptions, callback: Callback< - LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace, + | protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest + | null + | undefined, {} | null | undefined > ): void; - updateMigrationJob( - request: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, + getConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, callback: Callback< - LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace, + | protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest + | null + | undefined, {} | null | undefined > ): void; - updateMigrationJob( - request?: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, + getConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest, optionsOrCallback?: | CallOptions | Callback< - LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace, + | protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest + | null + | undefined, {} | null | undefined >, callback?: Callback< - LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace, + | protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest + | null + | undefined, {} | null | undefined > ): Promise< [ - LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace, + ( + | protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest + | undefined + ), {} | undefined ] > | void { @@ -1128,65 +1289,251 @@ export class DataMigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'migration_job.name': request.migrationJob!.name ?? '', + name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateMigrationJob(request, options, callback); + return this.innerApiCalls.getConversionWorkspace( + request, + options, + callback + ); } /** - * Check the status of the long running operation returned by `updateMigrationJob()`. - * @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. + * Searches/lists the background jobs for a specific + * conversion workspace. + * + * The background jobs are not resources like conversion workspaces or + * mapping rules, and they can't be created, updated or deleted. + * Instead, they are a way to expose the data plane jobs log. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.conversionWorkspace + * Required. Name of the conversion workspace resource whose jobs are listed, + * in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {boolean} [request.returnMostRecentPerJobType] + * Optional. Whether or not to return just the most recent job per job type, + * @param {number} [request.maxSize] + * Optional. The maximum number of jobs to return. The service may return + * fewer than this value. If unspecified, at most 100 jobs are + * returned. The maximum value is 100; values above 100 are coerced to + * 100. + * @param {google.protobuf.Timestamp} [request.completedUntilTime] + * Optional. If provided, only returns jobs that completed until (not + * including) the given timestamp. + * @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 {@link google.cloud.clouddms.v1.SearchBackgroundJobsResponse | SearchBackgroundJobsResponse}. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example include:samples/generated/v1/data_migration_service.update_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.search_background_jobs.js + * region_tag:datamigration_v1_generated_DataMigrationService_SearchBackgroundJobs_async */ - async checkUpdateMigrationJobProgress( - name: string + searchBackgroundJobs( + request?: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, + options?: CallOptions ): Promise< - LROperation< - protos.google.cloud.clouddms.v1.MigrationJob, - protos.google.cloud.clouddms.v1.OperationMetadata + [ + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest | undefined, + {} | undefined + ] + >; + searchBackgroundJobs( + request: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + | protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest + | null + | undefined, + {} | null | undefined > - > { - 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.updateMigrationJob, - this._gaxModule.createDefaultBackoffSettings() + ): void; + searchBackgroundJobs( + request: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, + callback: Callback< + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + | protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + searchBackgroundJobs( + request?: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + | protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + | protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest | 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({ + conversion_workspace: request.conversionWorkspace ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchBackgroundJobs(request, options, callback); + } + /** + * Retrieves a list of committed revisions of a specific conversion + * workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.conversionWorkspace + * Required. Name of the conversion workspace resource whose revisions are + * listed. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {string} [request.commitId] + * Optional. Optional filter to request a specific commit ID. + * @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 {@link google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse | DescribeConversionWorkspaceRevisionsResponse}. + * 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/data_migration_service.describe_conversion_workspace_revisions.js + * region_tag:datamigration_v1_generated_DataMigrationService_DescribeConversionWorkspaceRevisions_async + */ + describeConversionWorkspaceRevisions( + request?: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + ( + | protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest + | undefined + ), + {} | undefined + ] + >; + describeConversionWorkspaceRevisions( + request: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + | protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + describeConversionWorkspaceRevisions( + request: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, + callback: Callback< + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + | protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + describeConversionWorkspaceRevisions( + request?: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + | protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + | protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + ( + | protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest + | 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({ + conversion_workspace: request.conversionWorkspace ?? '', + }); + this.initialize(); + return this.innerApiCalls.describeConversionWorkspaceRevisions( + request, + options, + callback ); - return decodeOperation as LROperation< - protos.google.cloud.clouddms.v1.MigrationJob, - protos.google.cloud.clouddms.v1.OperationMetadata - >; } + /** - * Deletes a single migration job. + * Creates a new migration job in a given project and location. * * @param {Object} request * The request object that will be sent. - * @param {string} request.name - * Required. Name of the migration job resource to delete. + * @param {string} request.parent + * Required. The parent which owns this collection of migration jobs. + * @param {string} request.migrationJobId + * Required. The ID of the instance to create. + * @param {google.cloud.clouddms.v1.MigrationJob} request.migrationJob + * Required. Represents a [migration + * job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) + * object. * @param {string} request.requestId - * A unique id used to identify the request. If the server receives two - * requests with the same id, then the second request will be ignored. + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. * * It is recommended to always set this value to a UUID. * - * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores * (_), and hyphens (-). The maximum length is 40 characters. - * @param {boolean} request.force - * The destination CloudSQL connection profile is always deleted with the - * migration job. In case of force delete, the destination CloudSQL replica - * database is also deleted. * @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. @@ -1196,52 +1543,52 @@ export class DataMigrationServiceClient { * 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/data_migration_service.delete_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.create_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async */ - deleteMigrationJob( - request?: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, + createMigrationJob( + request?: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - deleteMigrationJob( - request: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, + createMigrationJob( + request: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteMigrationJob( - request: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, + createMigrationJob( + request: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteMigrationJob( - request?: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, + createMigrationJob( + request?: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1249,7 +1596,7 @@ export class DataMigrationServiceClient { >, callback?: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1258,7 +1605,7 @@ export class DataMigrationServiceClient { ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -1278,13 +1625,13 @@ export class DataMigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', + parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.deleteMigrationJob(request, options, callback); + return this.innerApiCalls.createMigrationJob(request, options, callback); } /** - * Check the status of the long running operation returned by `deleteMigrationJob()`. + * Check the status of the long running operation returned by `createMigrationJob()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1292,14 +1639,14 @@ export class DataMigrationServiceClient { * 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/data_migration_service.delete_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.create_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async */ - async checkDeleteMigrationJobProgress( + async checkCreateMigrationJobProgress( name: string ): Promise< LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.clouddms.v1.MigrationJob, protos.google.cloud.clouddms.v1.OperationMetadata > > { @@ -1310,35 +1657,46 @@ export class DataMigrationServiceClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.deleteMigrationJob, + this.descriptors.longrunning.createMigrationJob, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.clouddms.v1.MigrationJob, protos.google.cloud.clouddms.v1.OperationMetadata >; } /** - * Start an already created migration job. + * Updates the parameters of a single migration job. * * @param {Object} request * The request object that will be sent. - * @param {string} request.name - * Name of the migration job resource to start. - * @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. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the conversion workspace resource. + * @param {google.cloud.clouddms.v1.MigrationJob} request.migrationJob + * Required. The migration job parameters to update. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @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/data_migration_service.start_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_StartMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.update_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async */ - startMigrationJob( - request?: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, + updateMigrationJob( + request?: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, options?: CallOptions ): Promise< [ @@ -1350,8 +1708,8 @@ export class DataMigrationServiceClient { {} | undefined ] >; - startMigrationJob( - request: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, + updateMigrationJob( + request: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, options: CallOptions, callback: Callback< LROperation< @@ -1362,8 +1720,8 @@ export class DataMigrationServiceClient { {} | null | undefined > ): void; - startMigrationJob( - request: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, + updateMigrationJob( + request: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, callback: Callback< LROperation< protos.google.cloud.clouddms.v1.IMigrationJob, @@ -1373,8 +1731,8 @@ export class DataMigrationServiceClient { {} | null | undefined > ): void; - startMigrationJob( - request?: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, + updateMigrationJob( + request?: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1416,13 +1774,13 @@ export class DataMigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', + 'migration_job.name': request.migrationJob!.name ?? '', }); this.initialize(); - return this.innerApiCalls.startMigrationJob(request, options, callback); + return this.innerApiCalls.updateMigrationJob(request, options, callback); } /** - * Check the status of the long running operation returned by `startMigrationJob()`. + * Check the status of the long running operation returned by `updateMigrationJob()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1430,10 +1788,10 @@ export class DataMigrationServiceClient { * 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/data_migration_service.start_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_StartMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.update_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async */ - async checkStartMigrationJobProgress( + async checkUpdateMigrationJobProgress( name: string ): Promise< LROperation< @@ -1448,7 +1806,7 @@ export class DataMigrationServiceClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.startMigrationJob, + this.descriptors.longrunning.updateMigrationJob, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< @@ -1457,12 +1815,24 @@ export class DataMigrationServiceClient { >; } /** - * Stops a running migration job. + * Deletes a single migration job. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Name of the migration job resource to stop. + * Required. Name of the migration job resource to delete. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {boolean} request.force + * The destination CloudSQL connection profile is always deleted with the + * migration job. In case of force delete, the destination CloudSQL replica + * database is also deleted. * @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. @@ -1472,52 +1842,52 @@ export class DataMigrationServiceClient { * 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/data_migration_service.stop_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_StopMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.delete_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async */ - stopMigrationJob( - request?: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, + deleteMigrationJob( + request?: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.protobuf.IEmpty, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - stopMigrationJob( - request: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, + deleteMigrationJob( + request: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.protobuf.IEmpty, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - stopMigrationJob( - request: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, + deleteMigrationJob( + request: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, callback: Callback< LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.protobuf.IEmpty, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - stopMigrationJob( - request?: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, + deleteMigrationJob( + request?: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.protobuf.IEmpty, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1525,7 +1895,7 @@ export class DataMigrationServiceClient { >, callback?: Callback< LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.protobuf.IEmpty, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1534,7 +1904,7 @@ export class DataMigrationServiceClient { ): Promise< [ LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.protobuf.IEmpty, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -1557,10 +1927,10 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.stopMigrationJob(request, options, callback); + return this.innerApiCalls.deleteMigrationJob(request, options, callback); } /** - * Check the status of the long running operation returned by `stopMigrationJob()`. + * Check the status of the long running operation returned by `deleteMigrationJob()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1568,14 +1938,14 @@ export class DataMigrationServiceClient { * 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/data_migration_service.stop_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_StopMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.delete_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async */ - async checkStopMigrationJobProgress( + async checkDeleteMigrationJobProgress( name: string ): Promise< LROperation< - protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.protobuf.Empty, protos.google.cloud.clouddms.v1.OperationMetadata > > { @@ -1586,22 +1956,21 @@ export class DataMigrationServiceClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.stopMigrationJob, + this.descriptors.longrunning.deleteMigrationJob, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.protobuf.Empty, protos.google.cloud.clouddms.v1.OperationMetadata >; } /** - * Resume a migration job that is currently stopped and is resumable (was - * stopped during CDC phase). + * Start an already created migration job. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Name of the migration job resource to resume. + * Name of the migration job resource to start. * @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. @@ -1611,11 +1980,11 @@ export class DataMigrationServiceClient { * 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/data_migration_service.resume_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.start_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_StartMigrationJob_async */ - resumeMigrationJob( - request?: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, + startMigrationJob( + request?: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, options?: CallOptions ): Promise< [ @@ -1627,8 +1996,8 @@ export class DataMigrationServiceClient { {} | undefined ] >; - resumeMigrationJob( - request: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, + startMigrationJob( + request: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, options: CallOptions, callback: Callback< LROperation< @@ -1639,8 +2008,8 @@ export class DataMigrationServiceClient { {} | null | undefined > ): void; - resumeMigrationJob( - request: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, + startMigrationJob( + request: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, callback: Callback< LROperation< protos.google.cloud.clouddms.v1.IMigrationJob, @@ -1650,8 +2019,8 @@ export class DataMigrationServiceClient { {} | null | undefined > ): void; - resumeMigrationJob( - request?: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, + startMigrationJob( + request?: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1696,10 +2065,10 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.resumeMigrationJob(request, options, callback); + return this.innerApiCalls.startMigrationJob(request, options, callback); } /** - * Check the status of the long running operation returned by `resumeMigrationJob()`. + * Check the status of the long running operation returned by `startMigrationJob()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1707,10 +2076,10 @@ export class DataMigrationServiceClient { * 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/data_migration_service.resume_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.start_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_StartMigrationJob_async */ - async checkResumeMigrationJobProgress( + async checkStartMigrationJobProgress( name: string ): Promise< LROperation< @@ -1725,7 +2094,7 @@ export class DataMigrationServiceClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.resumeMigrationJob, + this.descriptors.longrunning.startMigrationJob, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< @@ -1734,13 +2103,12 @@ export class DataMigrationServiceClient { >; } /** - * Promote a migration job, stopping replication to the destination and - * promoting the destination to be a standalone database. + * Stops a running migration job. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Name of the migration job resource to promote. + * Name of the migration job resource to stop. * @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. @@ -1750,11 +2118,11 @@ export class DataMigrationServiceClient { * 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/data_migration_service.promote_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.stop_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_StopMigrationJob_async */ - promoteMigrationJob( - request?: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, + stopMigrationJob( + request?: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, options?: CallOptions ): Promise< [ @@ -1766,8 +2134,8 @@ export class DataMigrationServiceClient { {} | undefined ] >; - promoteMigrationJob( - request: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, + stopMigrationJob( + request: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, options: CallOptions, callback: Callback< LROperation< @@ -1778,8 +2146,8 @@ export class DataMigrationServiceClient { {} | null | undefined > ): void; - promoteMigrationJob( - request: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, + stopMigrationJob( + request: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, callback: Callback< LROperation< protos.google.cloud.clouddms.v1.IMigrationJob, @@ -1789,8 +2157,8 @@ export class DataMigrationServiceClient { {} | null | undefined > ): void; - promoteMigrationJob( - request?: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, + stopMigrationJob( + request?: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1835,10 +2203,10 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.promoteMigrationJob(request, options, callback); + return this.innerApiCalls.stopMigrationJob(request, options, callback); } /** - * Check the status of the long running operation returned by `promoteMigrationJob()`. + * Check the status of the long running operation returned by `stopMigrationJob()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1846,10 +2214,10 @@ export class DataMigrationServiceClient { * 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/data_migration_service.promote_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.stop_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_StopMigrationJob_async */ - async checkPromoteMigrationJobProgress( + async checkStopMigrationJobProgress( name: string ): Promise< LROperation< @@ -1864,7 +2232,7 @@ export class DataMigrationServiceClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.promoteMigrationJob, + this.descriptors.longrunning.stopMigrationJob, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< @@ -1873,13 +2241,13 @@ export class DataMigrationServiceClient { >; } /** - * Verify a migration job, making sure the destination can reach the source - * and that all configuration and prerequisites are met. + * Resume a migration job that is currently stopped and is resumable (was + * stopped during CDC phase). * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Name of the migration job resource to verify. + * Name of the migration job resource to resume. * @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. @@ -1889,11 +2257,11 @@ export class DataMigrationServiceClient { * 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/data_migration_service.verify_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.resume_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async */ - verifyMigrationJob( - request?: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, + resumeMigrationJob( + request?: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, options?: CallOptions ): Promise< [ @@ -1905,8 +2273,8 @@ export class DataMigrationServiceClient { {} | undefined ] >; - verifyMigrationJob( - request: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, + resumeMigrationJob( + request: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, options: CallOptions, callback: Callback< LROperation< @@ -1917,8 +2285,8 @@ export class DataMigrationServiceClient { {} | null | undefined > ): void; - verifyMigrationJob( - request: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, + resumeMigrationJob( + request: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, callback: Callback< LROperation< protos.google.cloud.clouddms.v1.IMigrationJob, @@ -1928,8 +2296,8 @@ export class DataMigrationServiceClient { {} | null | undefined > ): void; - verifyMigrationJob( - request?: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, + resumeMigrationJob( + request?: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1974,10 +2342,10 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.verifyMigrationJob(request, options, callback); + return this.innerApiCalls.resumeMigrationJob(request, options, callback); } /** - * Check the status of the long running operation returned by `verifyMigrationJob()`. + * Check the status of the long running operation returned by `resumeMigrationJob()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1985,10 +2353,10 @@ export class DataMigrationServiceClient { * 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/data_migration_service.verify_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.resume_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async */ - async checkVerifyMigrationJobProgress( + async checkResumeMigrationJobProgress( name: string ): Promise< LROperation< @@ -2003,7 +2371,7 @@ export class DataMigrationServiceClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.verifyMigrationJob, + this.descriptors.longrunning.resumeMigrationJob, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< @@ -2012,14 +2380,13 @@ export class DataMigrationServiceClient { >; } /** - * Restart a stopped or failed migration job, resetting the destination - * instance to its original state and starting the migration process from - * scratch. + * Promote a migration job, stopping replication to the destination and + * promoting the destination to be a standalone database. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Name of the migration job resource to restart. + * Name of the migration job resource to promote. * @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. @@ -2029,11 +2396,11 @@ export class DataMigrationServiceClient { * 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/data_migration_service.restart_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.promote_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async */ - restartMigrationJob( - request?: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, + promoteMigrationJob( + request?: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, options?: CallOptions ): Promise< [ @@ -2045,8 +2412,8 @@ export class DataMigrationServiceClient { {} | undefined ] >; - restartMigrationJob( - request: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, + promoteMigrationJob( + request: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, options: CallOptions, callback: Callback< LROperation< @@ -2057,8 +2424,8 @@ export class DataMigrationServiceClient { {} | null | undefined > ): void; - restartMigrationJob( - request: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, + promoteMigrationJob( + request: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, callback: Callback< LROperation< protos.google.cloud.clouddms.v1.IMigrationJob, @@ -2068,8 +2435,8 @@ export class DataMigrationServiceClient { {} | null | undefined > ): void; - restartMigrationJob( - request?: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, + promoteMigrationJob( + request?: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, optionsOrCallback?: | CallOptions | Callback< @@ -2114,10 +2481,10 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.restartMigrationJob(request, options, callback); + return this.innerApiCalls.promoteMigrationJob(request, options, callback); } /** - * Check the status of the long running operation returned by `restartMigrationJob()`. + * Check the status of the long running operation returned by `promoteMigrationJob()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -2125,10 +2492,10 @@ export class DataMigrationServiceClient { * 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/data_migration_service.restart_migration_job.js - * region_tag:datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async + * @example include:samples/generated/v1/data_migration_service.promote_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async */ - async checkRestartMigrationJobProgress( + async checkPromoteMigrationJobProgress( name: string ): Promise< LROperation< @@ -2143,7 +2510,7 @@ export class DataMigrationServiceClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.restartMigrationJob, + this.descriptors.longrunning.promoteMigrationJob, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< @@ -2152,24 +2519,13 @@ export class DataMigrationServiceClient { >; } /** - * Creates a new connection profile in a given project and location. + * Verify a migration job, making sure the destination can reach the source + * and that all configuration and prerequisites are met. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of connection profiles. - * @param {string} request.connectionProfileId - * Required. The connection profile identifier. - * @param {google.cloud.clouddms.v1.ConnectionProfile} request.connectionProfile - * Required. The create request body including the connection profile data - * @param {string} request.requestId - * A unique id used to identify the request. If the server receives two - * requests with the same id, then the second request will be ignored. - * - * It is recommended to always set this value to a UUID. - * - * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. + * @param {string} request.name + * Name of the migration job resource to verify. * @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. @@ -2179,52 +2535,52 @@ export class DataMigrationServiceClient { * 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/data_migration_service.create_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async + * @example include:samples/generated/v1/data_migration_service.verify_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async */ - createConnectionProfile( - request?: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, + verifyMigrationJob( + request?: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - createConnectionProfile( - request: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, + verifyMigrationJob( + request: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createConnectionProfile( - request: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, + verifyMigrationJob( + request: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, callback: Callback< LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createConnectionProfile( - request?: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, + verifyMigrationJob( + request?: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2232,7 +2588,7 @@ export class DataMigrationServiceClient { >, callback?: Callback< LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2241,7 +2597,7 @@ export class DataMigrationServiceClient { ): Promise< [ LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -2261,17 +2617,13 @@ export class DataMigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.createConnectionProfile( - request, - options, - callback - ); + return this.innerApiCalls.verifyMigrationJob(request, options, callback); } /** - * Check the status of the long running operation returned by `createConnectionProfile()`. + * Check the status of the long running operation returned by `verifyMigrationJob()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -2279,14 +2631,14 @@ export class DataMigrationServiceClient { * 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/data_migration_service.create_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async + * @example include:samples/generated/v1/data_migration_service.verify_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async */ - async checkCreateConnectionProfileProgress( + async checkVerifyMigrationJobProgress( name: string ): Promise< LROperation< - protos.google.cloud.clouddms.v1.ConnectionProfile, + protos.google.cloud.clouddms.v1.MigrationJob, protos.google.cloud.clouddms.v1.OperationMetadata > > { @@ -2297,32 +2649,23 @@ export class DataMigrationServiceClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.createConnectionProfile, + this.descriptors.longrunning.verifyMigrationJob, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.clouddms.v1.ConnectionProfile, + protos.google.cloud.clouddms.v1.MigrationJob, protos.google.cloud.clouddms.v1.OperationMetadata >; } /** - * Update the configuration of a single connection profile. + * Restart a stopped or failed migration job, resetting the destination + * instance to its original state and starting the migration process from + * scratch. * * @param {Object} request * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * connection profile resource by the update. - * @param {google.cloud.clouddms.v1.ConnectionProfile} request.connectionProfile - * Required. The connection profile parameters to update. - * @param {string} request.requestId - * A unique id used to identify the request. If the server receives two - * requests with the same id, then the second request will be ignored. - * - * It is recommended to always set this value to a UUID. - * - * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores - * (_), and hyphens (-). The maximum length is 40 characters. + * @param {string} request.name + * Name of the migration job resource to restart. * @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. @@ -2332,52 +2675,52 @@ export class DataMigrationServiceClient { * 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/data_migration_service.update_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async + * @example include:samples/generated/v1/data_migration_service.restart_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async */ - updateConnectionProfile( - request?: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + restartMigrationJob( + request?: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - updateConnectionProfile( - request: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + restartMigrationJob( + request: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - updateConnectionProfile( - request: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + restartMigrationJob( + request: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, callback: Callback< LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - updateConnectionProfile( - request?: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + restartMigrationJob( + request?: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2385,7 +2728,7 @@ export class DataMigrationServiceClient { >, callback?: Callback< LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2394,7 +2737,7 @@ export class DataMigrationServiceClient { ): Promise< [ LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -2414,17 +2757,13 @@ export class DataMigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'connection_profile.name': request.connectionProfile!.name ?? '', + name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateConnectionProfile( - request, - options, - callback - ); + return this.innerApiCalls.restartMigrationJob(request, options, callback); } /** - * Check the status of the long running operation returned by `updateConnectionProfile()`. + * Check the status of the long running operation returned by `restartMigrationJob()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -2432,14 +2771,14 @@ export class DataMigrationServiceClient { * 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/data_migration_service.update_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async + * @example include:samples/generated/v1/data_migration_service.restart_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async */ - async checkUpdateConnectionProfileProgress( + async checkRestartMigrationJobProgress( name: string ): Promise< LROperation< - protos.google.cloud.clouddms.v1.ConnectionProfile, + protos.google.cloud.clouddms.v1.MigrationJob, protos.google.cloud.clouddms.v1.OperationMetadata > > { @@ -2450,34 +2789,41 @@ export class DataMigrationServiceClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.updateConnectionProfile, + this.descriptors.longrunning.restartMigrationJob, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.clouddms.v1.ConnectionProfile, + protos.google.cloud.clouddms.v1.MigrationJob, protos.google.cloud.clouddms.v1.OperationMetadata >; } /** - * Deletes a single Database Migration Service connection profile. - * A connection profile can only be deleted if it is not in use by any - * active migration jobs. + * Creates a new connection profile in a given project and location. * * @param {Object} request * The request object that will be sent. - * @param {string} request.name - * Required. Name of the connection profile resource to delete. - * @param {string} request.requestId - * A unique id used to identify the request. If the server receives two - * requests with the same id, then the second request will be ignored. + * @param {string} request.parent + * Required. The parent which owns this collection of connection profiles. + * @param {string} request.connectionProfileId + * Required. The connection profile identifier. + * @param {google.cloud.clouddms.v1.ConnectionProfile} request.connectionProfile + * Required. The create request body including the connection profile data + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. * * It is recommended to always set this value to a UUID. * - * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores * (_), and hyphens (-). The maximum length is 40 characters. - * @param {boolean} request.force - * In case of force delete, the CloudSQL replica database is also deleted - * (only for CloudSQL connection profile). + * @param {boolean} [request.validateOnly] + * Optional. Only validate the connection profile, but don't create any + * resources. The default is false. Only supported for Oracle connection + * profiles. + * @param {boolean} [request.skipValidation] + * Optional. Create the connection profile without validating it. + * The default is false. + * Only supported for Oracle connection profiles. * @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. @@ -2487,52 +2833,52 @@ export class DataMigrationServiceClient { * 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/data_migration_service.delete_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async + * @example include:samples/generated/v1/data_migration_service.create_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async */ - deleteConnectionProfile( - request?: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + createConnectionProfile( + request?: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IConnectionProfile, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - deleteConnectionProfile( - request: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + createConnectionProfile( + request: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IConnectionProfile, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteConnectionProfile( - request: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + createConnectionProfile( + request: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IConnectionProfile, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteConnectionProfile( - request?: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + createConnectionProfile( + request?: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IConnectionProfile, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2540,7 +2886,7 @@ export class DataMigrationServiceClient { >, callback?: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IConnectionProfile, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -2549,7 +2895,7 @@ export class DataMigrationServiceClient { ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IConnectionProfile, protos.google.cloud.clouddms.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -2557,160 +2903,3105 @@ export class DataMigrationServiceClient { ] > | void { request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } + 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.createConnectionProfile( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createConnectionProfile()`. + * @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/data_migration_service.create_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async + */ + async checkCreateConnectionProfileProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.ConnectionProfile, + protos.google.cloud.clouddms.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.createConnectionProfile, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.ConnectionProfile, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Update the configuration of a single connection profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the conversion workspace resource. + * @param {google.cloud.clouddms.v1.ConnectionProfile} request.connectionProfile + * Required. The connection profile parameters to update. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the connection profile, but don't update any + * resources. The default is false. Only supported for Oracle connection + * profiles. + * @param {boolean} [request.skipValidation] + * Optional. Update the connection profile without validating it. + * The default is false. + * Only supported for Oracle connection profiles. + * @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/data_migration_service.update_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async + */ + updateConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateConnectionProfile( + request: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateConnectionProfile( + request: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.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({ + 'connection_profile.name': request.connectionProfile!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateConnectionProfile( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateConnectionProfile()`. + * @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/data_migration_service.update_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async + */ + async checkUpdateConnectionProfileProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.ConnectionProfile, + protos.google.cloud.clouddms.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.updateConnectionProfile, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.ConnectionProfile, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Deletes a single Database Migration Service connection profile. + * A connection profile can only be deleted if it is not in use by any + * active migration jobs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the connection profile resource to delete. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {boolean} request.force + * In case of force delete, the CloudSQL replica database is also deleted + * (only for CloudSQL connection profile). + * @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/data_migration_service.delete_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async + */ + deleteConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteConnectionProfile( + request: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteConnectionProfile( + request: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteConnectionProfile( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteConnectionProfile()`. + * @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/data_migration_service.delete_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async + */ + async checkDeleteConnectionProfileProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.clouddms.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.deleteConnectionProfile, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Creates a new private connection in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent that owns the collection of PrivateConnections. + * @param {string} request.privateConnectionId + * Required. The private connection identifier. + * @param {google.cloud.clouddms.v1.PrivateConnection} request.privateConnection + * Required. The private connection resource to create. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {boolean} [request.skipValidation] + * Optional. If set to true, will skip validations. + * @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/data_migration_service.create_private_connection.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreatePrivateConnection_async + */ + createPrivateConnection( + request?: protos.google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createPrivateConnection( + request: protos.google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createPrivateConnection( + request: protos.google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createPrivateConnection( + request?: protos.google.cloud.clouddms.v1.ICreatePrivateConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.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({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createPrivateConnection( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createPrivateConnection()`. + * @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/data_migration_service.create_private_connection.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreatePrivateConnection_async + */ + async checkCreatePrivateConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.PrivateConnection, + protos.google.cloud.clouddms.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.createPrivateConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.PrivateConnection, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Deletes a single Database Migration Service private connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the private connection to delete. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server receives + * two requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @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/data_migration_service.delete_private_connection.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeletePrivateConnection_async + */ + deletePrivateConnection( + request?: protos.google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deletePrivateConnection( + request: protos.google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deletePrivateConnection( + request: protos.google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deletePrivateConnection( + request?: protos.google.cloud.clouddms.v1.IDeletePrivateConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deletePrivateConnection( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deletePrivateConnection()`. + * @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/data_migration_service.delete_private_connection.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeletePrivateConnection_async + */ + async checkDeletePrivateConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.clouddms.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.deletePrivateConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Creates a new conversion workspace in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of conversion workspaces. + * @param {string} request.conversionWorkspaceId + * Required. The ID of the conversion workspace to create. + * @param {google.cloud.clouddms.v1.ConversionWorkspace} request.conversionWorkspace + * Required. Represents a conversion workspace object. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @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/data_migration_service.create_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateConversionWorkspace_async + */ + createConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createConversionWorkspace( + request: protos.google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createConversionWorkspace( + request: protos.google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.ICreateConversionWorkspaceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.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({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createConversionWorkspace( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createConversionWorkspace()`. + * @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/data_migration_service.create_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateConversionWorkspace_async + */ + async checkCreateConversionWorkspaceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.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.createConversionWorkspace, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single conversion workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten by the + * update in the conversion workspace resource. + * @param {google.cloud.clouddms.v1.ConversionWorkspace} request.conversionWorkspace + * Required. The conversion workspace parameters to update. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @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/data_migration_service.update_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConversionWorkspace_async + */ + updateConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IUpdateConversionWorkspaceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.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({ + 'conversion_workspace.name': request.conversionWorkspace!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateConversionWorkspace( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateConversionWorkspace()`. + * @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/data_migration_service.update_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConversionWorkspace_async + */ + async checkUpdateConversionWorkspaceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.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.updateConversionWorkspace, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Deletes a single conversion workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the conversion workspace resource to delete. + * @param {string} request.requestId + * A unique ID used to identify the request. If the server receives two + * requests with the same ID, then the second request is ignored. + * + * It is recommended to always set this value to a UUID. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @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/data_migration_service.delete_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConversionWorkspace_async + */ + deleteConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IDeleteConversionWorkspaceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteConversionWorkspace( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteConversionWorkspace()`. + * @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/data_migration_service.delete_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConversionWorkspace_async + */ + async checkDeleteConversionWorkspaceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.clouddms.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.deleteConversionWorkspace, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Imports a snapshot of the source database into the + * conversion workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the conversion workspace resource to seed with new database + * structure, in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {boolean} request.autoCommit + * Should the conversion workspace be committed automatically after the + * seed operation. + * @param {string} request.sourceConnectionProfile + * Fully qualified (Uri) name of the source connection profile. + * @param {string} request.destinationConnectionProfile + * Fully qualified (Uri) name of the destination connection profile. + * @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/data_migration_service.seed_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_SeedConversionWorkspace_async + */ + seedConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + seedConversionWorkspace( + request: protos.google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + seedConversionWorkspace( + request: protos.google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + seedConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.ISeedConversionWorkspaceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.seedConversionWorkspace( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `seedConversionWorkspace()`. + * @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/data_migration_service.seed_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_SeedConversionWorkspace_async + */ + async checkSeedConversionWorkspaceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.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.seedConversionWorkspace, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Imports the mapping rules for a given conversion workspace. + * Supports various formats of external rules files. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the conversion workspace resource to import the rules to + * in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {google.cloud.clouddms.v1.ImportRulesFileFormat} request.rulesFormat + * The format of the rules content file. + * @param {number[]} request.rulesFiles + * One or more rules files. + * @param {boolean} request.autoCommit + * Should the conversion workspace be committed automatically after the + * import operation. + * @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/data_migration_service.import_mapping_rules.js + * region_tag:datamigration_v1_generated_DataMigrationService_ImportMappingRules_async + */ + importMappingRules( + request?: protos.google.cloud.clouddms.v1.IImportMappingRulesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + importMappingRules( + request: protos.google.cloud.clouddms.v1.IImportMappingRulesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importMappingRules( + request: protos.google.cloud.clouddms.v1.IImportMappingRulesRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importMappingRules( + request?: protos.google.cloud.clouddms.v1.IImportMappingRulesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.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({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.importMappingRules(request, options, callback); + } + /** + * Check the status of the long running operation returned by `importMappingRules()`. + * @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/data_migration_service.import_mapping_rules.js + * region_tag:datamigration_v1_generated_DataMigrationService_ImportMappingRules_async + */ + async checkImportMappingRulesProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.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.importMappingRules, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Creates a draft tree schema for the destination database. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the conversion workspace resource to convert in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {boolean} request.autoCommit + * Specifies whether the conversion workspace is to be committed automatically + * after the conversion. + * @param {string} request.filter + * Filter the entities to convert. Leaving this field empty will convert all + * of the entities. Supports Google AIP-160 style filtering. + * @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/data_migration_service.convert_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_ConvertConversionWorkspace_async + */ + convertConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + convertConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + convertConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + convertConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IConvertConversionWorkspaceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.convertConversionWorkspace( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `convertConversionWorkspace()`. + * @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/data_migration_service.convert_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_ConvertConversionWorkspace_async + */ + async checkConvertConversionWorkspaceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.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.convertConversionWorkspace, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Marks all the data in the conversion workspace as committed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the conversion workspace resource to commit. + * @param {string} [request.commitName] + * Optional. Optional name of the commit. + * @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/data_migration_service.commit_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_CommitConversionWorkspace_async + */ + commitConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + commitConversionWorkspace( + request: protos.google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + commitConversionWorkspace( + request: protos.google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + commitConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.ICommitConversionWorkspaceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.commitConversionWorkspace( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `commitConversionWorkspace()`. + * @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/data_migration_service.commit_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_CommitConversionWorkspace_async + */ + async checkCommitConversionWorkspaceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.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.commitConversionWorkspace, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Rolls back a conversion workspace to the last committed snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the conversion workspace resource to roll back to. + * @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/data_migration_service.rollback_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_RollbackConversionWorkspace_async + */ + rollbackConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + rollbackConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rollbackConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rollbackConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IRollbackConversionWorkspaceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.rollbackConversionWorkspace( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `rollbackConversionWorkspace()`. + * @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/data_migration_service.rollback_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_RollbackConversionWorkspace_async + */ + async checkRollbackConversionWorkspaceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.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.rollbackConversionWorkspace, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Applies draft tree onto a specific destination database. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversion workspace resource for which to apply + * the draft tree. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. + * @param {string} request.filter + * Filter which entities to apply. Leaving this field empty will apply all of + * the entities. Supports Google AIP 160 based filtering. + * @param {string} request.connectionProfile + * Fully qualified (Uri) name of the destination connection profile. + * @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/data_migration_service.apply_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_ApplyConversionWorkspace_async + */ + applyConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + applyConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + applyConversionWorkspace( + request: protos.google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + applyConversionWorkspace( + request?: protos.google.cloud.clouddms.v1.IApplyConversionWorkspaceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.applyConversionWorkspace( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `applyConversionWorkspace()`. + * @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/data_migration_service.apply_conversion_workspace.js + * region_tag:datamigration_v1_generated_DataMigrationService_ApplyConversionWorkspace_async + */ + async checkApplyConversionWorkspaceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.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.applyConversionWorkspace, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.ConversionWorkspace, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Lists migration jobs in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of migrationJobs. + * @param {number} request.pageSize + * The maximum number of migration jobs to return. The service may return + * fewer than this value. If unspecified, at most 50 migration jobs will be + * returned. The maximum value is 1000; values above 1000 are coerced to + * 1000. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * migrationJobs.list, used in the subsequent request to retrieve the next + * page of results. On first call this should be left blank. When paginating, + * all other parameters provided to migrationJobs.list must match the call + * that provided the page token. + * @param {string} request.filter + * A filter expression that filters migration jobs listed in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, + * a number, or a boolean. The comparison operator must be + * either =, !=, >, or <. For example, list migration jobs created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + * You can also filter nested fields. For example, you could specify + * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + * jobs connecting through the specific SSH tunnel bastion. + * @param {string} request.orderBy + * Sort the results based on the migration job name. + * Valid values are: "name", "name asc", and "name desc". + * @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 {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob}. + * 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 `listMigrationJobsAsync()` + * 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. + */ + listMigrationJobs( + request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.clouddms.v1.IMigrationJob[], + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest | null, + protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + ] + >; + listMigrationJobs( + request: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IMigrationJob + > + ): void; + listMigrationJobs( + request: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IMigrationJob + > + ): void; + listMigrationJobs( + request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IMigrationJob + >, + callback?: PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IMigrationJob + > + ): Promise< + [ + protos.google.cloud.clouddms.v1.IMigrationJob[], + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest | null, + protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + ] + > | 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.listMigrationJobs(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 + * Required. The parent which owns this collection of migrationJobs. + * @param {number} request.pageSize + * The maximum number of migration jobs to return. The service may return + * fewer than this value. If unspecified, at most 50 migration jobs will be + * returned. The maximum value is 1000; values above 1000 are coerced to + * 1000. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * migrationJobs.list, used in the subsequent request to retrieve the next + * page of results. On first call this should be left blank. When paginating, + * all other parameters provided to migrationJobs.list must match the call + * that provided the page token. + * @param {string} request.filter + * A filter expression that filters migration jobs listed in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, + * a number, or a boolean. The comparison operator must be + * either =, !=, >, or <. For example, list migration jobs created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + * You can also filter nested fields. For example, you could specify + * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + * jobs connecting through the specific SSH tunnel bastion. + * @param {string} request.orderBy + * Sort the results based on the migration job name. + * Valid values are: "name", "name asc", and "name desc". + * @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 {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob} 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 `listMigrationJobsAsync()` + * 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. + */ + listMigrationJobsStream( + request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + 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['listMigrationJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMigrationJobs.createStream( + this.innerApiCalls.listMigrationJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listMigrationJobs`, 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 + * Required. The parent which owns this collection of migrationJobs. + * @param {number} request.pageSize + * The maximum number of migration jobs to return. The service may return + * fewer than this value. If unspecified, at most 50 migration jobs will be + * returned. The maximum value is 1000; values above 1000 are coerced to + * 1000. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * migrationJobs.list, used in the subsequent request to retrieve the next + * page of results. On first call this should be left blank. When paginating, + * all other parameters provided to migrationJobs.list must match the call + * that provided the page token. + * @param {string} request.filter + * A filter expression that filters migration jobs listed in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, + * a number, or a boolean. The comparison operator must be + * either =, !=, >, or <. For example, list migration jobs created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + * You can also filter nested fields. For example, you could specify + * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + * jobs connecting through the specific SSH tunnel bastion. + * @param {string} request.orderBy + * Sort the results based on the migration job name. + * Valid values are: "name", "name asc", and "name desc". + * @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 + * {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob}. 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/data_migration_service.list_migration_jobs.js + * region_tag:datamigration_v1_generated_DataMigrationService_ListMigrationJobs_async + */ + listMigrationJobsAsync( + request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + 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['listMigrationJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMigrationJobs.asyncIterate( + this.innerApiCalls['listMigrationJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Retrieves a list of all connection profiles in a given project and + * location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of connection profiles. + * @param {number} request.pageSize + * The maximum number of connection profiles to return. The service may return + * fewer than this value. If unspecified, at most 50 connection profiles will + * be returned. The maximum value is 1000; values above 1000 are coerced + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListConnectionProfiles` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListConnectionProfiles` + * must match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters connection profiles listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list connection profiles created this year by + * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + * also filter nested fields. For example, you could specify **mySql.username + * = %lt;my_username%gt;** to list all connection profiles configured to + * connect with a specific username. + * @param {string} request.orderBy + * A comma-separated list of fields to order results according to. + * @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 {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile}. + * 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 `listConnectionProfilesAsync()` + * 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. + */ + listConnectionProfiles( + request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.clouddms.v1.IConnectionProfile[], + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest | null, + protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + ] + >; + listConnectionProfiles( + request: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile + > + ): void; + listConnectionProfiles( + request: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile + > + ): void; + listConnectionProfiles( + request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile + >, + callback?: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile + > + ): Promise< + [ + protos.google.cloud.clouddms.v1.IConnectionProfile[], + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest | null, + protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + ] + > | 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.listConnectionProfiles( + 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 + * Required. The parent which owns this collection of connection profiles. + * @param {number} request.pageSize + * The maximum number of connection profiles to return. The service may return + * fewer than this value. If unspecified, at most 50 connection profiles will + * be returned. The maximum value is 1000; values above 1000 are coerced + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListConnectionProfiles` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListConnectionProfiles` + * must match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters connection profiles listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list connection profiles created this year by + * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + * also filter nested fields. For example, you could specify **mySql.username + * = %lt;my_username%gt;** to list all connection profiles configured to + * connect with a specific username. + * @param {string} request.orderBy + * A comma-separated list of fields to order results according to. + * @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 {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile} 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 `listConnectionProfilesAsync()` + * 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. + */ + listConnectionProfilesStream( + request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + 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['listConnectionProfiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectionProfiles.createStream( + this.innerApiCalls.listConnectionProfiles as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConnectionProfiles`, 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 + * Required. The parent which owns this collection of connection profiles. + * @param {number} request.pageSize + * The maximum number of connection profiles to return. The service may return + * fewer than this value. If unspecified, at most 50 connection profiles will + * be returned. The maximum value is 1000; values above 1000 are coerced + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListConnectionProfiles` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListConnectionProfiles` + * must match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters connection profiles listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list connection profiles created this year by + * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + * also filter nested fields. For example, you could specify **mySql.username + * = %lt;my_username%gt;** to list all connection profiles configured to + * connect with a specific username. + * @param {string} request.orderBy + * A comma-separated list of fields to order results according to. + * @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 + * {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile}. 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/data_migration_service.list_connection_profiles.js + * region_tag:datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_async + */ + listConnectionProfilesAsync( + request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + 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['listConnectionProfiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectionProfiles.asyncIterate( + this.innerApiCalls['listConnectionProfiles'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Retrieves a list of private connections in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent that owns the collection of private connections. + * @param {number} request.pageSize + * Maximum number of private connections to return. + * If unspecified, at most 50 private connections that are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. + * @param {string} request.pageToken + * Page token received from a previous `ListPrivateConnections` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListPrivateConnections` must match the call that provided the page + * token. + * @param {string} request.filter + * A filter expression that filters private connections listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list private connections created this year by + * specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. + * @param {string} request.orderBy + * Order by fields for the result. + * @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 {@link google.cloud.clouddms.v1.PrivateConnection | PrivateConnection}. + * 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 `listPrivateConnectionsAsync()` + * 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. + */ + listPrivateConnections( + request?: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.clouddms.v1.IPrivateConnection[], + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest | null, + protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse + ] + >; + listPrivateConnections( + request: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + | protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection + > + ): void; + listPrivateConnections( + request: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + | protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection + > + ): void; + listPrivateConnections( + request?: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + | protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection + >, + callback?: PaginationCallback< + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + | protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection + > + ): Promise< + [ + protos.google.cloud.clouddms.v1.IPrivateConnection[], + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest | null, + protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse + ] + > | 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.listPrivateConnections( + 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 + * Required. The parent that owns the collection of private connections. + * @param {number} request.pageSize + * Maximum number of private connections to return. + * If unspecified, at most 50 private connections that are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. + * @param {string} request.pageToken + * Page token received from a previous `ListPrivateConnections` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListPrivateConnections` must match the call that provided the page + * token. + * @param {string} request.filter + * A filter expression that filters private connections listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list private connections created this year by + * specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. + * @param {string} request.orderBy + * Order by fields for the result. + * @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 {@link google.cloud.clouddms.v1.PrivateConnection | PrivateConnection} 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 `listPrivateConnectionsAsync()` + * 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. + */ + listPrivateConnectionsStream( + request?: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + 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['listPrivateConnections']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPrivateConnections.createStream( + this.innerApiCalls.listPrivateConnections as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPrivateConnections`, 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 + * Required. The parent that owns the collection of private connections. + * @param {number} request.pageSize + * Maximum number of private connections to return. + * If unspecified, at most 50 private connections that are returned. + * The maximum value is 1000; values above 1000 are coerced to 1000. + * @param {string} request.pageToken + * Page token received from a previous `ListPrivateConnections` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListPrivateConnections` must match the call that provided the page + * token. + * @param {string} request.filter + * A filter expression that filters private connections listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list private connections created this year by + * specifying **createTime %gt; 2021-01-01T00:00:00.000000000Z**. + * @param {string} request.orderBy + * Order by fields for the result. + * @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 + * {@link google.cloud.clouddms.v1.PrivateConnection | PrivateConnection}. 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/data_migration_service.list_private_connections.js + * region_tag:datamigration_v1_generated_DataMigrationService_ListPrivateConnections_async + */ + listPrivateConnectionsAsync( + request?: protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + 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['listPrivateConnections']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPrivateConnections.asyncIterate( + this.innerApiCalls['listPrivateConnections'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists conversion workspaces in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent which owns this collection of conversion workspaces. + * @param {number} request.pageSize + * The maximum number of conversion workspaces to return. The service may + * return fewer than this value. If unspecified, at most 50 sets are returned. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * conversionWorkspaces.list, used in the subsequent request to retrieve the + * next page of results. On first call this should be left blank. When + * paginating, all other parameters provided to conversionWorkspaces.list must + * match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters conversion workspaces listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list conversion workspaces created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can + * also filter nested fields. For example, you could specify + * **source.version = "12.c.1"** to select all conversion workspaces with + * source database version equal to 12.c.1. + * @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 {@link google.cloud.clouddms.v1.ConversionWorkspace | ConversionWorkspace}. + * 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 `listConversionWorkspacesAsync()` + * 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. + */ + listConversionWorkspaces( + request?: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.clouddms.v1.IConversionWorkspace[], + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest | null, + protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse + ] + >; + listConversionWorkspaces( + request: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + | protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace + > + ): void; + listConversionWorkspaces( + request: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + | protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace + > + ): void; + listConversionWorkspaces( + request?: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + | protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace + >, + callback?: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + | protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace + > + ): Promise< + [ + protos.google.cloud.clouddms.v1.IConversionWorkspace[], + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest | null, + protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse + ] + > | 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.listConversionWorkspaces( + 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 + * Required. The parent which owns this collection of conversion workspaces. + * @param {number} request.pageSize + * The maximum number of conversion workspaces to return. The service may + * return fewer than this value. If unspecified, at most 50 sets are returned. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * conversionWorkspaces.list, used in the subsequent request to retrieve the + * next page of results. On first call this should be left blank. When + * paginating, all other parameters provided to conversionWorkspaces.list must + * match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters conversion workspaces listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list conversion workspaces created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can + * also filter nested fields. For example, you could specify + * **source.version = "12.c.1"** to select all conversion workspaces with + * source database version equal to 12.c.1. + * @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 {@link google.cloud.clouddms.v1.ConversionWorkspace | ConversionWorkspace} 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 `listConversionWorkspacesAsync()` + * 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. + */ + listConversionWorkspacesStream( + request?: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + 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['listConversionWorkspaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConversionWorkspaces.createStream( + this.innerApiCalls.listConversionWorkspaces as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConversionWorkspaces`, 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 + * Required. The parent which owns this collection of conversion workspaces. + * @param {number} request.pageSize + * The maximum number of conversion workspaces to return. The service may + * return fewer than this value. If unspecified, at most 50 sets are returned. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * conversionWorkspaces.list, used in the subsequent request to retrieve the + * next page of results. On first call this should be left blank. When + * paginating, all other parameters provided to conversionWorkspaces.list must + * match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters conversion workspaces listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list conversion workspaces created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** You can + * also filter nested fields. For example, you could specify + * **source.version = "12.c.1"** to select all conversion workspaces with + * source database version equal to 12.c.1. + * @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 + * {@link google.cloud.clouddms.v1.ConversionWorkspace | ConversionWorkspace}. 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/data_migration_service.list_conversion_workspaces.js + * region_tag:datamigration_v1_generated_DataMigrationService_ListConversionWorkspaces_async + */ + listConversionWorkspacesAsync( + request?: protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + 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({ - name: request.name ?? '', + parent: request.parent ?? '', }); + const defaultCallSettings = this._defaults['listConversionWorkspaces']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.innerApiCalls.deleteConnectionProfile( - request, - options, - callback - ); - } - /** - * Check the status of the long running operation returned by `deleteConnectionProfile()`. - * @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/data_migration_service.delete_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async - */ - async checkDeleteConnectionProfileProgress( - name: string - ): Promise< - LROperation< - protos.google.protobuf.Empty, - protos.google.cloud.clouddms.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.deleteConnectionProfile, - this._gaxModule.createDefaultBackoffSettings() - ); - return decodeOperation as LROperation< - protos.google.protobuf.Empty, - protos.google.cloud.clouddms.v1.OperationMetadata - >; + return this.descriptors.page.listConversionWorkspaces.asyncIterate( + this.innerApiCalls['listConversionWorkspaces'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; } /** - * Lists migration jobs in a given project and location. + * Describes the database entities tree for a specific conversion workspace + * and a specific tree type. + * + * Database entities are not resources like conversion workspaces or mapping + * rules, and they can't be created, updated or deleted. Instead, they are + * simple data objects describing the structure of the client database. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of migrationJobs. + * @param {string} request.conversionWorkspace + * Required. Name of the conversion workspace resource whose database entities + * are described. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. * @param {number} request.pageSize - * The maximum number of migration jobs to return. The service may return - * fewer than this value. If unspecified, at most 50 migration jobs will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. + * The maximum number of entities to return. The service may return + * fewer entities than the value specifies. * @param {string} request.pageToken * The nextPageToken value received in the previous call to - * migrationJobs.list, used in the subsequent request to retrieve the next - * page of results. On first call this should be left blank. When paginating, - * all other parameters provided to migrationJobs.list must match the call - * that provided the page token. + * conversionWorkspace.describeDatabaseEntities, used in the subsequent + * request to retrieve the next page of results. On first call this should be + * left blank. When paginating, all other parameters provided to + * conversionWorkspace.describeDatabaseEntities must match the call that + * provided the page token. + * @param {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType} request.tree + * The tree to fetch. + * @param {boolean} request.uncommitted + * Whether to retrieve the latest committed version of the entities or the + * latest version. This field is ignored if a specific commit_id is specified. + * @param {string} request.commitId + * Request a specific commit ID. If not specified, the entities from the + * latest commit are returned. * @param {string} request.filter - * A filter expression that filters migration jobs listed in the response. - * The expression must specify the field name, a comparison operator, and the - * value that you want to use for filtering. The value must be a string, - * a number, or a boolean. The comparison operator must be - * either =, !=, >, or <. For example, list migration jobs created this year - * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** - * You can also filter nested fields. For example, you could specify - * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration - * jobs connecting through the specific SSH tunnel bastion. - * @param {string} request.orderBy - * Sort the results based on the migration job name. - * Valid values are: "name", "name asc", and "name desc". + * Filter the returned entities based on AIP-160 standard. * @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 {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob}. + * The first element of the array is Array of {@link google.cloud.clouddms.v1.DatabaseEntity | DatabaseEntity}. * 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 `listMigrationJobsAsync()` + * We recommend using `describeDatabaseEntitiesAsync()` * 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. */ - listMigrationJobs( - request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + describeDatabaseEntities( + request?: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.clouddms.v1.IMigrationJob[], - protos.google.cloud.clouddms.v1.IListMigrationJobsRequest | null, - protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + protos.google.cloud.clouddms.v1.IDatabaseEntity[], + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest | null, + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse ] >; - listMigrationJobs( - request: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + describeDatabaseEntities( + request: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + | protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse | null | undefined, - protos.google.cloud.clouddms.v1.IMigrationJob + protos.google.cloud.clouddms.v1.IDatabaseEntity > ): void; - listMigrationJobs( - request: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + describeDatabaseEntities( + request: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + | protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse | null | undefined, - protos.google.cloud.clouddms.v1.IMigrationJob + protos.google.cloud.clouddms.v1.IDatabaseEntity > ): void; - listMigrationJobs( - request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + describeDatabaseEntities( + request?: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + | protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse | null | undefined, - protos.google.cloud.clouddms.v1.IMigrationJob + protos.google.cloud.clouddms.v1.IDatabaseEntity >, callback?: PaginationCallback< - protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, - | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + | protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse | null | undefined, - protos.google.cloud.clouddms.v1.IMigrationJob + protos.google.cloud.clouddms.v1.IDatabaseEntity > ): Promise< [ - protos.google.cloud.clouddms.v1.IMigrationJob[], - protos.google.cloud.clouddms.v1.IListMigrationJobsRequest | null, - protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + protos.google.cloud.clouddms.v1.IDatabaseEntity[], + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest | null, + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse ] > | void { request = request || {}; @@ -2726,56 +6017,58 @@ export class DataMigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + conversion_workspace: request.conversionWorkspace ?? '', }); this.initialize(); - return this.innerApiCalls.listMigrationJobs(request, options, callback); + return this.innerApiCalls.describeDatabaseEntities( + 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 - * Required. The parent, which owns this collection of migrationJobs. + * @param {string} request.conversionWorkspace + * Required. Name of the conversion workspace resource whose database entities + * are described. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. * @param {number} request.pageSize - * The maximum number of migration jobs to return. The service may return - * fewer than this value. If unspecified, at most 50 migration jobs will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. + * The maximum number of entities to return. The service may return + * fewer entities than the value specifies. * @param {string} request.pageToken * The nextPageToken value received in the previous call to - * migrationJobs.list, used in the subsequent request to retrieve the next - * page of results. On first call this should be left blank. When paginating, - * all other parameters provided to migrationJobs.list must match the call - * that provided the page token. + * conversionWorkspace.describeDatabaseEntities, used in the subsequent + * request to retrieve the next page of results. On first call this should be + * left blank. When paginating, all other parameters provided to + * conversionWorkspace.describeDatabaseEntities must match the call that + * provided the page token. + * @param {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType} request.tree + * The tree to fetch. + * @param {boolean} request.uncommitted + * Whether to retrieve the latest committed version of the entities or the + * latest version. This field is ignored if a specific commit_id is specified. + * @param {string} request.commitId + * Request a specific commit ID. If not specified, the entities from the + * latest commit are returned. * @param {string} request.filter - * A filter expression that filters migration jobs listed in the response. - * The expression must specify the field name, a comparison operator, and the - * value that you want to use for filtering. The value must be a string, - * a number, or a boolean. The comparison operator must be - * either =, !=, >, or <. For example, list migration jobs created this year - * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** - * You can also filter nested fields. For example, you could specify - * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration - * jobs connecting through the specific SSH tunnel bastion. - * @param {string} request.orderBy - * Sort the results based on the migration job name. - * Valid values are: "name", "name asc", and "name desc". + * Filter the returned entities based on AIP-160 standard. * @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 {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob} on 'data' event. + * An object stream which emits an object representing {@link google.cloud.clouddms.v1.DatabaseEntity | DatabaseEntity} 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 `listMigrationJobsAsync()` + * We recommend using `describeDatabaseEntitiesAsync()` * 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. */ - listMigrationJobsStream( - request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + describeDatabaseEntitiesStream( + request?: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, options?: CallOptions ): Transform { request = request || {}; @@ -2784,181 +6077,162 @@ export class DataMigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + conversion_workspace: request.conversionWorkspace ?? '', }); - const defaultCallSettings = this._defaults['listMigrationJobs']; + const defaultCallSettings = this._defaults['describeDatabaseEntities']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listMigrationJobs.createStream( - this.innerApiCalls.listMigrationJobs as GaxCall, + return this.descriptors.page.describeDatabaseEntities.createStream( + this.innerApiCalls.describeDatabaseEntities as GaxCall, request, callSettings ); } /** - * Equivalent to `listMigrationJobs`, but returns an iterable object. + * Equivalent to `describeDatabaseEntities`, 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 - * Required. The parent, which owns this collection of migrationJobs. + * @param {string} request.conversionWorkspace + * Required. Name of the conversion workspace resource whose database entities + * are described. Must be in the form of: + * projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}. * @param {number} request.pageSize - * The maximum number of migration jobs to return. The service may return - * fewer than this value. If unspecified, at most 50 migration jobs will be - * returned. The maximum value is 1000; values above 1000 will be coerced to - * 1000. + * The maximum number of entities to return. The service may return + * fewer entities than the value specifies. * @param {string} request.pageToken * The nextPageToken value received in the previous call to - * migrationJobs.list, used in the subsequent request to retrieve the next - * page of results. On first call this should be left blank. When paginating, - * all other parameters provided to migrationJobs.list must match the call - * that provided the page token. + * conversionWorkspace.describeDatabaseEntities, used in the subsequent + * request to retrieve the next page of results. On first call this should be + * left blank. When paginating, all other parameters provided to + * conversionWorkspace.describeDatabaseEntities must match the call that + * provided the page token. + * @param {google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest.DBTreeType} request.tree + * The tree to fetch. + * @param {boolean} request.uncommitted + * Whether to retrieve the latest committed version of the entities or the + * latest version. This field is ignored if a specific commit_id is specified. + * @param {string} request.commitId + * Request a specific commit ID. If not specified, the entities from the + * latest commit are returned. * @param {string} request.filter - * A filter expression that filters migration jobs listed in the response. - * The expression must specify the field name, a comparison operator, and the - * value that you want to use for filtering. The value must be a string, - * a number, or a boolean. The comparison operator must be - * either =, !=, >, or <. For example, list migration jobs created this year - * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** - * You can also filter nested fields. For example, you could specify - * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration - * jobs connecting through the specific SSH tunnel bastion. - * @param {string} request.orderBy - * Sort the results based on the migration job name. - * Valid values are: "name", "name asc", and "name desc". + * Filter the returned entities based on AIP-160 standard. * @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 - * {@link google.cloud.clouddms.v1.MigrationJob | MigrationJob}. The API will be called under the hood as needed, once per the page, + * {@link google.cloud.clouddms.v1.DatabaseEntity | DatabaseEntity}. 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/data_migration_service.list_migration_jobs.js - * region_tag:datamigration_v1_generated_DataMigrationService_ListMigrationJobs_async + * @example include:samples/generated/v1/data_migration_service.describe_database_entities.js + * region_tag:datamigration_v1_generated_DataMigrationService_DescribeDatabaseEntities_async */ - listMigrationJobsAsync( - request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + describeDatabaseEntitiesAsync( + request?: protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, options?: CallOptions - ): AsyncIterable { + ): 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 ?? '', + conversion_workspace: request.conversionWorkspace ?? '', }); - const defaultCallSettings = this._defaults['listMigrationJobs']; + const defaultCallSettings = this._defaults['describeDatabaseEntities']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listMigrationJobs.asyncIterate( - this.innerApiCalls['listMigrationJobs'] as GaxCall, + return this.descriptors.page.describeDatabaseEntities.asyncIterate( + this.innerApiCalls['describeDatabaseEntities'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** - * Retrieve a list of all connection profiles in a given project and location. + * Fetches a set of static IP addresses that need to be allowlisted by the + * customer when using the static-IP connectivity method. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of connection profiles. + * @param {string} request.name + * Required. The resource name for the location for which static IPs should be + * returned. Must be in the format `projects/* /locations/*`. * @param {number} request.pageSize - * The maximum number of connection profiles to return. The service may return - * fewer than this value. If unspecified, at most 50 connection profiles will - * be returned. The maximum value is 1000; values above 1000 will be coerced - * to 1000. + * Maximum number of IPs to return. * @param {string} request.pageToken - * A page token, received from a previous `ListConnectionProfiles` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListConnectionProfiles` - * must match the call that provided the page token. - * @param {string} request.filter - * A filter expression that filters connection profiles listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list connection profiles created this year by - * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can - * also filter nested fields. For example, you could specify **mySql.username - * = %lt;my_username%gt;** to list all connection profiles configured to - * connect with a specific username. - * @param {string} request.orderBy - * the order by fields for the result. + * A page token, received from a previous `FetchStaticIps` call. * @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 {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile}. + * The first element of the array is Array of string. * 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 `listConnectionProfilesAsync()` + * We recommend using `fetchStaticIpsAsync()` * 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. */ - listConnectionProfiles( - request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + fetchStaticIps( + request?: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.clouddms.v1.IConnectionProfile[], - protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest | null, - protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + string[], + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest | null, + protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse ] >; - listConnectionProfiles( - request: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + fetchStaticIps( + request: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + | protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse | null | undefined, - protos.google.cloud.clouddms.v1.IConnectionProfile + string > ): void; - listConnectionProfiles( - request: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + fetchStaticIps( + request: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, callback: PaginationCallback< - protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + | protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse | null | undefined, - protos.google.cloud.clouddms.v1.IConnectionProfile + string > ): void; - listConnectionProfiles( - request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + fetchStaticIps( + request?: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + | protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse | null | undefined, - protos.google.cloud.clouddms.v1.IConnectionProfile + string >, callback?: PaginationCallback< - protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, - | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + | protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse | null | undefined, - protos.google.cloud.clouddms.v1.IConnectionProfile + string > ): Promise< [ - protos.google.cloud.clouddms.v1.IConnectionProfile[], - protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest | null, - protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + string[], + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest | null, + protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse ] > | void { request = request || {}; @@ -2974,59 +6248,37 @@ export class DataMigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.listConnectionProfiles( - request, - options, - callback - ); + return this.innerApiCalls.fetchStaticIps(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 - * Required. The parent, which owns this collection of connection profiles. - * @param {number} request.pageSize - * The maximum number of connection profiles to return. The service may return - * fewer than this value. If unspecified, at most 50 connection profiles will - * be returned. The maximum value is 1000; values above 1000 will be coerced - * to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListConnectionProfiles` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListConnectionProfiles` - * must match the call that provided the page token. - * @param {string} request.filter - * A filter expression that filters connection profiles listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list connection profiles created this year by - * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can - * also filter nested fields. For example, you could specify **mySql.username - * = %lt;my_username%gt;** to list all connection profiles configured to - * connect with a specific username. - * @param {string} request.orderBy - * the order by fields for the result. + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name for the location for which static IPs should be + * returned. Must be in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of IPs to return. + * @param {string} request.pageToken + * A page token, received from a previous `FetchStaticIps` call. * @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 {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile} on 'data' event. + * An object stream which emits an object representing string 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 `listConnectionProfilesAsync()` + * We recommend using `fetchStaticIpsAsync()` * 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. */ - listConnectionProfilesStream( - request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + fetchStaticIpsStream( + request?: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, options?: CallOptions ): Transform { request = request || {}; @@ -3035,83 +6287,460 @@ export class DataMigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + name: request.name ?? '', }); - const defaultCallSettings = this._defaults['listConnectionProfiles']; + const defaultCallSettings = this._defaults['fetchStaticIps']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listConnectionProfiles.createStream( - this.innerApiCalls.listConnectionProfiles as GaxCall, + return this.descriptors.page.fetchStaticIps.createStream( + this.innerApiCalls.fetchStaticIps as GaxCall, request, callSettings ); } /** - * Equivalent to `listConnectionProfiles`, but returns an iterable object. + * Equivalent to `fetchStaticIps`, 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 - * Required. The parent, which owns this collection of connection profiles. + * @param {string} request.name + * Required. The resource name for the location for which static IPs should be + * returned. Must be in the format `projects/* /locations/*`. * @param {number} request.pageSize - * The maximum number of connection profiles to return. The service may return - * fewer than this value. If unspecified, at most 50 connection profiles will - * be returned. The maximum value is 1000; values above 1000 will be coerced - * to 1000. + * Maximum number of IPs to return. * @param {string} request.pageToken - * A page token, received from a previous `ListConnectionProfiles` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListConnectionProfiles` - * must match the call that provided the page token. - * @param {string} request.filter - * A filter expression that filters connection profiles listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. The value must - * be a string, a number, or a boolean. The comparison operator must be either - * =, !=, >, or <. For example, list connection profiles created this year by - * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can - * also filter nested fields. For example, you could specify **mySql.username - * = %lt;my_username%gt;** to list all connection profiles configured to - * connect with a specific username. - * @param {string} request.orderBy - * the order by fields for the result. + * A page token, received from a previous `FetchStaticIps` call. * @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 - * {@link google.cloud.clouddms.v1.ConnectionProfile | ConnectionProfile}. The API will be called under the hood as needed, once per the page, + * string. 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/data_migration_service.list_connection_profiles.js - * region_tag:datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_async + * @example include:samples/generated/v1/data_migration_service.fetch_static_ips.js + * region_tag:datamigration_v1_generated_DataMigrationService_FetchStaticIps_async */ - listConnectionProfilesAsync( - request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + fetchStaticIpsAsync( + request?: protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, options?: CallOptions - ): AsyncIterable { + ): 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 ?? '', + name: request.name ?? '', }); - const defaultCallSettings = this._defaults['listConnectionProfiles']; + const defaultCallSettings = this._defaults['fetchStaticIps']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listConnectionProfiles.asyncIterate( - this.innerApiCalls['listConnectionProfiles'] as GaxCall, + return this.descriptors.page.fetchStaticIps.asyncIterate( + this.innerApiCalls['fetchStaticIps'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.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 {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 {@link google.cloud.location.Location | Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @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 + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 -- // -------------------- @@ -3177,6 +6806,67 @@ export class DataMigrationServiceClient { ).connection_profile; } + /** + * Return a fully-qualified conversionWorkspace resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversion_workspace + * @returns {string} Resource name string. + */ + conversionWorkspacePath( + project: string, + location: string, + conversionWorkspace: string + ) { + return this.pathTemplates.conversionWorkspacePathTemplate.render({ + project: project, + location: location, + conversion_workspace: conversionWorkspace, + }); + } + + /** + * Parse the project from ConversionWorkspace resource. + * + * @param {string} conversionWorkspaceName + * A fully-qualified path representing ConversionWorkspace resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConversionWorkspaceName(conversionWorkspaceName: string) { + return this.pathTemplates.conversionWorkspacePathTemplate.match( + conversionWorkspaceName + ).project; + } + + /** + * Parse the location from ConversionWorkspace resource. + * + * @param {string} conversionWorkspaceName + * A fully-qualified path representing ConversionWorkspace resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConversionWorkspaceName(conversionWorkspaceName: string) { + return this.pathTemplates.conversionWorkspacePathTemplate.match( + conversionWorkspaceName + ).location; + } + + /** + * Parse the conversion_workspace from ConversionWorkspace resource. + * + * @param {string} conversionWorkspaceName + * A fully-qualified path representing ConversionWorkspace resource. + * @returns {string} A string representing the conversion_workspace. + */ + matchConversionWorkspaceFromConversionWorkspaceName( + conversionWorkspaceName: string + ) { + return this.pathTemplates.conversionWorkspacePathTemplate.match( + conversionWorkspaceName + ).conversion_workspace; + } + /** * Return a fully-qualified location resource name string. * @@ -3265,6 +6955,67 @@ export class DataMigrationServiceClient { .migration_job; } + /** + * Return a fully-qualified privateConnection resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} private_connection + * @returns {string} Resource name string. + */ + privateConnectionPath( + project: string, + location: string, + privateConnection: string + ) { + return this.pathTemplates.privateConnectionPathTemplate.render({ + project: project, + location: location, + private_connection: privateConnection, + }); + } + + /** + * Parse the project from PrivateConnection resource. + * + * @param {string} privateConnectionName + * A fully-qualified path representing PrivateConnection resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPrivateConnectionName(privateConnectionName: string) { + return this.pathTemplates.privateConnectionPathTemplate.match( + privateConnectionName + ).project; + } + + /** + * Parse the location from PrivateConnection resource. + * + * @param {string} privateConnectionName + * A fully-qualified path representing PrivateConnection resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPrivateConnectionName(privateConnectionName: string) { + return this.pathTemplates.privateConnectionPathTemplate.match( + privateConnectionName + ).location; + } + + /** + * Parse the private_connection from PrivateConnection resource. + * + * @param {string} privateConnectionName + * A fully-qualified path representing PrivateConnection resource. + * @returns {string} A string representing the private_connection. + */ + matchPrivateConnectionFromPrivateConnectionName( + privateConnectionName: string + ) { + return this.pathTemplates.privateConnectionPathTemplate.match( + privateConnectionName + ).private_connection; + } + /** * Return a fully-qualified project resource name string. * @@ -3299,6 +7050,8 @@ export class DataMigrationServiceClient { return this.dataMigrationServiceStub.then(stub => { this._terminated = true; stub.close(); + this.iamClient.close(); + this.locationsClient.close(); this.operationsClient.close(); }); } diff --git a/packages/google-cloud-clouddms/src/v1/data_migration_service_client_config.json b/packages/google-cloud-clouddms/src/v1/data_migration_service_client_config.json index 33c9e3a8686..8e34da8c8c8 100644 --- a/packages/google-cloud-clouddms/src/v1/data_migration_service_client_config.json +++ b/packages/google-cloud-clouddms/src/v1/data_migration_service_client_config.json @@ -104,6 +104,101 @@ "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "CreatePrivateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPrivateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPrivateConnections": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePrivateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListConversionWorkspaces": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SeedConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportMappingRules": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ConvertConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CommitConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RollbackConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ApplyConversionWorkspace": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DescribeDatabaseEntities": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SearchBackgroundJobs": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DescribeConversionWorkspaceRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchStaticIps": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-clouddms/src/v1/data_migration_service_proto_list.json b/packages/google-cloud-clouddms/src/v1/data_migration_service_proto_list.json index 888fb46fae1..9617525e5a5 100644 --- a/packages/google-cloud-clouddms/src/v1/data_migration_service_proto_list.json +++ b/packages/google-cloud-clouddms/src/v1/data_migration_service_proto_list.json @@ -1,4 +1,5 @@ [ "../../protos/google/cloud/clouddms/v1/clouddms.proto", - "../../protos/google/cloud/clouddms/v1/clouddms_resources.proto" + "../../protos/google/cloud/clouddms/v1/clouddms_resources.proto", + "../../protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto" ] diff --git a/packages/google-cloud-clouddms/src/v1/gapic_metadata.json b/packages/google-cloud-clouddms/src/v1/gapic_metadata.json index a50466d0076..b6a2e2f6715 100644 --- a/packages/google-cloud-clouddms/src/v1/gapic_metadata.json +++ b/packages/google-cloud-clouddms/src/v1/gapic_metadata.json @@ -25,6 +25,26 @@ "getConnectionProfile" ] }, + "GetPrivateConnection": { + "methods": [ + "getPrivateConnection" + ] + }, + "GetConversionWorkspace": { + "methods": [ + "getConversionWorkspace" + ] + }, + "SearchBackgroundJobs": { + "methods": [ + "searchBackgroundJobs" + ] + }, + "DescribeConversionWorkspaceRevisions": { + "methods": [ + "describeConversionWorkspaceRevisions" + ] + }, "CreateMigrationJob": { "methods": [ "createMigrationJob" @@ -85,6 +105,61 @@ "deleteConnectionProfile" ] }, + "CreatePrivateConnection": { + "methods": [ + "createPrivateConnection" + ] + }, + "DeletePrivateConnection": { + "methods": [ + "deletePrivateConnection" + ] + }, + "CreateConversionWorkspace": { + "methods": [ + "createConversionWorkspace" + ] + }, + "UpdateConversionWorkspace": { + "methods": [ + "updateConversionWorkspace" + ] + }, + "DeleteConversionWorkspace": { + "methods": [ + "deleteConversionWorkspace" + ] + }, + "SeedConversionWorkspace": { + "methods": [ + "seedConversionWorkspace" + ] + }, + "ImportMappingRules": { + "methods": [ + "importMappingRules" + ] + }, + "ConvertConversionWorkspace": { + "methods": [ + "convertConversionWorkspace" + ] + }, + "CommitConversionWorkspace": { + "methods": [ + "commitConversionWorkspace" + ] + }, + "RollbackConversionWorkspace": { + "methods": [ + "rollbackConversionWorkspace" + ] + }, + "ApplyConversionWorkspace": { + "methods": [ + "applyConversionWorkspace" + ] + }, "ListMigrationJobs": { "methods": [ "listMigrationJobs", @@ -98,6 +173,34 @@ "listConnectionProfilesStream", "listConnectionProfilesAsync" ] + }, + "ListPrivateConnections": { + "methods": [ + "listPrivateConnections", + "listPrivateConnectionsStream", + "listPrivateConnectionsAsync" + ] + }, + "ListConversionWorkspaces": { + "methods": [ + "listConversionWorkspaces", + "listConversionWorkspacesStream", + "listConversionWorkspacesAsync" + ] + }, + "DescribeDatabaseEntities": { + "methods": [ + "describeDatabaseEntities", + "describeDatabaseEntitiesStream", + "describeDatabaseEntitiesAsync" + ] + }, + "FetchStaticIps": { + "methods": [ + "fetchStaticIps", + "fetchStaticIpsStream", + "fetchStaticIpsAsync" + ] } } }, @@ -119,6 +222,26 @@ "getConnectionProfile" ] }, + "GetPrivateConnection": { + "methods": [ + "getPrivateConnection" + ] + }, + "GetConversionWorkspace": { + "methods": [ + "getConversionWorkspace" + ] + }, + "SearchBackgroundJobs": { + "methods": [ + "searchBackgroundJobs" + ] + }, + "DescribeConversionWorkspaceRevisions": { + "methods": [ + "describeConversionWorkspaceRevisions" + ] + }, "CreateMigrationJob": { "methods": [ "createMigrationJob" @@ -179,6 +302,61 @@ "deleteConnectionProfile" ] }, + "CreatePrivateConnection": { + "methods": [ + "createPrivateConnection" + ] + }, + "DeletePrivateConnection": { + "methods": [ + "deletePrivateConnection" + ] + }, + "CreateConversionWorkspace": { + "methods": [ + "createConversionWorkspace" + ] + }, + "UpdateConversionWorkspace": { + "methods": [ + "updateConversionWorkspace" + ] + }, + "DeleteConversionWorkspace": { + "methods": [ + "deleteConversionWorkspace" + ] + }, + "SeedConversionWorkspace": { + "methods": [ + "seedConversionWorkspace" + ] + }, + "ImportMappingRules": { + "methods": [ + "importMappingRules" + ] + }, + "ConvertConversionWorkspace": { + "methods": [ + "convertConversionWorkspace" + ] + }, + "CommitConversionWorkspace": { + "methods": [ + "commitConversionWorkspace" + ] + }, + "RollbackConversionWorkspace": { + "methods": [ + "rollbackConversionWorkspace" + ] + }, + "ApplyConversionWorkspace": { + "methods": [ + "applyConversionWorkspace" + ] + }, "ListMigrationJobs": { "methods": [ "listMigrationJobs", @@ -192,6 +370,34 @@ "listConnectionProfilesStream", "listConnectionProfilesAsync" ] + }, + "ListPrivateConnections": { + "methods": [ + "listPrivateConnections", + "listPrivateConnectionsStream", + "listPrivateConnectionsAsync" + ] + }, + "ListConversionWorkspaces": { + "methods": [ + "listConversionWorkspaces", + "listConversionWorkspacesStream", + "listConversionWorkspacesAsync" + ] + }, + "DescribeDatabaseEntities": { + "methods": [ + "describeDatabaseEntities", + "describeDatabaseEntitiesStream", + "describeDatabaseEntitiesAsync" + ] + }, + "FetchStaticIps": { + "methods": [ + "fetchStaticIps", + "fetchStaticIpsStream", + "fetchStaticIpsAsync" + ] } } } diff --git a/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts b/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts index 1e519637adf..2983ee96829 100644 --- a/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts +++ b/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts @@ -25,7 +25,13 @@ import * as datamigrationserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation, operationsProtos} from 'google-gax'; +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -670,8 +676,8 @@ describe('v1.DataMigrationServiceClient', () => { }); }); - describe('createMigrationJob', () => { - it('invokes createMigrationJob without error', async () => { + describe('getPrivateConnection', () => { + it('invokes getPrivateConnection without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -679,33 +685,32 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() + new protos.google.cloud.clouddms.v1.GetPrivateConnectionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.CreateMigrationJobRequest', - ['parent'] + '.google.cloud.clouddms.v1.GetPrivateConnectionRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.clouddms.v1.PrivateConnection() ); - client.innerApiCalls.createMigrationJob = - stubLongRunningCall(expectedResponse); - const [operation] = await client.createMigrationJob(request); - const [response] = await operation.promise(); + client.innerApiCalls.getPrivateConnection = + stubSimpleCall(expectedResponse); + const [response] = await client.getPrivateConnection(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createMigrationJob as SinonStub + client.innerApiCalls.getPrivateConnection as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createMigrationJob as SinonStub + client.innerApiCalls.getPrivateConnection as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createMigrationJob without error using callback', async () => { + it('invokes getPrivateConnection without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -713,28 +718,25 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() + new protos.google.cloud.clouddms.v1.GetPrivateConnectionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.CreateMigrationJobRequest', - ['parent'] + '.google.cloud.clouddms.v1.GetPrivateConnectionRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.clouddms.v1.PrivateConnection() ); - client.innerApiCalls.createMigrationJob = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getPrivateConnection = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createMigrationJob( + client.getPrivateConnection( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - > | null + result?: protos.google.cloud.clouddms.v1.IPrivateConnection | null ) => { if (err) { reject(err); @@ -744,23 +746,19 @@ describe('v1.DataMigrationServiceClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createMigrationJob as SinonStub + client.innerApiCalls.getPrivateConnection as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createMigrationJob as SinonStub + client.innerApiCalls.getPrivateConnection as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createMigrationJob with call error', async () => { + it('invokes getPrivateConnection with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -768,31 +766,31 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() + new protos.google.cloud.clouddms.v1.GetPrivateConnectionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.CreateMigrationJobRequest', - ['parent'] + '.google.cloud.clouddms.v1.GetPrivateConnectionRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createMigrationJob = stubLongRunningCall( + client.innerApiCalls.getPrivateConnection = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.createMigrationJob(request), expectedError); + await assert.rejects(client.getPrivateConnection(request), expectedError); const actualRequest = ( - client.innerApiCalls.createMigrationJob as SinonStub + client.innerApiCalls.getPrivateConnection as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createMigrationJob as SinonStub + client.innerApiCalls.getPrivateConnection as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createMigrationJob with LRO error', async () => { + it('invokes getPrivateConnection with closed client', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -800,78 +798,162 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() + new protos.google.cloud.clouddms.v1.GetPrivateConnectionRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.CreateMigrationJobRequest', - ['parent'] + '.google.cloud.clouddms.v1.GetPrivateConnectionRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createMigrationJob = stubLongRunningCall( - undefined, - undefined, - expectedError + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPrivateConnection(request), expectedError); + }); + }); + + describe('getConversionWorkspace', () => { + it('invokes getConversionWorkspace without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConversionWorkspaceRequest() ); - const [operation] = await client.createMigrationJob(request); - await assert.rejects(operation.promise(), expectedError); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GetConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ); + client.innerApiCalls.getConversionWorkspace = + stubSimpleCall(expectedResponse); + const [response] = await client.getConversionWorkspace(request); + assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createMigrationJob as SinonStub + client.innerApiCalls.getConversionWorkspace as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createMigrationJob as SinonStub + client.innerApiCalls.getConversionWorkspace as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateMigrationJobProgress without error', async () => { + it('invokes getConversionWorkspace without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConversionWorkspaceRequest() ); - 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.checkCreateMigrationJobProgress( - expectedResponse.name + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GetConversionWorkspaceRequest', + ['name'] ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ); + client.innerApiCalls.getConversionWorkspace = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConversionWorkspace( + request, + ( + err?: Error | null, + result?: protos.google.cloud.clouddms.v1.IConversionWorkspace | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateMigrationJobProgress with error', async () => { + it('invokes getConversionWorkspace with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GetConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( + client.innerApiCalls.getConversionWorkspace = stubSimpleCall( undefined, expectedError ); await assert.rejects( - client.checkCreateMigrationJobProgress(''), + client.getConversionWorkspace(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversionWorkspace with closed client', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GetConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getConversionWorkspace(request), expectedError ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('updateMigrationJob', () => { - it('invokes updateMigrationJob without error', async () => { + describe('searchBackgroundJobs', () => { + it('invokes searchBackgroundJobs without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -879,34 +961,32 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() + new protos.google.cloud.clouddms.v1.SearchBackgroundJobsRequest() ); - request.migrationJob ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.UpdateMigrationJobRequest', - ['migrationJob', 'name'] + '.google.cloud.clouddms.v1.SearchBackgroundJobsRequest', + ['conversionWorkspace'] ); - request.migrationJob.name = defaultValue1; - const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.clouddms.v1.SearchBackgroundJobsResponse() ); - client.innerApiCalls.updateMigrationJob = - stubLongRunningCall(expectedResponse); - const [operation] = await client.updateMigrationJob(request); - const [response] = await operation.promise(); + client.innerApiCalls.searchBackgroundJobs = + stubSimpleCall(expectedResponse); + const [response] = await client.searchBackgroundJobs(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateMigrationJob as SinonStub + client.innerApiCalls.searchBackgroundJobs as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateMigrationJob as SinonStub + client.innerApiCalls.searchBackgroundJobs as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateMigrationJob without error using callback', async () => { + it('invokes searchBackgroundJobs without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -914,29 +994,25 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() + new protos.google.cloud.clouddms.v1.SearchBackgroundJobsRequest() ); - request.migrationJob ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.UpdateMigrationJobRequest', - ['migrationJob', 'name'] + '.google.cloud.clouddms.v1.SearchBackgroundJobsRequest', + ['conversionWorkspace'] ); - request.migrationJob.name = defaultValue1; - const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.clouddms.v1.SearchBackgroundJobsResponse() ); - client.innerApiCalls.updateMigrationJob = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.searchBackgroundJobs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateMigrationJob( + client.searchBackgroundJobs( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - > | null + result?: protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse | null ) => { if (err) { reject(err); @@ -946,23 +1022,19 @@ describe('v1.DataMigrationServiceClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, - protos.google.cloud.clouddms.v1.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateMigrationJob as SinonStub + client.innerApiCalls.searchBackgroundJobs as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateMigrationJob as SinonStub + client.innerApiCalls.searchBackgroundJobs as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateMigrationJob with call error', async () => { + it('invokes searchBackgroundJobs with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -970,32 +1042,31 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() + new protos.google.cloud.clouddms.v1.SearchBackgroundJobsRequest() ); - request.migrationJob ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.UpdateMigrationJobRequest', - ['migrationJob', 'name'] + '.google.cloud.clouddms.v1.SearchBackgroundJobsRequest', + ['conversionWorkspace'] ); - request.migrationJob.name = defaultValue1; - const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateMigrationJob = stubLongRunningCall( + client.innerApiCalls.searchBackgroundJobs = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.updateMigrationJob(request), expectedError); + await assert.rejects(client.searchBackgroundJobs(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateMigrationJob as SinonStub + client.innerApiCalls.searchBackgroundJobs as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateMigrationJob as SinonStub + client.innerApiCalls.searchBackgroundJobs as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateMigrationJob with LRO error', async () => { + it('invokes searchBackgroundJobs with closed client', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1003,79 +1074,162 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() + new protos.google.cloud.clouddms.v1.SearchBackgroundJobsRequest() ); - request.migrationJob ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.UpdateMigrationJobRequest', - ['migrationJob', 'name'] - ); - request.migrationJob.name = defaultValue1; - const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateMigrationJob = stubLongRunningCall( - undefined, - undefined, - expectedError + '.google.cloud.clouddms.v1.SearchBackgroundJobsRequest', + ['conversionWorkspace'] ); - const [operation] = await client.updateMigrationJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.updateMigrationJob as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateMigrationJob as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + request.conversionWorkspace = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.searchBackgroundJobs(request), expectedError); }); + }); - it('invokes checkUpdateMigrationJobProgress without error', async () => { + describe('describeConversionWorkspaceRevisions', () => { + it('invokes describeConversionWorkspaceRevisions without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest() ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest', + ['conversionWorkspace'] + ); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse() + ); + client.innerApiCalls.describeConversionWorkspaceRevisions = + stubSimpleCall(expectedResponse); + const [response] = await client.describeConversionWorkspaceRevisions( + request + ); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateMigrationJobProgress( - expectedResponse.name + it('invokes describeConversionWorkspaceRevisions without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest() ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest', + ['conversionWorkspace'] + ); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse() + ); + client.innerApiCalls.describeConversionWorkspaceRevisions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.describeConversionWorkspaceRevisions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateMigrationJobProgress with error', async () => { + it('invokes describeConversionWorkspaceRevisions with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest', + ['conversionWorkspace'] + ); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, + client.innerApiCalls.describeConversionWorkspaceRevisions = + stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.describeConversionWorkspaceRevisions(request), expectedError ); + const actualRequest = ( + client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.describeConversionWorkspaceRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes describeConversionWorkspaceRevisions with closed client', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsRequest', + ['conversionWorkspace'] + ); + request.conversionWorkspace = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); await assert.rejects( - client.checkUpdateMigrationJobProgress(''), + client.describeConversionWorkspaceRevisions(request), expectedError ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteMigrationJob', () => { - it('invokes deleteMigrationJob without error', async () => { + describe('createMigrationJob', () => { + it('invokes createMigrationJob without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1083,33 +1237,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() + new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.DeleteMigrationJobRequest', - ['name'] + '.google.cloud.clouddms.v1.CreateMigrationJobRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteMigrationJob = + client.innerApiCalls.createMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteMigrationJob(request); + const [operation] = await client.createMigrationJob(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteMigrationJob as SinonStub + client.innerApiCalls.createMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteMigrationJob as SinonStub + client.innerApiCalls.createMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteMigrationJob without error using callback', async () => { + it('invokes createMigrationJob without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1117,26 +1271,26 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() + new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.DeleteMigrationJobRequest', - ['name'] + '.google.cloud.clouddms.v1.CreateMigrationJobRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteMigrationJob = + client.innerApiCalls.createMigrationJob = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteMigrationJob( + client.createMigrationJob( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata > | null ) => { @@ -1149,22 +1303,22 @@ describe('v1.DataMigrationServiceClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteMigrationJob as SinonStub + client.innerApiCalls.createMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteMigrationJob as SinonStub + client.innerApiCalls.createMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteMigrationJob with call error', async () => { + it('invokes createMigrationJob with call error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1172,31 +1326,31 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() + new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.DeleteMigrationJobRequest', - ['name'] + '.google.cloud.clouddms.v1.CreateMigrationJobRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteMigrationJob = stubLongRunningCall( + client.innerApiCalls.createMigrationJob = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteMigrationJob(request), expectedError); + await assert.rejects(client.createMigrationJob(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteMigrationJob as SinonStub + client.innerApiCalls.createMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteMigrationJob as SinonStub + client.innerApiCalls.createMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteMigrationJob with LRO error', async () => { + it('invokes createMigrationJob with LRO error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1204,33 +1358,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() + new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.DeleteMigrationJobRequest', - ['name'] + '.google.cloud.clouddms.v1.CreateMigrationJobRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteMigrationJob = stubLongRunningCall( + client.innerApiCalls.createMigrationJob = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteMigrationJob(request); + const [operation] = await client.createMigrationJob(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteMigrationJob as SinonStub + client.innerApiCalls.createMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteMigrationJob as SinonStub + client.innerApiCalls.createMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteMigrationJobProgress without error', async () => { + it('invokes checkCreateMigrationJobProgress without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1245,7 +1399,7 @@ describe('v1.DataMigrationServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteMigrationJobProgress( + const decodedOperation = await client.checkCreateMigrationJobProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1253,7 +1407,7 @@ describe('v1.DataMigrationServiceClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteMigrationJobProgress with error', async () => { + it('invokes checkCreateMigrationJobProgress with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1267,15 +1421,15 @@ describe('v1.DataMigrationServiceClient', () => { expectedError ); await assert.rejects( - client.checkDeleteMigrationJobProgress(''), + client.checkCreateMigrationJobProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('startMigrationJob', () => { - it('invokes startMigrationJob without error', async () => { + describe('updateMigrationJob', () => { + it('invokes updateMigrationJob without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1283,33 +1437,34 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() + new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() ); + request.migrationJob ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.StartMigrationJobRequest', - ['name'] + '.google.cloud.clouddms.v1.UpdateMigrationJobRequest', + ['migrationJob', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.migrationJob.name = defaultValue1; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.startMigrationJob = + client.innerApiCalls.updateMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.startMigrationJob(request); + const [operation] = await client.updateMigrationJob(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.startMigrationJob as SinonStub + client.innerApiCalls.updateMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.startMigrationJob as SinonStub + client.innerApiCalls.updateMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes startMigrationJob without error using callback', async () => { + it('invokes updateMigrationJob without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1317,21 +1472,22 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() + new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() ); + request.migrationJob ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.StartMigrationJobRequest', - ['name'] + '.google.cloud.clouddms.v1.UpdateMigrationJobRequest', + ['migrationJob', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.migrationJob.name = defaultValue1; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.startMigrationJob = + client.innerApiCalls.updateMigrationJob = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.startMigrationJob( + client.updateMigrationJob( request, ( err?: Error | null, @@ -1355,16 +1511,16 @@ describe('v1.DataMigrationServiceClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.startMigrationJob as SinonStub + client.innerApiCalls.updateMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.startMigrationJob as SinonStub + client.innerApiCalls.updateMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes startMigrationJob with call error', async () => { + it('invokes updateMigrationJob with call error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1372,31 +1528,32 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() + new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() ); + request.migrationJob ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.StartMigrationJobRequest', - ['name'] + '.google.cloud.clouddms.v1.UpdateMigrationJobRequest', + ['migrationJob', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.migrationJob.name = defaultValue1; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.startMigrationJob = stubLongRunningCall( + client.innerApiCalls.updateMigrationJob = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.startMigrationJob(request), expectedError); + await assert.rejects(client.updateMigrationJob(request), expectedError); const actualRequest = ( - client.innerApiCalls.startMigrationJob as SinonStub + client.innerApiCalls.updateMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.startMigrationJob as SinonStub + client.innerApiCalls.updateMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes startMigrationJob with LRO error', async () => { + it('invokes updateMigrationJob with LRO error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1404,33 +1561,34 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() + new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() ); + request.migrationJob ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.StartMigrationJobRequest', - ['name'] + '.google.cloud.clouddms.v1.UpdateMigrationJobRequest', + ['migrationJob', 'name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.migrationJob.name = defaultValue1; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.startMigrationJob = stubLongRunningCall( + client.innerApiCalls.updateMigrationJob = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.startMigrationJob(request); + const [operation] = await client.updateMigrationJob(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.startMigrationJob as SinonStub + client.innerApiCalls.updateMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.startMigrationJob as SinonStub + client.innerApiCalls.updateMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkStartMigrationJobProgress without error', async () => { + it('invokes checkUpdateMigrationJobProgress without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1445,7 +1603,7 @@ describe('v1.DataMigrationServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkStartMigrationJobProgress( + const decodedOperation = await client.checkUpdateMigrationJobProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1453,7 +1611,7 @@ describe('v1.DataMigrationServiceClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkStartMigrationJobProgress with error', async () => { + it('invokes checkUpdateMigrationJobProgress with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1467,15 +1625,15 @@ describe('v1.DataMigrationServiceClient', () => { expectedError ); await assert.rejects( - client.checkStartMigrationJobProgress(''), + client.checkUpdateMigrationJobProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('stopMigrationJob', () => { - it('invokes stopMigrationJob without error', async () => { + describe('deleteMigrationJob', () => { + it('invokes deleteMigrationJob without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1483,10 +1641,10 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() + new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.StopMigrationJobRequest', + '.google.cloud.clouddms.v1.DeleteMigrationJobRequest', ['name'] ); request.name = defaultValue1; @@ -1494,22 +1652,22 @@ describe('v1.DataMigrationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.stopMigrationJob = + client.innerApiCalls.deleteMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.stopMigrationJob(request); + const [operation] = await client.deleteMigrationJob(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.stopMigrationJob as SinonStub + client.innerApiCalls.deleteMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.stopMigrationJob as SinonStub + client.innerApiCalls.deleteMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes stopMigrationJob without error using callback', async () => { + it('invokes deleteMigrationJob without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1517,10 +1675,10 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() + new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.StopMigrationJobRequest', + '.google.cloud.clouddms.v1.DeleteMigrationJobRequest', ['name'] ); request.name = defaultValue1; @@ -1528,15 +1686,15 @@ describe('v1.DataMigrationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.stopMigrationJob = + client.innerApiCalls.deleteMigrationJob = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.stopMigrationJob( + client.deleteMigrationJob( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.protobuf.IEmpty, protos.google.cloud.clouddms.v1.IOperationMetadata > | null ) => { @@ -1549,22 +1707,22 @@ describe('v1.DataMigrationServiceClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.protobuf.IEmpty, protos.google.cloud.clouddms.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.stopMigrationJob as SinonStub + client.innerApiCalls.deleteMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.stopMigrationJob as SinonStub + client.innerApiCalls.deleteMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes stopMigrationJob with call error', async () => { + it('invokes deleteMigrationJob with call error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1572,31 +1730,31 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() + new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.StopMigrationJobRequest', + '.google.cloud.clouddms.v1.DeleteMigrationJobRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.stopMigrationJob = stubLongRunningCall( + client.innerApiCalls.deleteMigrationJob = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.stopMigrationJob(request), expectedError); + await assert.rejects(client.deleteMigrationJob(request), expectedError); const actualRequest = ( - client.innerApiCalls.stopMigrationJob as SinonStub + client.innerApiCalls.deleteMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.stopMigrationJob as SinonStub + client.innerApiCalls.deleteMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes stopMigrationJob with LRO error', async () => { + it('invokes deleteMigrationJob with LRO error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1604,33 +1762,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() + new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.StopMigrationJobRequest', + '.google.cloud.clouddms.v1.DeleteMigrationJobRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.stopMigrationJob = stubLongRunningCall( + client.innerApiCalls.deleteMigrationJob = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.stopMigrationJob(request); + const [operation] = await client.deleteMigrationJob(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.stopMigrationJob as SinonStub + client.innerApiCalls.deleteMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.stopMigrationJob as SinonStub + client.innerApiCalls.deleteMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkStopMigrationJobProgress without error', async () => { + it('invokes checkDeleteMigrationJobProgress without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1645,7 +1803,7 @@ describe('v1.DataMigrationServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkStopMigrationJobProgress( + const decodedOperation = await client.checkDeleteMigrationJobProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1653,7 +1811,7 @@ describe('v1.DataMigrationServiceClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkStopMigrationJobProgress with error', async () => { + it('invokes checkDeleteMigrationJobProgress with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1667,15 +1825,15 @@ describe('v1.DataMigrationServiceClient', () => { expectedError ); await assert.rejects( - client.checkStopMigrationJobProgress(''), + client.checkDeleteMigrationJobProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('resumeMigrationJob', () => { - it('invokes resumeMigrationJob without error', async () => { + describe('startMigrationJob', () => { + it('invokes startMigrationJob without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1683,10 +1841,10 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() + new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ResumeMigrationJobRequest', + '.google.cloud.clouddms.v1.StartMigrationJobRequest', ['name'] ); request.name = defaultValue1; @@ -1694,22 +1852,22 @@ describe('v1.DataMigrationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.resumeMigrationJob = + client.innerApiCalls.startMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.resumeMigrationJob(request); + const [operation] = await client.startMigrationJob(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.resumeMigrationJob as SinonStub + client.innerApiCalls.startMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.resumeMigrationJob as SinonStub + client.innerApiCalls.startMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes resumeMigrationJob without error using callback', async () => { + it('invokes startMigrationJob without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1717,10 +1875,10 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() + new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ResumeMigrationJobRequest', + '.google.cloud.clouddms.v1.StartMigrationJobRequest', ['name'] ); request.name = defaultValue1; @@ -1728,10 +1886,10 @@ describe('v1.DataMigrationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.resumeMigrationJob = + client.innerApiCalls.startMigrationJob = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.resumeMigrationJob( + client.startMigrationJob( request, ( err?: Error | null, @@ -1755,16 +1913,16 @@ describe('v1.DataMigrationServiceClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.resumeMigrationJob as SinonStub + client.innerApiCalls.startMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.resumeMigrationJob as SinonStub + client.innerApiCalls.startMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes resumeMigrationJob with call error', async () => { + it('invokes startMigrationJob with call error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1772,31 +1930,31 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() + new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ResumeMigrationJobRequest', + '.google.cloud.clouddms.v1.StartMigrationJobRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.resumeMigrationJob = stubLongRunningCall( + client.innerApiCalls.startMigrationJob = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.resumeMigrationJob(request), expectedError); + await assert.rejects(client.startMigrationJob(request), expectedError); const actualRequest = ( - client.innerApiCalls.resumeMigrationJob as SinonStub + client.innerApiCalls.startMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.resumeMigrationJob as SinonStub + client.innerApiCalls.startMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes resumeMigrationJob with LRO error', async () => { + it('invokes startMigrationJob with LRO error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1804,33 +1962,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() + new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ResumeMigrationJobRequest', + '.google.cloud.clouddms.v1.StartMigrationJobRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.resumeMigrationJob = stubLongRunningCall( + client.innerApiCalls.startMigrationJob = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.resumeMigrationJob(request); + const [operation] = await client.startMigrationJob(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.resumeMigrationJob as SinonStub + client.innerApiCalls.startMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.resumeMigrationJob as SinonStub + client.innerApiCalls.startMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkResumeMigrationJobProgress without error', async () => { + it('invokes checkStartMigrationJobProgress without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1845,7 +2003,7 @@ describe('v1.DataMigrationServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkResumeMigrationJobProgress( + const decodedOperation = await client.checkStartMigrationJobProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1853,7 +2011,7 @@ describe('v1.DataMigrationServiceClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkResumeMigrationJobProgress with error', async () => { + it('invokes checkStartMigrationJobProgress with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1867,15 +2025,15 @@ describe('v1.DataMigrationServiceClient', () => { expectedError ); await assert.rejects( - client.checkResumeMigrationJobProgress(''), + client.checkStartMigrationJobProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('promoteMigrationJob', () => { - it('invokes promoteMigrationJob without error', async () => { + describe('stopMigrationJob', () => { + it('invokes stopMigrationJob without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1883,10 +2041,10 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() + new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.PromoteMigrationJobRequest', + '.google.cloud.clouddms.v1.StopMigrationJobRequest', ['name'] ); request.name = defaultValue1; @@ -1894,22 +2052,22 @@ describe('v1.DataMigrationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.promoteMigrationJob = + client.innerApiCalls.stopMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.promoteMigrationJob(request); + const [operation] = await client.stopMigrationJob(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.promoteMigrationJob as SinonStub + client.innerApiCalls.stopMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.promoteMigrationJob as SinonStub + client.innerApiCalls.stopMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes promoteMigrationJob without error using callback', async () => { + it('invokes stopMigrationJob without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1917,10 +2075,10 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() + new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.PromoteMigrationJobRequest', + '.google.cloud.clouddms.v1.StopMigrationJobRequest', ['name'] ); request.name = defaultValue1; @@ -1928,10 +2086,10 @@ describe('v1.DataMigrationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.promoteMigrationJob = + client.innerApiCalls.stopMigrationJob = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.promoteMigrationJob( + client.stopMigrationJob( request, ( err?: Error | null, @@ -1955,16 +2113,16 @@ describe('v1.DataMigrationServiceClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.promoteMigrationJob as SinonStub + client.innerApiCalls.stopMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.promoteMigrationJob as SinonStub + client.innerApiCalls.stopMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes promoteMigrationJob with call error', async () => { + it('invokes stopMigrationJob with call error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1972,31 +2130,31 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() + new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.PromoteMigrationJobRequest', + '.google.cloud.clouddms.v1.StopMigrationJobRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.promoteMigrationJob = stubLongRunningCall( + client.innerApiCalls.stopMigrationJob = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.promoteMigrationJob(request), expectedError); + await assert.rejects(client.stopMigrationJob(request), expectedError); const actualRequest = ( - client.innerApiCalls.promoteMigrationJob as SinonStub + client.innerApiCalls.stopMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.promoteMigrationJob as SinonStub + client.innerApiCalls.stopMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes promoteMigrationJob with LRO error', async () => { + it('invokes stopMigrationJob with LRO error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2004,33 +2162,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() + new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.PromoteMigrationJobRequest', + '.google.cloud.clouddms.v1.StopMigrationJobRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.promoteMigrationJob = stubLongRunningCall( + client.innerApiCalls.stopMigrationJob = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.promoteMigrationJob(request); + const [operation] = await client.stopMigrationJob(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.promoteMigrationJob as SinonStub + client.innerApiCalls.stopMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.promoteMigrationJob as SinonStub + client.innerApiCalls.stopMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkPromoteMigrationJobProgress without error', async () => { + it('invokes checkStopMigrationJobProgress without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2045,7 +2203,7 @@ describe('v1.DataMigrationServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkPromoteMigrationJobProgress( + const decodedOperation = await client.checkStopMigrationJobProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2053,7 +2211,7 @@ describe('v1.DataMigrationServiceClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkPromoteMigrationJobProgress with error', async () => { + it('invokes checkStopMigrationJobProgress with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2067,15 +2225,15 @@ describe('v1.DataMigrationServiceClient', () => { expectedError ); await assert.rejects( - client.checkPromoteMigrationJobProgress(''), + client.checkStopMigrationJobProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('verifyMigrationJob', () => { - it('invokes verifyMigrationJob without error', async () => { + describe('resumeMigrationJob', () => { + it('invokes resumeMigrationJob without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2083,10 +2241,10 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() + new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.VerifyMigrationJobRequest', + '.google.cloud.clouddms.v1.ResumeMigrationJobRequest', ['name'] ); request.name = defaultValue1; @@ -2094,22 +2252,22 @@ describe('v1.DataMigrationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.verifyMigrationJob = + client.innerApiCalls.resumeMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.verifyMigrationJob(request); + const [operation] = await client.resumeMigrationJob(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.verifyMigrationJob as SinonStub + client.innerApiCalls.resumeMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.verifyMigrationJob as SinonStub + client.innerApiCalls.resumeMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes verifyMigrationJob without error using callback', async () => { + it('invokes resumeMigrationJob without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2117,10 +2275,10 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() + new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.VerifyMigrationJobRequest', + '.google.cloud.clouddms.v1.ResumeMigrationJobRequest', ['name'] ); request.name = defaultValue1; @@ -2128,10 +2286,10 @@ describe('v1.DataMigrationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.verifyMigrationJob = + client.innerApiCalls.resumeMigrationJob = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.verifyMigrationJob( + client.resumeMigrationJob( request, ( err?: Error | null, @@ -2155,16 +2313,16 @@ describe('v1.DataMigrationServiceClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.verifyMigrationJob as SinonStub + client.innerApiCalls.resumeMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.verifyMigrationJob as SinonStub + client.innerApiCalls.resumeMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes verifyMigrationJob with call error', async () => { + it('invokes resumeMigrationJob with call error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2172,31 +2330,31 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() + new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.VerifyMigrationJobRequest', + '.google.cloud.clouddms.v1.ResumeMigrationJobRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.verifyMigrationJob = stubLongRunningCall( + client.innerApiCalls.resumeMigrationJob = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.verifyMigrationJob(request), expectedError); + await assert.rejects(client.resumeMigrationJob(request), expectedError); const actualRequest = ( - client.innerApiCalls.verifyMigrationJob as SinonStub + client.innerApiCalls.resumeMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.verifyMigrationJob as SinonStub + client.innerApiCalls.resumeMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes verifyMigrationJob with LRO error', async () => { + it('invokes resumeMigrationJob with LRO error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2204,33 +2362,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() + new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.VerifyMigrationJobRequest', + '.google.cloud.clouddms.v1.ResumeMigrationJobRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.verifyMigrationJob = stubLongRunningCall( + client.innerApiCalls.resumeMigrationJob = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.verifyMigrationJob(request); + const [operation] = await client.resumeMigrationJob(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.verifyMigrationJob as SinonStub + client.innerApiCalls.resumeMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.verifyMigrationJob as SinonStub + client.innerApiCalls.resumeMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkVerifyMigrationJobProgress without error', async () => { + it('invokes checkResumeMigrationJobProgress without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2245,7 +2403,7 @@ describe('v1.DataMigrationServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkVerifyMigrationJobProgress( + const decodedOperation = await client.checkResumeMigrationJobProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2253,7 +2411,7 @@ describe('v1.DataMigrationServiceClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkVerifyMigrationJobProgress with error', async () => { + it('invokes checkResumeMigrationJobProgress with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2267,15 +2425,15 @@ describe('v1.DataMigrationServiceClient', () => { expectedError ); await assert.rejects( - client.checkVerifyMigrationJobProgress(''), + client.checkResumeMigrationJobProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('restartMigrationJob', () => { - it('invokes restartMigrationJob without error', async () => { + describe('promoteMigrationJob', () => { + it('invokes promoteMigrationJob without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2283,10 +2441,10 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() + new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.RestartMigrationJobRequest', + '.google.cloud.clouddms.v1.PromoteMigrationJobRequest', ['name'] ); request.name = defaultValue1; @@ -2294,22 +2452,22 @@ describe('v1.DataMigrationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restartMigrationJob = + client.innerApiCalls.promoteMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartMigrationJob(request); + const [operation] = await client.promoteMigrationJob(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restartMigrationJob as SinonStub + client.innerApiCalls.promoteMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartMigrationJob as SinonStub + client.innerApiCalls.promoteMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restartMigrationJob without error using callback', async () => { + it('invokes promoteMigrationJob without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2317,10 +2475,10 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() + new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.RestartMigrationJobRequest', + '.google.cloud.clouddms.v1.PromoteMigrationJobRequest', ['name'] ); request.name = defaultValue1; @@ -2328,10 +2486,10 @@ describe('v1.DataMigrationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.restartMigrationJob = + client.innerApiCalls.promoteMigrationJob = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.restartMigrationJob( + client.promoteMigrationJob( request, ( err?: Error | null, @@ -2355,16 +2513,16 @@ describe('v1.DataMigrationServiceClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.restartMigrationJob as SinonStub + client.innerApiCalls.promoteMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartMigrationJob as SinonStub + client.innerApiCalls.promoteMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restartMigrationJob with call error', async () => { + it('invokes promoteMigrationJob with call error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2372,31 +2530,31 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() + new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.RestartMigrationJobRequest', + '.google.cloud.clouddms.v1.PromoteMigrationJobRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restartMigrationJob = stubLongRunningCall( + client.innerApiCalls.promoteMigrationJob = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.restartMigrationJob(request), expectedError); + await assert.rejects(client.promoteMigrationJob(request), expectedError); const actualRequest = ( - client.innerApiCalls.restartMigrationJob as SinonStub + client.innerApiCalls.promoteMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartMigrationJob as SinonStub + client.innerApiCalls.promoteMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes restartMigrationJob with LRO error', async () => { + it('invokes promoteMigrationJob with LRO error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2404,33 +2562,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() + new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.RestartMigrationJobRequest', + '.google.cloud.clouddms.v1.PromoteMigrationJobRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.restartMigrationJob = stubLongRunningCall( + client.innerApiCalls.promoteMigrationJob = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.restartMigrationJob(request); + const [operation] = await client.promoteMigrationJob(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.restartMigrationJob as SinonStub + client.innerApiCalls.promoteMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.restartMigrationJob as SinonStub + client.innerApiCalls.promoteMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkRestartMigrationJobProgress without error', async () => { + it('invokes checkPromoteMigrationJobProgress without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2445,7 +2603,7 @@ describe('v1.DataMigrationServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRestartMigrationJobProgress( + const decodedOperation = await client.checkPromoteMigrationJobProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2453,7 +2611,7 @@ describe('v1.DataMigrationServiceClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkRestartMigrationJobProgress with error', async () => { + it('invokes checkPromoteMigrationJobProgress with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2467,15 +2625,15 @@ describe('v1.DataMigrationServiceClient', () => { expectedError ); await assert.rejects( - client.checkRestartMigrationJobProgress(''), + client.checkPromoteMigrationJobProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createConnectionProfile', () => { - it('invokes createConnectionProfile without error', async () => { + describe('verifyMigrationJob', () => { + it('invokes verifyMigrationJob without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2483,33 +2641,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() + new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.CreateConnectionProfileRequest', - ['parent'] + '.google.cloud.clouddms.v1.VerifyMigrationJobRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createConnectionProfile = + client.innerApiCalls.verifyMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.createConnectionProfile(request); + const [operation] = await client.verifyMigrationJob(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createConnectionProfile as SinonStub + client.innerApiCalls.verifyMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createConnectionProfile as SinonStub + client.innerApiCalls.verifyMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createConnectionProfile without error using callback', async () => { + it('invokes verifyMigrationJob without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2517,26 +2675,26 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() + new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.CreateConnectionProfileRequest', - ['parent'] + '.google.cloud.clouddms.v1.VerifyMigrationJobRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createConnectionProfile = + client.innerApiCalls.verifyMigrationJob = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createConnectionProfile( + client.verifyMigrationJob( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata > | null ) => { @@ -2549,22 +2707,22 @@ describe('v1.DataMigrationServiceClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createConnectionProfile as SinonStub + client.innerApiCalls.verifyMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createConnectionProfile as SinonStub + client.innerApiCalls.verifyMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createConnectionProfile with call error', async () => { + it('invokes verifyMigrationJob with call error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2572,34 +2730,31 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() + new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.CreateConnectionProfileRequest', - ['parent'] + '.google.cloud.clouddms.v1.VerifyMigrationJobRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createConnectionProfile = stubLongRunningCall( + client.innerApiCalls.verifyMigrationJob = stubLongRunningCall( undefined, expectedError ); - await assert.rejects( - client.createConnectionProfile(request), - expectedError - ); + await assert.rejects(client.verifyMigrationJob(request), expectedError); const actualRequest = ( - client.innerApiCalls.createConnectionProfile as SinonStub + client.innerApiCalls.verifyMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createConnectionProfile as SinonStub + client.innerApiCalls.verifyMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createConnectionProfile with LRO error', async () => { + it('invokes verifyMigrationJob with LRO error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2607,33 +2762,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() + new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.CreateConnectionProfileRequest', - ['parent'] + '.google.cloud.clouddms.v1.VerifyMigrationJobRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createConnectionProfile = stubLongRunningCall( + client.innerApiCalls.verifyMigrationJob = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createConnectionProfile(request); + const [operation] = await client.verifyMigrationJob(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createConnectionProfile as SinonStub + client.innerApiCalls.verifyMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createConnectionProfile as SinonStub + client.innerApiCalls.verifyMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateConnectionProfileProgress without error', async () => { + it('invokes checkVerifyMigrationJobProgress without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2648,16 +2803,15 @@ describe('v1.DataMigrationServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkCreateConnectionProfileProgress( - expectedResponse.name - ); + const decodedOperation = await client.checkVerifyMigrationJobProgress( + expectedResponse.name + ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateConnectionProfileProgress with error', async () => { + it('invokes checkVerifyMigrationJobProgress with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2671,15 +2825,15 @@ describe('v1.DataMigrationServiceClient', () => { expectedError ); await assert.rejects( - client.checkCreateConnectionProfileProgress(''), + client.checkVerifyMigrationJobProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('updateConnectionProfile', () => { - it('invokes updateConnectionProfile without error', async () => { + describe('restartMigrationJob', () => { + it('invokes restartMigrationJob without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2687,34 +2841,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() ); - request.connectionProfile ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', - ['connectionProfile', 'name'] + '.google.cloud.clouddms.v1.RestartMigrationJobRequest', + ['name'] ); - request.connectionProfile.name = defaultValue1; - const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateConnectionProfile = + client.innerApiCalls.restartMigrationJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateConnectionProfile(request); + const [operation] = await client.restartMigrationJob(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateConnectionProfile as SinonStub + client.innerApiCalls.restartMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateConnectionProfile as SinonStub + client.innerApiCalls.restartMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateConnectionProfile without error using callback', async () => { + it('invokes restartMigrationJob without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2722,27 +2875,26 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() ); - request.connectionProfile ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', - ['connectionProfile', 'name'] + '.google.cloud.clouddms.v1.RestartMigrationJobRequest', + ['name'] ); - request.connectionProfile.name = defaultValue1; - const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateConnectionProfile = + client.innerApiCalls.restartMigrationJob = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateConnectionProfile( + client.restartMigrationJob( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata > | null ) => { @@ -2755,22 +2907,22 @@ describe('v1.DataMigrationServiceClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IMigrationJob, protos.google.cloud.clouddms.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateConnectionProfile as SinonStub + client.innerApiCalls.restartMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateConnectionProfile as SinonStub + client.innerApiCalls.restartMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateConnectionProfile with call error', async () => { + it('invokes restartMigrationJob with call error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2778,35 +2930,31 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() ); - request.connectionProfile ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', - ['connectionProfile', 'name'] + '.google.cloud.clouddms.v1.RestartMigrationJobRequest', + ['name'] ); - request.connectionProfile.name = defaultValue1; - const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateConnectionProfile = stubLongRunningCall( + client.innerApiCalls.restartMigrationJob = stubLongRunningCall( undefined, expectedError ); - await assert.rejects( - client.updateConnectionProfile(request), - expectedError - ); + await assert.rejects(client.restartMigrationJob(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateConnectionProfile as SinonStub + client.innerApiCalls.restartMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateConnectionProfile as SinonStub + client.innerApiCalls.restartMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateConnectionProfile with LRO error', async () => { + it('invokes restartMigrationJob with LRO error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2814,34 +2962,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() ); - request.connectionProfile ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', - ['connectionProfile', 'name'] + '.google.cloud.clouddms.v1.RestartMigrationJobRequest', + ['name'] ); - request.connectionProfile.name = defaultValue1; - const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateConnectionProfile = stubLongRunningCall( + client.innerApiCalls.restartMigrationJob = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.updateConnectionProfile(request); + const [operation] = await client.restartMigrationJob(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.updateConnectionProfile as SinonStub + client.innerApiCalls.restartMigrationJob as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateConnectionProfile as SinonStub + client.innerApiCalls.restartMigrationJob as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateConnectionProfileProgress without error', async () => { + it('invokes checkRestartMigrationJobProgress without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2856,16 +3003,15 @@ describe('v1.DataMigrationServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = - await client.checkUpdateConnectionProfileProgress( - expectedResponse.name - ); + const decodedOperation = await client.checkRestartMigrationJobProgress( + expectedResponse.name + ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateConnectionProfileProgress with error', async () => { + it('invokes checkRestartMigrationJobProgress with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2879,15 +3025,15 @@ describe('v1.DataMigrationServiceClient', () => { expectedError ); await assert.rejects( - client.checkUpdateConnectionProfileProgress(''), + client.checkRestartMigrationJobProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteConnectionProfile', () => { - it('invokes deleteConnectionProfile without error', async () => { + describe('createConnectionProfile', () => { + it('invokes createConnectionProfile without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2895,33 +3041,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', - ['name'] + '.google.cloud.clouddms.v1.CreateConnectionProfileRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteConnectionProfile = + client.innerApiCalls.createConnectionProfile = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteConnectionProfile(request); + const [operation] = await client.createConnectionProfile(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteConnectionProfile as SinonStub + client.innerApiCalls.createConnectionProfile as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteConnectionProfile as SinonStub + client.innerApiCalls.createConnectionProfile as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteConnectionProfile without error using callback', async () => { + it('invokes createConnectionProfile without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2929,26 +3075,26 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', - ['name'] + '.google.cloud.clouddms.v1.CreateConnectionProfileRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteConnectionProfile = + client.innerApiCalls.createConnectionProfile = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteConnectionProfile( + client.createConnectionProfile( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IConnectionProfile, protos.google.cloud.clouddms.v1.IOperationMetadata > | null ) => { @@ -2961,22 +3107,22 @@ describe('v1.DataMigrationServiceClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IConnectionProfile, protos.google.cloud.clouddms.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteConnectionProfile as SinonStub + client.innerApiCalls.createConnectionProfile as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteConnectionProfile as SinonStub + client.innerApiCalls.createConnectionProfile as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteConnectionProfile with call error', async () => { + it('invokes createConnectionProfile with call error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2984,34 +3130,34 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', - ['name'] + '.google.cloud.clouddms.v1.CreateConnectionProfileRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall( + client.innerApiCalls.createConnectionProfile = stubLongRunningCall( undefined, expectedError ); await assert.rejects( - client.deleteConnectionProfile(request), + client.createConnectionProfile(request), expectedError ); const actualRequest = ( - client.innerApiCalls.deleteConnectionProfile as SinonStub + client.innerApiCalls.createConnectionProfile as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteConnectionProfile as SinonStub + client.innerApiCalls.createConnectionProfile as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteConnectionProfile with LRO error', async () => { + it('invokes createConnectionProfile with LRO error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3019,33 +3165,33 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', - ['name'] + '.google.cloud.clouddms.v1.CreateConnectionProfileRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall( + client.innerApiCalls.createConnectionProfile = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteConnectionProfile(request); + const [operation] = await client.createConnectionProfile(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteConnectionProfile as SinonStub + client.innerApiCalls.createConnectionProfile as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteConnectionProfile as SinonStub + client.innerApiCalls.createConnectionProfile as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteConnectionProfileProgress without error', async () => { + it('invokes checkCreateConnectionProfileProgress without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3061,7 +3207,7 @@ describe('v1.DataMigrationServiceClient', () => { client.operationsClient.getOperation = stubSimpleCall(expectedResponse); const decodedOperation = - await client.checkDeleteConnectionProfileProgress( + await client.checkCreateConnectionProfileProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -3069,7 +3215,7 @@ describe('v1.DataMigrationServiceClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteConnectionProfileProgress with error', async () => { + it('invokes checkCreateConnectionProfileProgress with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3083,15 +3229,15 @@ describe('v1.DataMigrationServiceClient', () => { expectedError ); await assert.rejects( - client.checkDeleteConnectionProfileProgress(''), + client.checkCreateConnectionProfileProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('listMigrationJobs', () => { - it('invokes listMigrationJobs without error', async () => { + describe('updateConnectionProfile', () => { + it('invokes updateConnectionProfile without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3099,39 +3245,34 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() ); + request.connectionProfile ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListMigrationJobsRequest', - ['parent'] + '.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', + ['connectionProfile', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() - ), - generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() - ), - generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() - ), - ]; - client.innerApiCalls.listMigrationJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listMigrationJobs(request); + request.connectionProfile.name = defaultValue1; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConnectionProfile = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateConnectionProfile(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listMigrationJobs as SinonStub + client.innerApiCalls.updateConnectionProfile as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listMigrationJobs as SinonStub + client.innerApiCalls.updateConnectionProfile as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listMigrationJobs without error using callback', async () => { + it('invokes updateConnectionProfile without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3139,33 +3280,29 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() ); + request.connectionProfile ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListMigrationJobsRequest', - ['parent'] + '.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', + ['connectionProfile', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() - ), - generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() - ), - generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() - ), - ]; - client.innerApiCalls.listMigrationJobs = - stubSimpleCallWithCallback(expectedResponse); + request.connectionProfile.name = defaultValue1; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConnectionProfile = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listMigrationJobs( + client.updateConnectionProfile( request, ( err?: Error | null, - result?: protos.google.cloud.clouddms.v1.IMigrationJob[] | null + result?: LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null ) => { if (err) { reject(err); @@ -3175,19 +3312,23 @@ describe('v1.DataMigrationServiceClient', () => { } ); }); - const response = await promise; + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listMigrationJobs as SinonStub + client.innerApiCalls.updateConnectionProfile as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listMigrationJobs as SinonStub + client.innerApiCalls.updateConnectionProfile as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listMigrationJobs with error', async () => { + it('invokes updateConnectionProfile with call error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3195,31 +3336,2853 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() ); + request.connectionProfile ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListMigrationJobsRequest', - ['parent'] + '.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', + ['connectionProfile', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.connectionProfile.name = defaultValue1; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listMigrationJobs = stubSimpleCall( + client.innerApiCalls.updateConnectionProfile = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.listMigrationJobs(request), expectedError); + await assert.rejects( + client.updateConnectionProfile(request), + expectedError + ); const actualRequest = ( - client.innerApiCalls.listMigrationJobs as SinonStub + client.innerApiCalls.updateConnectionProfile as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listMigrationJobs as SinonStub + client.innerApiCalls.updateConnectionProfile as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listMigrationJobsStream without error', async () => { + it('invokes updateConnectionProfile with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + ); + request.connectionProfile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', + ['connectionProfile', 'name'] + ); + request.connectionProfile.name = defaultValue1; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConnectionProfile = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateConnectionProfile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateConnectionProfileProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkUpdateConnectionProfileProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateConnectionProfileProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkUpdateConnectionProfileProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteConnectionProfile', () => { + it('invokes deleteConnectionProfile without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConnectionProfile = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteConnectionProfile(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnectionProfile without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConnectionProfile = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteConnectionProfile( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnectionProfile with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteConnectionProfile(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnectionProfile with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteConnectionProfile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteConnectionProfileProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeleteConnectionProfileProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteConnectionProfileProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeleteConnectionProfileProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createPrivateConnection', () => { + it('invokes createPrivateConnection without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreatePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreatePrivateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPrivateConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createPrivateConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPrivateConnection without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreatePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreatePrivateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPrivateConnection = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPrivateConnection( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPrivateConnection with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreatePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreatePrivateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPrivateConnection = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createPrivateConnection(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createPrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPrivateConnection with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreatePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreatePrivateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPrivateConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createPrivateConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createPrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreatePrivateConnectionProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCreatePrivateConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreatePrivateConnectionProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCreatePrivateConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deletePrivateConnection', () => { + it('invokes deletePrivateConnection without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeletePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeletePrivateConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePrivateConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deletePrivateConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePrivateConnection without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeletePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeletePrivateConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePrivateConnection = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePrivateConnection( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePrivateConnection with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeletePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeletePrivateConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePrivateConnection = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deletePrivateConnection(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePrivateConnection with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeletePrivateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeletePrivateConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePrivateConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deletePrivateConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePrivateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeletePrivateConnectionProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeletePrivateConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeletePrivateConnectionProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeletePrivateConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createConversionWorkspace', () => { + it('invokes createConversionWorkspace without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createConversionWorkspace = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConversionWorkspace without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createConversionWorkspace = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createConversionWorkspace( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConversionWorkspace with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConversionWorkspace = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createConversionWorkspace(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConversionWorkspace with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreateConversionWorkspaceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConversionWorkspace = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateConversionWorkspaceProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCreateConversionWorkspaceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateConversionWorkspaceProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCreateConversionWorkspaceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateConversionWorkspace', () => { + it('invokes updateConversionWorkspace without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest() + ); + request.conversionWorkspace ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest', + ['conversionWorkspace', 'name'] + ); + request.conversionWorkspace.name = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConversionWorkspace = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConversionWorkspace without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest() + ); + request.conversionWorkspace ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest', + ['conversionWorkspace', 'name'] + ); + request.conversionWorkspace.name = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConversionWorkspace = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateConversionWorkspace( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConversionWorkspace with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest() + ); + request.conversionWorkspace ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest', + ['conversionWorkspace', 'name'] + ); + request.conversionWorkspace.name = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConversionWorkspace = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateConversionWorkspace(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConversionWorkspace with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest() + ); + request.conversionWorkspace ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateConversionWorkspaceRequest', + ['conversionWorkspace', 'name'] + ); + request.conversionWorkspace.name = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConversionWorkspace = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateConversionWorkspaceProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkUpdateConversionWorkspaceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateConversionWorkspaceProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkUpdateConversionWorkspaceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteConversionWorkspace', () => { + it('invokes deleteConversionWorkspace without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConversionWorkspace = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversionWorkspace without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConversionWorkspace = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteConversionWorkspace( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversionWorkspace with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConversionWorkspace = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteConversionWorkspace(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversionWorkspace with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConversionWorkspace = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteConversionWorkspaceProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeleteConversionWorkspaceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteConversionWorkspaceProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkDeleteConversionWorkspaceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('seedConversionWorkspace', () => { + it('invokes seedConversionWorkspace without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.seedConversionWorkspace = + stubLongRunningCall(expectedResponse); + const [operation] = await client.seedConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.seedConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.seedConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes seedConversionWorkspace without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.seedConversionWorkspace = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.seedConversionWorkspace( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.seedConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.seedConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes seedConversionWorkspace with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.seedConversionWorkspace = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.seedConversionWorkspace(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.seedConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.seedConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes seedConversionWorkspace with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.SeedConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.seedConversionWorkspace = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.seedConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.seedConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.seedConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSeedConversionWorkspaceProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkSeedConversionWorkspaceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSeedConversionWorkspaceProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkSeedConversionWorkspaceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importMappingRules', () => { + it('invokes importMappingRules without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ImportMappingRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ImportMappingRulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importMappingRules = + stubLongRunningCall(expectedResponse); + const [operation] = await client.importMappingRules(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importMappingRules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importMappingRules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importMappingRules without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ImportMappingRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ImportMappingRulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importMappingRules = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importMappingRules( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importMappingRules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importMappingRules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importMappingRules with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ImportMappingRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ImportMappingRulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importMappingRules = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.importMappingRules(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importMappingRules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importMappingRules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importMappingRules with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ImportMappingRulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ImportMappingRulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importMappingRules = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.importMappingRules(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importMappingRules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importMappingRules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportMappingRulesProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkImportMappingRulesProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportMappingRulesProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkImportMappingRulesProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('convertConversionWorkspace', () => { + it('invokes convertConversionWorkspace without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.convertConversionWorkspace = + stubLongRunningCall(expectedResponse); + const [operation] = await client.convertConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.convertConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.convertConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes convertConversionWorkspace without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.convertConversionWorkspace = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.convertConversionWorkspace( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.convertConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.convertConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes convertConversionWorkspace with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.convertConversionWorkspace = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.convertConversionWorkspace(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.convertConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.convertConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes convertConversionWorkspace with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ConvertConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.convertConversionWorkspace = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.convertConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.convertConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.convertConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkConvertConversionWorkspaceProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkConvertConversionWorkspaceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkConvertConversionWorkspaceProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkConvertConversionWorkspaceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('commitConversionWorkspace', () => { + it('invokes commitConversionWorkspace without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.commitConversionWorkspace = + stubLongRunningCall(expectedResponse); + const [operation] = await client.commitConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.commitConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.commitConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commitConversionWorkspace without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.commitConversionWorkspace = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.commitConversionWorkspace( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.commitConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.commitConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commitConversionWorkspace with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.commitConversionWorkspace = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.commitConversionWorkspace(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.commitConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.commitConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes commitConversionWorkspace with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CommitConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.commitConversionWorkspace = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.commitConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.commitConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.commitConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCommitConversionWorkspaceProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCommitConversionWorkspaceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCommitConversionWorkspaceProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkCommitConversionWorkspaceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('rollbackConversionWorkspace', () => { + it('invokes rollbackConversionWorkspace without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.rollbackConversionWorkspace = + stubLongRunningCall(expectedResponse); + const [operation] = await client.rollbackConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollbackConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackConversionWorkspace without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.rollbackConversionWorkspace = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollbackConversionWorkspace( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollbackConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackConversionWorkspace with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackConversionWorkspace = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.rollbackConversionWorkspace(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.rollbackConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackConversionWorkspace with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.RollbackConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackConversionWorkspace = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.rollbackConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.rollbackConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRollbackConversionWorkspaceProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkRollbackConversionWorkspaceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRollbackConversionWorkspaceProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkRollbackConversionWorkspaceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('applyConversionWorkspace', () => { + it('invokes applyConversionWorkspace without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applyConversionWorkspace = + stubLongRunningCall(expectedResponse); + const [operation] = await client.applyConversionWorkspace(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.applyConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applyConversionWorkspace without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.applyConversionWorkspace = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.applyConversionWorkspace( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.applyConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applyConversionWorkspace with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.applyConversionWorkspace = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.applyConversionWorkspace(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.applyConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes applyConversionWorkspace with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ApplyConversionWorkspaceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.applyConversionWorkspace = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.applyConversionWorkspace(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.applyConversionWorkspace as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.applyConversionWorkspace as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkApplyConversionWorkspaceProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkApplyConversionWorkspaceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkApplyConversionWorkspaceProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.checkApplyConversionWorkspaceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listMigrationJobs', () => { + it('invokes listMigrationJobs without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + ]; + client.innerApiCalls.listMigrationJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listMigrationJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMigrationJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMigrationJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMigrationJobs without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + ]; + client.innerApiCalls.listMigrationJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMigrationJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.clouddms.v1.IMigrationJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMigrationJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMigrationJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMigrationJobs with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMigrationJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listMigrationJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listMigrationJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMigrationJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMigrationJobsStream without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + ]; + client.descriptors.page.listMigrationJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listMigrationJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.MigrationJob[] = []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.MigrationJob) => { + 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.listMigrationJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMigrationJobs, request) + ); + assert( + (client.descriptors.page.listMigrationJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMigrationJobsStream with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMigrationJobs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listMigrationJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.MigrationJob[] = []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.MigrationJob) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listMigrationJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMigrationJobs, request) + ); + assert( + (client.descriptors.page.listMigrationJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMigrationJobs without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + ]; + client.descriptors.page.listMigrationJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.clouddms.v1.IMigrationJob[] = []; + const iterable = client.listMigrationJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMigrationJobs with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3229,58 +6192,1978 @@ describe('v1.DataMigrationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListMigrationJobsRequest', - ['parent'] + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMigrationJobs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMigrationJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.clouddms.v1.IMigrationJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listConnectionProfiles', () => { + it('invokes listConnectionProfiles without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + ]; + client.innerApiCalls.listConnectionProfiles = + stubSimpleCall(expectedResponse); + const [response] = await client.listConnectionProfiles(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnectionProfiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectionProfiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectionProfiles without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + ]; + client.innerApiCalls.listConnectionProfiles = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConnectionProfiles( + request, + ( + err?: Error | null, + result?: protos.google.cloud.clouddms.v1.IConnectionProfile[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnectionProfiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectionProfiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectionProfiles with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConnectionProfiles = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listConnectionProfiles(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listConnectionProfiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectionProfiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectionProfilesStream without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + ]; + client.descriptors.page.listConnectionProfiles.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listConnectionProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.ConnectionProfile[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.ConnectionProfile) => { + 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.listConnectionProfiles + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listConnectionProfiles, request) + ); + assert( + ( + client.descriptors.page.listConnectionProfiles + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConnectionProfilesStream with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectionProfiles.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listConnectionProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.ConnectionProfile[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.ConnectionProfile) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listConnectionProfiles + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listConnectionProfiles, request) + ); + assert( + ( + client.descriptors.page.listConnectionProfiles + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectionProfiles without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + ]; + client.descriptors.page.listConnectionProfiles.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.clouddms.v1.IConnectionProfile[] = + []; + const iterable = client.listConnectionProfilesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnectionProfiles + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listConnectionProfiles + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectionProfiles with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectionProfiles.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConnectionProfilesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.clouddms.v1.IConnectionProfile[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnectionProfiles + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listConnectionProfiles + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listPrivateConnections', () => { + it('invokes listPrivateConnections without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ), + ]; + client.innerApiCalls.listPrivateConnections = + stubSimpleCall(expectedResponse); + const [response] = await client.listPrivateConnections(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPrivateConnections as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPrivateConnections as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrivateConnections without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ), + ]; + client.innerApiCalls.listPrivateConnections = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPrivateConnections( + request, + ( + err?: Error | null, + result?: protos.google.cloud.clouddms.v1.IPrivateConnection[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPrivateConnections as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPrivateConnections as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrivateConnections with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPrivateConnections = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listPrivateConnections(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listPrivateConnections as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPrivateConnections as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrivateConnectionsStream without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ), + ]; + client.descriptors.page.listPrivateConnections.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPrivateConnectionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.PrivateConnection[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.PrivateConnection) => { + 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.listPrivateConnections + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listPrivateConnections, request) + ); + assert( + ( + client.descriptors.page.listPrivateConnections + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPrivateConnectionsStream with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPrivateConnections.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPrivateConnectionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.PrivateConnection[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.PrivateConnection) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listPrivateConnections + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listPrivateConnections, request) + ); + assert( + ( + client.descriptors.page.listPrivateConnections + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPrivateConnections without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.PrivateConnection() + ), + ]; + client.descriptors.page.listPrivateConnections.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.clouddms.v1.IPrivateConnection[] = + []; + const iterable = client.listPrivateConnectionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPrivateConnections + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listPrivateConnections + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPrivateConnections with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListPrivateConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListPrivateConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPrivateConnections.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPrivateConnectionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.clouddms.v1.IPrivateConnection[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPrivateConnections + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listPrivateConnections + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listConversionWorkspaces', () => { + it('invokes listConversionWorkspaces without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ), + ]; + client.innerApiCalls.listConversionWorkspaces = + stubSimpleCall(expectedResponse); + const [response] = await client.listConversionWorkspaces(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConversionWorkspaces as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConversionWorkspaces as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversionWorkspaces without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ), + ]; + client.innerApiCalls.listConversionWorkspaces = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConversionWorkspaces( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.clouddms.v1.IConversionWorkspace[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConversionWorkspaces as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConversionWorkspaces as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversionWorkspaces with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConversionWorkspaces = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listConversionWorkspaces(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listConversionWorkspaces as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConversionWorkspaces as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversionWorkspacesStream without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ), + ]; + client.descriptors.page.listConversionWorkspaces.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listConversionWorkspacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.ConversionWorkspace[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.ConversionWorkspace) => { + 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.listConversionWorkspaces + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listConversionWorkspaces, request) + ); + assert( + ( + client.descriptors.page.listConversionWorkspaces + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConversionWorkspacesStream with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConversionWorkspaces.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listConversionWorkspacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.ConversionWorkspace[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.ConversionWorkspace) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listConversionWorkspaces + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listConversionWorkspaces, request) + ); + assert( + ( + client.descriptors.page.listConversionWorkspaces + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConversionWorkspaces without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConversionWorkspace() + ), + ]; + client.descriptors.page.listConversionWorkspaces.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.clouddms.v1.IConversionWorkspace[] = + []; + const iterable = client.listConversionWorkspacesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listConversionWorkspaces + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listConversionWorkspaces + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConversionWorkspaces with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConversionWorkspacesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConversionWorkspacesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConversionWorkspaces.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConversionWorkspacesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.clouddms.v1.IConversionWorkspace[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listConversionWorkspaces + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listConversionWorkspaces + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('describeDatabaseEntities', () => { + it('invokes describeDatabaseEntities without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', + ['conversionWorkspace'] + ); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.DatabaseEntity() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.DatabaseEntity() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.DatabaseEntity() + ), + ]; + client.innerApiCalls.describeDatabaseEntities = + stubSimpleCall(expectedResponse); + const [response] = await client.describeDatabaseEntities(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.describeDatabaseEntities as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.describeDatabaseEntities as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes describeDatabaseEntities without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', + ['conversionWorkspace'] + ); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.DatabaseEntity() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.DatabaseEntity() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.DatabaseEntity() + ), + ]; + client.innerApiCalls.describeDatabaseEntities = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.describeDatabaseEntities( + request, + ( + err?: Error | null, + result?: protos.google.cloud.clouddms.v1.IDatabaseEntity[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.describeDatabaseEntities as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.describeDatabaseEntities as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes describeDatabaseEntities with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', + ['conversionWorkspace'] + ); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.describeDatabaseEntities = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.describeDatabaseEntities(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.describeDatabaseEntities as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.describeDatabaseEntities as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes describeDatabaseEntitiesStream without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', + ['conversionWorkspace'] + ); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.DatabaseEntity() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.DatabaseEntity() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.DatabaseEntity() + ), + ]; + client.descriptors.page.describeDatabaseEntities.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.describeDatabaseEntitiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.DatabaseEntity[] = []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.DatabaseEntity) => { + 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.describeDatabaseEntities + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.describeDatabaseEntities, request) + ); + assert( + ( + client.descriptors.page.describeDatabaseEntities + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes describeDatabaseEntitiesStream with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', + ['conversionWorkspace'] + ); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.describeDatabaseEntities.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.describeDatabaseEntitiesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.DatabaseEntity[] = []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.DatabaseEntity) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.describeDatabaseEntities + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.describeDatabaseEntities, request) + ); + assert( + ( + client.descriptors.page.describeDatabaseEntities + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with describeDatabaseEntities without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', + ['conversionWorkspace'] + ); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.DatabaseEntity() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.DatabaseEntity() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.DatabaseEntity() + ), + ]; + client.descriptors.page.describeDatabaseEntities.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.clouddms.v1.IDatabaseEntity[] = []; + const iterable = client.describeDatabaseEntitiesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.describeDatabaseEntities + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.describeDatabaseEntities + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with describeDatabaseEntities with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DescribeDatabaseEntitiesRequest', + ['conversionWorkspace'] + ); + request.conversionWorkspace = defaultValue1; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.describeDatabaseEntities.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.describeDatabaseEntitiesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.clouddms.v1.IDatabaseEntity[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.describeDatabaseEntities + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.describeDatabaseEntities + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('fetchStaticIps', () => { + it('invokes fetchStaticIps without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.FetchStaticIpsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.fetchStaticIps = stubSimpleCall(expectedResponse); + const [response] = await client.fetchStaticIps(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchStaticIps as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchStaticIps as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchStaticIps without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.FetchStaticIpsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.innerApiCalls.fetchStaticIps = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchStaticIps( + request, + (err?: Error | null, result?: string[] | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchStaticIps as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchStaticIps as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchStaticIps with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.FetchStaticIpsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchStaticIps = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.fetchStaticIps(request), expectedError); + const actualRequest = ( + client.innerApiCalls.fetchStaticIps as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchStaticIps as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchStaticIpsStream without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.FetchStaticIpsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.fetchStaticIps.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.fetchStaticIpsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + 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.fetchStaticIps.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.fetchStaticIps, request) + ); + assert( + (client.descriptors.page.fetchStaticIps.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes fetchStaticIpsStream with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.FetchStaticIpsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchStaticIps.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.fetchStaticIpsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: string[] = []; + stream.on('data', (response: string) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.fetchStaticIps.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.fetchStaticIps, request) + ); + assert( + (client.descriptors.page.fetchStaticIps.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchStaticIps without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.FetchStaticIpsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [new String(), new String(), new String()]; + client.descriptors.page.fetchStaticIps.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: string[] = []; + const iterable = client.fetchStaticIpsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.fetchStaticIps.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.fetchStaticIps.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchStaticIps with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.FetchStaticIpsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.FetchStaticIpsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchStaticIps.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.fetchStaticIpsAsync(request); + await assert.rejects(async () => { + const responses: string[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.fetchStaticIps.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.fetchStaticIps.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() - ), - generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() - ), - generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() - ), - ]; - client.descriptors.page.listMigrationJobs.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listMigrationJobsStream(request); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.MigrationJob[] = []; - stream.on( - 'data', - (response: protos.google.cloud.clouddms.v1.MigrationJob) => { - responses.push(response); + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } } ); - stream.on('end', () => { - resolve(responses); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - stream.on('error', (err: Error) => { - reject(err); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); assert( - (client.descriptors.page.listMigrationJobs.createStream as SinonStub) + (client.iamClient.setIamPolicy as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listMigrationJobs, request) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError ); assert( - (client.descriptors.page.listMigrationJobs.createStream as SinonStub) + (client.iamClient.setIamPolicy as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .calledWith(request, expectedOptions, undefined) ); }); - - it('invokes listMigrationJobsStream with error', async () => { + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3288,49 +8171,226 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListMigrationJobsRequest', - ['parent'] + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedError = new Error('expected'); - client.descriptors.page.listMigrationJobs.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listMigrationJobsStream(request); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.MigrationJob[] = []; - stream.on( - 'data', - (response: protos.google.cloud.clouddms.v1.MigrationJob) => { - responses.push(response); + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } } ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listMigrationJobs.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listMigrationJobs, request) + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError ); assert( - (client.descriptors.page.listMigrationJobs.createStream as SinonStub) + (client.locationsClient.getLocation as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .calledWith(request, expectedOptions, undefined) ); }); - - it('uses async iteration with listMigrationJobs without error', async () => { + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3338,49 +8398,48 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListMigrationJobsRequest', - ['parent'] + new LocationProtos.google.cloud.location.ListLocationsRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() + new LocationProtos.google.cloud.location.Location() ), generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() + new LocationProtos.google.cloud.location.Location() ), generateSampleMessage( - new protos.google.cloud.clouddms.v1.MigrationJob() + new LocationProtos.google.cloud.location.Location() ), ]; - client.descriptors.page.listMigrationJobs.asyncIterate = + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.clouddms.v1.IMigrationJob[] = []; - const iterable = client.listMigrationJobsAsync(request); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams ) ); }); - - it('uses async iteration with listMigrationJobs with error', async () => { + it('uses async iteration with listLocations with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3388,32 +8447,32 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListMigrationJobsRequest', - ['parent'] + new LocationProtos.google.cloud.location.ListLocationsRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listMigrationJobs.asyncIterate = + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listMigrationJobsAsync(request); + const iterable = client.listLocationsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.clouddms.v1.IMigrationJob[] = []; + const responses: LocationProtos.google.cloud.location.ILocation[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( ( - client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3421,9 +8480,8 @@ describe('v1.DataMigrationServiceClient', () => { ); }); }); - - describe('listConnectionProfiles', () => { - it('invokes listConnectionProfiles without error', async () => { + describe('getOperation', () => { + it('invokes getOperation without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3431,74 +8489,42 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + new operationsProtos.google.longrunning.GetOperationRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', - ['parent'] + 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) ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() - ), - generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() - ), - generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() - ), - ]; - client.innerApiCalls.listConnectionProfiles = - stubSimpleCall(expectedResponse); - const [response] = await client.listConnectionProfiles(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listConnectionProfiles as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listConnectionProfiles as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - - it('invokes listConnectionProfiles without error using callback', async () => { + it('invokes getOperation without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + new operationsProtos.google.longrunning.GetOperationRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', - ['parent'] + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() - ), - generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() - ), - generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() - ), - ]; - client.innerApiCalls.listConnectionProfiles = - stubSimpleCallWithCallback(expectedResponse); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - client.listConnectionProfiles( + client.operationsClient.getOperation( request, + undefined, ( err?: Error | null, - result?: protos.google.cloud.clouddms.v1.IConnectionProfile[] | null + result?: operationsProtos.google.longrunning.Operation | null ) => { if (err) { reject(err); @@ -3510,52 +8536,34 @@ describe('v1.DataMigrationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listConnectionProfiles as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listConnectionProfiles as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - - it('invokes listConnectionProfiles with error', async () => { + it('invokes getOperation with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', - ['parent'] + new operationsProtos.google.longrunning.GetOperationRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listConnectionProfiles = stubSimpleCall( + client.operationsClient.getOperation = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.listConnectionProfiles(request), - expectedError + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) ); - const actualRequest = ( - client.innerApiCalls.listConnectionProfiles as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listConnectionProfiles as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - - it('invokes listConnectionProfilesStream without error', async () => { + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3563,179 +8571,202 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + new operationsProtos.google.longrunning.CancelOperationRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', - ['parent'] + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() - ), - generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() - ), - generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() - ), - ]; - client.descriptors.page.listConnectionProfiles.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listConnectionProfilesStream(request); + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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) => { - const responses: protos.google.cloud.clouddms.v1.ConnectionProfile[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.clouddms.v1.ConnectionProfile) => { - responses.push(response); + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } } ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.descriptors.page.listConnectionProfiles - .createStream as SinonStub - ) + (client.operationsClient.cancelOperation as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listConnectionProfiles, request) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.descriptors.page.listConnectionProfiles - .createStream as SinonStub - ) + (client.operationsClient.deleteOperation as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .calledWith(request) ); }); - - it('invokes listConnectionProfilesStream with error', async () => { + it('invokes deleteOperation without error using callback', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + new operationsProtos.google.longrunning.DeleteOperationRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', - ['parent'] + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listConnectionProfiles.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listConnectionProfilesStream(request); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.clouddms.v1.ConnectionProfile[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.clouddms.v1.ConnectionProfile) => { - responses.push(response); + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } } ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); }); - await assert.rejects(promise, expectedError); - assert( - ( - client.descriptors.page.listConnectionProfiles - .createStream as SinonStub - ) - .getCall(0) - .calledWith(client.innerApiCalls.listConnectionProfiles, request) + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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.descriptors.page.listConnectionProfiles - .createStream as SinonStub - ) + (client.operationsClient.deleteOperation as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .calledWith(request) ); }); - - it('uses async iteration with listConnectionProfiles without error', async () => { + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', - ['parent'] + new operationsProtos.google.longrunning.ListOperationsRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() + new operationsProtos.google.longrunning.ListOperationsResponse() ), generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() + new operationsProtos.google.longrunning.ListOperationsResponse() ), generateSampleMessage( - new protos.google.cloud.clouddms.v1.ConnectionProfile() + new operationsProtos.google.longrunning.ListOperationsResponse() ), ]; - client.descriptors.page.listConnectionProfiles.asyncIterate = + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.clouddms.v1.IConnectionProfile[] = + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.listConnectionProfilesAsync(request); + const iterable = client.operationsClient.listOperationsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listConnectionProfiles + client.operationsClient.descriptor.listOperations .asyncIterate as SinonStub ).getCall(0).args[1], request ); - assert( - ( - client.descriptors.page.listConnectionProfiles - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); }); - - it('uses async iteration with listConnectionProfiles with error', async () => { + it('uses async iteration with listOperations with error', async () => { const client = new datamigrationserviceModule.v1.DataMigrationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -3743,20 +8774,14 @@ describe('v1.DataMigrationServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', - ['parent'] + new operationsProtos.google.longrunning.ListOperationsRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listConnectionProfiles.asyncIterate = + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listConnectionProfilesAsync(request); + const iterable = client.operationsClient.listOperationsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.clouddms.v1.IConnectionProfile[] = + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -3764,21 +8789,11 @@ describe('v1.DataMigrationServiceClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listConnectionProfiles + client.operationsClient.descriptor.listOperations .asyncIterate as SinonStub ).getCall(0).args[1], request ); - assert( - ( - client.descriptors.page.listConnectionProfiles - .asyncIterate as SinonStub - ) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); }); }); @@ -3861,6 +8876,85 @@ describe('v1.DataMigrationServiceClient', () => { }); }); + describe('conversionWorkspace', () => { + const fakePath = '/rendered/path/conversionWorkspace'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversion_workspace: 'conversionWorkspaceValue', + }; + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.conversionWorkspacePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.conversionWorkspacePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('conversionWorkspacePath', () => { + const result = client.conversionWorkspacePath( + 'projectValue', + 'locationValue', + 'conversionWorkspaceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.conversionWorkspacePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromConversionWorkspaceName', () => { + const result = client.matchProjectFromConversionWorkspaceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.conversionWorkspacePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromConversionWorkspaceName', () => { + const result = + client.matchLocationFromConversionWorkspaceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.conversionWorkspacePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversionWorkspaceFromConversionWorkspaceName', () => { + const result = + client.matchConversionWorkspaceFromConversionWorkspaceName(fakePath); + assert.strictEqual(result, 'conversionWorkspaceValue'); + assert( + ( + client.pathTemplates.conversionWorkspacePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('location', () => { const fakePath = '/rendered/path/location'; const expectedParameters = { @@ -3976,6 +9070,84 @@ describe('v1.DataMigrationServiceClient', () => { }); }); + describe('privateConnection', () => { + const fakePath = '/rendered/path/privateConnection'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + private_connection: 'privateConnectionValue', + }; + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.privateConnectionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.privateConnectionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('privateConnectionPath', () => { + const result = client.privateConnectionPath( + 'projectValue', + 'locationValue', + 'privateConnectionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.privateConnectionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPrivateConnectionName', () => { + const result = client.matchProjectFromPrivateConnectionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.privateConnectionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPrivateConnectionName', () => { + const result = client.matchLocationFromPrivateConnectionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.privateConnectionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPrivateConnectionFromPrivateConnectionName', () => { + const result = + client.matchPrivateConnectionFromPrivateConnectionName(fakePath); + assert.strictEqual(result, 'privateConnectionValue'); + assert( + ( + client.pathTemplates.privateConnectionPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('project', () => { const fakePath = '/rendered/path/project'; const expectedParameters = {