Skip to main content

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 gax::Result;
80pub use gax::error::Error;
81
82#[allow(rustdoc::invalid_html_tags)]
83#[allow(rustdoc::redundant_explicit_links)]
84pub mod stub;
85
86/// Concrete implementations of this client library traits.
87pub mod client;
88
89/// Request builders.
90pub mod builder;
91
92#[doc(hidden)]
93pub(crate) mod tracing;
94
95#[doc(hidden)]
96pub(crate) mod transport;
97
98/// The default host used by the service.
99#[cfg(any(
100    feature = "assistant-service",
101    feature = "cmek-config-service",
102    feature = "completion-service",
103    feature = "control-service",
104    feature = "conversational-search-service",
105    feature = "data-store-service",
106    feature = "document-service",
107    feature = "engine-service",
108    feature = "grounded-generation-service",
109    feature = "identity-mapping-store-service",
110    feature = "project-service",
111    feature = "rank-service",
112    feature = "recommendation-service",
113    feature = "schema-service",
114    feature = "search-service",
115    feature = "search-tuning-service",
116    feature = "serving-config-service",
117    feature = "session-service",
118    feature = "site-search-engine-service",
119    feature = "user-event-service",
120    feature = "user-license-service",
121))]
122const DEFAULT_HOST: &str = "https://discoveryengine.googleapis.com/";
123
124#[cfg(any(
125    feature = "assistant-service",
126    feature = "cmek-config-service",
127    feature = "completion-service",
128    feature = "control-service",
129    feature = "conversational-search-service",
130    feature = "data-store-service",
131    feature = "document-service",
132    feature = "engine-service",
133    feature = "grounded-generation-service",
134    feature = "identity-mapping-store-service",
135    feature = "project-service",
136    feature = "rank-service",
137    feature = "recommendation-service",
138    feature = "schema-service",
139    feature = "search-service",
140    feature = "search-tuning-service",
141    feature = "serving-config-service",
142    feature = "session-service",
143    feature = "site-search-engine-service",
144    feature = "user-event-service",
145    feature = "user-license-service",
146))]
147pub(crate) mod info {
148    const NAME: &str = env!("CARGO_PKG_NAME");
149    const VERSION: &str = env!("CARGO_PKG_VERSION");
150    lazy_static::lazy_static! {
151        pub(crate) static ref X_GOOG_API_CLIENT_HEADER: String = {
152            let ac = gaxi::api_header::XGoogApiClient{
153                name:          NAME,
154                version:       VERSION,
155                library_type:  gaxi::api_header::GAPIC,
156            };
157            ac.rest_header_value()
158        };
159    }
160}