diff --git a/packages/google-cloud-clouddms/linkinator.config.json b/packages/google-cloud-clouddms/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-clouddms/linkinator.config.json +++ b/packages/google-cloud-clouddms/linkinator.config.json @@ -3,8 +3,14 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" ], "silent": true, - "concurrency": 5 + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 } diff --git a/packages/google-cloud-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 11325df7041..38f87e1a1f2 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-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 b9eed97b4e3..0b34e68f1e4 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-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 0f373718f1b..537200bf332 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-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 65a23ad9c54..efe0daeb921 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-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 d97e5f34b5c..afa672f7937 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js index 8f1b4eccd9f..f0d3d184c69 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js index 0d443dd003d..c6987c4a1a4 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-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 f031b3dc931..d1805530d9b 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-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 4e28118d3c3..60ea66dc75a 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js index b375709d055..53c2f92776d 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js index 7faaf5438e8..c8e81d474bd 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js index cc3232be4e4..99a69346213 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js index 2c5538deae8..c9abce0dd2d 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js index 0d5c33168fe..0890fb1bbaa 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-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 4bd4ad4b6a6..7147d6a097a 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-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 ba0d6a36514..1ab2e2b04de 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js index 338181e714d..7d4c39d0781 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-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 new file mode 100644 index 00000000000..0d34ae0ca07 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json @@ -0,0 +1,799 @@ +{ + "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": 84, + "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": 50, + "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": 71, + "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": 65, + "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": 65, + "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": 50, + "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": 50, + "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": 50, + "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": 50, + "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": 50, + "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": 50, + "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": 66, + "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": " Retrieve 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": 82, + "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": 50, + "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": 69, + "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" + } + ], + "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": 65, + "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" + } + ], + "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": 64, + "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" + } + } + } + } + ] +} 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 be6ca24332a..6f5d9a067fe 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 @@ -3207,9 +3207,8 @@ export class DataMigrationServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.dataMigrationServiceStub!.then(stub => { + if (this.dataMigrationServiceStub && !this._terminated) { + return this.dataMigrationServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); 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 41a5f322e85..6659a05c314 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 @@ -190,14 +190,31 @@ describe('v1.DataMigrationServiceClient', () => { assert(client.dataMigrationServiceStub); }); - it('has close method', () => { + 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.close(); + 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 () => { @@ -350,6 +367,23 @@ describe('v1.DataMigrationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMigrationJob(request), expectedError); + }); }); describe('generateSshScript', () => { @@ -464,6 +498,23 @@ describe('v1.DataMigrationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.migrationJob = ''; + const expectedHeaderRequestParams = 'migration_job='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateSshScript(request), expectedError); + }); }); describe('getConnectionProfile', () => { @@ -579,6 +630,23 @@ describe('v1.DataMigrationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConnectionProfile(request), expectedError); + }); }); describe('createMigrationJob', () => {