From cd14cf123bc2f5a45966f7f2e4e261dcd73b3c1e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 10 Nov 2021 22:46:37 +0000 Subject: [PATCH] docs(samples): add example tags to generated samples (#563) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 408439482 Source-Link: https://github.com/googleapis/googleapis/commit/b9f61843dc80c7c285fc34fd3a40aae55082c2b9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9 --- linkinator.config.json | 2 +- .../generated/v1/auto_ml.create_dataset.js | 58 + samples/generated/v1/auto_ml.create_model.js | 58 + .../generated/v1/auto_ml.delete_dataset.js | 53 + samples/generated/v1/auto_ml.delete_model.js | 53 + samples/generated/v1/auto_ml.deploy_model.js | 61 + samples/generated/v1/auto_ml.export_data.js | 58 + samples/generated/v1/auto_ml.export_model.js | 58 + .../v1/auto_ml.get_annotation_spec.js | 52 + samples/generated/v1/auto_ml.get_dataset.js | 52 + samples/generated/v1/auto_ml.get_model.js | 52 + .../v1/auto_ml.get_model_evaluation.js | 52 + samples/generated/v1/auto_ml.import_data.js | 60 + samples/generated/v1/auto_ml.list_datasets.js | 74 + .../v1/auto_ml.list_model_evaluations.js | 79 + samples/generated/v1/auto_ml.list_models.js | 75 + .../generated/v1/auto_ml.undeploy_model.js | 53 + .../generated/v1/auto_ml.update_dataset.js | 57 + samples/generated/v1/auto_ml.update_model.js | 57 + .../v1/prediction_service.batch_predict.js | 132 ++ .../v1/prediction_service.predict.js | 84 ++ .../v1beta1/auto_ml.create_dataset.js | 57 + .../generated/v1beta1/auto_ml.create_model.js | 58 + .../v1beta1/auto_ml.delete_dataset.js | 53 + .../generated/v1beta1/auto_ml.delete_model.js | 53 + .../generated/v1beta1/auto_ml.deploy_model.js | 61 + .../generated/v1beta1/auto_ml.export_data.js | 58 + .../auto_ml.export_evaluated_examples.js | 59 + .../generated/v1beta1/auto_ml.export_model.js | 58 + .../v1beta1/auto_ml.get_annotation_spec.js | 52 + .../v1beta1/auto_ml.get_column_spec.js | 56 + .../generated/v1beta1/auto_ml.get_dataset.js | 52 + .../generated/v1beta1/auto_ml.get_model.js | 52 + .../v1beta1/auto_ml.get_model_evaluation.js | 52 + .../v1beta1/auto_ml.get_table_spec.js | 56 + .../generated/v1beta1/auto_ml.import_data.js | 60 + .../v1beta1/auto_ml.list_column_specs.js | 74 + .../v1beta1/auto_ml.list_datasets.js | 74 + .../v1beta1/auto_ml.list_model_evaluations.js | 78 + .../generated/v1beta1/auto_ml.list_models.js | 75 + .../v1beta1/auto_ml.list_table_specs.js | 74 + .../v1beta1/auto_ml.undeploy_model.js | 53 + .../v1beta1/auto_ml.update_column_spec.js | 56 + .../v1beta1/auto_ml.update_dataset.js | 56 + .../v1beta1/auto_ml.update_table_spec.js | 56 + .../prediction_service.batch_predict.js | 126 ++ .../v1beta1/prediction_service.predict.js | 78 + samples/package.json | 2 +- src/v1/auto_ml_client.ts | 960 ++++++------ src/v1/prediction_service_client.ts | 142 +- src/v1beta1/auto_ml_client.ts | 1302 ++++++++--------- src/v1beta1/prediction_service_client.ts | 142 +- 52 files changed, 4142 insertions(+), 1323 deletions(-) create mode 100644 samples/generated/v1/auto_ml.create_dataset.js create mode 100644 samples/generated/v1/auto_ml.create_model.js create mode 100644 samples/generated/v1/auto_ml.delete_dataset.js create mode 100644 samples/generated/v1/auto_ml.delete_model.js create mode 100644 samples/generated/v1/auto_ml.deploy_model.js create mode 100644 samples/generated/v1/auto_ml.export_data.js create mode 100644 samples/generated/v1/auto_ml.export_model.js create mode 100644 samples/generated/v1/auto_ml.get_annotation_spec.js create mode 100644 samples/generated/v1/auto_ml.get_dataset.js create mode 100644 samples/generated/v1/auto_ml.get_model.js create mode 100644 samples/generated/v1/auto_ml.get_model_evaluation.js create mode 100644 samples/generated/v1/auto_ml.import_data.js create mode 100644 samples/generated/v1/auto_ml.list_datasets.js create mode 100644 samples/generated/v1/auto_ml.list_model_evaluations.js create mode 100644 samples/generated/v1/auto_ml.list_models.js create mode 100644 samples/generated/v1/auto_ml.undeploy_model.js create mode 100644 samples/generated/v1/auto_ml.update_dataset.js create mode 100644 samples/generated/v1/auto_ml.update_model.js create mode 100644 samples/generated/v1/prediction_service.batch_predict.js create mode 100644 samples/generated/v1/prediction_service.predict.js create mode 100644 samples/generated/v1beta1/auto_ml.create_dataset.js create mode 100644 samples/generated/v1beta1/auto_ml.create_model.js create mode 100644 samples/generated/v1beta1/auto_ml.delete_dataset.js create mode 100644 samples/generated/v1beta1/auto_ml.delete_model.js create mode 100644 samples/generated/v1beta1/auto_ml.deploy_model.js create mode 100644 samples/generated/v1beta1/auto_ml.export_data.js create mode 100644 samples/generated/v1beta1/auto_ml.export_evaluated_examples.js create mode 100644 samples/generated/v1beta1/auto_ml.export_model.js create mode 100644 samples/generated/v1beta1/auto_ml.get_annotation_spec.js create mode 100644 samples/generated/v1beta1/auto_ml.get_column_spec.js create mode 100644 samples/generated/v1beta1/auto_ml.get_dataset.js create mode 100644 samples/generated/v1beta1/auto_ml.get_model.js create mode 100644 samples/generated/v1beta1/auto_ml.get_model_evaluation.js create mode 100644 samples/generated/v1beta1/auto_ml.get_table_spec.js create mode 100644 samples/generated/v1beta1/auto_ml.import_data.js create mode 100644 samples/generated/v1beta1/auto_ml.list_column_specs.js create mode 100644 samples/generated/v1beta1/auto_ml.list_datasets.js create mode 100644 samples/generated/v1beta1/auto_ml.list_model_evaluations.js create mode 100644 samples/generated/v1beta1/auto_ml.list_models.js create mode 100644 samples/generated/v1beta1/auto_ml.list_table_specs.js create mode 100644 samples/generated/v1beta1/auto_ml.undeploy_model.js create mode 100644 samples/generated/v1beta1/auto_ml.update_column_spec.js create mode 100644 samples/generated/v1beta1/auto_ml.update_dataset.js create mode 100644 samples/generated/v1beta1/auto_ml.update_table_spec.js create mode 100644 samples/generated/v1beta1/prediction_service.batch_predict.js create mode 100644 samples/generated/v1beta1/prediction_service.predict.js diff --git a/linkinator.config.json b/linkinator.config.json index 29a223b6..0121dfa6 100644 --- a/linkinator.config.json +++ b/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/samples/generated/v1/auto_ml.create_dataset.js b/samples/generated/v1/auto_ml.create_dataset.js new file mode 100644 index 00000000..67a1efeb --- /dev/null +++ b/samples/generated/v1/auto_ml.create_dataset.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, dataset) { + // [START automl_v1_generated_AutoMl_CreateDataset_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the project to create the dataset for. + */ + // const parent = 'abc123' + /** + * Required. The dataset to create. + */ + // const dataset = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callCreateDataset() { + // Construct request + const request = { + parent, + dataset, + }; + + // Run request + const [operation] = await automlClient.createDataset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateDataset(); + // [END automl_v1_generated_AutoMl_CreateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.create_model.js b/samples/generated/v1/auto_ml.create_model.js new file mode 100644 index 00000000..ea0c482a --- /dev/null +++ b/samples/generated/v1/auto_ml.create_model.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, model) { + // [START automl_v1_generated_AutoMl_CreateModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent project where the model is being created. + */ + // const parent = 'abc123' + /** + * Required. The model to create. + */ + // const model = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callCreateModel() { + // Construct request + const request = { + parent, + model, + }; + + // Run request + const [operation] = await automlClient.createModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateModel(); + // [END automl_v1_generated_AutoMl_CreateModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.delete_dataset.js b/samples/generated/v1/auto_ml.delete_dataset.js new file mode 100644 index 00000000..ef409472 --- /dev/null +++ b/samples/generated/v1/auto_ml.delete_dataset.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1_generated_AutoMl_DeleteDataset_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the dataset to delete. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeleteDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deleteDataset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteDataset(); + // [END automl_v1_generated_AutoMl_DeleteDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.delete_model.js b/samples/generated/v1/auto_ml.delete_model.js new file mode 100644 index 00000000..19ed2fb6 --- /dev/null +++ b/samples/generated/v1/auto_ml.delete_model.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1_generated_AutoMl_DeleteModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the model being deleted. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeleteModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deleteModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteModel(); + // [END automl_v1_generated_AutoMl_DeleteModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.deploy_model.js b/samples/generated/v1/auto_ml.deploy_model.js new file mode 100644 index 00000000..9ec5630f --- /dev/null +++ b/samples/generated/v1/auto_ml.deploy_model.js @@ -0,0 +1,61 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1_generated_AutoMl_DeployModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Model deployment metadata specific to Image Object Detection. + */ + // const imageObjectDetectionModelDeploymentMetadata = {} + /** + * Model deployment metadata specific to Image Classification. + */ + // const imageClassificationModelDeploymentMetadata = {} + /** + * Required. Resource name of the model to deploy. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeployModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deployModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployModel(); + // [END automl_v1_generated_AutoMl_DeployModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.export_data.js b/samples/generated/v1/auto_ml.export_data.js new file mode 100644 index 00000000..f156e5d3 --- /dev/null +++ b/samples/generated/v1/auto_ml.export_data.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, outputConfig) { + // [START automl_v1_generated_AutoMl_ExportData_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the dataset. + */ + // const name = 'abc123' + /** + * Required. The desired output location. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportData() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportData(); + // [END automl_v1_generated_AutoMl_ExportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.export_model.js b/samples/generated/v1/auto_ml.export_model.js new file mode 100644 index 00000000..1572dd15 --- /dev/null +++ b/samples/generated/v1/auto_ml.export_model.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, outputConfig) { + // [START automl_v1_generated_AutoMl_ExportModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the model to export. + */ + // const name = 'abc123' + /** + * Required. The desired output location and configuration. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportModel() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportModel(); + // [END automl_v1_generated_AutoMl_ExportModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.get_annotation_spec.js b/samples/generated/v1/auto_ml.get_annotation_spec.js new file mode 100644 index 00000000..25525cf2 --- /dev/null +++ b/samples/generated/v1/auto_ml.get_annotation_spec.js @@ -0,0 +1,52 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1_generated_AutoMl_GetAnnotationSpec_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the annotation spec to retrieve. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetAnnotationSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getAnnotationSpec(request); + console.log(response); + } + + callGetAnnotationSpec(); + // [END automl_v1_generated_AutoMl_GetAnnotationSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.get_dataset.js b/samples/generated/v1/auto_ml.get_dataset.js new file mode 100644 index 00000000..b3ec723b --- /dev/null +++ b/samples/generated/v1/auto_ml.get_dataset.js @@ -0,0 +1,52 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1_generated_AutoMl_GetDataset_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the dataset to retrieve. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getDataset(request); + console.log(response); + } + + callGetDataset(); + // [END automl_v1_generated_AutoMl_GetDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.get_model.js b/samples/generated/v1/auto_ml.get_model.js new file mode 100644 index 00000000..27615ba7 --- /dev/null +++ b/samples/generated/v1/auto_ml.get_model.js @@ -0,0 +1,52 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1_generated_AutoMl_GetModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the model. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getModel(request); + console.log(response); + } + + callGetModel(); + // [END automl_v1_generated_AutoMl_GetModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.get_model_evaluation.js b/samples/generated/v1/auto_ml.get_model_evaluation.js new file mode 100644 index 00000000..d711a68a --- /dev/null +++ b/samples/generated/v1/auto_ml.get_model_evaluation.js @@ -0,0 +1,52 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1_generated_AutoMl_GetModelEvaluation_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name for the model evaluation. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetModelEvaluation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getModelEvaluation(request); + console.log(response); + } + + callGetModelEvaluation(); + // [END automl_v1_generated_AutoMl_GetModelEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.import_data.js b/samples/generated/v1/auto_ml.import_data.js new file mode 100644 index 00000000..0233c2b4 --- /dev/null +++ b/samples/generated/v1/auto_ml.import_data.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, inputConfig) { + // [START automl_v1_generated_AutoMl_ImportData_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + */ + // const name = 'abc123' + /** + * Required. The desired input location and its domain specific semantics, + * if any. + */ + // const inputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callImportData() { + // Construct request + const request = { + name, + inputConfig, + }; + + // Run request + const [operation] = await automlClient.importData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportData(); + // [END automl_v1_generated_AutoMl_ImportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.list_datasets.js b/samples/generated/v1/auto_ml.list_datasets.js new file mode 100644 index 00000000..4abf4005 --- /dev/null +++ b/samples/generated/v1/auto_ml.list_datasets.js @@ -0,0 +1,74 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START automl_v1_generated_AutoMl_ListDatasets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the project from which to list datasets. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * image_classification_dataset_metadata:*). Some examples of using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * translation_dataset_metadata. + */ + // const filter = 'abc123' + /** + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * ListDatasetsResponse.next_page_token google.cloud.automl.v1.ListDatasetsResponse.next_page_token of the previous + * AutoMl.ListDatasets google.cloud.automl.v1.AutoMl.ListDatasets call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListDatasets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listDatasetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatasets(); + // [END automl_v1_generated_AutoMl_ListDatasets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.list_model_evaluations.js b/samples/generated/v1/auto_ml.list_model_evaluations.js new file mode 100644 index 00000000..506a77f2 --- /dev/null +++ b/samples/generated/v1/auto_ml.list_model_evaluations.js @@ -0,0 +1,79 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, filter) { + // [START automl_v1_generated_AutoMl_ListModelEvaluations_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + */ + // const parent = 'abc123' + /** + * Required. An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + */ + // const filter = 'abc123' + /** + * Requested page size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained via + * ListModelEvaluationsResponse.next_page_token google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token of the previous + * AutoMl.ListModelEvaluations google.cloud.automl.v1.AutoMl.ListModelEvaluations call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListModelEvaluations() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const iterable = await automlClient.listModelEvaluationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModelEvaluations(); + // [END automl_v1_generated_AutoMl_ListModelEvaluations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.list_models.js b/samples/generated/v1/auto_ml.list_models.js new file mode 100644 index 00000000..88966e23 --- /dev/null +++ b/samples/generated/v1/auto_ml.list_models.js @@ -0,0 +1,75 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START automl_v1_generated_AutoMl_ListModels_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the project, from which to list the models. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * video_classification_model_metadata:*). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * image_classification_model_metadata. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + */ + // const filter = 'abc123' + /** + * Requested page size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * ListModelsResponse.next_page_token google.cloud.automl.v1.ListModelsResponse.next_page_token of the previous + * AutoMl.ListModels google.cloud.automl.v1.AutoMl.ListModels call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListModels() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listModelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModels(); + // [END automl_v1_generated_AutoMl_ListModels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.undeploy_model.js b/samples/generated/v1/auto_ml.undeploy_model.js new file mode 100644 index 00000000..23fc22eb --- /dev/null +++ b/samples/generated/v1/auto_ml.undeploy_model.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1_generated_AutoMl_UndeployModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the model to undeploy. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUndeployModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.undeployModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeployModel(); + // [END automl_v1_generated_AutoMl_UndeployModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.update_dataset.js b/samples/generated/v1/auto_ml.update_dataset.js new file mode 100644 index 00000000..9ab8957a --- /dev/null +++ b/samples/generated/v1/auto_ml.update_dataset.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(dataset, updateMask) { + // [START automl_v1_generated_AutoMl_UpdateDataset_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The dataset which replaces the resource on the server. + */ + // const dataset = {} + /** + * Required. The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateDataset() { + // Construct request + const request = { + dataset, + updateMask, + }; + + // Run request + const response = await automlClient.updateDataset(request); + console.log(response); + } + + callUpdateDataset(); + // [END automl_v1_generated_AutoMl_UpdateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/auto_ml.update_model.js b/samples/generated/v1/auto_ml.update_model.js new file mode 100644 index 00000000..22c845a5 --- /dev/null +++ b/samples/generated/v1/auto_ml.update_model.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(model, updateMask) { + // [START automl_v1_generated_AutoMl_UpdateModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The model which replaces the resource on the server. + */ + // const model = {} + /** + * Required. The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateModel() { + // Construct request + const request = { + model, + updateMask, + }; + + // Run request + const response = await automlClient.updateModel(request); + console.log(response); + } + + callUpdateModel(); + // [END automl_v1_generated_AutoMl_UpdateModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/prediction_service.batch_predict.js b/samples/generated/v1/prediction_service.batch_predict.js new file mode 100644 index 00000000..78e2f65a --- /dev/null +++ b/samples/generated/v1/prediction_service.batch_predict.js @@ -0,0 +1,132 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, inputConfig, outputConfig) { + // [START automl_v1_generated_PredictionService_BatchPredict_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the model requested to serve the batch prediction. + */ + // const name = 'abc123' + /** + * Required. The input configuration for batch prediction. + */ + // const inputConfig = {} + /** + * Required. The Configuration specifying where output predictions should + * be written. + */ + // const outputConfig = {} + /** + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * AutoML Natural Language Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * AutoML Video Intelligence Object Tracking + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + */ + // const params = 1234 + + // Imports the Automl library + const {PredictionServiceClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new PredictionServiceClient(); + + async function callBatchPredict() { + // Construct request + const request = { + name, + inputConfig, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.batchPredict(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchPredict(); + // [END automl_v1_generated_PredictionService_BatchPredict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/prediction_service.predict.js b/samples/generated/v1/prediction_service.predict.js new file mode 100644 index 00000000..f5b24743 --- /dev/null +++ b/samples/generated/v1/prediction_service.predict.js @@ -0,0 +1,84 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, payload) { + // [START automl_v1_generated_PredictionService_Predict_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the model requested to serve the prediction. + */ + // const name = 'abc123' + /** + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + */ + // const payload = {} + /** + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * AutoML Tables + * `feature_importance` + * : (boolean) Whether + * feature_importance google.cloud.automl.v1.TablesModelColumnInfo.feature_importance + * is populated in the returned list of + * TablesAnnotation google.cloud.automl.v1.TablesAnnotation + * objects. The default is false. + */ + // const params = 1234 + + // Imports the Automl library + const {PredictionServiceClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new PredictionServiceClient(); + + async function callPredict() { + // Construct request + const request = { + name, + payload, + }; + + // Run request + const response = await automlClient.predict(request); + console.log(response); + } + + callPredict(); + // [END automl_v1_generated_PredictionService_Predict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.create_dataset.js b/samples/generated/v1beta1/auto_ml.create_dataset.js new file mode 100644 index 00000000..f030439c --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.create_dataset.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, dataset) { + // [START automl_v1beta1_generated_AutoMl_CreateDataset_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the project to create the dataset for. + */ + // const parent = 'abc123' + /** + * Required. The dataset to create. + */ + // const dataset = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callCreateDataset() { + // Construct request + const request = { + parent, + dataset, + }; + + // Run request + const response = await automlClient.createDataset(request); + console.log(response); + } + + callCreateDataset(); + // [END automl_v1beta1_generated_AutoMl_CreateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.create_model.js b/samples/generated/v1beta1/auto_ml.create_model.js new file mode 100644 index 00000000..13d5cb6f --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.create_model.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, model) { + // [START automl_v1beta1_generated_AutoMl_CreateModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent project where the model is being created. + */ + // const parent = 'abc123' + /** + * Required. The model to create. + */ + // const model = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callCreateModel() { + // Construct request + const request = { + parent, + model, + }; + + // Run request + const [operation] = await automlClient.createModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateModel(); + // [END automl_v1beta1_generated_AutoMl_CreateModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.delete_dataset.js b/samples/generated/v1beta1/auto_ml.delete_dataset.js new file mode 100644 index 00000000..c0d72478 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.delete_dataset.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1beta1_generated_AutoMl_DeleteDataset_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the dataset to delete. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeleteDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deleteDataset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteDataset(); + // [END automl_v1beta1_generated_AutoMl_DeleteDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.delete_model.js b/samples/generated/v1beta1/auto_ml.delete_model.js new file mode 100644 index 00000000..c9607797 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.delete_model.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1beta1_generated_AutoMl_DeleteModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the model being deleted. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeleteModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deleteModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteModel(); + // [END automl_v1beta1_generated_AutoMl_DeleteModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.deploy_model.js b/samples/generated/v1beta1/auto_ml.deploy_model.js new file mode 100644 index 00000000..922c608a --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.deploy_model.js @@ -0,0 +1,61 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1beta1_generated_AutoMl_DeployModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Model deployment metadata specific to Image Object Detection. + */ + // const imageObjectDetectionModelDeploymentMetadata = {} + /** + * Model deployment metadata specific to Image Classification. + */ + // const imageClassificationModelDeploymentMetadata = {} + /** + * Required. Resource name of the model to deploy. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeployModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deployModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployModel(); + // [END automl_v1beta1_generated_AutoMl_DeployModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.export_data.js b/samples/generated/v1beta1/auto_ml.export_data.js new file mode 100644 index 00000000..56d6f528 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.export_data.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, outputConfig) { + // [START automl_v1beta1_generated_AutoMl_ExportData_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the dataset. + */ + // const name = 'abc123' + /** + * Required. The desired output location. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportData() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportData(); + // [END automl_v1beta1_generated_AutoMl_ExportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js b/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js new file mode 100644 index 00000000..b8c1791f --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js @@ -0,0 +1,59 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, outputConfig) { + // [START automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the model whose evaluated examples are to + * be exported. + */ + // const name = 'abc123' + /** + * Required. The desired output location and configuration. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportEvaluatedExamples() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportEvaluatedExamples(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportEvaluatedExamples(); + // [END automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.export_model.js b/samples/generated/v1beta1/auto_ml.export_model.js new file mode 100644 index 00000000..7a9602d8 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.export_model.js @@ -0,0 +1,58 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, outputConfig) { + // [START automl_v1beta1_generated_AutoMl_ExportModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the model to export. + */ + // const name = 'abc123' + /** + * Required. The desired output location and configuration. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportModel() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportModel(); + // [END automl_v1beta1_generated_AutoMl_ExportModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.get_annotation_spec.js b/samples/generated/v1beta1/auto_ml.get_annotation_spec.js new file mode 100644 index 00000000..c193283b --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.get_annotation_spec.js @@ -0,0 +1,52 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1beta1_generated_AutoMl_GetAnnotationSpec_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the annotation spec to retrieve. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetAnnotationSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getAnnotationSpec(request); + console.log(response); + } + + callGetAnnotationSpec(); + // [END automl_v1beta1_generated_AutoMl_GetAnnotationSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.get_column_spec.js b/samples/generated/v1beta1/auto_ml.get_column_spec.js new file mode 100644 index 00000000..e602cdd6 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.get_column_spec.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1beta1_generated_AutoMl_GetColumnSpec_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the column spec to retrieve. + */ + // const name = 'abc123' + /** + * Mask specifying which fields to read. + */ + // const fieldMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetColumnSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getColumnSpec(request); + console.log(response); + } + + callGetColumnSpec(); + // [END automl_v1beta1_generated_AutoMl_GetColumnSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.get_dataset.js b/samples/generated/v1beta1/auto_ml.get_dataset.js new file mode 100644 index 00000000..9de9c1bf --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.get_dataset.js @@ -0,0 +1,52 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1beta1_generated_AutoMl_GetDataset_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the dataset to retrieve. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getDataset(request); + console.log(response); + } + + callGetDataset(); + // [END automl_v1beta1_generated_AutoMl_GetDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.get_model.js b/samples/generated/v1beta1/auto_ml.get_model.js new file mode 100644 index 00000000..c900f21a --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.get_model.js @@ -0,0 +1,52 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1beta1_generated_AutoMl_GetModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the model. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getModel(request); + console.log(response); + } + + callGetModel(); + // [END automl_v1beta1_generated_AutoMl_GetModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.get_model_evaluation.js b/samples/generated/v1beta1/auto_ml.get_model_evaluation.js new file mode 100644 index 00000000..56794c63 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.get_model_evaluation.js @@ -0,0 +1,52 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1beta1_generated_AutoMl_GetModelEvaluation_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name for the model evaluation. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetModelEvaluation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getModelEvaluation(request); + console.log(response); + } + + callGetModelEvaluation(); + // [END automl_v1beta1_generated_AutoMl_GetModelEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.get_table_spec.js b/samples/generated/v1beta1/auto_ml.get_table_spec.js new file mode 100644 index 00000000..32fee0eb --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.get_table_spec.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1beta1_generated_AutoMl_GetTableSpec_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the table spec to retrieve. + */ + // const name = 'abc123' + /** + * Mask specifying which fields to read. + */ + // const fieldMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetTableSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getTableSpec(request); + console.log(response); + } + + callGetTableSpec(); + // [END automl_v1beta1_generated_AutoMl_GetTableSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.import_data.js b/samples/generated/v1beta1/auto_ml.import_data.js new file mode 100644 index 00000000..6c7504e7 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.import_data.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, inputConfig) { + // [START automl_v1beta1_generated_AutoMl_ImportData_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + */ + // const name = 'abc123' + /** + * Required. The desired input location and its domain specific semantics, + * if any. + */ + // const inputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callImportData() { + // Construct request + const request = { + name, + inputConfig, + }; + + // Run request + const [operation] = await automlClient.importData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportData(); + // [END automl_v1beta1_generated_AutoMl_ImportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.list_column_specs.js b/samples/generated/v1beta1/auto_ml.list_column_specs.js new file mode 100644 index 00000000..859f2cf9 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.list_column_specs.js @@ -0,0 +1,74 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START automl_v1beta1_generated_AutoMl_ListColumnSpecs_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the table spec to list column specs from. + */ + // const parent = 'abc123' + /** + * Mask specifying which fields to read. + */ + // const fieldMask = {} + /** + * Filter expression, see go/filtering. + */ + // const filter = 'abc123' + /** + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained from the + * ListColumnSpecsResponse.next_page_token google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token field of the previous + * AutoMl.ListColumnSpecs google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListColumnSpecs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listColumnSpecsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListColumnSpecs(); + // [END automl_v1beta1_generated_AutoMl_ListColumnSpecs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.list_datasets.js b/samples/generated/v1beta1/auto_ml.list_datasets.js new file mode 100644 index 00000000..e992f0e4 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.list_datasets.js @@ -0,0 +1,74 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START automl_v1beta1_generated_AutoMl_ListDatasets_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the project from which to list datasets. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * image_classification_dataset_metadata:*). Some examples of using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * translation_dataset_metadata. + */ + // const filter = 'abc123' + /** + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * ListDatasetsResponse.next_page_token google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token of the previous + * AutoMl.ListDatasets google.cloud.automl.v1beta1.AutoMl.ListDatasets call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListDatasets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listDatasetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatasets(); + // [END automl_v1beta1_generated_AutoMl_ListDatasets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.list_model_evaluations.js b/samples/generated/v1beta1/auto_ml.list_model_evaluations.js new file mode 100644 index 00000000..6e14c799 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.list_model_evaluations.js @@ -0,0 +1,78 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START automl_v1beta1_generated_AutoMl_ListModelEvaluations_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + */ + // const filter = 'abc123' + /** + * Requested page size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained via + * ListModelEvaluationsResponse.next_page_token google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token of the previous + * AutoMl.ListModelEvaluations google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListModelEvaluations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listModelEvaluationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModelEvaluations(); + // [END automl_v1beta1_generated_AutoMl_ListModelEvaluations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.list_models.js b/samples/generated/v1beta1/auto_ml.list_models.js new file mode 100644 index 00000000..a7dd2e6a --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.list_models.js @@ -0,0 +1,75 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START automl_v1beta1_generated_AutoMl_ListModels_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the project, from which to list the models. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * video_classification_model_metadata:*). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * image_classification_model_metadata. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + */ + // const filter = 'abc123' + /** + * Requested page size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * ListModelsResponse.next_page_token google.cloud.automl.v1beta1.ListModelsResponse.next_page_token of the previous + * AutoMl.ListModels google.cloud.automl.v1beta1.AutoMl.ListModels call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListModels() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listModelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModels(); + // [END automl_v1beta1_generated_AutoMl_ListModels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.list_table_specs.js b/samples/generated/v1beta1/auto_ml.list_table_specs.js new file mode 100644 index 00000000..ac3d7d34 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.list_table_specs.js @@ -0,0 +1,74 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START automl_v1beta1_generated_AutoMl_ListTableSpecs_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the dataset to list table specs from. + */ + // const parent = 'abc123' + /** + * Mask specifying which fields to read. + */ + // const fieldMask = {} + /** + * Filter expression, see go/filtering. + */ + // const filter = 'abc123' + /** + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained from the + * ListTableSpecsResponse.next_page_token google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token field of the previous + * AutoMl.ListTableSpecs google.cloud.automl.v1beta1.AutoMl.ListTableSpecs call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListTableSpecs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listTableSpecsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTableSpecs(); + // [END automl_v1beta1_generated_AutoMl_ListTableSpecs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.undeploy_model.js b/samples/generated/v1beta1/auto_ml.undeploy_model.js new file mode 100644 index 00000000..ebc29591 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.undeploy_model.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START automl_v1beta1_generated_AutoMl_UndeployModel_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the model to undeploy. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUndeployModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.undeployModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeployModel(); + // [END automl_v1beta1_generated_AutoMl_UndeployModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.update_column_spec.js b/samples/generated/v1beta1/auto_ml.update_column_spec.js new file mode 100644 index 00000000..6b6523f7 --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.update_column_spec.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(columnSpec) { + // [START automl_v1beta1_generated_AutoMl_UpdateColumnSpec_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The column spec which replaces the resource on the server. + */ + // const columnSpec = {} + /** + * The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateColumnSpec() { + // Construct request + const request = { + columnSpec, + }; + + // Run request + const response = await automlClient.updateColumnSpec(request); + console.log(response); + } + + callUpdateColumnSpec(); + // [END automl_v1beta1_generated_AutoMl_UpdateColumnSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.update_dataset.js b/samples/generated/v1beta1/auto_ml.update_dataset.js new file mode 100644 index 00000000..f626a32c --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.update_dataset.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(dataset) { + // [START automl_v1beta1_generated_AutoMl_UpdateDataset_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The dataset which replaces the resource on the server. + */ + // const dataset = {} + /** + * The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateDataset() { + // Construct request + const request = { + dataset, + }; + + // Run request + const response = await automlClient.updateDataset(request); + console.log(response); + } + + callUpdateDataset(); + // [END automl_v1beta1_generated_AutoMl_UpdateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/auto_ml.update_table_spec.js b/samples/generated/v1beta1/auto_ml.update_table_spec.js new file mode 100644 index 00000000..41e5d9cf --- /dev/null +++ b/samples/generated/v1beta1/auto_ml.update_table_spec.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(tableSpec) { + // [START automl_v1beta1_generated_AutoMl_UpdateTableSpec_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The table spec which replaces the resource on the server. + */ + // const tableSpec = {} + /** + * The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateTableSpec() { + // Construct request + const request = { + tableSpec, + }; + + // Run request + const response = await automlClient.updateTableSpec(request); + console.log(response); + } + + callUpdateTableSpec(); + // [END automl_v1beta1_generated_AutoMl_UpdateTableSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/prediction_service.batch_predict.js b/samples/generated/v1beta1/prediction_service.batch_predict.js new file mode 100644 index 00000000..b6eb036e --- /dev/null +++ b/samples/generated/v1beta1/prediction_service.batch_predict.js @@ -0,0 +1,126 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, inputConfig, outputConfig, params) { + // [START automl_v1beta1_generated_PredictionService_BatchPredict_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the model requested to serve the batch prediction. + */ + // const name = 'abc123' + /** + * Required. The input configuration for batch prediction. + */ + // const inputConfig = {} + /** + * Required. The Configuration specifying where output predictions should + * be written. + */ + // const outputConfig = {} + /** + * Required. Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * * For Text Classification: + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * * For Image Classification: + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * * For Image Object Detection: + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be produced per image. Default is 100, the + * requested value may be limited by server. + * * For Video Classification : + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` - (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is "true". + * `shot_classification` - (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. The default is "false". + * `1s_interval_classification` - (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. The default is + * "false". + * * For Tables: + * feature_importance - (boolean) Whether feature importance + * should be populated in the returned TablesAnnotations. The + * default is false. + * * For Video Object Tracking: + * `score_threshold` - (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be returned per frame. Default is 100, the requested + * value may be limited by server. + * `min_bounding_box_size` - (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size will be + * returned. Value in 0 to 1 range. Default is 0. + */ + // const params = 1234 + + // Imports the Automl library + const {PredictionServiceClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new PredictionServiceClient(); + + async function callBatchPredict() { + // Construct request + const request = { + name, + inputConfig, + outputConfig, + params, + }; + + // Run request + const [operation] = await automlClient.batchPredict(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchPredict(); + // [END automl_v1beta1_generated_PredictionService_BatchPredict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1beta1/prediction_service.predict.js b/samples/generated/v1beta1/prediction_service.predict.js new file mode 100644 index 00000000..4aa8c187 --- /dev/null +++ b/samples/generated/v1beta1/prediction_service.predict.js @@ -0,0 +1,78 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name, payload) { + // [START automl_v1beta1_generated_PredictionService_Predict_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the model requested to serve the prediction. + */ + // const name = 'abc123' + /** + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + */ + // const payload = {} + /** + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * * For Image Classification: + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * * For Image Object Detection: + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be returned in the response. Default is 100, the + * requested value may be limited by server. + * * For Tables: + * feature_importance - (boolean) Whether feature importance + * should be populated in the returned TablesAnnotation. + * The default is false. + */ + // const params = 1234 + + // Imports the Automl library + const {PredictionServiceClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new PredictionServiceClient(); + + async function callPredict() { + // Construct request + const request = { + name, + payload, + }; + + // Run request + const response = await automlClient.predict(request); + console.log(response); + } + + callPredict(); + // [END automl_v1beta1_generated_PredictionService_Predict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/package.json b/samples/package.json index 9306cc84..201d768c 100644 --- a/samples/package.json +++ b/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=8" + "node": ">=10" }, "repository": "googleapis/nodejs-automl", "private": true, diff --git a/src/v1/auto_ml_client.ts b/src/v1/auto_ml_client.ts index f9b22bf7..2d0da45d 100644 --- a/src/v1/auto_ml_client.ts +++ b/src/v1/auto_ml_client.ts @@ -485,6 +485,23 @@ export class AutoMlClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Dataset]{@link google.cloud.automl.v1.Dataset}. + * 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/auto_ml.get_dataset.js + * region_tag:automl_v1_generated_AutoMl_GetDataset_async + */ getDataset( request?: protos.google.cloud.automl.v1.IGetDatasetRequest, options?: CallOptions @@ -512,23 +529,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Gets a dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the dataset to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Dataset]{@link google.cloud.automl.v1.Dataset}. - * 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.getDataset(request); - */ getDataset( request?: protos.google.cloud.automl.v1.IGetDatasetRequest, optionsOrCallback?: @@ -568,6 +568,25 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.getDataset(request, options, callback); } + /** + * Updates a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1.Dataset} request.dataset + * Required. The dataset which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@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 [Dataset]{@link google.cloud.automl.v1.Dataset}. + * 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/auto_ml.update_dataset.js + * region_tag:automl_v1_generated_AutoMl_UpdateDataset_async + */ updateDataset( request?: protos.google.cloud.automl.v1.IUpdateDatasetRequest, options?: CallOptions @@ -595,25 +614,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Updates a dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.automl.v1.Dataset} request.dataset - * Required. The dataset which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. - * @param {object} [options] - * Call options. See {@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 [Dataset]{@link google.cloud.automl.v1.Dataset}. - * 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.updateDataset(request); - */ updateDataset( request?: protos.google.cloud.automl.v1.IUpdateDatasetRequest, optionsOrCallback?: @@ -655,6 +655,23 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.updateDataset(request, options, callback); } + /** + * Gets an annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the annotation spec to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotationSpec]{@link google.cloud.automl.v1.AnnotationSpec}. + * 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/auto_ml.get_annotation_spec.js + * region_tag:automl_v1_generated_AutoMl_GetAnnotationSpec_async + */ getAnnotationSpec( request?: protos.google.cloud.automl.v1.IGetAnnotationSpecRequest, options?: CallOptions @@ -686,23 +703,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Gets an annotation spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the annotation spec to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnnotationSpec]{@link google.cloud.automl.v1.AnnotationSpec}. - * 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.getAnnotationSpec(request); - */ getAnnotationSpec( request?: protos.google.cloud.automl.v1.IGetAnnotationSpecRequest, optionsOrCallback?: @@ -746,6 +746,23 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.getAnnotationSpec(request, options, callback); } + /** + * Gets a model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Model]{@link google.cloud.automl.v1.Model}. + * 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/auto_ml.get_model.js + * region_tag:automl_v1_generated_AutoMl_GetModel_async + */ getModel( request?: protos.google.cloud.automl.v1.IGetModelRequest, options?: CallOptions @@ -773,23 +790,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Gets a model. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the model. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Model]{@link google.cloud.automl.v1.Model}. - * 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.getModel(request); - */ getModel( request?: protos.google.cloud.automl.v1.IGetModelRequest, optionsOrCallback?: @@ -829,6 +829,25 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.getModel(request, options, callback); } + /** + * Updates a model. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1.Model} request.model + * Required. The model which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@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 [Model]{@link google.cloud.automl.v1.Model}. + * 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/auto_ml.update_model.js + * region_tag:automl_v1_generated_AutoMl_UpdateModel_async + */ updateModel( request?: protos.google.cloud.automl.v1.IUpdateModelRequest, options?: CallOptions @@ -856,25 +875,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Updates a model. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.automl.v1.Model} request.model - * Required. The model which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The update mask applies to the resource. - * @param {object} [options] - * Call options. See {@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 [Model]{@link google.cloud.automl.v1.Model}. - * 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.updateModel(request); - */ updateModel( request?: protos.google.cloud.automl.v1.IUpdateModelRequest, optionsOrCallback?: @@ -914,6 +914,23 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.updateModel(request, options, callback); } + /** + * Gets a model evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name for the model evaluation. + * @param {object} [options] + * Call options. See {@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 [ModelEvaluation]{@link google.cloud.automl.v1.ModelEvaluation}. + * 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/auto_ml.get_model_evaluation.js + * region_tag:automl_v1_generated_AutoMl_GetModelEvaluation_async + */ getModelEvaluation( request?: protos.google.cloud.automl.v1.IGetModelEvaluationRequest, options?: CallOptions @@ -945,23 +962,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Gets a model evaluation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name for the model evaluation. - * @param {object} [options] - * Call options. See {@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 [ModelEvaluation]{@link google.cloud.automl.v1.ModelEvaluation}. - * 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.getModelEvaluation(request); - */ getModelEvaluation( request?: protos.google.cloud.automl.v1.IGetModelEvaluationRequest, optionsOrCallback?: @@ -1006,6 +1006,27 @@ export class AutoMlClient { return this.innerApiCalls.getModelEvaluation(request, options, callback); } + /** + * Creates a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project to create the dataset for. + * @param {google.cloud.automl.v1.Dataset} request.dataset + * Required. The dataset to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.create_dataset.js + * region_tag:automl_v1_generated_AutoMl_CreateDataset_async + */ createDataset( request?: protos.google.cloud.automl.v1.ICreateDatasetRequest, options?: CallOptions @@ -1042,28 +1063,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Creates a dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the project to create the dataset for. - * @param {google.cloud.automl.v1.Dataset} request.dataset - * Required. The dataset to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.createDataset(request); - * const [response] = await operation.promise(); - */ createDataset( request?: protos.google.cloud.automl.v1.ICreateDatasetRequest, optionsOrCallback?: @@ -1121,11 +1120,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateDatasetProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/auto_ml.create_dataset.js + * region_tag:automl_v1_generated_AutoMl_CreateDataset_async */ async checkCreateDatasetProgress( name: string @@ -1149,6 +1145,29 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata >; } + /** + * Deletes a dataset and all of its contents. + * Returns empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes, + * and `delete_details` in the + * {@link google.longrunning.Operation.metadata|metadata} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.delete_dataset.js + * region_tag:automl_v1_generated_AutoMl_DeleteDataset_async + */ deleteDataset( request?: protos.google.cloud.automl.v1.IDeleteDatasetRequest, options?: CallOptions @@ -1185,30 +1204,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Deletes a dataset and all of its contents. - * Returns empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes, - * and `delete_details` in the - * {@link google.longrunning.Operation.metadata|metadata} field. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the dataset to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.deleteDataset(request); - * const [response] = await operation.promise(); - */ deleteDataset( request?: protos.google.cloud.automl.v1.IDeleteDatasetRequest, optionsOrCallback?: @@ -1266,11 +1261,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteDatasetProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/auto_ml.delete_dataset.js + * region_tag:automl_v1_generated_AutoMl_DeleteDataset_async */ async checkDeleteDatasetProgress( name: string @@ -1294,6 +1286,37 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata >; } + /** + * Imports data into a dataset. + * For Tables this method can only be called on an empty Dataset. + * + * For Tables: + * * A + * {@link google.cloud.automl.v1.InputConfig.params|schema_inference_version} + * parameter must be explicitly set. + * Returns an empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * @param {google.cloud.automl.v1.InputConfig} request.inputConfig + * Required. The desired input location and its domain specific semantics, + * if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is 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/auto_ml.import_data.js + * region_tag:automl_v1_generated_AutoMl_ImportData_async + */ importData( request?: protos.google.cloud.automl.v1.IImportDataRequest, options?: CallOptions @@ -1330,38 +1353,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Imports data into a dataset. - * For Tables this method can only be called on an empty Dataset. - * - * For Tables: - * * A - * {@link google.cloud.automl.v1.InputConfig.params|schema_inference_version} - * parameter must be explicitly set. - * Returns an empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Dataset name. Dataset must already exist. All imported - * annotations and examples will be added. - * @param {google.cloud.automl.v1.InputConfig} request.inputConfig - * Required. The desired input location and its domain specific semantics, - * if any. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.importData(request); - * const [response] = await operation.promise(); - */ importData( request?: protos.google.cloud.automl.v1.IImportDataRequest, optionsOrCallback?: @@ -1419,11 +1410,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkImportDataProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/auto_ml.import_data.js + * region_tag:automl_v1_generated_AutoMl_ImportData_async */ async checkImportDataProgress( name: string @@ -1447,6 +1435,29 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata >; } + /** + * Exports dataset's data to the provided output location. + * Returns an empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset. + * @param {google.cloud.automl.v1.OutputConfig} request.outputConfig + * Required. The desired output 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 + * 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/auto_ml.export_data.js + * region_tag:automl_v1_generated_AutoMl_ExportData_async + */ exportData( request?: protos.google.cloud.automl.v1.IExportDataRequest, options?: CallOptions @@ -1483,30 +1494,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Exports dataset's data to the provided output location. - * Returns an empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the dataset. - * @param {google.cloud.automl.v1.OutputConfig} request.outputConfig - * Required. The desired output 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 - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.exportData(request); - * const [response] = await operation.promise(); - */ exportData( request?: protos.google.cloud.automl.v1.IExportDataRequest, optionsOrCallback?: @@ -1564,11 +1551,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkExportDataProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/auto_ml.export_data.js + * region_tag:automl_v1_generated_AutoMl_ExportData_async */ async checkExportDataProgress( name: string @@ -1592,6 +1576,31 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata >; } + /** + * Creates a model. + * Returns a Model in the {@link google.longrunning.Operation.response|response} + * field when it completes. + * When you create a model, several model evaluations are created for it: + * a global evaluation, and one evaluation for each annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent project where the model is being created. + * @param {google.cloud.automl.v1.Model} request.model + * Required. The model to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/auto_ml.create_model.js + * region_tag:automl_v1_generated_AutoMl_CreateModel_async + */ createModel( request?: protos.google.cloud.automl.v1.ICreateModelRequest, options?: CallOptions @@ -1628,32 +1637,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Creates a model. - * Returns a Model in the {@link google.longrunning.Operation.response|response} - * field when it completes. - * When you create a model, several model evaluations are created for it: - * a global evaluation, and one evaluation for each annotation spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent project where the model is being created. - * @param {google.cloud.automl.v1.Model} request.model - * Required. The model to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.createModel(request); - * const [response] = await operation.promise(); - */ createModel( request?: protos.google.cloud.automl.v1.ICreateModelRequest, optionsOrCallback?: @@ -1711,11 +1694,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateModelProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/auto_ml.create_model.js + * region_tag:automl_v1_generated_AutoMl_CreateModel_async */ async checkCreateModelProgress( name: string @@ -1739,6 +1719,29 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata >; } + /** + * Deletes a model. + * Returns `google.protobuf.Empty` in the + * {@link google.longrunning.Operation.response|response} field when it completes, + * and `delete_details` in the + * {@link google.longrunning.Operation.metadata|metadata} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model being 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/auto_ml.delete_model.js + * region_tag:automl_v1_generated_AutoMl_DeleteModel_async + */ deleteModel( request?: protos.google.cloud.automl.v1.IDeleteModelRequest, options?: CallOptions @@ -1775,30 +1778,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Deletes a model. - * Returns `google.protobuf.Empty` in the - * {@link google.longrunning.Operation.response|response} field when it completes, - * and `delete_details` in the - * {@link google.longrunning.Operation.metadata|metadata} field. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the model being 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 - * const [operation] = await client.deleteModel(request); - * const [response] = await operation.promise(); - */ deleteModel( request?: protos.google.cloud.automl.v1.IDeleteModelRequest, optionsOrCallback?: @@ -1856,11 +1835,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteModelProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/auto_ml.delete_model.js + * region_tag:automl_v1_generated_AutoMl_DeleteModel_async */ async checkDeleteModelProgress( name: string @@ -1884,6 +1860,40 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata >; } + /** + * Deploys a model. If a model is already deployed, deploying it with the + * same parameters has no effect. Deploying with different parametrs + * (as e.g. changing + * + * {@link google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number|node_number}) + * will reset the deployment state without pausing the model's availability. + * + * Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage + * deployment automatically. + * + * Returns an empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} request.imageObjectDetectionModelDeploymentMetadata + * Model deployment metadata specific to Image Object Detection. + * @param {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} request.imageClassificationModelDeploymentMetadata + * Model deployment metadata specific to Image Classification. + * @param {string} request.name + * Required. Resource name of the model to deploy. + * @param {object} [options] + * Call options. See {@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/auto_ml.deploy_model.js + * region_tag:automl_v1_generated_AutoMl_DeployModel_async + */ deployModel( request?: protos.google.cloud.automl.v1.IDeployModelRequest, options?: CallOptions @@ -1920,41 +1930,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Deploys a model. If a model is already deployed, deploying it with the - * same parameters has no effect. Deploying with different parametrs - * (as e.g. changing - * - * {@link google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number|node_number}) - * will reset the deployment state without pausing the model's availability. - * - * Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage - * deployment automatically. - * - * Returns an empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} request.imageObjectDetectionModelDeploymentMetadata - * Model deployment metadata specific to Image Object Detection. - * @param {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} request.imageClassificationModelDeploymentMetadata - * Model deployment metadata specific to Image Classification. - * @param {string} request.name - * Required. Resource name of the model to deploy. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.deployModel(request); - * const [response] = await operation.promise(); - */ deployModel( request?: protos.google.cloud.automl.v1.IDeployModelRequest, optionsOrCallback?: @@ -2012,11 +1987,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeployModelProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/auto_ml.deploy_model.js + * region_tag:automl_v1_generated_AutoMl_DeployModel_async */ async checkDeployModelProgress( name: string @@ -2040,6 +2012,31 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata >; } + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + * Only applicable for Text Classification, Image Object Detection and Tables; + * all other domains manage deployment automatically. + * + * Returns an empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model to undeploy. + * @param {object} [options] + * Call options. See {@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/auto_ml.undeploy_model.js + * region_tag:automl_v1_generated_AutoMl_UndeployModel_async + */ undeployModel( request?: protos.google.cloud.automl.v1.IUndeployModelRequest, options?: CallOptions @@ -2076,32 +2073,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Undeploys a model. If the model is not deployed this method has no effect. - * - * Only applicable for Text Classification, Image Object Detection and Tables; - * all other domains manage deployment automatically. - * - * Returns an empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the model to undeploy. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.undeployModel(request); - * const [response] = await operation.promise(); - */ undeployModel( request?: protos.google.cloud.automl.v1.IUndeployModelRequest, optionsOrCallback?: @@ -2159,11 +2130,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUndeployModelProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/auto_ml.undeploy_model.js + * region_tag:automl_v1_generated_AutoMl_UndeployModel_async */ async checkUndeployModelProgress( name: string @@ -2187,6 +2155,33 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata >; } + /** + * Exports a trained, "export-able", model to a user specified Google Cloud + * Storage location. A model is considered export-able if and only if it has + * an export format defined for it in + * {@link google.cloud.automl.v1.ModelExportOutputConfig|ModelExportOutputConfig}. + * + * Returns an empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model to export. + * @param {google.cloud.automl.v1.ModelExportOutputConfig} request.outputConfig + * Required. The desired output location and configuration. + * @param {object} [options] + * Call options. See {@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/auto_ml.export_model.js + * region_tag:automl_v1_generated_AutoMl_ExportModel_async + */ exportModel( request?: protos.google.cloud.automl.v1.IExportModelRequest, options?: CallOptions @@ -2223,34 +2218,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Exports a trained, "export-able", model to a user specified Google Cloud - * Storage location. A model is considered export-able if and only if it has - * an export format defined for it in - * {@link google.cloud.automl.v1.ModelExportOutputConfig|ModelExportOutputConfig}. - * - * Returns an empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the model to export. - * @param {google.cloud.automl.v1.ModelExportOutputConfig} request.outputConfig - * Required. The desired output location and configuration. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.exportModel(request); - * const [response] = await operation.promise(); - */ exportModel( request?: protos.google.cloud.automl.v1.IExportModelRequest, optionsOrCallback?: @@ -2308,11 +2275,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkExportModelProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/auto_ml.export_model.js + * region_tag:automl_v1_generated_AutoMl_ExportModel_async */ async checkExportModelProgress( name: string @@ -2336,33 +2300,6 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata >; } - listDatasets( - request?: protos.google.cloud.automl.v1.IListDatasetsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.automl.v1.IDataset[], - protos.google.cloud.automl.v1.IListDatasetsRequest | null, - protos.google.cloud.automl.v1.IListDatasetsResponse - ] - >; - listDatasets( - request: protos.google.cloud.automl.v1.IListDatasetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.automl.v1.IListDatasetsRequest, - protos.google.cloud.automl.v1.IListDatasetsResponse | null | undefined, - protos.google.cloud.automl.v1.IDataset - > - ): void; - listDatasets( - request: protos.google.cloud.automl.v1.IListDatasetsRequest, - callback: PaginationCallback< - protos.google.cloud.automl.v1.IListDatasetsRequest, - protos.google.cloud.automl.v1.IListDatasetsResponse | null | undefined, - protos.google.cloud.automl.v1.IDataset - > - ): void; /** * Lists datasets in a project. * @@ -2399,6 +2336,33 @@ export class AutoMlClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listDatasets( + request?: protos.google.cloud.automl.v1.IListDatasetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset[], + protos.google.cloud.automl.v1.IListDatasetsRequest | null, + protos.google.cloud.automl.v1.IListDatasetsResponse + ] + >; + listDatasets( + request: protos.google.cloud.automl.v1.IListDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListDatasetsRequest, + protos.google.cloud.automl.v1.IListDatasetsResponse | null | undefined, + protos.google.cloud.automl.v1.IDataset + > + ): void; + listDatasets( + request: protos.google.cloud.automl.v1.IListDatasetsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListDatasetsRequest, + protos.google.cloud.automl.v1.IListDatasetsResponse | null | undefined, + protos.google.cloud.automl.v1.IDataset + > + ): void; listDatasets( request?: protos.google.cloud.automl.v1.IListDatasetsRequest, optionsOrCallback?: @@ -2487,7 +2451,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listDatasets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listDatasets.createStream( this.innerApiCalls.listDatasets as gax.GaxCall, @@ -2530,11 +2495,8 @@ export class AutoMlClient { * 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.listDatasetsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/auto_ml.list_datasets.js + * region_tag:automl_v1_generated_AutoMl_ListDatasets_async */ listDatasetsAsync( request?: protos.google.cloud.automl.v1.IListDatasetsRequest, @@ -2548,8 +2510,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listDatasets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listDatasets.asyncIterate( this.innerApiCalls['listDatasets'] as GaxCall, @@ -2557,33 +2519,6 @@ export class AutoMlClient { callSettings ) as AsyncIterable; } - listModels( - request?: protos.google.cloud.automl.v1.IListModelsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.automl.v1.IModel[], - protos.google.cloud.automl.v1.IListModelsRequest | null, - protos.google.cloud.automl.v1.IListModelsResponse - ] - >; - listModels( - request: protos.google.cloud.automl.v1.IListModelsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.automl.v1.IListModelsRequest, - protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, - protos.google.cloud.automl.v1.IModel - > - ): void; - listModels( - request: protos.google.cloud.automl.v1.IListModelsRequest, - callback: PaginationCallback< - protos.google.cloud.automl.v1.IListModelsRequest, - protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, - protos.google.cloud.automl.v1.IModel - > - ): void; /** * Lists models. * @@ -2621,6 +2556,33 @@ export class AutoMlClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listModels( + request?: protos.google.cloud.automl.v1.IListModelsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IModel[], + protos.google.cloud.automl.v1.IListModelsRequest | null, + protos.google.cloud.automl.v1.IListModelsResponse + ] + >; + listModels( + request: protos.google.cloud.automl.v1.IListModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListModelsRequest, + protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1.IModel + > + ): void; + listModels( + request: protos.google.cloud.automl.v1.IListModelsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListModelsRequest, + protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1.IModel + > + ): void; listModels( request?: protos.google.cloud.automl.v1.IListModelsRequest, optionsOrCallback?: @@ -2708,7 +2670,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listModels.createStream( this.innerApiCalls.listModels as gax.GaxCall, @@ -2752,11 +2715,8 @@ export class AutoMlClient { * 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.listModelsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/auto_ml.list_models.js + * region_tag:automl_v1_generated_AutoMl_ListModels_async */ listModelsAsync( request?: protos.google.cloud.automl.v1.IListModelsRequest, @@ -2770,8 +2730,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listModels.asyncIterate( this.innerApiCalls['listModels'] as GaxCall, @@ -2779,37 +2739,6 @@ export class AutoMlClient { callSettings ) as AsyncIterable; } - listModelEvaluations( - request?: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.automl.v1.IModelEvaluation[], - protos.google.cloud.automl.v1.IListModelEvaluationsRequest | null, - protos.google.cloud.automl.v1.IListModelEvaluationsResponse - ] - >; - listModelEvaluations( - request: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.automl.v1.IListModelEvaluationsRequest, - | protos.google.cloud.automl.v1.IListModelEvaluationsResponse - | null - | undefined, - protos.google.cloud.automl.v1.IModelEvaluation - > - ): void; - listModelEvaluations( - request: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, - callback: PaginationCallback< - protos.google.cloud.automl.v1.IListModelEvaluationsRequest, - | protos.google.cloud.automl.v1.IListModelEvaluationsResponse - | null - | undefined, - protos.google.cloud.automl.v1.IModelEvaluation - > - ): void; /** * Lists model evaluations. * @@ -2851,6 +2780,37 @@ export class AutoMlClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listModelEvaluations( + request?: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IModelEvaluation[], + protos.google.cloud.automl.v1.IListModelEvaluationsRequest | null, + protos.google.cloud.automl.v1.IListModelEvaluationsResponse + ] + >; + listModelEvaluations( + request: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IModelEvaluation + > + ): void; + listModelEvaluations( + request: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IModelEvaluation + > + ): void; listModelEvaluations( request?: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, optionsOrCallback?: @@ -2946,7 +2906,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listModelEvaluations.createStream( this.innerApiCalls.listModelEvaluations as gax.GaxCall, @@ -2994,11 +2955,8 @@ export class AutoMlClient { * 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.listModelEvaluationsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/auto_ml.list_model_evaluations.js + * region_tag:automl_v1_generated_AutoMl_ListModelEvaluations_async */ listModelEvaluationsAsync( request?: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, @@ -3012,8 +2970,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listModelEvaluations.asyncIterate( this.innerApiCalls['listModelEvaluations'] as GaxCall, diff --git a/src/v1/prediction_service_client.ts b/src/v1/prediction_service_client.ts index 72a9d4c6..a53b06c1 100644 --- a/src/v1/prediction_service_client.ts +++ b/src/v1/prediction_service_client.ts @@ -337,33 +337,6 @@ export class PredictionServiceClient { // ------------------- // -- Service calls -- // ------------------- - predict( - request?: protos.google.cloud.automl.v1.IPredictRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.automl.v1.IPredictResponse, - protos.google.cloud.automl.v1.IPredictRequest | undefined, - {} | undefined - ] - >; - predict( - request: protos.google.cloud.automl.v1.IPredictRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.automl.v1.IPredictResponse, - protos.google.cloud.automl.v1.IPredictRequest | null | undefined, - {} | null | undefined - > - ): void; - predict( - request: protos.google.cloud.automl.v1.IPredictRequest, - callback: Callback< - protos.google.cloud.automl.v1.IPredictResponse, - protos.google.cloud.automl.v1.IPredictRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Perform an online prediction. The prediction result is directly * returned in the response. @@ -448,9 +421,36 @@ export class PredictionServiceClient { * 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.predict(request); + * @example include:samples/generated/v1/prediction_service.predict.js + * region_tag:automl_v1_generated_PredictionService_Predict_async */ + predict( + request?: protos.google.cloud.automl.v1.IPredictRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | undefined, + {} | undefined + ] + >; + predict( + request: protos.google.cloud.automl.v1.IPredictRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): void; + predict( + request: protos.google.cloud.automl.v1.IPredictRequest, + callback: Callback< + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): void; predict( request?: protos.google.cloud.automl.v1.IPredictRequest, optionsOrCallback?: @@ -491,42 +491,6 @@ export class PredictionServiceClient { return this.innerApiCalls.predict(request, options, callback); } - batchPredict( - request?: protos.google.cloud.automl.v1.IBatchPredictRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.automl.v1.IBatchPredictResult, - protos.google.cloud.automl.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchPredict( - request: protos.google.cloud.automl.v1.IBatchPredictRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.automl.v1.IBatchPredictResult, - protos.google.cloud.automl.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchPredict( - request: protos.google.cloud.automl.v1.IBatchPredictRequest, - callback: Callback< - LROperation< - protos.google.cloud.automl.v1.IBatchPredictResult, - protos.google.cloud.automl.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Perform a batch prediction. Unlike the online {@link google.cloud.automl.v1.PredictionService.Predict|Predict}, batch * prediction result won't be immediately available in the response. Instead, @@ -647,10 +611,45 @@ export class PredictionServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchPredict(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v1/prediction_service.batch_predict.js + * region_tag:automl_v1_generated_PredictionService_BatchPredict_async */ + batchPredict( + request?: protos.google.cloud.automl.v1.IBatchPredictRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchPredict( + request: protos.google.cloud.automl.v1.IBatchPredictRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchPredict( + request: protos.google.cloud.automl.v1.IBatchPredictRequest, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchPredict( request?: protos.google.cloud.automl.v1.IBatchPredictRequest, optionsOrCallback?: @@ -708,11 +707,8 @@ export class PredictionServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchPredictProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/prediction_service.batch_predict.js + * region_tag:automl_v1_generated_PredictionService_BatchPredict_async */ async checkBatchPredictProgress( name: string diff --git a/src/v1beta1/auto_ml_client.ts b/src/v1beta1/auto_ml_client.ts index e292803c..c6bfef61 100644 --- a/src/v1beta1/auto_ml_client.ts +++ b/src/v1beta1/auto_ml_client.ts @@ -511,6 +511,25 @@ export class AutoMlClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Creates a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project to create the dataset for. + * @param {google.cloud.automl.v1beta1.Dataset} request.dataset + * Required. The dataset to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Dataset]{@link google.cloud.automl.v1beta1.Dataset}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.create_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_CreateDataset_async + */ createDataset( request?: protos.google.cloud.automl.v1beta1.ICreateDatasetRequest, options?: CallOptions @@ -542,25 +561,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Creates a dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the project to create the dataset for. - * @param {google.cloud.automl.v1beta1.Dataset} request.dataset - * Required. The dataset to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Dataset]{@link google.cloud.automl.v1beta1.Dataset}. - * 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.createDataset(request); - */ createDataset( request?: protos.google.cloud.automl.v1beta1.ICreateDatasetRequest, optionsOrCallback?: @@ -604,6 +604,23 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.createDataset(request, options, callback); } + /** + * Gets a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Dataset]{@link google.cloud.automl.v1beta1.Dataset}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.get_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_GetDataset_async + */ getDataset( request?: protos.google.cloud.automl.v1beta1.IGetDatasetRequest, options?: CallOptions @@ -631,23 +648,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Gets a dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the dataset to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Dataset]{@link google.cloud.automl.v1beta1.Dataset}. - * 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.getDataset(request); - */ getDataset( request?: protos.google.cloud.automl.v1beta1.IGetDatasetRequest, optionsOrCallback?: @@ -689,6 +689,25 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.getDataset(request, options, callback); } + /** + * Updates a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1beta1.Dataset} request.dataset + * Required. The dataset which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@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 [Dataset]{@link google.cloud.automl.v1beta1.Dataset}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.update_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_UpdateDataset_async + */ updateDataset( request?: protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest, options?: CallOptions @@ -720,25 +739,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Updates a dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.automl.v1beta1.Dataset} request.dataset - * Required. The dataset which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * The update mask applies to the resource. - * @param {object} [options] - * Call options. See {@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 [Dataset]{@link google.cloud.automl.v1beta1.Dataset}. - * 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.updateDataset(request); - */ updateDataset( request?: protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest, optionsOrCallback?: @@ -782,6 +782,23 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.updateDataset(request, options, callback); } + /** + * Gets an annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the annotation spec to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotationSpec]{@link google.cloud.automl.v1beta1.AnnotationSpec}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.get_annotation_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_GetAnnotationSpec_async + */ getAnnotationSpec( request?: protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, options?: CallOptions @@ -813,23 +830,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Gets an annotation spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the annotation spec to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnnotationSpec]{@link google.cloud.automl.v1beta1.AnnotationSpec}. - * 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.getAnnotationSpec(request); - */ getAnnotationSpec( request?: protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, optionsOrCallback?: @@ -873,6 +873,25 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.getAnnotationSpec(request, options, callback); } + /** + * Gets a table spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the table spec to retrieve. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@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 [TableSpec]{@link google.cloud.automl.v1beta1.TableSpec}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.get_table_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_GetTableSpec_async + */ getTableSpec( request?: protos.google.cloud.automl.v1beta1.IGetTableSpecRequest, options?: CallOptions @@ -904,25 +923,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Gets a table spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the table spec to retrieve. - * @param {google.protobuf.FieldMask} request.fieldMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@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 [TableSpec]{@link google.cloud.automl.v1beta1.TableSpec}. - * 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.getTableSpec(request); - */ getTableSpec( request?: protos.google.cloud.automl.v1beta1.IGetTableSpecRequest, optionsOrCallback?: @@ -966,6 +966,25 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.getTableSpec(request, options, callback); } + /** + * Updates a table spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1beta1.TableSpec} request.tableSpec + * Required. The table spec which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@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 [TableSpec]{@link google.cloud.automl.v1beta1.TableSpec}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.update_table_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_UpdateTableSpec_async + */ updateTableSpec( request?: protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest, options?: CallOptions @@ -997,25 +1016,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Updates a table spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.automl.v1beta1.TableSpec} request.tableSpec - * Required. The table spec which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * The update mask applies to the resource. - * @param {object} [options] - * Call options. See {@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 [TableSpec]{@link google.cloud.automl.v1beta1.TableSpec}. - * 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.updateTableSpec(request); - */ updateTableSpec( request?: protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest, optionsOrCallback?: @@ -1059,6 +1059,25 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.updateTableSpec(request, options, callback); } + /** + * Gets a column spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the column spec to retrieve. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {object} [options] + * Call options. See {@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 [ColumnSpec]{@link google.cloud.automl.v1beta1.ColumnSpec}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.get_column_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_GetColumnSpec_async + */ getColumnSpec( request?: protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest, options?: CallOptions @@ -1090,25 +1109,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Gets a column spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the column spec to retrieve. - * @param {google.protobuf.FieldMask} request.fieldMask - * Mask specifying which fields to read. - * @param {object} [options] - * Call options. See {@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 [ColumnSpec]{@link google.cloud.automl.v1beta1.ColumnSpec}. - * 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.getColumnSpec(request); - */ getColumnSpec( request?: protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest, optionsOrCallback?: @@ -1152,6 +1152,25 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.getColumnSpec(request, options, callback); } + /** + * Updates a column spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1beta1.ColumnSpec} request.columnSpec + * Required. The column spec which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@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 [ColumnSpec]{@link google.cloud.automl.v1beta1.ColumnSpec}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.update_column_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_UpdateColumnSpec_async + */ updateColumnSpec( request?: protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, options?: CallOptions @@ -1183,25 +1202,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Updates a column spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.automl.v1beta1.ColumnSpec} request.columnSpec - * Required. The column spec which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * The update mask applies to the resource. - * @param {object} [options] - * Call options. See {@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 [ColumnSpec]{@link google.cloud.automl.v1beta1.ColumnSpec}. - * 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.updateColumnSpec(request); - */ updateColumnSpec( request?: protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, optionsOrCallback?: @@ -1245,6 +1245,23 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.updateColumnSpec(request, options, callback); } + /** + * Gets a model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Model]{@link google.cloud.automl.v1beta1.Model}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.get_model.js + * region_tag:automl_v1beta1_generated_AutoMl_GetModel_async + */ getModel( request?: protos.google.cloud.automl.v1beta1.IGetModelRequest, options?: CallOptions @@ -1272,23 +1289,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Gets a model. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the model. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Model]{@link google.cloud.automl.v1beta1.Model}. - * 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.getModel(request); - */ getModel( request?: protos.google.cloud.automl.v1beta1.IGetModelRequest, optionsOrCallback?: @@ -1330,6 +1330,23 @@ export class AutoMlClient { this.initialize(); return this.innerApiCalls.getModel(request, options, callback); } + /** + * Gets a model evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name for the model evaluation. + * @param {object} [options] + * Call options. See {@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 [ModelEvaluation]{@link google.cloud.automl.v1beta1.ModelEvaluation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.get_model_evaluation.js + * region_tag:automl_v1beta1_generated_AutoMl_GetModelEvaluation_async + */ getModelEvaluation( request?: protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest, options?: CallOptions @@ -1361,23 +1378,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Gets a model evaluation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name for the model evaluation. - * @param {object} [options] - * Call options. See {@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 [ModelEvaluation]{@link google.cloud.automl.v1beta1.ModelEvaluation}. - * 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.getModelEvaluation(request); - */ getModelEvaluation( request?: protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest, optionsOrCallback?: @@ -1422,6 +1422,29 @@ export class AutoMlClient { return this.innerApiCalls.getModelEvaluation(request, options, callback); } + /** + * Deletes a dataset and all of its contents. + * Returns empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes, + * and `delete_details` in the + * {@link google.longrunning.Operation.metadata|metadata} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.delete_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_DeleteDataset_async + */ deleteDataset( request?: protos.google.cloud.automl.v1beta1.IDeleteDatasetRequest, options?: CallOptions @@ -1458,30 +1481,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Deletes a dataset and all of its contents. - * Returns empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes, - * and `delete_details` in the - * {@link google.longrunning.Operation.metadata|metadata} field. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the dataset to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.deleteDataset(request); - * const [response] = await operation.promise(); - */ deleteDataset( request?: protos.google.cloud.automl.v1beta1.IDeleteDatasetRequest, optionsOrCallback?: @@ -1539,11 +1538,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteDatasetProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/auto_ml.delete_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_DeleteDataset_async */ async checkDeleteDatasetProgress( name: string @@ -1567,6 +1563,37 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata >; } + /** + * Imports data into a dataset. + * For Tables this method can only be called on an empty Dataset. + * + * For Tables: + * * A + * {@link google.cloud.automl.v1beta1.InputConfig.params|schema_inference_version} + * parameter must be explicitly set. + * Returns an empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * @param {google.cloud.automl.v1beta1.InputConfig} request.inputConfig + * Required. The desired input location and its domain specific semantics, + * if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.import_data.js + * region_tag:automl_v1beta1_generated_AutoMl_ImportData_async + */ importData( request?: protos.google.cloud.automl.v1beta1.IImportDataRequest, options?: CallOptions @@ -1603,38 +1630,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Imports data into a dataset. - * For Tables this method can only be called on an empty Dataset. - * - * For Tables: - * * A - * {@link google.cloud.automl.v1beta1.InputConfig.params|schema_inference_version} - * parameter must be explicitly set. - * Returns an empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Dataset name. Dataset must already exist. All imported - * annotations and examples will be added. - * @param {google.cloud.automl.v1beta1.InputConfig} request.inputConfig - * Required. The desired input location and its domain specific semantics, - * if any. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.importData(request); - * const [response] = await operation.promise(); - */ importData( request?: protos.google.cloud.automl.v1beta1.IImportDataRequest, optionsOrCallback?: @@ -1692,11 +1687,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkImportDataProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/auto_ml.import_data.js + * region_tag:automl_v1beta1_generated_AutoMl_ImportData_async */ async checkImportDataProgress( name: string @@ -1720,6 +1712,29 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata >; } + /** + * Exports dataset's data to the provided output location. + * Returns an empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset. + * @param {google.cloud.automl.v1beta1.OutputConfig} request.outputConfig + * Required. The desired output 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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.export_data.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportData_async + */ exportData( request?: protos.google.cloud.automl.v1beta1.IExportDataRequest, options?: CallOptions @@ -1756,30 +1771,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Exports dataset's data to the provided output location. - * Returns an empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the dataset. - * @param {google.cloud.automl.v1beta1.OutputConfig} request.outputConfig - * Required. The desired output 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 - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.exportData(request); - * const [response] = await operation.promise(); - */ exportData( request?: protos.google.cloud.automl.v1beta1.IExportDataRequest, optionsOrCallback?: @@ -1837,11 +1828,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkExportDataProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/auto_ml.export_data.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportData_async */ async checkExportDataProgress( name: string @@ -1865,6 +1853,31 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata >; } + /** + * Creates a model. + * Returns a Model in the {@link google.longrunning.Operation.response|response} + * field when it completes. + * When you create a model, several model evaluations are created for it: + * a global evaluation, and one evaluation for each annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent project where the model is being created. + * @param {google.cloud.automl.v1beta1.Model} request.model + * Required. The model to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.create_model.js + * region_tag:automl_v1beta1_generated_AutoMl_CreateModel_async + */ createModel( request?: protos.google.cloud.automl.v1beta1.ICreateModelRequest, options?: CallOptions @@ -1901,32 +1914,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Creates a model. - * Returns a Model in the {@link google.longrunning.Operation.response|response} - * field when it completes. - * When you create a model, several model evaluations are created for it: - * a global evaluation, and one evaluation for each annotation spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent project where the model is being created. - * @param {google.cloud.automl.v1beta1.Model} request.model - * Required. The model to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.createModel(request); - * const [response] = await operation.promise(); - */ createModel( request?: protos.google.cloud.automl.v1beta1.ICreateModelRequest, optionsOrCallback?: @@ -1984,11 +1971,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateModelProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/auto_ml.create_model.js + * region_tag:automl_v1beta1_generated_AutoMl_CreateModel_async */ async checkCreateModelProgress( name: string @@ -2012,6 +1996,29 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata >; } + /** + * Deletes a model. + * Returns `google.protobuf.Empty` in the + * {@link google.longrunning.Operation.response|response} field when it completes, + * and `delete_details` in the + * {@link google.longrunning.Operation.metadata|metadata} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model being 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/v1beta1/auto_ml.delete_model.js + * region_tag:automl_v1beta1_generated_AutoMl_DeleteModel_async + */ deleteModel( request?: protos.google.cloud.automl.v1beta1.IDeleteModelRequest, options?: CallOptions @@ -2048,30 +2055,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Deletes a model. - * Returns `google.protobuf.Empty` in the - * {@link google.longrunning.Operation.response|response} field when it completes, - * and `delete_details` in the - * {@link google.longrunning.Operation.metadata|metadata} field. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the model being 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 - * const [operation] = await client.deleteModel(request); - * const [response] = await operation.promise(); - */ deleteModel( request?: protos.google.cloud.automl.v1beta1.IDeleteModelRequest, optionsOrCallback?: @@ -2129,11 +2112,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteModelProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/auto_ml.delete_model.js + * region_tag:automl_v1beta1_generated_AutoMl_DeleteModel_async */ async checkDeleteModelProgress( name: string @@ -2157,6 +2137,40 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata >; } + /** + * Deploys a model. If a model is already deployed, deploying it with the + * same parameters has no effect. Deploying with different parametrs + * (as e.g. changing + * + * {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number|node_number}) + * will reset the deployment state without pausing the model's availability. + * + * Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage + * deployment automatically. + * + * Returns an empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} request.imageObjectDetectionModelDeploymentMetadata + * Model deployment metadata specific to Image Object Detection. + * @param {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} request.imageClassificationModelDeploymentMetadata + * Model deployment metadata specific to Image Classification. + * @param {string} request.name + * Required. Resource name of the model to deploy. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.deploy_model.js + * region_tag:automl_v1beta1_generated_AutoMl_DeployModel_async + */ deployModel( request?: protos.google.cloud.automl.v1beta1.IDeployModelRequest, options?: CallOptions @@ -2193,41 +2207,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Deploys a model. If a model is already deployed, deploying it with the - * same parameters has no effect. Deploying with different parametrs - * (as e.g. changing - * - * {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number|node_number}) - * will reset the deployment state without pausing the model's availability. - * - * Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage - * deployment automatically. - * - * Returns an empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} request.imageObjectDetectionModelDeploymentMetadata - * Model deployment metadata specific to Image Object Detection. - * @param {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} request.imageClassificationModelDeploymentMetadata - * Model deployment metadata specific to Image Classification. - * @param {string} request.name - * Required. Resource name of the model to deploy. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.deployModel(request); - * const [response] = await operation.promise(); - */ deployModel( request?: protos.google.cloud.automl.v1beta1.IDeployModelRequest, optionsOrCallback?: @@ -2285,11 +2264,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeployModelProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/auto_ml.deploy_model.js + * region_tag:automl_v1beta1_generated_AutoMl_DeployModel_async */ async checkDeployModelProgress( name: string @@ -2313,6 +2289,31 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata >; } + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + * Only applicable for Text Classification, Image Object Detection and Tables; + * all other domains manage deployment automatically. + * + * Returns an empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model to undeploy. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.undeploy_model.js + * region_tag:automl_v1beta1_generated_AutoMl_UndeployModel_async + */ undeployModel( request?: protos.google.cloud.automl.v1beta1.IUndeployModelRequest, options?: CallOptions @@ -2349,32 +2350,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Undeploys a model. If the model is not deployed this method has no effect. - * - * Only applicable for Text Classification, Image Object Detection and Tables; - * all other domains manage deployment automatically. - * - * Returns an empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the model to undeploy. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.undeployModel(request); - * const [response] = await operation.promise(); - */ undeployModel( request?: protos.google.cloud.automl.v1beta1.IUndeployModelRequest, optionsOrCallback?: @@ -2432,11 +2407,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUndeployModelProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/auto_ml.undeploy_model.js + * region_tag:automl_v1beta1_generated_AutoMl_UndeployModel_async */ async checkUndeployModelProgress( name: string @@ -2460,6 +2432,34 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata >; } + /** + * Exports a trained, "export-able", model to a user specified Google Cloud + * Storage location. A model is considered export-able if and only if it has + * an export format defined for it in + * + * {@link google.cloud.automl.v1beta1.ModelExportOutputConfig|ModelExportOutputConfig}. + * + * Returns an empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model to export. + * @param {google.cloud.automl.v1beta1.ModelExportOutputConfig} request.outputConfig + * Required. The desired output location and configuration. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.export_model.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportModel_async + */ exportModel( request?: protos.google.cloud.automl.v1beta1.IExportModelRequest, options?: CallOptions @@ -2496,35 +2496,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Exports a trained, "export-able", model to a user specified Google Cloud - * Storage location. A model is considered export-able if and only if it has - * an export format defined for it in - * - * {@link google.cloud.automl.v1beta1.ModelExportOutputConfig|ModelExportOutputConfig}. - * - * Returns an empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the model to export. - * @param {google.cloud.automl.v1beta1.ModelExportOutputConfig} request.outputConfig - * Required. The desired output location and configuration. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.exportModel(request); - * const [response] = await operation.promise(); - */ exportModel( request?: protos.google.cloud.automl.v1beta1.IExportModelRequest, optionsOrCallback?: @@ -2582,11 +2553,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkExportModelProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/auto_ml.export_model.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportModel_async */ async checkExportModelProgress( name: string @@ -2610,6 +2578,41 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata >; } + /** + * Exports examples on which the model was evaluated (i.e. which were in the + * TEST set of the dataset the model was created from), together with their + * ground truth annotations and the annotations created (predicted) by the + * model. + * The examples, ground truth and predictions are exported in the state + * they were at the moment the model was evaluated. + * + * This export is available only for 30 days since the model evaluation is + * created. + * + * Currently only available for Tables. + * + * Returns an empty response in the + * {@link google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model whose evaluated examples are to + * be exported. + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} request.outputConfig + * Required. The desired output location and configuration. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/auto_ml.export_evaluated_examples.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async + */ exportEvaluatedExamples( request?: protos.google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, options?: CallOptions @@ -2646,42 +2649,6 @@ export class AutoMlClient { {} | null | undefined > ): void; - /** - * Exports examples on which the model was evaluated (i.e. which were in the - * TEST set of the dataset the model was created from), together with their - * ground truth annotations and the annotations created (predicted) by the - * model. - * The examples, ground truth and predictions are exported in the state - * they were at the moment the model was evaluated. - * - * This export is available only for 30 days since the model evaluation is - * created. - * - * Currently only available for Tables. - * - * Returns an empty response in the - * {@link google.longrunning.Operation.response|response} field when it completes. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the model whose evaluated examples are to - * be exported. - * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} request.outputConfig - * Required. The desired output location and configuration. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.exportEvaluatedExamples(request); - * const [response] = await operation.promise(); - */ exportEvaluatedExamples( request?: protos.google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, optionsOrCallback?: @@ -2743,11 +2710,8 @@ export class AutoMlClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkExportEvaluatedExamplesProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/auto_ml.export_evaluated_examples.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async */ async checkExportEvaluatedExamplesProgress( name: string @@ -2771,37 +2735,6 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata >; } - listDatasets( - request?: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.automl.v1beta1.IDataset[], - protos.google.cloud.automl.v1beta1.IListDatasetsRequest | null, - protos.google.cloud.automl.v1beta1.IListDatasetsResponse - ] - >; - listDatasets( - request: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.automl.v1beta1.IListDatasetsRequest, - | protos.google.cloud.automl.v1beta1.IListDatasetsResponse - | null - | undefined, - protos.google.cloud.automl.v1beta1.IDataset - > - ): void; - listDatasets( - request: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, - callback: PaginationCallback< - protos.google.cloud.automl.v1beta1.IListDatasetsRequest, - | protos.google.cloud.automl.v1beta1.IListDatasetsResponse - | null - | undefined, - protos.google.cloud.automl.v1beta1.IDataset - > - ): void; /** * Lists datasets in a project. * @@ -2838,6 +2771,37 @@ export class AutoMlClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listDatasets( + request?: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset[], + protos.google.cloud.automl.v1beta1.IListDatasetsRequest | null, + protos.google.cloud.automl.v1beta1.IListDatasetsResponse + ] + >; + listDatasets( + request: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + | protos.google.cloud.automl.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IDataset + > + ): void; + listDatasets( + request: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + | protos.google.cloud.automl.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IDataset + > + ): void; listDatasets( request?: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, optionsOrCallback?: @@ -2928,7 +2892,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listDatasets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listDatasets.createStream( this.innerApiCalls.listDatasets as gax.GaxCall, @@ -2971,11 +2936,8 @@ export class AutoMlClient { * 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.listDatasetsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/auto_ml.list_datasets.js + * region_tag:automl_v1beta1_generated_AutoMl_ListDatasets_async */ listDatasetsAsync( request?: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, @@ -2989,8 +2951,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listDatasets']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listDatasets.asyncIterate( this.innerApiCalls['listDatasets'] as GaxCall, @@ -2998,37 +2960,6 @@ export class AutoMlClient { callSettings ) as AsyncIterable; } - listTableSpecs( - request?: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.automl.v1beta1.ITableSpec[], - protos.google.cloud.automl.v1beta1.IListTableSpecsRequest | null, - protos.google.cloud.automl.v1beta1.IListTableSpecsResponse - ] - >; - listTableSpecs( - request: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, - | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse - | null - | undefined, - protos.google.cloud.automl.v1beta1.ITableSpec - > - ): void; - listTableSpecs( - request: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, - callback: PaginationCallback< - protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, - | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse - | null - | undefined, - protos.google.cloud.automl.v1beta1.ITableSpec - > - ): void; /** * Lists table specs in a dataset. * @@ -3061,6 +2992,37 @@ export class AutoMlClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listTableSpecs( + request?: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec[], + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest | null, + protos.google.cloud.automl.v1beta1.IListTableSpecsResponse + ] + >; + listTableSpecs( + request: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.ITableSpec + > + ): void; + listTableSpecs( + request: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.ITableSpec + > + ): void; listTableSpecs( request?: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, optionsOrCallback?: @@ -3147,7 +3109,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTableSpecs']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTableSpecs.createStream( this.innerApiCalls.listTableSpecs as gax.GaxCall, @@ -3186,11 +3149,8 @@ export class AutoMlClient { * 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.listTableSpecsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/auto_ml.list_table_specs.js + * region_tag:automl_v1beta1_generated_AutoMl_ListTableSpecs_async */ listTableSpecsAsync( request?: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, @@ -3204,8 +3164,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listTableSpecs']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listTableSpecs.asyncIterate( this.innerApiCalls['listTableSpecs'] as GaxCall, @@ -3213,37 +3173,6 @@ export class AutoMlClient { callSettings ) as AsyncIterable; } - listColumnSpecs( - request?: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.automl.v1beta1.IColumnSpec[], - protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest | null, - protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse - ] - >; - listColumnSpecs( - request: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, - | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse - | null - | undefined, - protos.google.cloud.automl.v1beta1.IColumnSpec - > - ): void; - listColumnSpecs( - request: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, - callback: PaginationCallback< - protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, - | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse - | null - | undefined, - protos.google.cloud.automl.v1beta1.IColumnSpec - > - ): void; /** * Lists column specs in a table spec. * @@ -3276,6 +3205,37 @@ export class AutoMlClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listColumnSpecs( + request?: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec[], + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest | null, + protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse + ] + >; + listColumnSpecs( + request: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IColumnSpec + > + ): void; + listColumnSpecs( + request: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IColumnSpec + > + ): void; listColumnSpecs( request?: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, optionsOrCallback?: @@ -3362,7 +3322,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listColumnSpecs']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listColumnSpecs.createStream( this.innerApiCalls.listColumnSpecs as gax.GaxCall, @@ -3401,11 +3362,8 @@ export class AutoMlClient { * 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.listColumnSpecsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/auto_ml.list_column_specs.js + * region_tag:automl_v1beta1_generated_AutoMl_ListColumnSpecs_async */ listColumnSpecsAsync( request?: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, @@ -3419,8 +3377,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listColumnSpecs']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listColumnSpecs.asyncIterate( this.innerApiCalls['listColumnSpecs'] as GaxCall, @@ -3428,33 +3386,6 @@ export class AutoMlClient { callSettings ) as AsyncIterable; } - listModels( - request?: protos.google.cloud.automl.v1beta1.IListModelsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.automl.v1beta1.IModel[], - protos.google.cloud.automl.v1beta1.IListModelsRequest | null, - protos.google.cloud.automl.v1beta1.IListModelsResponse - ] - >; - listModels( - request: protos.google.cloud.automl.v1beta1.IListModelsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.automl.v1beta1.IListModelsRequest, - protos.google.cloud.automl.v1beta1.IListModelsResponse | null | undefined, - protos.google.cloud.automl.v1beta1.IModel - > - ): void; - listModels( - request: protos.google.cloud.automl.v1beta1.IListModelsRequest, - callback: PaginationCallback< - protos.google.cloud.automl.v1beta1.IListModelsRequest, - protos.google.cloud.automl.v1beta1.IListModelsResponse | null | undefined, - protos.google.cloud.automl.v1beta1.IModel - > - ): void; /** * Lists models. * @@ -3492,6 +3423,33 @@ export class AutoMlClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listModels( + request?: protos.google.cloud.automl.v1beta1.IListModelsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModel[], + protos.google.cloud.automl.v1beta1.IListModelsRequest | null, + protos.google.cloud.automl.v1beta1.IListModelsResponse + ] + >; + listModels( + request: protos.google.cloud.automl.v1beta1.IListModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelsRequest, + protos.google.cloud.automl.v1beta1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1beta1.IModel + > + ): void; + listModels( + request: protos.google.cloud.automl.v1beta1.IListModelsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelsRequest, + protos.google.cloud.automl.v1beta1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1beta1.IModel + > + ): void; listModels( request?: protos.google.cloud.automl.v1beta1.IListModelsRequest, optionsOrCallback?: @@ -3581,7 +3539,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listModels.createStream( this.innerApiCalls.listModels as gax.GaxCall, @@ -3625,11 +3584,8 @@ export class AutoMlClient { * 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.listModelsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/auto_ml.list_models.js + * region_tag:automl_v1beta1_generated_AutoMl_ListModels_async */ listModelsAsync( request?: protos.google.cloud.automl.v1beta1.IListModelsRequest, @@ -3643,8 +3599,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listModels.asyncIterate( this.innerApiCalls['listModels'] as GaxCall, @@ -3652,37 +3608,6 @@ export class AutoMlClient { callSettings ) as AsyncIterable; } - listModelEvaluations( - request?: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.automl.v1beta1.IModelEvaluation[], - protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest | null, - protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse - ] - >; - listModelEvaluations( - request: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, - | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse - | null - | undefined, - protos.google.cloud.automl.v1beta1.IModelEvaluation - > - ): void; - listModelEvaluations( - request: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, - callback: PaginationCallback< - protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, - | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse - | null - | undefined, - protos.google.cloud.automl.v1beta1.IModelEvaluation - > - ): void; /** * Lists model evaluations. * @@ -3724,6 +3649,37 @@ export class AutoMlClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listModelEvaluations( + request?: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModelEvaluation[], + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest | null, + protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse + ] + >; + listModelEvaluations( + request: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModelEvaluation + > + ): void; + listModelEvaluations( + request: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModelEvaluation + > + ): void; listModelEvaluations( request?: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, optionsOrCallback?: @@ -3819,7 +3775,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listModelEvaluations.createStream( this.innerApiCalls.listModelEvaluations as gax.GaxCall, @@ -3867,11 +3824,8 @@ export class AutoMlClient { * 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.listModelEvaluationsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/auto_ml.list_model_evaluations.js + * region_tag:automl_v1beta1_generated_AutoMl_ListModelEvaluations_async */ listModelEvaluationsAsync( request?: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, @@ -3885,8 +3839,8 @@ export class AutoMlClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listModelEvaluations.asyncIterate( this.innerApiCalls['listModelEvaluations'] as GaxCall, diff --git a/src/v1beta1/prediction_service_client.ts b/src/v1beta1/prediction_service_client.ts index b6437b4c..a274a245 100644 --- a/src/v1beta1/prediction_service_client.ts +++ b/src/v1beta1/prediction_service_client.ts @@ -343,33 +343,6 @@ export class PredictionServiceClient { // ------------------- // -- Service calls -- // ------------------- - predict( - request?: protos.google.cloud.automl.v1beta1.IPredictRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.automl.v1beta1.IPredictResponse, - protos.google.cloud.automl.v1beta1.IPredictRequest | undefined, - {} | undefined - ] - >; - predict( - request: protos.google.cloud.automl.v1beta1.IPredictRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.automl.v1beta1.IPredictResponse, - protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, - {} | null | undefined - > - ): void; - predict( - request: protos.google.cloud.automl.v1beta1.IPredictRequest, - callback: Callback< - protos.google.cloud.automl.v1beta1.IPredictResponse, - protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Perform an online prediction. The prediction result will be directly * returned in the response. @@ -426,9 +399,36 @@ export class PredictionServiceClient { * 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.predict(request); + * @example include:samples/generated/v1beta1/prediction_service.predict.js + * region_tag:automl_v1beta1_generated_PredictionService_Predict_async */ + predict( + request?: protos.google.cloud.automl.v1beta1.IPredictRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | undefined, + {} | undefined + ] + >; + predict( + request: protos.google.cloud.automl.v1beta1.IPredictRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): void; + predict( + request: protos.google.cloud.automl.v1beta1.IPredictRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): void; predict( request?: protos.google.cloud.automl.v1beta1.IPredictRequest, optionsOrCallback?: @@ -469,42 +469,6 @@ export class PredictionServiceClient { return this.innerApiCalls.predict(request, options, callback); } - batchPredict( - request?: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.automl.v1beta1.IBatchPredictResult, - protos.google.cloud.automl.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchPredict( - request: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.automl.v1beta1.IBatchPredictResult, - protos.google.cloud.automl.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchPredict( - request: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, - callback: Callback< - LROperation< - protos.google.cloud.automl.v1beta1.IBatchPredictResult, - protos.google.cloud.automl.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Perform a batch prediction. Unlike the online {@link google.cloud.automl.v1beta1.PredictionService.Predict|Predict}, batch * prediction result won't be immediately available in the response. Instead, @@ -608,10 +572,45 @@ export class PredictionServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchPredict(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v1beta1/prediction_service.batch_predict.js + * region_tag:automl_v1beta1_generated_PredictionService_BatchPredict_async */ + batchPredict( + request?: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchPredict( + request: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchPredict( + request: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchPredict( request?: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, optionsOrCallback?: @@ -669,11 +668,8 @@ export class PredictionServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchPredictProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/prediction_service.batch_predict.js + * region_tag:automl_v1beta1_generated_PredictionService_BatchPredict_async */ async checkBatchPredictProgress( name: string