Skip to main content

google_cloud_retail_v2/
lib.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17//! Google Cloud Client Libraries for Rust - Vertex AI Search for commerce API
18//!
19//! **WARNING:** some RPCs have no corresponding Rust function to call them.
20//! Typically these are streaming RPCs. We expect adding these RPCs in a
21//! way that does not break the existing APIs or changes their behavior in a
22//! significant way. We do anticipate a number of new crate dependencies
23//! will be required. If you need these RPCs please open an issue in our
24//! GitHub repository.
25//!
26//! This crate contains traits, types, and functions to interact with Vertex AI Search for commerce API
27//! Most applications will use the structs defined in the [client] module.
28//!
29//! The client library types and functions are stable and not expected to change.
30//! Please note that Google Cloud services do change from time to time. The client
31//! libraries are designed to preserve backwards compatibility when the service
32//! changes in compatible ways. For example, adding RPCs, or fields to messages
33//! should not introduce breaking changes to the client libraries.
34//!
35//! # Available Clients
36//!
37//! * [AnalyticsService](client/struct.AnalyticsService.html)
38//! * [CatalogService](client/struct.CatalogService.html)
39//! * [CompletionService](client/struct.CompletionService.html)
40//! * [ControlService](client/struct.ControlService.html)
41//! * [ConversationalSearchService](client/struct.ConversationalSearchService.html)
42//! * [GenerativeQuestionService](client/struct.GenerativeQuestionService.html)
43//! * [ModelService](client/struct.ModelService.html)
44//! * [PredictionService](client/struct.PredictionService.html)
45//! * [ProductService](client/struct.ProductService.html)
46//! * [SearchService](client/struct.SearchService.html)
47//! * [ServingConfigService](client/struct.ServingConfigService.html)
48//! * [UserEventService](client/struct.UserEventService.html)
49//!
50//! # Features
51//!
52//! - `default-rustls-provider`: enabled by default. Use the default rustls
53//!   crypto provider ([aws-lc-rs]) for TLS and authentication. Applications
54//!   with specific requirements for cryptography (such as exclusively using the
55//!   [ring] crate) should disable this default and call
56//!   `rustls::crypto::CryptoProvider::install_default()`.
57//!
58//! [aws-lc-rs]: https://crates.io/crates/aws-lc-rs
59//! [ring]: https://crates.io/crates/ring
60
61#![allow(deprecated)]
62
63/// The messages and enums that are part of this client library.
64#[allow(clippy::module_inception)]
65pub mod model;
66
67pub use google_cloud_gax::Result;
68pub use google_cloud_gax::error::Error;
69
70#[allow(rustdoc::invalid_html_tags)]
71#[allow(rustdoc::redundant_explicit_links)]
72pub mod stub;
73
74///
75/// # Example
76/// ```
77/// # use google_cloud_retail_v2::client::CatalogService;
78/// use google_cloud_gax::paginator::ItemPaginator as _;
79/// async fn sample(
80///    parent: &str,
81/// ) -> anyhow::Result<()> {
82///     let client = CatalogService::builder().build().await?;
83///     let mut list = client.list_catalogs()
84///         .set_parent(parent)
85///         .by_item();
86///     while let Some(item) = list.next().await.transpose()? {
87///         println!("{:?}", item);
88///     }
89///     Ok(())
90/// }
91/// ```
92/// Concrete implementations of this client library traits.
93pub mod client;
94
95/// Request builders.
96pub mod builder;
97
98#[doc(hidden)]
99pub(crate) mod tracing;
100
101#[doc(hidden)]
102pub(crate) mod transport;
103
104/// The default host used by the service.
105const DEFAULT_HOST: &str = "https://retail.googleapis.com/";
106
107pub(crate) mod info {
108    const NAME: &str = env!("CARGO_PKG_NAME");
109    const VERSION: &str = env!("CARGO_PKG_VERSION");
110    pub(crate) static X_GOOG_API_CLIENT_HEADER: std::sync::LazyLock<String> =
111        std::sync::LazyLock::new(|| {
112            let ac = gaxi::api_header::XGoogApiClient {
113                name: NAME,
114                version: VERSION,
115                library_type: gaxi::api_header::GAPIC,
116            };
117            ac.rest_header_value()
118        });
119}
120
121// Define some shortcuts for imported crates.
122pub(crate) use google_cloud_gax::client_builder::ClientBuilder;
123pub(crate) use google_cloud_gax::client_builder::Result as ClientBuilderResult;
124pub(crate) use google_cloud_gax::client_builder::internal::ClientFactory;
125pub(crate) use google_cloud_gax::client_builder::internal::new_builder as new_client_builder;
126pub(crate) use google_cloud_gax::options::RequestOptions;
127pub(crate) use google_cloud_gax::options::internal::RequestBuilder;
128pub(crate) use google_cloud_gax::response::Response;