Skip to content

Commit

Permalink
docs(samples): add example tags to generated samples (#116)
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] authored Nov 10, 2021
1 parent 88c6d1f commit b04ce47
Show file tree
Hide file tree
Showing 87 changed files with 2,980 additions and 3,120 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-retail/linkinator.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"img.shields.io"
],
"silent": true,
"concurrency": 10
"concurrency": 5
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function main() {
// Instantiates a client
const retailClient = new CatalogServiceClient();

async function getDefaultBranch() {
async function callGetDefaultBranch() {
// Construct request
const request = {};

Expand All @@ -40,7 +40,7 @@ function main() {
console.log(response);
}

getDefaultBranch();
callGetDefaultBranch();
// [END retail_v2_generated_CatalogService_GetDefaultBranch_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ function main(parent) {
/**
* Required. The account resource name with an associated location.
* If the caller does not have permission to list
* [Catalog][google.cloud.retail.v2.Catalog]s under this location, regardless
* Catalog google.cloud.retail.v2.Catalog s under this location, regardless
* of whether or not this location exists, a PERMISSION_DENIED error is
* returned.
*/
// const parent = 'abc123'
/**
* Maximum number of [Catalog][google.cloud.retail.v2.Catalog]s to return. If
* Maximum number of Catalog google.cloud.retail.v2.Catalog s to return. If
* unspecified, defaults to 50. The maximum allowed value is 1000. Values
* above 1000 will be coerced to 1000.
* If this field is negative, an INVALID_ARGUMENT is returned.
*/
// const pageSize = 1234
/**
* A page token
* [ListCatalogsResponse.next_page_token][google.cloud.retail.v2.ListCatalogsResponse.next_page_token],
* ListCatalogsResponse.next_page_token google.cloud.retail.v2.ListCatalogsResponse.next_page_token,
* received from a previous
* [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs]
* CatalogService.ListCatalogs google.cloud.retail.v2.CatalogService.ListCatalogs
* call. Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to
* [CatalogService.ListCatalogs][google.cloud.retail.v2.CatalogService.ListCatalogs]
* CatalogService.ListCatalogs google.cloud.retail.v2.CatalogService.ListCatalogs
* must match the call that provided the page token. Otherwise, an
* INVALID_ARGUMENT error is returned.
*/
Expand All @@ -53,7 +53,7 @@ function main(parent) {
// Instantiates a client
const retailClient = new CatalogServiceClient();

async function listCatalogs() {
async function callListCatalogs() {
// Construct request
const request = {
parent,
Expand All @@ -66,7 +66,7 @@ function main(parent) {
}
}

listCatalogs();
callListCatalogs();
// [END retail_v2_generated_CatalogService_ListCatalogs_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function main() {
// const branchId = 'abc123'
/**
* Some note on this request, this can be retrieved by
* [CatalogService.GetDefaultBranch][google.cloud.retail.v2.CatalogService.GetDefaultBranch]
* CatalogService.GetDefaultBranch google.cloud.retail.v2.CatalogService.GetDefaultBranch
* before next valid default branch set occurs.
* This field must be a UTF-8 encoded string with a length limit of 1,000
* characters. Otherwise, an INVALID_ARGUMENT error is returned.
Expand All @@ -45,7 +45,7 @@ function main() {
// Instantiates a client
const retailClient = new CatalogServiceClient();

async function setDefaultBranch() {
async function callSetDefaultBranch() {
// Construct request
const request = {};

Expand All @@ -54,7 +54,7 @@ function main() {
console.log(response);
}

setDefaultBranch();
callSetDefaultBranch();
// [END retail_v2_generated_CatalogService_SetDefaultBranch_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,29 @@ function main(catalog) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The [Catalog][google.cloud.retail.v2.Catalog] to update.
* Required. The Catalog google.cloud.retail.v2.Catalog to update.
* If the caller does not have permission to update the
* [Catalog][google.cloud.retail.v2.Catalog], regardless of whether or not it
* Catalog google.cloud.retail.v2.Catalog, regardless of whether or not it
* exists, a PERMISSION_DENIED error is returned.
* If the [Catalog][google.cloud.retail.v2.Catalog] to update does not exist,
* If the Catalog google.cloud.retail.v2.Catalog to update does not exist,
* a NOT_FOUND error is returned.
*/
// const catalog = ''
// const catalog = {}
/**
* Indicates which fields in the provided
* [Catalog][google.cloud.retail.v2.Catalog] to update.
* Catalog google.cloud.retail.v2.Catalog to update.
* If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
* is returned.
*/
// const updateMask = ''
// const updateMask = {}

// Imports the Retail library
const {CatalogServiceClient} = require('@google-cloud/retail').v2;

// Instantiates a client
const retailClient = new CatalogServiceClient();

async function updateCatalog() {
async function callUpdateCatalog() {
// Construct request
const request = {
catalog,
Expand All @@ -53,7 +53,7 @@ function main(catalog) {
console.log(response);
}

updateCatalog();
callUpdateCatalog();
// [END retail_v2_generated_CatalogService_UpdateCatalog_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function main(catalog, query) {
* The list of languages of the query. This is
* the BCP-47 language code, such as "en-US" or "sr-Latn".
* For more information, see
* [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47).
* Tags for Identifying Languages (https://tools.ietf.org/html/bcp47).
* The maximum number of allowed characters is 255.
* Only "en-US" is currently supported.
*/
Expand All @@ -63,7 +63,7 @@ function main(catalog, query) {
/**
* Determines which dataset to use for fetching completion. "user-data" will
* use the imported dataset through
* [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
* CompletionService.ImportCompletionData google.cloud.retail.v2.CompletionService.ImportCompletionData.
* "cloud-retail" will use the dataset generated by cloud retail based on user
* events. If leave empty, it will use the "user-data".
* Current supported values:
Expand All @@ -75,7 +75,7 @@ function main(catalog, query) {
// const dataset = 'abc123'
/**
* Completion max suggestions. If left unset or set to 0, then will fallback
* to the configured value [CompletionConfig.max_suggestions][].
* to the configured value CompletionConfig.max_suggestions .
* The maximum allowed max suggestions is 20. If it is set higher, it will be
* capped by 20.
*/
Expand All @@ -87,7 +87,7 @@ function main(catalog, query) {
// Instantiates a client
const retailClient = new CompletionServiceClient();

async function completeQuery() {
async function callCompleteQuery() {
// Construct request
const request = {
catalog,
Expand All @@ -99,7 +99,7 @@ function main(catalog, query) {
console.log(response);
}

completeQuery();
callCompleteQuery();
// [END retail_v2_generated_CompletionService_CompleteQuery_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ function main(parent, inputConfig) {
/**
* Required. The desired input location of the data.
*/
// const inputConfig = ''
// const inputConfig = {}
/**
* Pub/Sub topic for receiving notification. If this field is set,
* when the import is finished, a notification will be sent to
* specified Pub/Sub topic. The message data will be JSON string of a
* [Operation][google.longrunning.Operation].
* Operation google.longrunning.Operation.
* Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
*/
// const notificationPubsubTopic = 'abc123'
Expand All @@ -43,7 +43,7 @@ function main(parent, inputConfig) {
// Instantiates a client
const retailClient = new CompletionServiceClient();

async function importCompletionData() {
async function callImportCompletionData() {
// Construct request
const request = {
parent,
Expand All @@ -56,7 +56,7 @@ function main(parent, inputConfig) {
console.log(response);
}

importCompletionData();
callImportCompletionData();
// [END retail_v2_generated_CompletionService_ImportCompletionData_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function main(placement, userEvent) {
* {name=projects/* /locations/global/catalogs/default_catalog/placements/*}
* The ID of the Recommendations AI placement. Before you can request
* predictions from your model, you must create at least one placement for it.
* For more information, see [Managing
* placements](https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
* For more information, see Managing
* placements (https://cloud.google.com/retail/recommendations-ai/docs/manage-placements).
* The full list of available placements can be seen at
* https://console.cloud.google.com/recommendation/catalogs/default_catalog/placements
*/
Expand All @@ -36,7 +36,7 @@ function main(placement, userEvent) {
* won't be ingested to userEvent logs. Thus, a separate userEvent write
* request is required for event logging.
*/
// const userEvent = ''
// const userEvent = {}
/**
* Maximum number of results to return per page. Set this property
* to the number of prediction results needed. If zero, the service will
Expand Down Expand Up @@ -117,8 +117,8 @@ function main(placement, userEvent) {
* * The key portion of a label must be unique. However, you can use the same
* key with multiple resources.
* * Keys must start with a lowercase letter or international character.
* See [Google Cloud
* Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
* See Google Cloud
* Document (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
* for more details.
*/
// const labels = 1234
Expand All @@ -129,7 +129,7 @@ function main(placement, userEvent) {
// Instantiates a client
const retailClient = new PredictionServiceClient();

async function predict() {
async function callPredict() {
// Construct request
const request = {
placement,
Expand All @@ -141,7 +141,7 @@ function main(placement, userEvent) {
console.log(response);
}

predict();
callPredict();
// [END retail_v2_generated_PredictionService_Predict_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ function main(product, type, placeIds) {
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Full resource name of [Product][google.cloud.retail.v2.Product],
* Required. Full resource name of Product google.cloud.retail.v2.Product,
* such as
* `projects/* /locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.
* If the caller does not have permission to access the
* [Product][google.cloud.retail.v2.Product], regardless of whether or not it
* Product google.cloud.retail.v2.Product, regardless of whether or not it
* exists, a PERMISSION_DENIED error is returned.
*/
// const product = 'abc123'
Expand All @@ -43,22 +43,22 @@ function main(product, type, placeIds) {
* * "custom-type-5"
* If this field is set to an invalid value other than these, an
* INVALID_ARGUMENT error is returned.
* This field directly corresponds to [Product.fulfillment_info.type][].
* This field directly corresponds to Product.fulfillment_info.type .
*/
// const type = 'abc123'
/**
* Required. The IDs for this
* [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type], such as
* type google.cloud.retail.v2.AddFulfillmentPlacesRequest.type, such as
* the store IDs for "pickup-in-store" or the region IDs for
* "same-day-delivery" to be added for this
* [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type]. Duplicate
* type google.cloud.retail.v2.AddFulfillmentPlacesRequest.type. Duplicate
* IDs will be automatically ignored.
* At least 1 value is required, and a maximum of 2000 values are allowed.
* Each value must be a string with a length limit of 10 characters, matching
* the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
* INVALID_ARGUMENT error is returned.
* If the total number of place IDs exceeds 2000 for this
* [type][google.cloud.retail.v2.AddFulfillmentPlacesRequest.type] after
* type google.cloud.retail.v2.AddFulfillmentPlacesRequest.type after
* adding, then the update will be rejected.
*/
// const placeIds = 'abc123'
Expand All @@ -67,14 +67,14 @@ function main(product, type, placeIds) {
* out-of-order updates on fulfillment information. If not provided, the
* internal system time will be used.
*/
// const addTime = ''
// const addTime = {}
/**
* If set to true, and the [Product][google.cloud.retail.v2.Product] is not
* If set to true, and the Product google.cloud.retail.v2.Product is not
* found, the fulfillment information will still be processed and retained for
* at most 1 day and processed once the
* [Product][google.cloud.retail.v2.Product] is created. If set to false, a
* Product google.cloud.retail.v2.Product is created. If set to false, a
* NOT_FOUND error is returned if the
* [Product][google.cloud.retail.v2.Product] is not found.
* Product google.cloud.retail.v2.Product is not found.
*/
// const allowMissing = true

Expand All @@ -84,7 +84,7 @@ function main(product, type, placeIds) {
// Instantiates a client
const retailClient = new ProductServiceClient();

async function addFulfillmentPlaces() {
async function callAddFulfillmentPlaces() {
// Construct request
const request = {
product,
Expand All @@ -98,7 +98,7 @@ function main(product, type, placeIds) {
console.log(response);
}

addFulfillmentPlaces();
callAddFulfillmentPlaces();
// [END retail_v2_generated_ProductService_AddFulfillmentPlaces_async]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ function main(parent, product, productId) {
*/
// const parent = 'abc123'
/**
* Required. The [Product][google.cloud.retail.v2.Product] to create.
* Required. The Product google.cloud.retail.v2.Product to create.
*/
// const product = ''
// const product = {}
/**
* Required. The ID to use for the [Product][google.cloud.retail.v2.Product],
* Required. The ID to use for the Product google.cloud.retail.v2.Product,
* which will become the final component of the
* [Product.name][google.cloud.retail.v2.Product.name].
* Product.name google.cloud.retail.v2.Product.name.
* If the caller does not have permission to create the
* [Product][google.cloud.retail.v2.Product], regardless of whether or not it
* Product google.cloud.retail.v2.Product, regardless of whether or not it
* exists, a PERMISSION_DENIED error is returned.
* This field must be unique among all
* [Product][google.cloud.retail.v2.Product]s with the same
* [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an
* Product google.cloud.retail.v2.Product s with the same
* parent google.cloud.retail.v2.CreateProductRequest.parent. Otherwise, an
* ALREADY_EXISTS error is returned.
* This field must be a UTF-8 encoded string with a length limit of 128
* characters. Otherwise, an INVALID_ARGUMENT error is returned.
Expand All @@ -50,7 +50,7 @@ function main(parent, product, productId) {
// Instantiates a client
const retailClient = new ProductServiceClient();

async function createProduct() {
async function callCreateProduct() {
// Construct request
const request = {
parent,
Expand All @@ -63,7 +63,7 @@ function main(parent, product, productId) {
console.log(response);
}

createProduct();
callCreateProduct();
// [END retail_v2_generated_ProductService_CreateProduct_async]
}

Expand Down
Loading

0 comments on commit b04ce47

Please sign in to comment.