-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(samples): add auto-generated samples for Node with api short nam…
…e in region tag (#43) * docs(samples): add auto-generated samples for Node with api short name in region tag PiperOrigin-RevId: 399287285 Source-Link: googleapis/googleapis@1575986 Source-Link: googleapis/googleapis-gen@b27fff6 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI3ZmZmNjIzYTVkOGQ1ODZiNzAzYjVlNDkxOTg1NmFiZTdjMmViMyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
e03944c
commit 9d2ed6b
Showing
4 changed files
with
233 additions
and
6 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
.../google-cloud-privatecatalog/samples/generated/v1beta1/private_catalog.search_catalogs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// 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(resource) { | ||
// [START cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The name of the resource context. It can be in following formats: | ||
* * `projects/{project}` | ||
* * `folders/{folder}` | ||
* * `organizations/{organization}` | ||
*/ | ||
// const resource = 'abc123' | ||
/** | ||
* The query to filter the catalogs. The supported queries are: | ||
* * Get a single catalog: `name=catalogs/{catalog}` | ||
*/ | ||
// const query = 'abc123' | ||
/** | ||
* The maximum number of entries that are requested. | ||
*/ | ||
// const pageSize = 1234 | ||
/** | ||
* A pagination token returned from a previous call to SearchCatalogs that | ||
* indicates where this listing should continue from. | ||
*/ | ||
// const pageToken = 'abc123' | ||
|
||
// Imports the Privatecatalog library | ||
const {PrivateCatalogClient} = | ||
require('@google-cloud/private-catalog').v1beta1; | ||
|
||
// Instantiates a client | ||
const privatecatalogClient = new PrivateCatalogClient(); | ||
|
||
async function searchCatalogs() { | ||
// Construct request | ||
const request = { | ||
resource, | ||
}; | ||
|
||
// Run request | ||
const iterable = await privatecatalogClient.searchCatalogsAsync(request); | ||
for await (const response of iterable) { | ||
console.log(response); | ||
} | ||
} | ||
|
||
searchCatalogs(); | ||
// [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
74 changes: 74 additions & 0 deletions
74
.../google-cloud-privatecatalog/samples/generated/v1beta1/private_catalog.search_products.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(resource) { | ||
// [START cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] | ||
* for details. | ||
*/ | ||
// const resource = 'abc123' | ||
/** | ||
* The query to filter the products. | ||
* The supported queries are: | ||
* * List products of all catalogs: empty | ||
* * List products under a catalog: `parent=catalogs/{catalog}` | ||
* * Get a product by name: | ||
* `name=catalogs/{catalog}/products/{product}` | ||
*/ | ||
// const query = 'abc123' | ||
/** | ||
* The maximum number of entries that are requested. | ||
*/ | ||
// const pageSize = 1234 | ||
/** | ||
* A pagination token returned from a previous call to SearchProducts that | ||
* indicates where this listing should continue from. | ||
*/ | ||
// const pageToken = 'abc123' | ||
|
||
// Imports the Privatecatalog library | ||
const {PrivateCatalogClient} = | ||
require('@google-cloud/private-catalog').v1beta1; | ||
|
||
// Instantiates a client | ||
const privatecatalogClient = new PrivateCatalogClient(); | ||
|
||
async function searchProducts() { | ||
// Construct request | ||
const request = { | ||
resource, | ||
}; | ||
|
||
// Run request | ||
const iterable = await privatecatalogClient.searchProductsAsync(request); | ||
for await (const response of iterable) { | ||
console.log(response); | ||
} | ||
} | ||
|
||
searchProducts(); | ||
// [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
75 changes: 75 additions & 0 deletions
75
.../google-cloud-privatecatalog/samples/generated/v1beta1/private_catalog.search_versions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(resource, query) { | ||
// [START cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_async] | ||
/** | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The name of the resource context. See [SearchCatalogsRequest.resource][google.cloud.privatecatalog.v1beta1.SearchCatalogsRequest.resource] | ||
* for details. | ||
*/ | ||
// const resource = 'abc123' | ||
/** | ||
* Required. The query to filter the versions. | ||
* The supported queries are: | ||
* * List versions under a product: | ||
* `parent=catalogs/{catalog}/products/{product}` | ||
* * Get a version by name: | ||
* `name=catalogs/{catalog}/products/{product}/versions/{version}` | ||
*/ | ||
// const query = 'abc123' | ||
/** | ||
* The maximum number of entries that are requested. | ||
*/ | ||
// const pageSize = 1234 | ||
/** | ||
* A pagination token returned from a previous call to SearchVersions | ||
* that indicates where this listing should continue from. | ||
*/ | ||
// const pageToken = 'abc123' | ||
|
||
// Imports the Privatecatalog library | ||
const {PrivateCatalogClient} = | ||
require('@google-cloud/private-catalog').v1beta1; | ||
|
||
// Instantiates a client | ||
const privatecatalogClient = new PrivateCatalogClient(); | ||
|
||
async function searchVersions() { | ||
// Construct request | ||
const request = { | ||
resource, | ||
query, | ||
}; | ||
|
||
// Run request | ||
const iterable = await privatecatalogClient.searchVersionsAsync(request); | ||
for await (const response of iterable) { | ||
console.log(response); | ||
} | ||
} | ||
|
||
searchVersions(); | ||
// [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters