google_cloud_dialogflow_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 - Dialogflow 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 Dialogflow 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//! * [Agents](client/struct.Agents.html)
38//! * [AnswerRecords](client/struct.AnswerRecords.html)
39//! * [Contexts](client/struct.Contexts.html)
40//! * [Conversations](client/struct.Conversations.html)
41//! * [ConversationDatasets](client/struct.ConversationDatasets.html)
42//! * [ConversationModels](client/struct.ConversationModels.html)
43//! * [ConversationProfiles](client/struct.ConversationProfiles.html)
44//! * [Documents](client/struct.Documents.html)
45//! * [EncryptionSpecService](client/struct.EncryptionSpecService.html)
46//! * [EntityTypes](client/struct.EntityTypes.html)
47//! * [Environments](client/struct.Environments.html)
48//! * [Fulfillments](client/struct.Fulfillments.html)
49//! * [Generators](client/struct.Generators.html)
50//! * [GeneratorEvaluations](client/struct.GeneratorEvaluations.html)
51//! * [Intents](client/struct.Intents.html)
52//! * [KnowledgeBases](client/struct.KnowledgeBases.html)
53//! * [Participants](client/struct.Participants.html)
54//! * [Sessions](client/struct.Sessions.html)
55//! * [SessionEntityTypes](client/struct.SessionEntityTypes.html)
56//! * [SipTrunks](client/struct.SipTrunks.html)
57//! * [Tools](client/struct.Tools.html)
58//! * [Versions](client/struct.Versions.html)
59//!
60//! # Features
61//!
62//! - `default-rustls-provider`: enabled by default. Use the default rustls
63//! crypto provider ([aws-lc-rs]) for TLS and authentication. Applications
64//! with specific requirements for cryptography (such as exclusively using the
65//! [ring] crate) should disable this default and call
66//! `rustls::crypto::CryptoProvider::install_default()`.
67//! - Each client can be enabled using its own feature. Use the client's name
68//! in `kebab-case` to enable the client.
69//!
70//! [aws-lc-rs]: https://crates.io/crates/aws-lc-rs
71//! [ring]: https://crates.io/crates/ring
72
73#![cfg_attr(docsrs, feature(doc_cfg))]
74#![allow(deprecated)]
75
76/// The messages and enums that are part of this client library.
77#[allow(clippy::module_inception)]
78pub mod model;
79
80pub use google_cloud_gax::Result;
81pub use google_cloud_gax::error::Error;
82
83#[allow(rustdoc::invalid_html_tags)]
84#[allow(rustdoc::redundant_explicit_links)]
85pub mod stub;
86
87///
88/// # Example
89/// ```
90/// # use google_cloud_dialogflow_v2::client::AnswerRecords;
91/// use google_cloud_gax::paginator::ItemPaginator as _;
92/// async fn sample(
93/// project_id: &str,
94/// ) -> anyhow::Result<()> {
95/// let client = AnswerRecords::builder().build().await?;
96/// let mut list = client.list_answer_records()
97/// .set_parent(format!("projects/{project_id}"))
98/// .by_item();
99/// while let Some(item) = list.next().await.transpose()? {
100/// println!("{:?}", item);
101/// }
102/// Ok(())
103/// }
104/// ```
105/// Concrete implementations of this client library traits.
106pub mod client;
107
108/// Request builders.
109pub mod builder;
110
111#[doc(hidden)]
112pub(crate) mod tracing;
113
114#[doc(hidden)]
115pub(crate) mod transport;
116
117/// The default host used by the service.
118#[cfg(any(
119 feature = "agents",
120 feature = "answer-records",
121 feature = "contexts",
122 feature = "conversations",
123 feature = "conversation-datasets",
124 feature = "conversation-models",
125 feature = "conversation-profiles",
126 feature = "documents",
127 feature = "encryption-spec-service",
128 feature = "entity-types",
129 feature = "environments",
130 feature = "fulfillments",
131 feature = "generators",
132 feature = "generator-evaluations",
133 feature = "intents",
134 feature = "knowledge-bases",
135 feature = "participants",
136 feature = "sessions",
137 feature = "session-entity-types",
138 feature = "sip-trunks",
139 feature = "tools",
140 feature = "versions",
141))]
142const DEFAULT_HOST: &str = "https://dialogflow.googleapis.com/";
143
144#[cfg(any(
145 feature = "agents",
146 feature = "answer-records",
147 feature = "contexts",
148 feature = "conversations",
149 feature = "conversation-datasets",
150 feature = "conversation-models",
151 feature = "conversation-profiles",
152 feature = "documents",
153 feature = "encryption-spec-service",
154 feature = "entity-types",
155 feature = "environments",
156 feature = "fulfillments",
157 feature = "generators",
158 feature = "generator-evaluations",
159 feature = "intents",
160 feature = "knowledge-bases",
161 feature = "participants",
162 feature = "sessions",
163 feature = "session-entity-types",
164 feature = "sip-trunks",
165 feature = "tools",
166 feature = "versions",
167))]
168pub(crate) mod info {
169 const NAME: &str = env!("CARGO_PKG_NAME");
170 const VERSION: &str = env!("CARGO_PKG_VERSION");
171 pub(crate) static X_GOOG_API_CLIENT_HEADER: std::sync::LazyLock<String> =
172 std::sync::LazyLock::new(|| {
173 let ac = gaxi::api_header::XGoogApiClient {
174 name: NAME,
175 version: VERSION,
176 library_type: gaxi::api_header::GAPIC,
177 };
178 ac.rest_header_value()
179 });
180}
181
182// Define some shortcuts for imported crates.
183pub(crate) use google_cloud_gax::client_builder::ClientBuilder;
184pub(crate) use google_cloud_gax::client_builder::Result as ClientBuilderResult;
185pub(crate) use google_cloud_gax::client_builder::internal::ClientFactory;
186pub(crate) use google_cloud_gax::client_builder::internal::new_builder as new_client_builder;
187pub(crate) use google_cloud_gax::options::RequestOptions;
188pub(crate) use google_cloud_gax::options::internal::RequestBuilder;
189pub(crate) use google_cloud_gax::response::Response;