Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
docs(samples): add example tags to generated samples (#563)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 408439482

Source-Link: googleapis/googleapis@b9f6184

Source-Link: googleapis/googleapis-gen@eb888bc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9
  • Loading branch information
gcf-owl-bot[bot] committed Nov 10, 2021
1 parent eb8927f commit cd14cf1
Show file tree
Hide file tree
Showing 52 changed files with 4,142 additions and 1,323 deletions.
2 changes: 1 addition & 1 deletion linkinator.config.json
Expand Up @@ -6,5 +6,5 @@
"img.shields.io"
],
"silent": true,
"concurrency": 10
"concurrency": 5
}
58 changes: 58 additions & 0 deletions 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));
58 changes: 58 additions & 0 deletions 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));
53 changes: 53 additions & 0 deletions 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));
53 changes: 53 additions & 0 deletions 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));
61 changes: 61 additions & 0 deletions 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));
58 changes: 58 additions & 0 deletions 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));

0 comments on commit cd14cf1

Please sign in to comment.