google_cloud_discoveryengine_v1/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 - Discovery Engine 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 Discovery Engine 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//! * [AssistantService](client/struct.AssistantService.html)
38//! * [CmekConfigService](client/struct.CmekConfigService.html)
39//! * [CompletionService](client/struct.CompletionService.html)
40//! * [ControlService](client/struct.ControlService.html)
41//! * [ConversationalSearchService](client/struct.ConversationalSearchService.html)
42//! * [DataStoreService](client/struct.DataStoreService.html)
43//! * [DocumentService](client/struct.DocumentService.html)
44//! * [EngineService](client/struct.EngineService.html)
45//! * [GroundedGenerationService](client/struct.GroundedGenerationService.html)
46//! * [IdentityMappingStoreService](client/struct.IdentityMappingStoreService.html)
47//! * [ProjectService](client/struct.ProjectService.html)
48//! * [RankService](client/struct.RankService.html)
49//! * [RecommendationService](client/struct.RecommendationService.html)
50//! * [SchemaService](client/struct.SchemaService.html)
51//! * [SearchService](client/struct.SearchService.html)
52//! * [SearchTuningService](client/struct.SearchTuningService.html)
53//! * [ServingConfigService](client/struct.ServingConfigService.html)
54//! * [SessionService](client/struct.SessionService.html)
55//! * [SiteSearchEngineService](client/struct.SiteSearchEngineService.html)
56//! * [UserEventService](client/struct.UserEventService.html)
57//! * [UserLicenseService](client/struct.UserLicenseService.html)
58//!
59//! # Features
60//!
61//! - `default-rustls-provider`: enabled by default. Use the default rustls
62//! crypto provider ([aws-lc-rs]) for TLS and authentication. Applications
63//! with specific requirements for cryptography (such as exclusively using the
64//! [ring] crate) should disable this default and call
65//! `rustls::crypto::CryptoProvider::install_default()`.
66//! - Each client can be enabled using its own feature. Use the client's name
67//! in `kebab-case` to enable the client.
68//!
69//! [aws-lc-rs]: https://crates.io/crates/aws-lc-rs
70//! [ring]: https://crates.io/crates/ring
71
72#![cfg_attr(docsrs, feature(doc_cfg))]
73#![allow(deprecated)]
74
75/// The messages and enums that are part of this client library.
76#[allow(clippy::module_inception)]
77pub mod model;
78
79pub use google_cloud_gax::Result;
80pub use google_cloud_gax::error::Error;
81
82#[allow(rustdoc::invalid_html_tags)]
83#[allow(rustdoc::redundant_explicit_links)]
84pub mod stub;
85
86///
87/// # Example
88/// ```
89/// # use google_cloud_discoveryengine_v1::client::CmekConfigService;
90/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
91/// let client = CmekConfigService::builder().build().await?;
92/// let name = "name_value";
93/// let response = client.get_cmek_config()
94/// .set_name(name)
95/// .send().await?;
96/// println!("response {:?}", response);
97/// # Ok(()) }
98/// ```
99/// Concrete implementations of this client library traits.
100pub mod client;
101
102/// Request builders.
103pub mod builder;
104
105#[doc(hidden)]
106pub(crate) mod tracing;
107
108#[doc(hidden)]
109pub(crate) mod transport;
110
111/// The default host used by the service.
112#[cfg(any(
113 feature = "assistant-service",
114 feature = "cmek-config-service",
115 feature = "completion-service",
116 feature = "control-service",
117 feature = "conversational-search-service",
118 feature = "data-store-service",
119 feature = "document-service",
120 feature = "engine-service",
121 feature = "grounded-generation-service",
122 feature = "identity-mapping-store-service",
123 feature = "project-service",
124 feature = "rank-service",
125 feature = "recommendation-service",
126 feature = "schema-service",
127 feature = "search-service",
128 feature = "search-tuning-service",
129 feature = "serving-config-service",
130 feature = "session-service",
131 feature = "site-search-engine-service",
132 feature = "user-event-service",
133 feature = "user-license-service",
134))]
135const DEFAULT_HOST: &str = "https://discoveryengine.googleapis.com/";
136
137#[cfg(any(
138 feature = "assistant-service",
139 feature = "cmek-config-service",
140 feature = "completion-service",
141 feature = "control-service",
142 feature = "conversational-search-service",
143 feature = "data-store-service",
144 feature = "document-service",
145 feature = "engine-service",
146 feature = "grounded-generation-service",
147 feature = "identity-mapping-store-service",
148 feature = "project-service",
149 feature = "rank-service",
150 feature = "recommendation-service",
151 feature = "schema-service",
152 feature = "search-service",
153 feature = "search-tuning-service",
154 feature = "serving-config-service",
155 feature = "session-service",
156 feature = "site-search-engine-service",
157 feature = "user-event-service",
158 feature = "user-license-service",
159))]
160pub(crate) mod info {
161 const NAME: &str = env!("CARGO_PKG_NAME");
162 const VERSION: &str = env!("CARGO_PKG_VERSION");
163 lazy_static::lazy_static! {
164 pub(crate) static ref X_GOOG_API_CLIENT_HEADER: String = {
165 let ac = gaxi::api_header::XGoogApiClient{
166 name: NAME,
167 version: VERSION,
168 library_type: gaxi::api_header::GAPIC,
169 };
170 ac.rest_header_value()
171 };
172 }
173}
174
175// Define some shortcuts for imported crates.
176pub(crate) use google_cloud_gax::client_builder::ClientBuilder;
177pub(crate) use google_cloud_gax::client_builder::Result as ClientBuilderResult;
178pub(crate) use google_cloud_gax::client_builder::internal::ClientFactory;
179pub(crate) use google_cloud_gax::client_builder::internal::new_builder as new_client_builder;
180pub(crate) use google_cloud_gax::options::RequestOptions;
181pub(crate) use google_cloud_gax::options::internal::RequestBuilder;
182pub(crate) use google_cloud_gax::response::Response;