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//! This crate contains traits, types, and functions to interact with Discovery Engine API
20//! Most applications will use the structs defined in the [client] module.
21//!
22//! The client library types and functions are stable and not expected to change.
23//! Please note that Google Cloud services do change from time to time. The client
24//! libraries are designed to preserve backwards compatibility when the service
25//! changes in compatible ways. For example, adding RPCs, or fields to messages
26//! should not introduce breaking changes to the client libraries.
27//!
28//! # Available Clients
29//!
30//! * [AssistantService](client/struct.AssistantService.html)
31//! * [CmekConfigService](client/struct.CmekConfigService.html)
32//! * [CompletionService](client/struct.CompletionService.html)
33//! * [ControlService](client/struct.ControlService.html)
34//! * [ConversationalSearchService](client/struct.ConversationalSearchService.html)
35//! * [DataStoreService](client/struct.DataStoreService.html)
36//! * [DocumentService](client/struct.DocumentService.html)
37//! * [EngineService](client/struct.EngineService.html)
38//! * [GroundedGenerationService](client/struct.GroundedGenerationService.html)
39//! * [IdentityMappingStoreService](client/struct.IdentityMappingStoreService.html)
40//! * [ProjectService](client/struct.ProjectService.html)
41//! * [RankService](client/struct.RankService.html)
42//! * [RecommendationService](client/struct.RecommendationService.html)
43//! * [SchemaService](client/struct.SchemaService.html)
44//! * [SearchService](client/struct.SearchService.html)
45//! * [SearchTuningService](client/struct.SearchTuningService.html)
46//! * [ServingConfigService](client/struct.ServingConfigService.html)
47//! * [SessionService](client/struct.SessionService.html)
48//! * [SiteSearchEngineService](client/struct.SiteSearchEngineService.html)
49//! * [UserEventService](client/struct.UserEventService.html)
50//! * [UserLicenseService](client/struct.UserLicenseService.html)
51//!
52//! # Features
53//!
54//! - `default-rustls-provider`: enabled by default. Use the default rustls
55//! crypto provider ([aws-lc-rs]) for TLS and authentication. Applications
56//! with specific requirements for cryptography (such as exclusively using the
57//! [ring] crate) should disable this default and call
58//! `rustls::crypto::CryptoProvider::install_default()`.
59//! - Each client can be enabled using its own feature. Use the client's name
60//! in `kebab-case` to enable the client.
61//!
62//! [aws-lc-rs]: https://crates.io/crates/aws-lc-rs
63//! [ring]: https://crates.io/crates/ring
64
65#![cfg_attr(docsrs, feature(doc_cfg))]
66#![allow(deprecated)]
67
68/// The messages and enums that are part of this client library.
69#[allow(clippy::module_inception)]
70pub mod model;
71
72pub use google_cloud_gax::Result;
73pub use google_cloud_gax::error::Error;
74
75#[allow(rustdoc::invalid_html_tags)]
76#[allow(rustdoc::redundant_explicit_links)]
77pub mod stub;
78
79/// Concrete implementations of client library traits.
80///
81/// # Example
82/// ```
83/// # use google_cloud_discoveryengine_v1::client::CmekConfigService;
84/// async fn sample(
85/// project_id: &str,
86/// location_id: &str,
87/// ) -> anyhow::Result<()> {
88/// let client = CmekConfigService::builder().build().await?;
89/// let response = client.get_cmek_config()
90/// .set_name(format!("projects/{project_id}/locations/{location_id}/cmekConfig"))
91/// .send().await?;
92/// println!("response {:?}", response);
93/// Ok(())
94/// }
95/// ```
96pub mod client;
97
98/// Request builders.
99pub mod builder;
100
101#[doc(hidden)]
102pub(crate) mod tracing;
103
104#[doc(hidden)]
105pub(crate) mod transport;
106
107#[cfg(any(
108 feature = "assistant-service",
109 feature = "conversational-search-service",
110 feature = "grounded-generation-service",
111))]
112#[doc(hidden)]
113#[allow(clippy::all)]
114#[allow(unused_imports)]
115#[allow(dead_code)]
116#[allow(missing_docs)]
117pub(crate) mod prost {
118 include!("prost/includes.rs");
119}
120
121#[cfg(any(
122 feature = "assistant-service",
123 feature = "conversational-search-service",
124 feature = "grounded-generation-service",
125))]
126#[doc(hidden)]
127#[allow(clippy::all)]
128#[allow(unused_imports)]
129#[allow(dead_code)]
130#[allow(missing_docs)]
131pub(crate) mod convert;
132
133/// The default host used by the service.
134#[cfg(any(
135 feature = "assistant-service",
136 feature = "cmek-config-service",
137 feature = "completion-service",
138 feature = "control-service",
139 feature = "conversational-search-service",
140 feature = "data-store-service",
141 feature = "document-service",
142 feature = "engine-service",
143 feature = "grounded-generation-service",
144 feature = "identity-mapping-store-service",
145 feature = "project-service",
146 feature = "rank-service",
147 feature = "recommendation-service",
148 feature = "schema-service",
149 feature = "search-service",
150 feature = "search-tuning-service",
151 feature = "serving-config-service",
152 feature = "session-service",
153 feature = "site-search-engine-service",
154 feature = "user-event-service",
155 feature = "user-license-service",
156))]
157const DEFAULT_HOST: &str = "https://discoveryengine.googleapis.com/";
158
159#[cfg(any(
160 feature = "assistant-service",
161 feature = "cmek-config-service",
162 feature = "completion-service",
163 feature = "control-service",
164 feature = "conversational-search-service",
165 feature = "data-store-service",
166 feature = "document-service",
167 feature = "engine-service",
168 feature = "grounded-generation-service",
169 feature = "identity-mapping-store-service",
170 feature = "project-service",
171 feature = "rank-service",
172 feature = "recommendation-service",
173 feature = "schema-service",
174 feature = "search-service",
175 feature = "search-tuning-service",
176 feature = "serving-config-service",
177 feature = "session-service",
178 feature = "site-search-engine-service",
179 feature = "user-event-service",
180 feature = "user-license-service",
181))]
182pub(crate) mod info {
183 const NAME: &str = env!("CARGO_PKG_NAME");
184 const VERSION: &str = env!("CARGO_PKG_VERSION");
185 pub(crate) static X_GOOG_API_CLIENT_HEADER: std::sync::LazyLock<String> =
186 std::sync::LazyLock::new(|| {
187 let ac = gaxi::api_header::XGoogApiClient {
188 name: NAME,
189 version: VERSION,
190 library_type: gaxi::api_header::GAPIC,
191 };
192 ac.rest_header_value()
193 });
194 pub(crate) static X_GOOG_API_CLIENT_GRPC_HEADER: std::sync::LazyLock<String> =
195 std::sync::LazyLock::new(|| {
196 let ac = gaxi::api_header::XGoogApiClient {
197 name: NAME,
198 version: VERSION,
199 library_type: gaxi::api_header::GAPIC,
200 };
201 ac.grpc_header_value()
202 });
203}
204
205// Define some shortcuts for imported crates.
206pub(crate) use google_cloud_gax::client_builder::ClientBuilder;
207pub(crate) use google_cloud_gax::client_builder::Result as ClientBuilderResult;
208pub(crate) use google_cloud_gax::client_builder::internal::ClientFactory;
209pub(crate) use google_cloud_gax::client_builder::internal::new_builder as new_client_builder;
210pub(crate) use google_cloud_gax::options::RequestOptions;
211pub(crate) use google_cloud_gax::options::internal::RequestBuilder;
212pub(crate) use google_cloud_gax::response::Response;