Skip to main content

google_cloud_aiplatform_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 - Vertex AI 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 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//! * [DataFoundryService](client/struct.DataFoundryService.html)
38//! * [DatasetService](client/struct.DatasetService.html)
39//! * [DeploymentResourcePoolService](client/struct.DeploymentResourcePoolService.html)
40//! * [EndpointService](client/struct.EndpointService.html)
41//! * [EvaluationService](client/struct.EvaluationService.html)
42//! * [FeatureOnlineStoreAdminService](client/struct.FeatureOnlineStoreAdminService.html)
43//! * [FeatureOnlineStoreService](client/struct.FeatureOnlineStoreService.html)
44//! * [FeatureRegistryService](client/struct.FeatureRegistryService.html)
45//! * [FeaturestoreOnlineServingService](client/struct.FeaturestoreOnlineServingService.html)
46//! * [FeaturestoreService](client/struct.FeaturestoreService.html)
47//! * [GenAiCacheService](client/struct.GenAiCacheService.html)
48//! * [GenAiTuningService](client/struct.GenAiTuningService.html)
49//! * [IndexEndpointService](client/struct.IndexEndpointService.html)
50//! * [IndexService](client/struct.IndexService.html)
51//! * [JobService](client/struct.JobService.html)
52//! * [LlmUtilityService](client/struct.LlmUtilityService.html)
53//! * [MatchService](client/struct.MatchService.html)
54//! * [MetadataService](client/struct.MetadataService.html)
55//! * [MigrationService](client/struct.MigrationService.html)
56//! * [ModelGardenService](client/struct.ModelGardenService.html)
57//! * [ModelService](client/struct.ModelService.html)
58//! * [NotebookService](client/struct.NotebookService.html)
59//! * [PersistentResourceService](client/struct.PersistentResourceService.html)
60//! * [PipelineService](client/struct.PipelineService.html)
61//! * [PredictionService](client/struct.PredictionService.html)
62//! * [ReasoningEngineExecutionService](client/struct.ReasoningEngineExecutionService.html)
63//! * [ReasoningEngineService](client/struct.ReasoningEngineService.html)
64//! * [ScheduleService](client/struct.ScheduleService.html)
65//! * [SessionService](client/struct.SessionService.html)
66//! * [SpecialistPoolService](client/struct.SpecialistPoolService.html)
67//! * [TensorboardService](client/struct.TensorboardService.html)
68//! * [VertexRagDataService](client/struct.VertexRagDataService.html)
69//! * [VertexRagService](client/struct.VertexRagService.html)
70//! * [VizierService](client/struct.VizierService.html)
71//!
72//! # Features
73//!
74//! - `default-rustls-provider`: enabled by default. Use the default rustls
75//!   crypto provider ([aws-lc-rs]) for TLS and authentication. Applications
76//!   with specific requirements for cryptography (such as exclusively using the
77//!   [ring] crate) should disable this default and call
78//!   `rustls::crypto::CryptoProvider::install_default()`.
79//! - Each client can be enabled using its own feature. Use the client's name
80//!   in `kebab-case` to enable the client.
81//!
82//! [aws-lc-rs]: https://crates.io/crates/aws-lc-rs
83//! [ring]: https://crates.io/crates/ring
84
85#![cfg_attr(docsrs, feature(doc_cfg))]
86#![allow(deprecated)]
87
88/// The messages and enums that are part of this client library.
89#[allow(clippy::module_inception)]
90pub mod model;
91
92pub use google_cloud_gax::Result;
93pub use google_cloud_gax::error::Error;
94
95#[allow(rustdoc::invalid_html_tags)]
96#[allow(rustdoc::redundant_explicit_links)]
97pub mod stub;
98
99///
100/// # Example
101/// ```
102/// # use google_cloud_aiplatform_v1::client::PredictionService;
103/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
104///     let client = PredictionService::builder().build().await?;
105///     let response = client.predict()
106///         /* set fields */
107///         .send().await?;
108///     println!("response {:?}", response);
109/// # Ok(()) }
110/// ```
111/// Concrete implementations of this client library traits.
112pub mod client;
113
114/// Request builders.
115pub mod builder;
116
117#[doc(hidden)]
118pub(crate) mod tracing;
119
120#[doc(hidden)]
121pub(crate) mod transport;
122
123/// The default host used by the service.
124#[cfg(any(
125    feature = "data-foundry-service",
126    feature = "dataset-service",
127    feature = "deployment-resource-pool-service",
128    feature = "endpoint-service",
129    feature = "evaluation-service",
130    feature = "feature-online-store-admin-service",
131    feature = "feature-online-store-service",
132    feature = "feature-registry-service",
133    feature = "featurestore-online-serving-service",
134    feature = "featurestore-service",
135    feature = "gen-ai-cache-service",
136    feature = "gen-ai-tuning-service",
137    feature = "index-endpoint-service",
138    feature = "index-service",
139    feature = "job-service",
140    feature = "llm-utility-service",
141    feature = "match-service",
142    feature = "metadata-service",
143    feature = "migration-service",
144    feature = "model-garden-service",
145    feature = "model-service",
146    feature = "notebook-service",
147    feature = "persistent-resource-service",
148    feature = "pipeline-service",
149    feature = "prediction-service",
150    feature = "reasoning-engine-execution-service",
151    feature = "reasoning-engine-service",
152    feature = "schedule-service",
153    feature = "session-service",
154    feature = "specialist-pool-service",
155    feature = "tensorboard-service",
156    feature = "vertex-rag-data-service",
157    feature = "vertex-rag-service",
158    feature = "vizier-service",
159))]
160const DEFAULT_HOST: &str = "https://aiplatform.googleapis.com/";
161
162#[cfg(any(
163    feature = "data-foundry-service",
164    feature = "dataset-service",
165    feature = "deployment-resource-pool-service",
166    feature = "endpoint-service",
167    feature = "evaluation-service",
168    feature = "feature-online-store-admin-service",
169    feature = "feature-online-store-service",
170    feature = "feature-registry-service",
171    feature = "featurestore-online-serving-service",
172    feature = "featurestore-service",
173    feature = "gen-ai-cache-service",
174    feature = "gen-ai-tuning-service",
175    feature = "index-endpoint-service",
176    feature = "index-service",
177    feature = "job-service",
178    feature = "llm-utility-service",
179    feature = "match-service",
180    feature = "metadata-service",
181    feature = "migration-service",
182    feature = "model-garden-service",
183    feature = "model-service",
184    feature = "notebook-service",
185    feature = "persistent-resource-service",
186    feature = "pipeline-service",
187    feature = "prediction-service",
188    feature = "reasoning-engine-execution-service",
189    feature = "reasoning-engine-service",
190    feature = "schedule-service",
191    feature = "session-service",
192    feature = "specialist-pool-service",
193    feature = "tensorboard-service",
194    feature = "vertex-rag-data-service",
195    feature = "vertex-rag-service",
196    feature = "vizier-service",
197))]
198pub(crate) mod info {
199    const NAME: &str = env!("CARGO_PKG_NAME");
200    const VERSION: &str = env!("CARGO_PKG_VERSION");
201    lazy_static::lazy_static! {
202        pub(crate) static ref X_GOOG_API_CLIENT_HEADER: String = {
203            let ac = gaxi::api_header::XGoogApiClient{
204                name:          NAME,
205                version:       VERSION,
206                library_type:  gaxi::api_header::GAPIC,
207            };
208            ac.rest_header_value()
209        };
210    }
211}
212
213// Define some shortcuts for imported crates.
214pub(crate) use google_cloud_gax::client_builder::ClientBuilder;
215pub(crate) use google_cloud_gax::client_builder::Result as ClientBuilderResult;
216pub(crate) use google_cloud_gax::client_builder::internal::ClientFactory;
217pub(crate) use google_cloud_gax::client_builder::internal::new_builder as new_client_builder;
218pub(crate) use google_cloud_gax::options::RequestOptions;
219pub(crate) use google_cloud_gax::options::internal::RequestBuilder;
220pub(crate) use google_cloud_gax::response::Response;