@google-cloud/retail
v3.6.0
Published
Retail client for Node.js
Downloads
21,972
Readme
Retail API: Node.js Client
Retail client for Node.js
A comprehensive list of changes in each version may be found in the CHANGELOG.
- [Retail API Node.js Client API Reference][client-docs]
- [Retail API Documentation][product-docs]
- github.com/googleapis/google-cloud-node/packages/google-cloud-retail
Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.
Table of contents:
Quickstart
Before you begin
- [Select or create a Cloud Platform project][projects].
- [Enable billing for your project][billing].
- [Enable the Retail API API][enable_api].
- [Set up authentication][auth] so you can access the API from your local workstation.
Installing the client library
npm install @google-cloud/retail
Using the client library
// Imports the Google Cloud client library
const {CatalogServiceClient} = require('@google-cloud/retail');
// TODO(developer): uncomment these variables with your information
// const projectId = 'my-project'
// const location = 'global'
// Creates a client
const client = new CatalogServiceClient();
async function listCatalogs() {
const catalogs = await client.listCatalogs({
parent: `projects/${projectId}/locations/${location}`,
});
console.info(catalogs);
}
listCatalogs();
Samples
Samples are in the samples/
directory. Each sample's README.md
has instructions for running its sample.
| Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | | Analytics_service.export_analytics_metrics | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.add_catalog_attribute | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.get_attributes_config | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.get_completion_config | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.get_default_branch | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.list_catalogs | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.remove_catalog_attribute | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.replace_catalog_attribute | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.set_default_branch | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.update_attributes_config | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.update_catalog | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.update_completion_config | source code | ![Open in Cloud Shell][shell_img] | | Completion_service.complete_query | source code | ![Open in Cloud Shell][shell_img] | | Completion_service.import_completion_data | source code | ![Open in Cloud Shell][shell_img] | | Control_service.create_control | source code | ![Open in Cloud Shell][shell_img] | | Control_service.delete_control | source code | ![Open in Cloud Shell][shell_img] | | Control_service.get_control | source code | ![Open in Cloud Shell][shell_img] | | Control_service.list_controls | source code | ![Open in Cloud Shell][shell_img] | | Control_service.update_control | source code | ![Open in Cloud Shell][shell_img] | | Generative_question_service.batch_update_generative_question_configs | source code | ![Open in Cloud Shell][shell_img] | | Generative_question_service.get_generative_questions_feature_config | source code | ![Open in Cloud Shell][shell_img] | | Generative_question_service.list_generative_question_configs | source code | ![Open in Cloud Shell][shell_img] | | Generative_question_service.update_generative_question_config | source code | ![Open in Cloud Shell][shell_img] | | Generative_question_service.update_generative_questions_feature_config | source code | ![Open in Cloud Shell][shell_img] | | Model_service.create_model | source code | ![Open in Cloud Shell][shell_img] | | Model_service.delete_model | source code | ![Open in Cloud Shell][shell_img] | | Model_service.get_model | source code | ![Open in Cloud Shell][shell_img] | | Model_service.list_models | source code | ![Open in Cloud Shell][shell_img] | | Model_service.pause_model | source code | ![Open in Cloud Shell][shell_img] | | Model_service.resume_model | source code | ![Open in Cloud Shell][shell_img] | | Model_service.tune_model | source code | ![Open in Cloud Shell][shell_img] | | Model_service.update_model | source code | ![Open in Cloud Shell][shell_img] | | Prediction_service.predict | source code | ![Open in Cloud Shell][shell_img] | | Product_service.add_fulfillment_places | source code | ![Open in Cloud Shell][shell_img] | | Product_service.add_local_inventories | source code | ![Open in Cloud Shell][shell_img] | | Product_service.create_product | source code | ![Open in Cloud Shell][shell_img] | | Product_service.delete_product | source code | ![Open in Cloud Shell][shell_img] | | Product_service.get_product | source code | ![Open in Cloud Shell][shell_img] | | Product_service.import_products | source code | ![Open in Cloud Shell][shell_img] | | Product_service.list_products | source code | ![Open in Cloud Shell][shell_img] | | Product_service.purge_products | source code | ![Open in Cloud Shell][shell_img] | | Product_service.remove_fulfillment_places | source code | ![Open in Cloud Shell][shell_img] | | Product_service.remove_local_inventories | source code | ![Open in Cloud Shell][shell_img] | | Product_service.set_inventory | source code | ![Open in Cloud Shell][shell_img] | | Product_service.update_product | source code | ![Open in Cloud Shell][shell_img] | | Search_service.search | source code | ![Open in Cloud Shell][shell_img] | | Serving_config_service.add_control | source code | ![Open in Cloud Shell][shell_img] | | Serving_config_service.create_serving_config | source code | ![Open in Cloud Shell][shell_img] | | Serving_config_service.delete_serving_config | source code | ![Open in Cloud Shell][shell_img] | | Serving_config_service.get_serving_config | source code | ![Open in Cloud Shell][shell_img] | | Serving_config_service.list_serving_configs | source code | ![Open in Cloud Shell][shell_img] | | Serving_config_service.remove_control | source code | ![Open in Cloud Shell][shell_img] | | Serving_config_service.update_serving_config | source code | ![Open in Cloud Shell][shell_img] | | User_event_service.collect_user_event | source code | ![Open in Cloud Shell][shell_img] | | User_event_service.import_user_events | source code | ![Open in Cloud Shell][shell_img] | | User_event_service.purge_user_events | source code | ![Open in Cloud Shell][shell_img] | | User_event_service.rejoin_user_events | source code | ![Open in Cloud Shell][shell_img] | | User_event_service.write_user_event | source code | ![Open in Cloud Shell][shell_img] | | Analytics_service.export_analytics_metrics | source code | ![Open in Cloud Shell][shell_img] | | Branch_service.get_branch | source code | ![Open in Cloud Shell][shell_img] | | Branch_service.list_branches | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.add_catalog_attribute | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.batch_remove_catalog_attributes | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.get_attributes_config | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.get_completion_config | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.get_default_branch | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.list_catalogs | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.remove_catalog_attribute | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.replace_catalog_attribute | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.set_default_branch | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.update_attributes_config | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.update_catalog | source code | ![Open in Cloud Shell][shell_img] | | Catalog_service.update_completion_config | source code | ![Open in Cloud Shell][shell_img] | | Completion_service.complete_query | source code | ![Open in Cloud Shell][shell_img] | | Completion_service.import_completion_data | source code | ![Open in Cloud Shell][shell_img] | | Control_service.create_control | source code | ![Open in Cloud Shell][shell_img] | | Control_service.delete_control | source code | ![Open in Cloud Shell][shell_img] | | Control_service.get_control | source code | ![Open in Cloud Shell][shell_img] | | Control_service.list_controls | source code | ![Open in Cloud Shell][shell_img] | | Control_service.update_control | source code | ![Open in Cloud Shell][shell_img] | | Generative_question_service.batch_update_generative_question_configs | source code | ![Open in Cloud Shell][shell_img] | | Generative_question_service.get_generative_questions_feature_config | source code | ![Open in Cloud Shell][shell_img] | | Generative_question_service.list_generative_question_configs | source code | ![Open in Cloud Shell][shell_img] | | Generative_question_service.update_generative_question_config | source code | ![Open in Cloud Shell][shell_img] | | Generative_question_service.update_generative_questions_feature_config | source code | ![Open in Cloud Shell][shell_img] | | Merchant_center_account_link_service.create_merchant_center_account_link | source code | ![Open in Cloud Shell][shell_img] | | Merchant_center_account_link_service.delete_merchant_center_account_link | source code | ![Open in Cloud Shell][shell_img] | | Merchant_center_account_link_service.list_merchant_center_account_links | source code | ![Open in Cloud Shell][shell_img] | | Model_service.create_model | source code | ![Open in Cloud Shell][shell_img] | | Model_service.delete_model | source code | ![Open in Cloud Shell][shell_img] | | Model_service.get_model | source code | ![Open in Cloud Shell][shell_img] | | Model_service.list_models | source code | ![Open in Cloud Shell][shell_img] | | Model_service.pause_model | source code | ![Open in Cloud Shell][shell_img] | | Model_service.resume_model | source code | ![Open in Cloud Shell][shell_img] | | Model_service.tune_model | source code | ![Open in Cloud Shell][shell_img] | | Model_service.update_model | source code | ![Open in Cloud Shell][shell_img] | | Prediction_service.predict | source code | ![Open in Cloud Shell][shell_img] | | Product_service.add_fulfillment_places | source code | ![Open in Cloud Shell][shell_img] | | Product_service.add_local_inventories | source code | ![Open in Cloud Shell][shell_img] | | Product_service.create_product | source code | ![Open in Cloud Shell][shell_img] | | Product_service.delete_product | source code | ![Open in Cloud Shell][shell_img] | | Product_service.export_products | source code | ![Open in Cloud Shell][shell_img] | | Product_service.get_product | source code | ![Open in Cloud Shell][shell_img] | | Product_service.import_products | source code | ![Open in Cloud Shell][shell_img] | | Product_service.list_products | source code | ![Open in Cloud Shell][shell_img] | | Product_service.purge_products | source code | ![Open in Cloud Shell][shell_img] | | Product_service.remove_fulfillment_places | source code | ![Open in Cloud Shell][shell_img] | | Product_service.remove_local_inventories | source code | ![Open in Cloud Shell][shell_img] | | Product_service.set_inventory | source code | ![Open in Cloud Shell][shell_img] | | Product_service.update_product | source code | ![Open in Cloud Shell][shell_img] | | Project_service.accept_terms | source code | ![Open in Cloud Shell][shell_img] | | Project_service.enroll_solution | source code | ![Open in Cloud Shell][shell_img] | | Project_service.get_alert_config | source code | ![Open in Cloud Shell][shell_img] | | Project_service.get_logging_config | source code | ![Open in Cloud Shell][shell_img] | | Project_service.get_project | source code | ![Open in Cloud Shell][shell_img] | | Project_service.list_enrolled_solutions | source code | ![Open in Cloud Shell][shell_img] | | Project_service.update_alert_config | source code | ![Open in Cloud Shell][shell_img] | | Project_service.update_logging_config | source code | ![Open in Cloud Shell][shell_img] | | Search_service.search | source code | ![Open in Cloud Shell][shell_img] | | Serving_config_service.add_control | source code | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-retail/samples/generated/v2alpha/serving_config_service.add_control.js,packages/googl