google_cloud_aiplatform_v1/client.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#![allow(rustdoc::redundant_explicit_links)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::invalid_html_tags)]
19
20/// Implements a client for the Vertex AI API.
21///
22/// # Example
23/// ```
24/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25/// # use google_cloud_aiplatform_v1::client::DataFoundryService;
26/// let client = DataFoundryService::builder().build().await?;
27/// // use `client` to make requests to the Vertex AI API.
28/// # Ok(()) }
29/// ```
30///
31/// # Service Description
32///
33/// Service for generating and preparing datasets for Gen AI evaluation.
34///
35/// # Configuration
36///
37/// To configure `DataFoundryService` use the `with_*` methods in the type returned
38/// by [builder()][DataFoundryService::builder]. The default configuration should
39/// work for most applications. Common configuration changes include
40///
41/// * [with_endpoint()]: by default this client uses the global default endpoint
42/// (`https://aiplatform.googleapis.com`). Applications using regional
43/// endpoints or running in restricted networks (e.g. a network configured
44// with [Private Google Access with VPC Service Controls]) may want to
45/// override this default.
46/// * [with_credentials()]: by default this client uses
47/// [Application Default Credentials]. Applications using custom
48/// authentication may need to override this default.
49///
50/// [with_endpoint()]: super::builder::data_foundry_service::ClientBuilder::with_endpoint
51/// [with_credentials()]: super::builder::data_foundry_service::ClientBuilder::credentials
52/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
53/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
54///
55/// # Pooling and Cloning
56///
57/// `DataFoundryService` holds a connection pool internally, it is advised to
58/// create one and the reuse it. You do not need to wrap `DataFoundryService` in
59/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
60/// already uses an `Arc` internally.
61#[cfg(feature = "data-foundry-service")]
62#[cfg_attr(docsrs, doc(cfg(feature = "data-foundry-service")))]
63#[derive(Clone, Debug)]
64pub struct DataFoundryService {
65 inner: std::sync::Arc<dyn super::stub::dynamic::DataFoundryService>,
66}
67
68#[cfg(feature = "data-foundry-service")]
69impl DataFoundryService {
70 /// Returns a builder for [DataFoundryService].
71 ///
72 /// ```
73 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
74 /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
75 /// let client = DataFoundryService::builder().build().await?;
76 /// # Ok(()) }
77 /// ```
78 pub fn builder() -> super::builder::data_foundry_service::ClientBuilder {
79 crate::new_client_builder(super::builder::data_foundry_service::client::Factory)
80 }
81
82 /// Creates a new client from the provided stub.
83 ///
84 /// The most common case for calling this function is in tests mocking the
85 /// client's behavior.
86 pub fn from_stub<T>(stub: T) -> Self
87 where
88 T: super::stub::DataFoundryService + 'static,
89 {
90 Self {
91 inner: std::sync::Arc::new(stub),
92 }
93 }
94
95 pub(crate) async fn new(
96 config: gaxi::options::ClientConfig,
97 ) -> crate::ClientBuilderResult<Self> {
98 let inner = Self::build_inner(config).await?;
99 Ok(Self { inner })
100 }
101
102 async fn build_inner(
103 conf: gaxi::options::ClientConfig,
104 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DataFoundryService>>
105 {
106 if gaxi::options::tracing_enabled(&conf) {
107 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
108 }
109 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
110 }
111
112 async fn build_transport(
113 conf: gaxi::options::ClientConfig,
114 ) -> crate::ClientBuilderResult<impl super::stub::DataFoundryService> {
115 super::transport::DataFoundryService::new(conf).await
116 }
117
118 async fn build_with_tracing(
119 conf: gaxi::options::ClientConfig,
120 ) -> crate::ClientBuilderResult<impl super::stub::DataFoundryService> {
121 Self::build_transport(conf)
122 .await
123 .map(super::tracing::DataFoundryService::new)
124 }
125
126 /// Generates synthetic data based on the provided configuration.
127 pub fn generate_synthetic_data(
128 &self,
129 ) -> super::builder::data_foundry_service::GenerateSyntheticData {
130 super::builder::data_foundry_service::GenerateSyntheticData::new(self.inner.clone())
131 }
132
133 /// Lists information about the supported locations for this service.
134 pub fn list_locations(&self) -> super::builder::data_foundry_service::ListLocations {
135 super::builder::data_foundry_service::ListLocations::new(self.inner.clone())
136 }
137
138 /// Gets information about a location.
139 pub fn get_location(&self) -> super::builder::data_foundry_service::GetLocation {
140 super::builder::data_foundry_service::GetLocation::new(self.inner.clone())
141 }
142
143 /// Sets the access control policy on the specified resource. Replaces
144 /// any existing policy.
145 ///
146 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
147 /// errors.
148 pub fn set_iam_policy(&self) -> super::builder::data_foundry_service::SetIamPolicy {
149 super::builder::data_foundry_service::SetIamPolicy::new(self.inner.clone())
150 }
151
152 /// Gets the access control policy for a resource. Returns an empty policy
153 /// if the resource exists and does not have a policy set.
154 pub fn get_iam_policy(&self) -> super::builder::data_foundry_service::GetIamPolicy {
155 super::builder::data_foundry_service::GetIamPolicy::new(self.inner.clone())
156 }
157
158 /// Returns permissions that a caller has on the specified resource. If the
159 /// resource does not exist, this will return an empty set of
160 /// permissions, not a `NOT_FOUND` error.
161 ///
162 /// Note: This operation is designed to be used for building
163 /// permission-aware UIs and command-line tools, not for authorization
164 /// checking. This operation may "fail open" without warning.
165 pub fn test_iam_permissions(&self) -> super::builder::data_foundry_service::TestIamPermissions {
166 super::builder::data_foundry_service::TestIamPermissions::new(self.inner.clone())
167 }
168
169 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
170 ///
171 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
172 pub fn list_operations(&self) -> super::builder::data_foundry_service::ListOperations {
173 super::builder::data_foundry_service::ListOperations::new(self.inner.clone())
174 }
175
176 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
177 ///
178 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
179 pub fn get_operation(&self) -> super::builder::data_foundry_service::GetOperation {
180 super::builder::data_foundry_service::GetOperation::new(self.inner.clone())
181 }
182
183 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
184 ///
185 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
186 pub fn delete_operation(&self) -> super::builder::data_foundry_service::DeleteOperation {
187 super::builder::data_foundry_service::DeleteOperation::new(self.inner.clone())
188 }
189
190 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
191 ///
192 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
193 pub fn cancel_operation(&self) -> super::builder::data_foundry_service::CancelOperation {
194 super::builder::data_foundry_service::CancelOperation::new(self.inner.clone())
195 }
196
197 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
198 ///
199 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
200 pub fn wait_operation(&self) -> super::builder::data_foundry_service::WaitOperation {
201 super::builder::data_foundry_service::WaitOperation::new(self.inner.clone())
202 }
203}
204
205/// Implements a client for the Vertex AI API.
206///
207/// # Example
208/// ```
209/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
210/// # use google_cloud_aiplatform_v1::client::DatasetService;
211/// let client = DatasetService::builder().build().await?;
212/// // use `client` to make requests to the Vertex AI API.
213/// # Ok(()) }
214/// ```
215///
216/// # Service Description
217///
218/// The service that manages Vertex AI Dataset and its child resources.
219///
220/// # Configuration
221///
222/// To configure `DatasetService` use the `with_*` methods in the type returned
223/// by [builder()][DatasetService::builder]. The default configuration should
224/// work for most applications. Common configuration changes include
225///
226/// * [with_endpoint()]: by default this client uses the global default endpoint
227/// (`https://aiplatform.googleapis.com`). Applications using regional
228/// endpoints or running in restricted networks (e.g. a network configured
229// with [Private Google Access with VPC Service Controls]) may want to
230/// override this default.
231/// * [with_credentials()]: by default this client uses
232/// [Application Default Credentials]. Applications using custom
233/// authentication may need to override this default.
234///
235/// [with_endpoint()]: super::builder::dataset_service::ClientBuilder::with_endpoint
236/// [with_credentials()]: super::builder::dataset_service::ClientBuilder::credentials
237/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
238/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
239///
240/// # Pooling and Cloning
241///
242/// `DatasetService` holds a connection pool internally, it is advised to
243/// create one and the reuse it. You do not need to wrap `DatasetService` in
244/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
245/// already uses an `Arc` internally.
246#[cfg(feature = "dataset-service")]
247#[cfg_attr(docsrs, doc(cfg(feature = "dataset-service")))]
248#[derive(Clone, Debug)]
249pub struct DatasetService {
250 inner: std::sync::Arc<dyn super::stub::dynamic::DatasetService>,
251}
252
253#[cfg(feature = "dataset-service")]
254impl DatasetService {
255 /// Returns a builder for [DatasetService].
256 ///
257 /// ```
258 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
259 /// # use google_cloud_aiplatform_v1::client::DatasetService;
260 /// let client = DatasetService::builder().build().await?;
261 /// # Ok(()) }
262 /// ```
263 pub fn builder() -> super::builder::dataset_service::ClientBuilder {
264 crate::new_client_builder(super::builder::dataset_service::client::Factory)
265 }
266
267 /// Creates a new client from the provided stub.
268 ///
269 /// The most common case for calling this function is in tests mocking the
270 /// client's behavior.
271 pub fn from_stub<T>(stub: T) -> Self
272 where
273 T: super::stub::DatasetService + 'static,
274 {
275 Self {
276 inner: std::sync::Arc::new(stub),
277 }
278 }
279
280 pub(crate) async fn new(
281 config: gaxi::options::ClientConfig,
282 ) -> crate::ClientBuilderResult<Self> {
283 let inner = Self::build_inner(config).await?;
284 Ok(Self { inner })
285 }
286
287 async fn build_inner(
288 conf: gaxi::options::ClientConfig,
289 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DatasetService>> {
290 if gaxi::options::tracing_enabled(&conf) {
291 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
292 }
293 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
294 }
295
296 async fn build_transport(
297 conf: gaxi::options::ClientConfig,
298 ) -> crate::ClientBuilderResult<impl super::stub::DatasetService> {
299 super::transport::DatasetService::new(conf).await
300 }
301
302 async fn build_with_tracing(
303 conf: gaxi::options::ClientConfig,
304 ) -> crate::ClientBuilderResult<impl super::stub::DatasetService> {
305 Self::build_transport(conf)
306 .await
307 .map(super::tracing::DatasetService::new)
308 }
309
310 /// Creates a Dataset.
311 ///
312 /// # Long running operations
313 ///
314 /// This method is used to start, and/or poll a [long-running Operation].
315 /// The [Working with long-running operations] chapter in the [user guide]
316 /// covers these operations in detail.
317 ///
318 /// [long-running operation]: https://google.aip.dev/151
319 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
320 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
321 pub fn create_dataset(&self) -> super::builder::dataset_service::CreateDataset {
322 super::builder::dataset_service::CreateDataset::new(self.inner.clone())
323 }
324
325 /// Gets a Dataset.
326 pub fn get_dataset(&self) -> super::builder::dataset_service::GetDataset {
327 super::builder::dataset_service::GetDataset::new(self.inner.clone())
328 }
329
330 /// Updates a Dataset.
331 pub fn update_dataset(&self) -> super::builder::dataset_service::UpdateDataset {
332 super::builder::dataset_service::UpdateDataset::new(self.inner.clone())
333 }
334
335 /// Lists Datasets in a Location.
336 pub fn list_datasets(&self) -> super::builder::dataset_service::ListDatasets {
337 super::builder::dataset_service::ListDatasets::new(self.inner.clone())
338 }
339
340 /// Deletes a Dataset.
341 ///
342 /// # Long running operations
343 ///
344 /// This method is used to start, and/or poll a [long-running Operation].
345 /// The [Working with long-running operations] chapter in the [user guide]
346 /// covers these operations in detail.
347 ///
348 /// [long-running operation]: https://google.aip.dev/151
349 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
350 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
351 pub fn delete_dataset(&self) -> super::builder::dataset_service::DeleteDataset {
352 super::builder::dataset_service::DeleteDataset::new(self.inner.clone())
353 }
354
355 /// Imports data into a Dataset.
356 ///
357 /// # Long running operations
358 ///
359 /// This method is used to start, and/or poll a [long-running Operation].
360 /// The [Working with long-running operations] chapter in the [user guide]
361 /// covers these operations in detail.
362 ///
363 /// [long-running operation]: https://google.aip.dev/151
364 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
365 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
366 pub fn import_data(&self) -> super::builder::dataset_service::ImportData {
367 super::builder::dataset_service::ImportData::new(self.inner.clone())
368 }
369
370 /// Exports data from a Dataset.
371 ///
372 /// # Long running operations
373 ///
374 /// This method is used to start, and/or poll a [long-running Operation].
375 /// The [Working with long-running operations] chapter in the [user guide]
376 /// covers these operations in detail.
377 ///
378 /// [long-running operation]: https://google.aip.dev/151
379 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
380 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
381 pub fn export_data(&self) -> super::builder::dataset_service::ExportData {
382 super::builder::dataset_service::ExportData::new(self.inner.clone())
383 }
384
385 /// Create a version from a Dataset.
386 ///
387 /// # Long running operations
388 ///
389 /// This method is used to start, and/or poll a [long-running Operation].
390 /// The [Working with long-running operations] chapter in the [user guide]
391 /// covers these operations in detail.
392 ///
393 /// [long-running operation]: https://google.aip.dev/151
394 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
395 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
396 pub fn create_dataset_version(&self) -> super::builder::dataset_service::CreateDatasetVersion {
397 super::builder::dataset_service::CreateDatasetVersion::new(self.inner.clone())
398 }
399
400 /// Updates a DatasetVersion.
401 pub fn update_dataset_version(&self) -> super::builder::dataset_service::UpdateDatasetVersion {
402 super::builder::dataset_service::UpdateDatasetVersion::new(self.inner.clone())
403 }
404
405 /// Deletes a Dataset version.
406 ///
407 /// # Long running operations
408 ///
409 /// This method is used to start, and/or poll a [long-running Operation].
410 /// The [Working with long-running operations] chapter in the [user guide]
411 /// covers these operations in detail.
412 ///
413 /// [long-running operation]: https://google.aip.dev/151
414 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
415 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
416 pub fn delete_dataset_version(&self) -> super::builder::dataset_service::DeleteDatasetVersion {
417 super::builder::dataset_service::DeleteDatasetVersion::new(self.inner.clone())
418 }
419
420 /// Gets a Dataset version.
421 pub fn get_dataset_version(&self) -> super::builder::dataset_service::GetDatasetVersion {
422 super::builder::dataset_service::GetDatasetVersion::new(self.inner.clone())
423 }
424
425 /// Lists DatasetVersions in a Dataset.
426 pub fn list_dataset_versions(&self) -> super::builder::dataset_service::ListDatasetVersions {
427 super::builder::dataset_service::ListDatasetVersions::new(self.inner.clone())
428 }
429
430 /// Restores a dataset version.
431 ///
432 /// # Long running operations
433 ///
434 /// This method is used to start, and/or poll a [long-running Operation].
435 /// The [Working with long-running operations] chapter in the [user guide]
436 /// covers these operations in detail.
437 ///
438 /// [long-running operation]: https://google.aip.dev/151
439 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
440 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
441 pub fn restore_dataset_version(
442 &self,
443 ) -> super::builder::dataset_service::RestoreDatasetVersion {
444 super::builder::dataset_service::RestoreDatasetVersion::new(self.inner.clone())
445 }
446
447 /// Lists DataItems in a Dataset.
448 pub fn list_data_items(&self) -> super::builder::dataset_service::ListDataItems {
449 super::builder::dataset_service::ListDataItems::new(self.inner.clone())
450 }
451
452 /// Searches DataItems in a Dataset.
453 pub fn search_data_items(&self) -> super::builder::dataset_service::SearchDataItems {
454 super::builder::dataset_service::SearchDataItems::new(self.inner.clone())
455 }
456
457 /// Lists SavedQueries in a Dataset.
458 pub fn list_saved_queries(&self) -> super::builder::dataset_service::ListSavedQueries {
459 super::builder::dataset_service::ListSavedQueries::new(self.inner.clone())
460 }
461
462 /// Deletes a SavedQuery.
463 ///
464 /// # Long running operations
465 ///
466 /// This method is used to start, and/or poll a [long-running Operation].
467 /// The [Working with long-running operations] chapter in the [user guide]
468 /// covers these operations in detail.
469 ///
470 /// [long-running operation]: https://google.aip.dev/151
471 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
472 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
473 pub fn delete_saved_query(&self) -> super::builder::dataset_service::DeleteSavedQuery {
474 super::builder::dataset_service::DeleteSavedQuery::new(self.inner.clone())
475 }
476
477 /// Gets an AnnotationSpec.
478 pub fn get_annotation_spec(&self) -> super::builder::dataset_service::GetAnnotationSpec {
479 super::builder::dataset_service::GetAnnotationSpec::new(self.inner.clone())
480 }
481
482 /// Lists Annotations belongs to a dataitem.
483 pub fn list_annotations(&self) -> super::builder::dataset_service::ListAnnotations {
484 super::builder::dataset_service::ListAnnotations::new(self.inner.clone())
485 }
486
487 /// Lists information about the supported locations for this service.
488 pub fn list_locations(&self) -> super::builder::dataset_service::ListLocations {
489 super::builder::dataset_service::ListLocations::new(self.inner.clone())
490 }
491
492 /// Gets information about a location.
493 pub fn get_location(&self) -> super::builder::dataset_service::GetLocation {
494 super::builder::dataset_service::GetLocation::new(self.inner.clone())
495 }
496
497 /// Sets the access control policy on the specified resource. Replaces
498 /// any existing policy.
499 ///
500 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
501 /// errors.
502 pub fn set_iam_policy(&self) -> super::builder::dataset_service::SetIamPolicy {
503 super::builder::dataset_service::SetIamPolicy::new(self.inner.clone())
504 }
505
506 /// Gets the access control policy for a resource. Returns an empty policy
507 /// if the resource exists and does not have a policy set.
508 pub fn get_iam_policy(&self) -> super::builder::dataset_service::GetIamPolicy {
509 super::builder::dataset_service::GetIamPolicy::new(self.inner.clone())
510 }
511
512 /// Returns permissions that a caller has on the specified resource. If the
513 /// resource does not exist, this will return an empty set of
514 /// permissions, not a `NOT_FOUND` error.
515 ///
516 /// Note: This operation is designed to be used for building
517 /// permission-aware UIs and command-line tools, not for authorization
518 /// checking. This operation may "fail open" without warning.
519 pub fn test_iam_permissions(&self) -> super::builder::dataset_service::TestIamPermissions {
520 super::builder::dataset_service::TestIamPermissions::new(self.inner.clone())
521 }
522
523 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
524 ///
525 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
526 pub fn list_operations(&self) -> super::builder::dataset_service::ListOperations {
527 super::builder::dataset_service::ListOperations::new(self.inner.clone())
528 }
529
530 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
531 ///
532 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
533 pub fn get_operation(&self) -> super::builder::dataset_service::GetOperation {
534 super::builder::dataset_service::GetOperation::new(self.inner.clone())
535 }
536
537 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
538 ///
539 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
540 pub fn delete_operation(&self) -> super::builder::dataset_service::DeleteOperation {
541 super::builder::dataset_service::DeleteOperation::new(self.inner.clone())
542 }
543
544 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
545 ///
546 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
547 pub fn cancel_operation(&self) -> super::builder::dataset_service::CancelOperation {
548 super::builder::dataset_service::CancelOperation::new(self.inner.clone())
549 }
550
551 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
552 ///
553 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
554 pub fn wait_operation(&self) -> super::builder::dataset_service::WaitOperation {
555 super::builder::dataset_service::WaitOperation::new(self.inner.clone())
556 }
557}
558
559/// Implements a client for the Vertex AI API.
560///
561/// # Example
562/// ```
563/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
564/// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
565/// let client = DeploymentResourcePoolService::builder().build().await?;
566/// // use `client` to make requests to the Vertex AI API.
567/// # Ok(()) }
568/// ```
569///
570/// # Service Description
571///
572/// A service that manages the DeploymentResourcePool resource.
573///
574/// # Configuration
575///
576/// To configure `DeploymentResourcePoolService` use the `with_*` methods in the type returned
577/// by [builder()][DeploymentResourcePoolService::builder]. The default configuration should
578/// work for most applications. Common configuration changes include
579///
580/// * [with_endpoint()]: by default this client uses the global default endpoint
581/// (`https://aiplatform.googleapis.com`). Applications using regional
582/// endpoints or running in restricted networks (e.g. a network configured
583// with [Private Google Access with VPC Service Controls]) may want to
584/// override this default.
585/// * [with_credentials()]: by default this client uses
586/// [Application Default Credentials]. Applications using custom
587/// authentication may need to override this default.
588///
589/// [with_endpoint()]: super::builder::deployment_resource_pool_service::ClientBuilder::with_endpoint
590/// [with_credentials()]: super::builder::deployment_resource_pool_service::ClientBuilder::credentials
591/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
592/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
593///
594/// # Pooling and Cloning
595///
596/// `DeploymentResourcePoolService` holds a connection pool internally, it is advised to
597/// create one and the reuse it. You do not need to wrap `DeploymentResourcePoolService` in
598/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
599/// already uses an `Arc` internally.
600#[cfg(feature = "deployment-resource-pool-service")]
601#[cfg_attr(docsrs, doc(cfg(feature = "deployment-resource-pool-service")))]
602#[derive(Clone, Debug)]
603pub struct DeploymentResourcePoolService {
604 inner: std::sync::Arc<dyn super::stub::dynamic::DeploymentResourcePoolService>,
605}
606
607#[cfg(feature = "deployment-resource-pool-service")]
608impl DeploymentResourcePoolService {
609 /// Returns a builder for [DeploymentResourcePoolService].
610 ///
611 /// ```
612 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
613 /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
614 /// let client = DeploymentResourcePoolService::builder().build().await?;
615 /// # Ok(()) }
616 /// ```
617 pub fn builder() -> super::builder::deployment_resource_pool_service::ClientBuilder {
618 crate::new_client_builder(super::builder::deployment_resource_pool_service::client::Factory)
619 }
620
621 /// Creates a new client from the provided stub.
622 ///
623 /// The most common case for calling this function is in tests mocking the
624 /// client's behavior.
625 pub fn from_stub<T>(stub: T) -> Self
626 where
627 T: super::stub::DeploymentResourcePoolService + 'static,
628 {
629 Self {
630 inner: std::sync::Arc::new(stub),
631 }
632 }
633
634 pub(crate) async fn new(
635 config: gaxi::options::ClientConfig,
636 ) -> crate::ClientBuilderResult<Self> {
637 let inner = Self::build_inner(config).await?;
638 Ok(Self { inner })
639 }
640
641 async fn build_inner(
642 conf: gaxi::options::ClientConfig,
643 ) -> crate::ClientBuilderResult<
644 std::sync::Arc<dyn super::stub::dynamic::DeploymentResourcePoolService>,
645 > {
646 if gaxi::options::tracing_enabled(&conf) {
647 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
648 }
649 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
650 }
651
652 async fn build_transport(
653 conf: gaxi::options::ClientConfig,
654 ) -> crate::ClientBuilderResult<impl super::stub::DeploymentResourcePoolService> {
655 super::transport::DeploymentResourcePoolService::new(conf).await
656 }
657
658 async fn build_with_tracing(
659 conf: gaxi::options::ClientConfig,
660 ) -> crate::ClientBuilderResult<impl super::stub::DeploymentResourcePoolService> {
661 Self::build_transport(conf)
662 .await
663 .map(super::tracing::DeploymentResourcePoolService::new)
664 }
665
666 /// Create a DeploymentResourcePool.
667 ///
668 /// # Long running operations
669 ///
670 /// This method is used to start, and/or poll a [long-running Operation].
671 /// The [Working with long-running operations] chapter in the [user guide]
672 /// covers these operations in detail.
673 ///
674 /// [long-running operation]: https://google.aip.dev/151
675 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
676 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
677 pub fn create_deployment_resource_pool(
678 &self,
679 ) -> super::builder::deployment_resource_pool_service::CreateDeploymentResourcePool {
680 super::builder::deployment_resource_pool_service::CreateDeploymentResourcePool::new(
681 self.inner.clone(),
682 )
683 }
684
685 /// Get a DeploymentResourcePool.
686 pub fn get_deployment_resource_pool(
687 &self,
688 ) -> super::builder::deployment_resource_pool_service::GetDeploymentResourcePool {
689 super::builder::deployment_resource_pool_service::GetDeploymentResourcePool::new(
690 self.inner.clone(),
691 )
692 }
693
694 /// List DeploymentResourcePools in a location.
695 pub fn list_deployment_resource_pools(
696 &self,
697 ) -> super::builder::deployment_resource_pool_service::ListDeploymentResourcePools {
698 super::builder::deployment_resource_pool_service::ListDeploymentResourcePools::new(
699 self.inner.clone(),
700 )
701 }
702
703 /// Update a DeploymentResourcePool.
704 ///
705 /// # Long running operations
706 ///
707 /// This method is used to start, and/or poll a [long-running Operation].
708 /// The [Working with long-running operations] chapter in the [user guide]
709 /// covers these operations in detail.
710 ///
711 /// [long-running operation]: https://google.aip.dev/151
712 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
713 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
714 pub fn update_deployment_resource_pool(
715 &self,
716 ) -> super::builder::deployment_resource_pool_service::UpdateDeploymentResourcePool {
717 super::builder::deployment_resource_pool_service::UpdateDeploymentResourcePool::new(
718 self.inner.clone(),
719 )
720 }
721
722 /// Delete a DeploymentResourcePool.
723 ///
724 /// # Long running operations
725 ///
726 /// This method is used to start, and/or poll a [long-running Operation].
727 /// The [Working with long-running operations] chapter in the [user guide]
728 /// covers these operations in detail.
729 ///
730 /// [long-running operation]: https://google.aip.dev/151
731 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
732 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
733 pub fn delete_deployment_resource_pool(
734 &self,
735 ) -> super::builder::deployment_resource_pool_service::DeleteDeploymentResourcePool {
736 super::builder::deployment_resource_pool_service::DeleteDeploymentResourcePool::new(
737 self.inner.clone(),
738 )
739 }
740
741 /// List DeployedModels that have been deployed on this DeploymentResourcePool.
742 pub fn query_deployed_models(
743 &self,
744 ) -> super::builder::deployment_resource_pool_service::QueryDeployedModels {
745 super::builder::deployment_resource_pool_service::QueryDeployedModels::new(
746 self.inner.clone(),
747 )
748 }
749
750 /// Lists information about the supported locations for this service.
751 pub fn list_locations(
752 &self,
753 ) -> super::builder::deployment_resource_pool_service::ListLocations {
754 super::builder::deployment_resource_pool_service::ListLocations::new(self.inner.clone())
755 }
756
757 /// Gets information about a location.
758 pub fn get_location(&self) -> super::builder::deployment_resource_pool_service::GetLocation {
759 super::builder::deployment_resource_pool_service::GetLocation::new(self.inner.clone())
760 }
761
762 /// Sets the access control policy on the specified resource. Replaces
763 /// any existing policy.
764 ///
765 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
766 /// errors.
767 pub fn set_iam_policy(&self) -> super::builder::deployment_resource_pool_service::SetIamPolicy {
768 super::builder::deployment_resource_pool_service::SetIamPolicy::new(self.inner.clone())
769 }
770
771 /// Gets the access control policy for a resource. Returns an empty policy
772 /// if the resource exists and does not have a policy set.
773 pub fn get_iam_policy(&self) -> super::builder::deployment_resource_pool_service::GetIamPolicy {
774 super::builder::deployment_resource_pool_service::GetIamPolicy::new(self.inner.clone())
775 }
776
777 /// Returns permissions that a caller has on the specified resource. If the
778 /// resource does not exist, this will return an empty set of
779 /// permissions, not a `NOT_FOUND` error.
780 ///
781 /// Note: This operation is designed to be used for building
782 /// permission-aware UIs and command-line tools, not for authorization
783 /// checking. This operation may "fail open" without warning.
784 pub fn test_iam_permissions(
785 &self,
786 ) -> super::builder::deployment_resource_pool_service::TestIamPermissions {
787 super::builder::deployment_resource_pool_service::TestIamPermissions::new(
788 self.inner.clone(),
789 )
790 }
791
792 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
793 ///
794 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
795 pub fn list_operations(
796 &self,
797 ) -> super::builder::deployment_resource_pool_service::ListOperations {
798 super::builder::deployment_resource_pool_service::ListOperations::new(self.inner.clone())
799 }
800
801 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
802 ///
803 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
804 pub fn get_operation(&self) -> super::builder::deployment_resource_pool_service::GetOperation {
805 super::builder::deployment_resource_pool_service::GetOperation::new(self.inner.clone())
806 }
807
808 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
809 ///
810 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
811 pub fn delete_operation(
812 &self,
813 ) -> super::builder::deployment_resource_pool_service::DeleteOperation {
814 super::builder::deployment_resource_pool_service::DeleteOperation::new(self.inner.clone())
815 }
816
817 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
818 ///
819 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
820 pub fn cancel_operation(
821 &self,
822 ) -> super::builder::deployment_resource_pool_service::CancelOperation {
823 super::builder::deployment_resource_pool_service::CancelOperation::new(self.inner.clone())
824 }
825
826 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
827 ///
828 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
829 pub fn wait_operation(
830 &self,
831 ) -> super::builder::deployment_resource_pool_service::WaitOperation {
832 super::builder::deployment_resource_pool_service::WaitOperation::new(self.inner.clone())
833 }
834}
835
836/// Implements a client for the Vertex AI API.
837///
838/// # Example
839/// ```
840/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
841/// # use google_cloud_aiplatform_v1::client::EndpointService;
842/// let client = EndpointService::builder().build().await?;
843/// // use `client` to make requests to the Vertex AI API.
844/// # Ok(()) }
845/// ```
846///
847/// # Service Description
848///
849/// A service for managing Vertex AI's Endpoints.
850///
851/// # Configuration
852///
853/// To configure `EndpointService` use the `with_*` methods in the type returned
854/// by [builder()][EndpointService::builder]. The default configuration should
855/// work for most applications. Common configuration changes include
856///
857/// * [with_endpoint()]: by default this client uses the global default endpoint
858/// (`https://aiplatform.googleapis.com`). Applications using regional
859/// endpoints or running in restricted networks (e.g. a network configured
860// with [Private Google Access with VPC Service Controls]) may want to
861/// override this default.
862/// * [with_credentials()]: by default this client uses
863/// [Application Default Credentials]. Applications using custom
864/// authentication may need to override this default.
865///
866/// [with_endpoint()]: super::builder::endpoint_service::ClientBuilder::with_endpoint
867/// [with_credentials()]: super::builder::endpoint_service::ClientBuilder::credentials
868/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
869/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
870///
871/// # Pooling and Cloning
872///
873/// `EndpointService` holds a connection pool internally, it is advised to
874/// create one and the reuse it. You do not need to wrap `EndpointService` in
875/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
876/// already uses an `Arc` internally.
877#[cfg(feature = "endpoint-service")]
878#[cfg_attr(docsrs, doc(cfg(feature = "endpoint-service")))]
879#[derive(Clone, Debug)]
880pub struct EndpointService {
881 inner: std::sync::Arc<dyn super::stub::dynamic::EndpointService>,
882}
883
884#[cfg(feature = "endpoint-service")]
885impl EndpointService {
886 /// Returns a builder for [EndpointService].
887 ///
888 /// ```
889 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
890 /// # use google_cloud_aiplatform_v1::client::EndpointService;
891 /// let client = EndpointService::builder().build().await?;
892 /// # Ok(()) }
893 /// ```
894 pub fn builder() -> super::builder::endpoint_service::ClientBuilder {
895 crate::new_client_builder(super::builder::endpoint_service::client::Factory)
896 }
897
898 /// Creates a new client from the provided stub.
899 ///
900 /// The most common case for calling this function is in tests mocking the
901 /// client's behavior.
902 pub fn from_stub<T>(stub: T) -> Self
903 where
904 T: super::stub::EndpointService + 'static,
905 {
906 Self {
907 inner: std::sync::Arc::new(stub),
908 }
909 }
910
911 pub(crate) async fn new(
912 config: gaxi::options::ClientConfig,
913 ) -> crate::ClientBuilderResult<Self> {
914 let inner = Self::build_inner(config).await?;
915 Ok(Self { inner })
916 }
917
918 async fn build_inner(
919 conf: gaxi::options::ClientConfig,
920 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::EndpointService>> {
921 if gaxi::options::tracing_enabled(&conf) {
922 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
923 }
924 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
925 }
926
927 async fn build_transport(
928 conf: gaxi::options::ClientConfig,
929 ) -> crate::ClientBuilderResult<impl super::stub::EndpointService> {
930 super::transport::EndpointService::new(conf).await
931 }
932
933 async fn build_with_tracing(
934 conf: gaxi::options::ClientConfig,
935 ) -> crate::ClientBuilderResult<impl super::stub::EndpointService> {
936 Self::build_transport(conf)
937 .await
938 .map(super::tracing::EndpointService::new)
939 }
940
941 /// Creates an Endpoint.
942 ///
943 /// # Long running operations
944 ///
945 /// This method is used to start, and/or poll a [long-running Operation].
946 /// The [Working with long-running operations] chapter in the [user guide]
947 /// covers these operations in detail.
948 ///
949 /// [long-running operation]: https://google.aip.dev/151
950 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
951 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
952 pub fn create_endpoint(&self) -> super::builder::endpoint_service::CreateEndpoint {
953 super::builder::endpoint_service::CreateEndpoint::new(self.inner.clone())
954 }
955
956 /// Gets an Endpoint.
957 pub fn get_endpoint(&self) -> super::builder::endpoint_service::GetEndpoint {
958 super::builder::endpoint_service::GetEndpoint::new(self.inner.clone())
959 }
960
961 /// Lists Endpoints in a Location.
962 pub fn list_endpoints(&self) -> super::builder::endpoint_service::ListEndpoints {
963 super::builder::endpoint_service::ListEndpoints::new(self.inner.clone())
964 }
965
966 /// Updates an Endpoint.
967 pub fn update_endpoint(&self) -> super::builder::endpoint_service::UpdateEndpoint {
968 super::builder::endpoint_service::UpdateEndpoint::new(self.inner.clone())
969 }
970
971 /// Updates an Endpoint with a long running operation.
972 ///
973 /// # Long running operations
974 ///
975 /// This method is used to start, and/or poll a [long-running Operation].
976 /// The [Working with long-running operations] chapter in the [user guide]
977 /// covers these operations in detail.
978 ///
979 /// [long-running operation]: https://google.aip.dev/151
980 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
981 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
982 pub fn update_endpoint_long_running(
983 &self,
984 ) -> super::builder::endpoint_service::UpdateEndpointLongRunning {
985 super::builder::endpoint_service::UpdateEndpointLongRunning::new(self.inner.clone())
986 }
987
988 /// Deletes an Endpoint.
989 ///
990 /// # Long running operations
991 ///
992 /// This method is used to start, and/or poll a [long-running Operation].
993 /// The [Working with long-running operations] chapter in the [user guide]
994 /// covers these operations in detail.
995 ///
996 /// [long-running operation]: https://google.aip.dev/151
997 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
998 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
999 pub fn delete_endpoint(&self) -> super::builder::endpoint_service::DeleteEndpoint {
1000 super::builder::endpoint_service::DeleteEndpoint::new(self.inner.clone())
1001 }
1002
1003 /// Deploys a Model into this Endpoint, creating a DeployedModel within it.
1004 ///
1005 /// # Long running operations
1006 ///
1007 /// This method is used to start, and/or poll a [long-running Operation].
1008 /// The [Working with long-running operations] chapter in the [user guide]
1009 /// covers these operations in detail.
1010 ///
1011 /// [long-running operation]: https://google.aip.dev/151
1012 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1013 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1014 pub fn deploy_model(&self) -> super::builder::endpoint_service::DeployModel {
1015 super::builder::endpoint_service::DeployModel::new(self.inner.clone())
1016 }
1017
1018 /// Undeploys a Model from an Endpoint, removing a DeployedModel from it, and
1019 /// freeing all resources it's using.
1020 ///
1021 /// # Long running operations
1022 ///
1023 /// This method is used to start, and/or poll a [long-running Operation].
1024 /// The [Working with long-running operations] chapter in the [user guide]
1025 /// covers these operations in detail.
1026 ///
1027 /// [long-running operation]: https://google.aip.dev/151
1028 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1029 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1030 pub fn undeploy_model(&self) -> super::builder::endpoint_service::UndeployModel {
1031 super::builder::endpoint_service::UndeployModel::new(self.inner.clone())
1032 }
1033
1034 /// Updates an existing deployed model. Updatable fields include
1035 /// `min_replica_count`, `max_replica_count`, `required_replica_count`,
1036 /// `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and
1037 /// `enable_container_logging` (v1beta1 only).
1038 ///
1039 /// # Long running operations
1040 ///
1041 /// This method is used to start, and/or poll a [long-running Operation].
1042 /// The [Working with long-running operations] chapter in the [user guide]
1043 /// covers these operations in detail.
1044 ///
1045 /// [long-running operation]: https://google.aip.dev/151
1046 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1047 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1048 pub fn mutate_deployed_model(&self) -> super::builder::endpoint_service::MutateDeployedModel {
1049 super::builder::endpoint_service::MutateDeployedModel::new(self.inner.clone())
1050 }
1051
1052 /// Lists information about the supported locations for this service.
1053 pub fn list_locations(&self) -> super::builder::endpoint_service::ListLocations {
1054 super::builder::endpoint_service::ListLocations::new(self.inner.clone())
1055 }
1056
1057 /// Gets information about a location.
1058 pub fn get_location(&self) -> super::builder::endpoint_service::GetLocation {
1059 super::builder::endpoint_service::GetLocation::new(self.inner.clone())
1060 }
1061
1062 /// Sets the access control policy on the specified resource. Replaces
1063 /// any existing policy.
1064 ///
1065 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1066 /// errors.
1067 pub fn set_iam_policy(&self) -> super::builder::endpoint_service::SetIamPolicy {
1068 super::builder::endpoint_service::SetIamPolicy::new(self.inner.clone())
1069 }
1070
1071 /// Gets the access control policy for a resource. Returns an empty policy
1072 /// if the resource exists and does not have a policy set.
1073 pub fn get_iam_policy(&self) -> super::builder::endpoint_service::GetIamPolicy {
1074 super::builder::endpoint_service::GetIamPolicy::new(self.inner.clone())
1075 }
1076
1077 /// Returns permissions that a caller has on the specified resource. If the
1078 /// resource does not exist, this will return an empty set of
1079 /// permissions, not a `NOT_FOUND` error.
1080 ///
1081 /// Note: This operation is designed to be used for building
1082 /// permission-aware UIs and command-line tools, not for authorization
1083 /// checking. This operation may "fail open" without warning.
1084 pub fn test_iam_permissions(&self) -> super::builder::endpoint_service::TestIamPermissions {
1085 super::builder::endpoint_service::TestIamPermissions::new(self.inner.clone())
1086 }
1087
1088 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1089 ///
1090 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1091 pub fn list_operations(&self) -> super::builder::endpoint_service::ListOperations {
1092 super::builder::endpoint_service::ListOperations::new(self.inner.clone())
1093 }
1094
1095 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1096 ///
1097 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1098 pub fn get_operation(&self) -> super::builder::endpoint_service::GetOperation {
1099 super::builder::endpoint_service::GetOperation::new(self.inner.clone())
1100 }
1101
1102 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1103 ///
1104 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1105 pub fn delete_operation(&self) -> super::builder::endpoint_service::DeleteOperation {
1106 super::builder::endpoint_service::DeleteOperation::new(self.inner.clone())
1107 }
1108
1109 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1110 ///
1111 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1112 pub fn cancel_operation(&self) -> super::builder::endpoint_service::CancelOperation {
1113 super::builder::endpoint_service::CancelOperation::new(self.inner.clone())
1114 }
1115
1116 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1117 ///
1118 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1119 pub fn wait_operation(&self) -> super::builder::endpoint_service::WaitOperation {
1120 super::builder::endpoint_service::WaitOperation::new(self.inner.clone())
1121 }
1122}
1123
1124/// Implements a client for the Vertex AI API.
1125///
1126/// # Example
1127/// ```
1128/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1129/// # use google_cloud_aiplatform_v1::client::EvaluationService;
1130/// let client = EvaluationService::builder().build().await?;
1131/// // use `client` to make requests to the Vertex AI API.
1132/// # Ok(()) }
1133/// ```
1134///
1135/// # Service Description
1136///
1137/// Vertex AI Online Evaluation Service.
1138///
1139/// # Configuration
1140///
1141/// To configure `EvaluationService` use the `with_*` methods in the type returned
1142/// by [builder()][EvaluationService::builder]. The default configuration should
1143/// work for most applications. Common configuration changes include
1144///
1145/// * [with_endpoint()]: by default this client uses the global default endpoint
1146/// (`https://aiplatform.googleapis.com`). Applications using regional
1147/// endpoints or running in restricted networks (e.g. a network configured
1148// with [Private Google Access with VPC Service Controls]) may want to
1149/// override this default.
1150/// * [with_credentials()]: by default this client uses
1151/// [Application Default Credentials]. Applications using custom
1152/// authentication may need to override this default.
1153///
1154/// [with_endpoint()]: super::builder::evaluation_service::ClientBuilder::with_endpoint
1155/// [with_credentials()]: super::builder::evaluation_service::ClientBuilder::credentials
1156/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1157/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1158///
1159/// # Pooling and Cloning
1160///
1161/// `EvaluationService` holds a connection pool internally, it is advised to
1162/// create one and the reuse it. You do not need to wrap `EvaluationService` in
1163/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1164/// already uses an `Arc` internally.
1165#[cfg(feature = "evaluation-service")]
1166#[cfg_attr(docsrs, doc(cfg(feature = "evaluation-service")))]
1167#[derive(Clone, Debug)]
1168pub struct EvaluationService {
1169 inner: std::sync::Arc<dyn super::stub::dynamic::EvaluationService>,
1170}
1171
1172#[cfg(feature = "evaluation-service")]
1173impl EvaluationService {
1174 /// Returns a builder for [EvaluationService].
1175 ///
1176 /// ```
1177 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1178 /// # use google_cloud_aiplatform_v1::client::EvaluationService;
1179 /// let client = EvaluationService::builder().build().await?;
1180 /// # Ok(()) }
1181 /// ```
1182 pub fn builder() -> super::builder::evaluation_service::ClientBuilder {
1183 crate::new_client_builder(super::builder::evaluation_service::client::Factory)
1184 }
1185
1186 /// Creates a new client from the provided stub.
1187 ///
1188 /// The most common case for calling this function is in tests mocking the
1189 /// client's behavior.
1190 pub fn from_stub<T>(stub: T) -> Self
1191 where
1192 T: super::stub::EvaluationService + 'static,
1193 {
1194 Self {
1195 inner: std::sync::Arc::new(stub),
1196 }
1197 }
1198
1199 pub(crate) async fn new(
1200 config: gaxi::options::ClientConfig,
1201 ) -> crate::ClientBuilderResult<Self> {
1202 let inner = Self::build_inner(config).await?;
1203 Ok(Self { inner })
1204 }
1205
1206 async fn build_inner(
1207 conf: gaxi::options::ClientConfig,
1208 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::EvaluationService>>
1209 {
1210 if gaxi::options::tracing_enabled(&conf) {
1211 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1212 }
1213 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1214 }
1215
1216 async fn build_transport(
1217 conf: gaxi::options::ClientConfig,
1218 ) -> crate::ClientBuilderResult<impl super::stub::EvaluationService> {
1219 super::transport::EvaluationService::new(conf).await
1220 }
1221
1222 async fn build_with_tracing(
1223 conf: gaxi::options::ClientConfig,
1224 ) -> crate::ClientBuilderResult<impl super::stub::EvaluationService> {
1225 Self::build_transport(conf)
1226 .await
1227 .map(super::tracing::EvaluationService::new)
1228 }
1229
1230 /// Evaluates instances based on a given metric.
1231 pub fn evaluate_instances(&self) -> super::builder::evaluation_service::EvaluateInstances {
1232 super::builder::evaluation_service::EvaluateInstances::new(self.inner.clone())
1233 }
1234
1235 /// Lists information about the supported locations for this service.
1236 pub fn list_locations(&self) -> super::builder::evaluation_service::ListLocations {
1237 super::builder::evaluation_service::ListLocations::new(self.inner.clone())
1238 }
1239
1240 /// Gets information about a location.
1241 pub fn get_location(&self) -> super::builder::evaluation_service::GetLocation {
1242 super::builder::evaluation_service::GetLocation::new(self.inner.clone())
1243 }
1244
1245 /// Sets the access control policy on the specified resource. Replaces
1246 /// any existing policy.
1247 ///
1248 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1249 /// errors.
1250 pub fn set_iam_policy(&self) -> super::builder::evaluation_service::SetIamPolicy {
1251 super::builder::evaluation_service::SetIamPolicy::new(self.inner.clone())
1252 }
1253
1254 /// Gets the access control policy for a resource. Returns an empty policy
1255 /// if the resource exists and does not have a policy set.
1256 pub fn get_iam_policy(&self) -> super::builder::evaluation_service::GetIamPolicy {
1257 super::builder::evaluation_service::GetIamPolicy::new(self.inner.clone())
1258 }
1259
1260 /// Returns permissions that a caller has on the specified resource. If the
1261 /// resource does not exist, this will return an empty set of
1262 /// permissions, not a `NOT_FOUND` error.
1263 ///
1264 /// Note: This operation is designed to be used for building
1265 /// permission-aware UIs and command-line tools, not for authorization
1266 /// checking. This operation may "fail open" without warning.
1267 pub fn test_iam_permissions(&self) -> super::builder::evaluation_service::TestIamPermissions {
1268 super::builder::evaluation_service::TestIamPermissions::new(self.inner.clone())
1269 }
1270
1271 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1272 ///
1273 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1274 pub fn list_operations(&self) -> super::builder::evaluation_service::ListOperations {
1275 super::builder::evaluation_service::ListOperations::new(self.inner.clone())
1276 }
1277
1278 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1279 ///
1280 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1281 pub fn get_operation(&self) -> super::builder::evaluation_service::GetOperation {
1282 super::builder::evaluation_service::GetOperation::new(self.inner.clone())
1283 }
1284
1285 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1286 ///
1287 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1288 pub fn delete_operation(&self) -> super::builder::evaluation_service::DeleteOperation {
1289 super::builder::evaluation_service::DeleteOperation::new(self.inner.clone())
1290 }
1291
1292 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1293 ///
1294 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1295 pub fn cancel_operation(&self) -> super::builder::evaluation_service::CancelOperation {
1296 super::builder::evaluation_service::CancelOperation::new(self.inner.clone())
1297 }
1298
1299 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1300 ///
1301 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1302 pub fn wait_operation(&self) -> super::builder::evaluation_service::WaitOperation {
1303 super::builder::evaluation_service::WaitOperation::new(self.inner.clone())
1304 }
1305}
1306
1307/// Implements a client for the Vertex AI API.
1308///
1309/// # Example
1310/// ```
1311/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1312/// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
1313/// let client = FeatureOnlineStoreAdminService::builder().build().await?;
1314/// // use `client` to make requests to the Vertex AI API.
1315/// # Ok(()) }
1316/// ```
1317///
1318/// # Service Description
1319///
1320/// The service that handles CRUD and List for resources for
1321/// FeatureOnlineStore.
1322///
1323/// # Configuration
1324///
1325/// To configure `FeatureOnlineStoreAdminService` use the `with_*` methods in the type returned
1326/// by [builder()][FeatureOnlineStoreAdminService::builder]. The default configuration should
1327/// work for most applications. Common configuration changes include
1328///
1329/// * [with_endpoint()]: by default this client uses the global default endpoint
1330/// (`https://aiplatform.googleapis.com`). Applications using regional
1331/// endpoints or running in restricted networks (e.g. a network configured
1332// with [Private Google Access with VPC Service Controls]) may want to
1333/// override this default.
1334/// * [with_credentials()]: by default this client uses
1335/// [Application Default Credentials]. Applications using custom
1336/// authentication may need to override this default.
1337///
1338/// [with_endpoint()]: super::builder::feature_online_store_admin_service::ClientBuilder::with_endpoint
1339/// [with_credentials()]: super::builder::feature_online_store_admin_service::ClientBuilder::credentials
1340/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1341/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1342///
1343/// # Pooling and Cloning
1344///
1345/// `FeatureOnlineStoreAdminService` holds a connection pool internally, it is advised to
1346/// create one and the reuse it. You do not need to wrap `FeatureOnlineStoreAdminService` in
1347/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1348/// already uses an `Arc` internally.
1349#[cfg(feature = "feature-online-store-admin-service")]
1350#[cfg_attr(docsrs, doc(cfg(feature = "feature-online-store-admin-service")))]
1351#[derive(Clone, Debug)]
1352pub struct FeatureOnlineStoreAdminService {
1353 inner: std::sync::Arc<dyn super::stub::dynamic::FeatureOnlineStoreAdminService>,
1354}
1355
1356#[cfg(feature = "feature-online-store-admin-service")]
1357impl FeatureOnlineStoreAdminService {
1358 /// Returns a builder for [FeatureOnlineStoreAdminService].
1359 ///
1360 /// ```
1361 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1362 /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
1363 /// let client = FeatureOnlineStoreAdminService::builder().build().await?;
1364 /// # Ok(()) }
1365 /// ```
1366 pub fn builder() -> super::builder::feature_online_store_admin_service::ClientBuilder {
1367 crate::new_client_builder(
1368 super::builder::feature_online_store_admin_service::client::Factory,
1369 )
1370 }
1371
1372 /// Creates a new client from the provided stub.
1373 ///
1374 /// The most common case for calling this function is in tests mocking the
1375 /// client's behavior.
1376 pub fn from_stub<T>(stub: T) -> Self
1377 where
1378 T: super::stub::FeatureOnlineStoreAdminService + 'static,
1379 {
1380 Self {
1381 inner: std::sync::Arc::new(stub),
1382 }
1383 }
1384
1385 pub(crate) async fn new(
1386 config: gaxi::options::ClientConfig,
1387 ) -> crate::ClientBuilderResult<Self> {
1388 let inner = Self::build_inner(config).await?;
1389 Ok(Self { inner })
1390 }
1391
1392 async fn build_inner(
1393 conf: gaxi::options::ClientConfig,
1394 ) -> crate::ClientBuilderResult<
1395 std::sync::Arc<dyn super::stub::dynamic::FeatureOnlineStoreAdminService>,
1396 > {
1397 if gaxi::options::tracing_enabled(&conf) {
1398 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1399 }
1400 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1401 }
1402
1403 async fn build_transport(
1404 conf: gaxi::options::ClientConfig,
1405 ) -> crate::ClientBuilderResult<impl super::stub::FeatureOnlineStoreAdminService> {
1406 super::transport::FeatureOnlineStoreAdminService::new(conf).await
1407 }
1408
1409 async fn build_with_tracing(
1410 conf: gaxi::options::ClientConfig,
1411 ) -> crate::ClientBuilderResult<impl super::stub::FeatureOnlineStoreAdminService> {
1412 Self::build_transport(conf)
1413 .await
1414 .map(super::tracing::FeatureOnlineStoreAdminService::new)
1415 }
1416
1417 /// Creates a new FeatureOnlineStore in a given project and location.
1418 ///
1419 /// # Long running operations
1420 ///
1421 /// This method is used to start, and/or poll a [long-running Operation].
1422 /// The [Working with long-running operations] chapter in the [user guide]
1423 /// covers these operations in detail.
1424 ///
1425 /// [long-running operation]: https://google.aip.dev/151
1426 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1427 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1428 pub fn create_feature_online_store(
1429 &self,
1430 ) -> super::builder::feature_online_store_admin_service::CreateFeatureOnlineStore {
1431 super::builder::feature_online_store_admin_service::CreateFeatureOnlineStore::new(
1432 self.inner.clone(),
1433 )
1434 }
1435
1436 /// Gets details of a single FeatureOnlineStore.
1437 pub fn get_feature_online_store(
1438 &self,
1439 ) -> super::builder::feature_online_store_admin_service::GetFeatureOnlineStore {
1440 super::builder::feature_online_store_admin_service::GetFeatureOnlineStore::new(
1441 self.inner.clone(),
1442 )
1443 }
1444
1445 /// Lists FeatureOnlineStores in a given project and location.
1446 pub fn list_feature_online_stores(
1447 &self,
1448 ) -> super::builder::feature_online_store_admin_service::ListFeatureOnlineStores {
1449 super::builder::feature_online_store_admin_service::ListFeatureOnlineStores::new(
1450 self.inner.clone(),
1451 )
1452 }
1453
1454 /// Updates the parameters of a single FeatureOnlineStore.
1455 ///
1456 /// # Long running operations
1457 ///
1458 /// This method is used to start, and/or poll a [long-running Operation].
1459 /// The [Working with long-running operations] chapter in the [user guide]
1460 /// covers these operations in detail.
1461 ///
1462 /// [long-running operation]: https://google.aip.dev/151
1463 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1464 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1465 pub fn update_feature_online_store(
1466 &self,
1467 ) -> super::builder::feature_online_store_admin_service::UpdateFeatureOnlineStore {
1468 super::builder::feature_online_store_admin_service::UpdateFeatureOnlineStore::new(
1469 self.inner.clone(),
1470 )
1471 }
1472
1473 /// Deletes a single FeatureOnlineStore. The FeatureOnlineStore must not
1474 /// contain any FeatureViews.
1475 ///
1476 /// # Long running operations
1477 ///
1478 /// This method is used to start, and/or poll a [long-running Operation].
1479 /// The [Working with long-running operations] chapter in the [user guide]
1480 /// covers these operations in detail.
1481 ///
1482 /// [long-running operation]: https://google.aip.dev/151
1483 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1484 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1485 pub fn delete_feature_online_store(
1486 &self,
1487 ) -> super::builder::feature_online_store_admin_service::DeleteFeatureOnlineStore {
1488 super::builder::feature_online_store_admin_service::DeleteFeatureOnlineStore::new(
1489 self.inner.clone(),
1490 )
1491 }
1492
1493 /// Creates a new FeatureView in a given FeatureOnlineStore.
1494 ///
1495 /// # Long running operations
1496 ///
1497 /// This method is used to start, and/or poll a [long-running Operation].
1498 /// The [Working with long-running operations] chapter in the [user guide]
1499 /// covers these operations in detail.
1500 ///
1501 /// [long-running operation]: https://google.aip.dev/151
1502 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1503 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1504 pub fn create_feature_view(
1505 &self,
1506 ) -> super::builder::feature_online_store_admin_service::CreateFeatureView {
1507 super::builder::feature_online_store_admin_service::CreateFeatureView::new(
1508 self.inner.clone(),
1509 )
1510 }
1511
1512 /// Gets details of a single FeatureView.
1513 pub fn get_feature_view(
1514 &self,
1515 ) -> super::builder::feature_online_store_admin_service::GetFeatureView {
1516 super::builder::feature_online_store_admin_service::GetFeatureView::new(self.inner.clone())
1517 }
1518
1519 /// Lists FeatureViews in a given FeatureOnlineStore.
1520 pub fn list_feature_views(
1521 &self,
1522 ) -> super::builder::feature_online_store_admin_service::ListFeatureViews {
1523 super::builder::feature_online_store_admin_service::ListFeatureViews::new(
1524 self.inner.clone(),
1525 )
1526 }
1527
1528 /// Updates the parameters of a single FeatureView.
1529 ///
1530 /// # Long running operations
1531 ///
1532 /// This method is used to start, and/or poll a [long-running Operation].
1533 /// The [Working with long-running operations] chapter in the [user guide]
1534 /// covers these operations in detail.
1535 ///
1536 /// [long-running operation]: https://google.aip.dev/151
1537 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1538 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1539 pub fn update_feature_view(
1540 &self,
1541 ) -> super::builder::feature_online_store_admin_service::UpdateFeatureView {
1542 super::builder::feature_online_store_admin_service::UpdateFeatureView::new(
1543 self.inner.clone(),
1544 )
1545 }
1546
1547 /// Deletes a single FeatureView.
1548 ///
1549 /// # Long running operations
1550 ///
1551 /// This method is used to start, and/or poll a [long-running Operation].
1552 /// The [Working with long-running operations] chapter in the [user guide]
1553 /// covers these operations in detail.
1554 ///
1555 /// [long-running operation]: https://google.aip.dev/151
1556 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1557 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1558 pub fn delete_feature_view(
1559 &self,
1560 ) -> super::builder::feature_online_store_admin_service::DeleteFeatureView {
1561 super::builder::feature_online_store_admin_service::DeleteFeatureView::new(
1562 self.inner.clone(),
1563 )
1564 }
1565
1566 /// Triggers on-demand sync for the FeatureView.
1567 pub fn sync_feature_view(
1568 &self,
1569 ) -> super::builder::feature_online_store_admin_service::SyncFeatureView {
1570 super::builder::feature_online_store_admin_service::SyncFeatureView::new(self.inner.clone())
1571 }
1572
1573 /// Gets details of a single FeatureViewSync.
1574 pub fn get_feature_view_sync(
1575 &self,
1576 ) -> super::builder::feature_online_store_admin_service::GetFeatureViewSync {
1577 super::builder::feature_online_store_admin_service::GetFeatureViewSync::new(
1578 self.inner.clone(),
1579 )
1580 }
1581
1582 /// Lists FeatureViewSyncs in a given FeatureView.
1583 pub fn list_feature_view_syncs(
1584 &self,
1585 ) -> super::builder::feature_online_store_admin_service::ListFeatureViewSyncs {
1586 super::builder::feature_online_store_admin_service::ListFeatureViewSyncs::new(
1587 self.inner.clone(),
1588 )
1589 }
1590
1591 /// Lists information about the supported locations for this service.
1592 pub fn list_locations(
1593 &self,
1594 ) -> super::builder::feature_online_store_admin_service::ListLocations {
1595 super::builder::feature_online_store_admin_service::ListLocations::new(self.inner.clone())
1596 }
1597
1598 /// Gets information about a location.
1599 pub fn get_location(&self) -> super::builder::feature_online_store_admin_service::GetLocation {
1600 super::builder::feature_online_store_admin_service::GetLocation::new(self.inner.clone())
1601 }
1602
1603 /// Sets the access control policy on the specified resource. Replaces
1604 /// any existing policy.
1605 ///
1606 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1607 /// errors.
1608 pub fn set_iam_policy(
1609 &self,
1610 ) -> super::builder::feature_online_store_admin_service::SetIamPolicy {
1611 super::builder::feature_online_store_admin_service::SetIamPolicy::new(self.inner.clone())
1612 }
1613
1614 /// Gets the access control policy for a resource. Returns an empty policy
1615 /// if the resource exists and does not have a policy set.
1616 pub fn get_iam_policy(
1617 &self,
1618 ) -> super::builder::feature_online_store_admin_service::GetIamPolicy {
1619 super::builder::feature_online_store_admin_service::GetIamPolicy::new(self.inner.clone())
1620 }
1621
1622 /// Returns permissions that a caller has on the specified resource. If the
1623 /// resource does not exist, this will return an empty set of
1624 /// permissions, not a `NOT_FOUND` error.
1625 ///
1626 /// Note: This operation is designed to be used for building
1627 /// permission-aware UIs and command-line tools, not for authorization
1628 /// checking. This operation may "fail open" without warning.
1629 pub fn test_iam_permissions(
1630 &self,
1631 ) -> super::builder::feature_online_store_admin_service::TestIamPermissions {
1632 super::builder::feature_online_store_admin_service::TestIamPermissions::new(
1633 self.inner.clone(),
1634 )
1635 }
1636
1637 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1638 ///
1639 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1640 pub fn list_operations(
1641 &self,
1642 ) -> super::builder::feature_online_store_admin_service::ListOperations {
1643 super::builder::feature_online_store_admin_service::ListOperations::new(self.inner.clone())
1644 }
1645
1646 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1647 ///
1648 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1649 pub fn get_operation(
1650 &self,
1651 ) -> super::builder::feature_online_store_admin_service::GetOperation {
1652 super::builder::feature_online_store_admin_service::GetOperation::new(self.inner.clone())
1653 }
1654
1655 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1656 ///
1657 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1658 pub fn delete_operation(
1659 &self,
1660 ) -> super::builder::feature_online_store_admin_service::DeleteOperation {
1661 super::builder::feature_online_store_admin_service::DeleteOperation::new(self.inner.clone())
1662 }
1663
1664 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1665 ///
1666 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1667 pub fn cancel_operation(
1668 &self,
1669 ) -> super::builder::feature_online_store_admin_service::CancelOperation {
1670 super::builder::feature_online_store_admin_service::CancelOperation::new(self.inner.clone())
1671 }
1672
1673 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1674 ///
1675 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1676 pub fn wait_operation(
1677 &self,
1678 ) -> super::builder::feature_online_store_admin_service::WaitOperation {
1679 super::builder::feature_online_store_admin_service::WaitOperation::new(self.inner.clone())
1680 }
1681}
1682
1683/// Implements a client for the Vertex AI API.
1684///
1685/// # Example
1686/// ```
1687/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1688/// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
1689/// let client = FeatureOnlineStoreService::builder().build().await?;
1690/// // use `client` to make requests to the Vertex AI API.
1691/// # Ok(()) }
1692/// ```
1693///
1694/// # Service Description
1695///
1696/// A service for fetching feature values from the online store.
1697///
1698/// # Configuration
1699///
1700/// To configure `FeatureOnlineStoreService` use the `with_*` methods in the type returned
1701/// by [builder()][FeatureOnlineStoreService::builder]. The default configuration should
1702/// work for most applications. Common configuration changes include
1703///
1704/// * [with_endpoint()]: by default this client uses the global default endpoint
1705/// (`https://aiplatform.googleapis.com`). Applications using regional
1706/// endpoints or running in restricted networks (e.g. a network configured
1707// with [Private Google Access with VPC Service Controls]) may want to
1708/// override this default.
1709/// * [with_credentials()]: by default this client uses
1710/// [Application Default Credentials]. Applications using custom
1711/// authentication may need to override this default.
1712///
1713/// [with_endpoint()]: super::builder::feature_online_store_service::ClientBuilder::with_endpoint
1714/// [with_credentials()]: super::builder::feature_online_store_service::ClientBuilder::credentials
1715/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1716/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1717///
1718/// # Pooling and Cloning
1719///
1720/// `FeatureOnlineStoreService` holds a connection pool internally, it is advised to
1721/// create one and the reuse it. You do not need to wrap `FeatureOnlineStoreService` in
1722/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1723/// already uses an `Arc` internally.
1724#[cfg(feature = "feature-online-store-service")]
1725#[cfg_attr(docsrs, doc(cfg(feature = "feature-online-store-service")))]
1726#[derive(Clone, Debug)]
1727pub struct FeatureOnlineStoreService {
1728 inner: std::sync::Arc<dyn super::stub::dynamic::FeatureOnlineStoreService>,
1729}
1730
1731#[cfg(feature = "feature-online-store-service")]
1732impl FeatureOnlineStoreService {
1733 /// Returns a builder for [FeatureOnlineStoreService].
1734 ///
1735 /// ```
1736 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1737 /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
1738 /// let client = FeatureOnlineStoreService::builder().build().await?;
1739 /// # Ok(()) }
1740 /// ```
1741 pub fn builder() -> super::builder::feature_online_store_service::ClientBuilder {
1742 crate::new_client_builder(super::builder::feature_online_store_service::client::Factory)
1743 }
1744
1745 /// Creates a new client from the provided stub.
1746 ///
1747 /// The most common case for calling this function is in tests mocking the
1748 /// client's behavior.
1749 pub fn from_stub<T>(stub: T) -> Self
1750 where
1751 T: super::stub::FeatureOnlineStoreService + 'static,
1752 {
1753 Self {
1754 inner: std::sync::Arc::new(stub),
1755 }
1756 }
1757
1758 pub(crate) async fn new(
1759 config: gaxi::options::ClientConfig,
1760 ) -> crate::ClientBuilderResult<Self> {
1761 let inner = Self::build_inner(config).await?;
1762 Ok(Self { inner })
1763 }
1764
1765 async fn build_inner(
1766 conf: gaxi::options::ClientConfig,
1767 ) -> crate::ClientBuilderResult<
1768 std::sync::Arc<dyn super::stub::dynamic::FeatureOnlineStoreService>,
1769 > {
1770 if gaxi::options::tracing_enabled(&conf) {
1771 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1772 }
1773 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1774 }
1775
1776 async fn build_transport(
1777 conf: gaxi::options::ClientConfig,
1778 ) -> crate::ClientBuilderResult<impl super::stub::FeatureOnlineStoreService> {
1779 super::transport::FeatureOnlineStoreService::new(conf).await
1780 }
1781
1782 async fn build_with_tracing(
1783 conf: gaxi::options::ClientConfig,
1784 ) -> crate::ClientBuilderResult<impl super::stub::FeatureOnlineStoreService> {
1785 Self::build_transport(conf)
1786 .await
1787 .map(super::tracing::FeatureOnlineStoreService::new)
1788 }
1789
1790 /// Fetch feature values under a FeatureView.
1791 pub fn fetch_feature_values(
1792 &self,
1793 ) -> super::builder::feature_online_store_service::FetchFeatureValues {
1794 super::builder::feature_online_store_service::FetchFeatureValues::new(self.inner.clone())
1795 }
1796
1797 /// Search the nearest entities under a FeatureView.
1798 /// Search only works for indexable feature view; if a feature view isn't
1799 /// indexable, returns Invalid argument response.
1800 pub fn search_nearest_entities(
1801 &self,
1802 ) -> super::builder::feature_online_store_service::SearchNearestEntities {
1803 super::builder::feature_online_store_service::SearchNearestEntities::new(self.inner.clone())
1804 }
1805
1806 /// RPC to generate an access token for the given feature view. FeatureViews
1807 /// under the same FeatureOnlineStore share the same access token.
1808 pub fn generate_fetch_access_token(
1809 &self,
1810 ) -> super::builder::feature_online_store_service::GenerateFetchAccessToken {
1811 super::builder::feature_online_store_service::GenerateFetchAccessToken::new(
1812 self.inner.clone(),
1813 )
1814 }
1815
1816 /// Lists information about the supported locations for this service.
1817 pub fn list_locations(&self) -> super::builder::feature_online_store_service::ListLocations {
1818 super::builder::feature_online_store_service::ListLocations::new(self.inner.clone())
1819 }
1820
1821 /// Gets information about a location.
1822 pub fn get_location(&self) -> super::builder::feature_online_store_service::GetLocation {
1823 super::builder::feature_online_store_service::GetLocation::new(self.inner.clone())
1824 }
1825
1826 /// Sets the access control policy on the specified resource. Replaces
1827 /// any existing policy.
1828 ///
1829 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1830 /// errors.
1831 pub fn set_iam_policy(&self) -> super::builder::feature_online_store_service::SetIamPolicy {
1832 super::builder::feature_online_store_service::SetIamPolicy::new(self.inner.clone())
1833 }
1834
1835 /// Gets the access control policy for a resource. Returns an empty policy
1836 /// if the resource exists and does not have a policy set.
1837 pub fn get_iam_policy(&self) -> super::builder::feature_online_store_service::GetIamPolicy {
1838 super::builder::feature_online_store_service::GetIamPolicy::new(self.inner.clone())
1839 }
1840
1841 /// Returns permissions that a caller has on the specified resource. If the
1842 /// resource does not exist, this will return an empty set of
1843 /// permissions, not a `NOT_FOUND` error.
1844 ///
1845 /// Note: This operation is designed to be used for building
1846 /// permission-aware UIs and command-line tools, not for authorization
1847 /// checking. This operation may "fail open" without warning.
1848 pub fn test_iam_permissions(
1849 &self,
1850 ) -> super::builder::feature_online_store_service::TestIamPermissions {
1851 super::builder::feature_online_store_service::TestIamPermissions::new(self.inner.clone())
1852 }
1853
1854 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1855 ///
1856 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1857 pub fn list_operations(&self) -> super::builder::feature_online_store_service::ListOperations {
1858 super::builder::feature_online_store_service::ListOperations::new(self.inner.clone())
1859 }
1860
1861 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1862 ///
1863 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1864 pub fn get_operation(&self) -> super::builder::feature_online_store_service::GetOperation {
1865 super::builder::feature_online_store_service::GetOperation::new(self.inner.clone())
1866 }
1867
1868 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1869 ///
1870 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1871 pub fn delete_operation(
1872 &self,
1873 ) -> super::builder::feature_online_store_service::DeleteOperation {
1874 super::builder::feature_online_store_service::DeleteOperation::new(self.inner.clone())
1875 }
1876
1877 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1878 ///
1879 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1880 pub fn cancel_operation(
1881 &self,
1882 ) -> super::builder::feature_online_store_service::CancelOperation {
1883 super::builder::feature_online_store_service::CancelOperation::new(self.inner.clone())
1884 }
1885
1886 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1887 ///
1888 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1889 pub fn wait_operation(&self) -> super::builder::feature_online_store_service::WaitOperation {
1890 super::builder::feature_online_store_service::WaitOperation::new(self.inner.clone())
1891 }
1892}
1893
1894/// Implements a client for the Vertex AI API.
1895///
1896/// # Example
1897/// ```
1898/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1899/// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
1900/// let client = FeatureRegistryService::builder().build().await?;
1901/// // use `client` to make requests to the Vertex AI API.
1902/// # Ok(()) }
1903/// ```
1904///
1905/// # Service Description
1906///
1907/// The service that handles CRUD and List for resources for
1908/// FeatureRegistry.
1909///
1910/// # Configuration
1911///
1912/// To configure `FeatureRegistryService` use the `with_*` methods in the type returned
1913/// by [builder()][FeatureRegistryService::builder]. The default configuration should
1914/// work for most applications. Common configuration changes include
1915///
1916/// * [with_endpoint()]: by default this client uses the global default endpoint
1917/// (`https://aiplatform.googleapis.com`). Applications using regional
1918/// endpoints or running in restricted networks (e.g. a network configured
1919// with [Private Google Access with VPC Service Controls]) may want to
1920/// override this default.
1921/// * [with_credentials()]: by default this client uses
1922/// [Application Default Credentials]. Applications using custom
1923/// authentication may need to override this default.
1924///
1925/// [with_endpoint()]: super::builder::feature_registry_service::ClientBuilder::with_endpoint
1926/// [with_credentials()]: super::builder::feature_registry_service::ClientBuilder::credentials
1927/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1928/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1929///
1930/// # Pooling and Cloning
1931///
1932/// `FeatureRegistryService` holds a connection pool internally, it is advised to
1933/// create one and the reuse it. You do not need to wrap `FeatureRegistryService` in
1934/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1935/// already uses an `Arc` internally.
1936#[cfg(feature = "feature-registry-service")]
1937#[cfg_attr(docsrs, doc(cfg(feature = "feature-registry-service")))]
1938#[derive(Clone, Debug)]
1939pub struct FeatureRegistryService {
1940 inner: std::sync::Arc<dyn super::stub::dynamic::FeatureRegistryService>,
1941}
1942
1943#[cfg(feature = "feature-registry-service")]
1944impl FeatureRegistryService {
1945 /// Returns a builder for [FeatureRegistryService].
1946 ///
1947 /// ```
1948 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1949 /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
1950 /// let client = FeatureRegistryService::builder().build().await?;
1951 /// # Ok(()) }
1952 /// ```
1953 pub fn builder() -> super::builder::feature_registry_service::ClientBuilder {
1954 crate::new_client_builder(super::builder::feature_registry_service::client::Factory)
1955 }
1956
1957 /// Creates a new client from the provided stub.
1958 ///
1959 /// The most common case for calling this function is in tests mocking the
1960 /// client's behavior.
1961 pub fn from_stub<T>(stub: T) -> Self
1962 where
1963 T: super::stub::FeatureRegistryService + 'static,
1964 {
1965 Self {
1966 inner: std::sync::Arc::new(stub),
1967 }
1968 }
1969
1970 pub(crate) async fn new(
1971 config: gaxi::options::ClientConfig,
1972 ) -> crate::ClientBuilderResult<Self> {
1973 let inner = Self::build_inner(config).await?;
1974 Ok(Self { inner })
1975 }
1976
1977 async fn build_inner(
1978 conf: gaxi::options::ClientConfig,
1979 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FeatureRegistryService>>
1980 {
1981 if gaxi::options::tracing_enabled(&conf) {
1982 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1983 }
1984 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1985 }
1986
1987 async fn build_transport(
1988 conf: gaxi::options::ClientConfig,
1989 ) -> crate::ClientBuilderResult<impl super::stub::FeatureRegistryService> {
1990 super::transport::FeatureRegistryService::new(conf).await
1991 }
1992
1993 async fn build_with_tracing(
1994 conf: gaxi::options::ClientConfig,
1995 ) -> crate::ClientBuilderResult<impl super::stub::FeatureRegistryService> {
1996 Self::build_transport(conf)
1997 .await
1998 .map(super::tracing::FeatureRegistryService::new)
1999 }
2000
2001 /// Creates a new FeatureGroup in a given project and location.
2002 ///
2003 /// # Long running operations
2004 ///
2005 /// This method is used to start, and/or poll a [long-running Operation].
2006 /// The [Working with long-running operations] chapter in the [user guide]
2007 /// covers these operations in detail.
2008 ///
2009 /// [long-running operation]: https://google.aip.dev/151
2010 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2011 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2012 pub fn create_feature_group(
2013 &self,
2014 ) -> super::builder::feature_registry_service::CreateFeatureGroup {
2015 super::builder::feature_registry_service::CreateFeatureGroup::new(self.inner.clone())
2016 }
2017
2018 /// Gets details of a single FeatureGroup.
2019 pub fn get_feature_group(&self) -> super::builder::feature_registry_service::GetFeatureGroup {
2020 super::builder::feature_registry_service::GetFeatureGroup::new(self.inner.clone())
2021 }
2022
2023 /// Lists FeatureGroups in a given project and location.
2024 pub fn list_feature_groups(
2025 &self,
2026 ) -> super::builder::feature_registry_service::ListFeatureGroups {
2027 super::builder::feature_registry_service::ListFeatureGroups::new(self.inner.clone())
2028 }
2029
2030 /// Updates the parameters of a single FeatureGroup.
2031 ///
2032 /// # Long running operations
2033 ///
2034 /// This method is used to start, and/or poll a [long-running Operation].
2035 /// The [Working with long-running operations] chapter in the [user guide]
2036 /// covers these operations in detail.
2037 ///
2038 /// [long-running operation]: https://google.aip.dev/151
2039 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2040 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2041 pub fn update_feature_group(
2042 &self,
2043 ) -> super::builder::feature_registry_service::UpdateFeatureGroup {
2044 super::builder::feature_registry_service::UpdateFeatureGroup::new(self.inner.clone())
2045 }
2046
2047 /// Deletes a single FeatureGroup.
2048 ///
2049 /// # Long running operations
2050 ///
2051 /// This method is used to start, and/or poll a [long-running Operation].
2052 /// The [Working with long-running operations] chapter in the [user guide]
2053 /// covers these operations in detail.
2054 ///
2055 /// [long-running operation]: https://google.aip.dev/151
2056 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2057 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2058 pub fn delete_feature_group(
2059 &self,
2060 ) -> super::builder::feature_registry_service::DeleteFeatureGroup {
2061 super::builder::feature_registry_service::DeleteFeatureGroup::new(self.inner.clone())
2062 }
2063
2064 /// Creates a new Feature in a given FeatureGroup.
2065 ///
2066 /// # Long running operations
2067 ///
2068 /// This method is used to start, and/or poll a [long-running Operation].
2069 /// The [Working with long-running operations] chapter in the [user guide]
2070 /// covers these operations in detail.
2071 ///
2072 /// [long-running operation]: https://google.aip.dev/151
2073 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2074 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2075 pub fn create_feature(&self) -> super::builder::feature_registry_service::CreateFeature {
2076 super::builder::feature_registry_service::CreateFeature::new(self.inner.clone())
2077 }
2078
2079 /// Creates a batch of Features in a given FeatureGroup.
2080 ///
2081 /// # Long running operations
2082 ///
2083 /// This method is used to start, and/or poll a [long-running Operation].
2084 /// The [Working with long-running operations] chapter in the [user guide]
2085 /// covers these operations in detail.
2086 ///
2087 /// [long-running operation]: https://google.aip.dev/151
2088 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2089 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2090 pub fn batch_create_features(
2091 &self,
2092 ) -> super::builder::feature_registry_service::BatchCreateFeatures {
2093 super::builder::feature_registry_service::BatchCreateFeatures::new(self.inner.clone())
2094 }
2095
2096 /// Gets details of a single Feature.
2097 pub fn get_feature(&self) -> super::builder::feature_registry_service::GetFeature {
2098 super::builder::feature_registry_service::GetFeature::new(self.inner.clone())
2099 }
2100
2101 /// Lists Features in a given FeatureGroup.
2102 pub fn list_features(&self) -> super::builder::feature_registry_service::ListFeatures {
2103 super::builder::feature_registry_service::ListFeatures::new(self.inner.clone())
2104 }
2105
2106 /// Updates the parameters of a single Feature.
2107 ///
2108 /// # Long running operations
2109 ///
2110 /// This method is used to start, and/or poll a [long-running Operation].
2111 /// The [Working with long-running operations] chapter in the [user guide]
2112 /// covers these operations in detail.
2113 ///
2114 /// [long-running operation]: https://google.aip.dev/151
2115 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2116 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2117 pub fn update_feature(&self) -> super::builder::feature_registry_service::UpdateFeature {
2118 super::builder::feature_registry_service::UpdateFeature::new(self.inner.clone())
2119 }
2120
2121 /// Deletes a single Feature.
2122 ///
2123 /// # Long running operations
2124 ///
2125 /// This method is used to start, and/or poll a [long-running Operation].
2126 /// The [Working with long-running operations] chapter in the [user guide]
2127 /// covers these operations in detail.
2128 ///
2129 /// [long-running operation]: https://google.aip.dev/151
2130 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2131 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2132 pub fn delete_feature(&self) -> super::builder::feature_registry_service::DeleteFeature {
2133 super::builder::feature_registry_service::DeleteFeature::new(self.inner.clone())
2134 }
2135
2136 /// Lists information about the supported locations for this service.
2137 pub fn list_locations(&self) -> super::builder::feature_registry_service::ListLocations {
2138 super::builder::feature_registry_service::ListLocations::new(self.inner.clone())
2139 }
2140
2141 /// Gets information about a location.
2142 pub fn get_location(&self) -> super::builder::feature_registry_service::GetLocation {
2143 super::builder::feature_registry_service::GetLocation::new(self.inner.clone())
2144 }
2145
2146 /// Sets the access control policy on the specified resource. Replaces
2147 /// any existing policy.
2148 ///
2149 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
2150 /// errors.
2151 pub fn set_iam_policy(&self) -> super::builder::feature_registry_service::SetIamPolicy {
2152 super::builder::feature_registry_service::SetIamPolicy::new(self.inner.clone())
2153 }
2154
2155 /// Gets the access control policy for a resource. Returns an empty policy
2156 /// if the resource exists and does not have a policy set.
2157 pub fn get_iam_policy(&self) -> super::builder::feature_registry_service::GetIamPolicy {
2158 super::builder::feature_registry_service::GetIamPolicy::new(self.inner.clone())
2159 }
2160
2161 /// Returns permissions that a caller has on the specified resource. If the
2162 /// resource does not exist, this will return an empty set of
2163 /// permissions, not a `NOT_FOUND` error.
2164 ///
2165 /// Note: This operation is designed to be used for building
2166 /// permission-aware UIs and command-line tools, not for authorization
2167 /// checking. This operation may "fail open" without warning.
2168 pub fn test_iam_permissions(
2169 &self,
2170 ) -> super::builder::feature_registry_service::TestIamPermissions {
2171 super::builder::feature_registry_service::TestIamPermissions::new(self.inner.clone())
2172 }
2173
2174 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2175 ///
2176 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2177 pub fn list_operations(&self) -> super::builder::feature_registry_service::ListOperations {
2178 super::builder::feature_registry_service::ListOperations::new(self.inner.clone())
2179 }
2180
2181 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2182 ///
2183 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2184 pub fn get_operation(&self) -> super::builder::feature_registry_service::GetOperation {
2185 super::builder::feature_registry_service::GetOperation::new(self.inner.clone())
2186 }
2187
2188 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2189 ///
2190 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2191 pub fn delete_operation(&self) -> super::builder::feature_registry_service::DeleteOperation {
2192 super::builder::feature_registry_service::DeleteOperation::new(self.inner.clone())
2193 }
2194
2195 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2196 ///
2197 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2198 pub fn cancel_operation(&self) -> super::builder::feature_registry_service::CancelOperation {
2199 super::builder::feature_registry_service::CancelOperation::new(self.inner.clone())
2200 }
2201
2202 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2203 ///
2204 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2205 pub fn wait_operation(&self) -> super::builder::feature_registry_service::WaitOperation {
2206 super::builder::feature_registry_service::WaitOperation::new(self.inner.clone())
2207 }
2208}
2209
2210/// Implements a client for the Vertex AI API.
2211///
2212/// # Example
2213/// ```
2214/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2215/// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
2216/// let client = FeaturestoreOnlineServingService::builder().build().await?;
2217/// // use `client` to make requests to the Vertex AI API.
2218/// # Ok(()) }
2219/// ```
2220///
2221/// # Service Description
2222///
2223/// A service for serving online feature values.
2224///
2225/// # Configuration
2226///
2227/// To configure `FeaturestoreOnlineServingService` use the `with_*` methods in the type returned
2228/// by [builder()][FeaturestoreOnlineServingService::builder]. The default configuration should
2229/// work for most applications. Common configuration changes include
2230///
2231/// * [with_endpoint()]: by default this client uses the global default endpoint
2232/// (`https://aiplatform.googleapis.com`). Applications using regional
2233/// endpoints or running in restricted networks (e.g. a network configured
2234// with [Private Google Access with VPC Service Controls]) may want to
2235/// override this default.
2236/// * [with_credentials()]: by default this client uses
2237/// [Application Default Credentials]. Applications using custom
2238/// authentication may need to override this default.
2239///
2240/// [with_endpoint()]: super::builder::featurestore_online_serving_service::ClientBuilder::with_endpoint
2241/// [with_credentials()]: super::builder::featurestore_online_serving_service::ClientBuilder::credentials
2242/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2243/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2244///
2245/// # Pooling and Cloning
2246///
2247/// `FeaturestoreOnlineServingService` holds a connection pool internally, it is advised to
2248/// create one and the reuse it. You do not need to wrap `FeaturestoreOnlineServingService` in
2249/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2250/// already uses an `Arc` internally.
2251#[cfg(feature = "featurestore-online-serving-service")]
2252#[cfg_attr(docsrs, doc(cfg(feature = "featurestore-online-serving-service")))]
2253#[derive(Clone, Debug)]
2254pub struct FeaturestoreOnlineServingService {
2255 inner: std::sync::Arc<dyn super::stub::dynamic::FeaturestoreOnlineServingService>,
2256}
2257
2258#[cfg(feature = "featurestore-online-serving-service")]
2259impl FeaturestoreOnlineServingService {
2260 /// Returns a builder for [FeaturestoreOnlineServingService].
2261 ///
2262 /// ```
2263 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2264 /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
2265 /// let client = FeaturestoreOnlineServingService::builder().build().await?;
2266 /// # Ok(()) }
2267 /// ```
2268 pub fn builder() -> super::builder::featurestore_online_serving_service::ClientBuilder {
2269 crate::new_client_builder(
2270 super::builder::featurestore_online_serving_service::client::Factory,
2271 )
2272 }
2273
2274 /// Creates a new client from the provided stub.
2275 ///
2276 /// The most common case for calling this function is in tests mocking the
2277 /// client's behavior.
2278 pub fn from_stub<T>(stub: T) -> Self
2279 where
2280 T: super::stub::FeaturestoreOnlineServingService + 'static,
2281 {
2282 Self {
2283 inner: std::sync::Arc::new(stub),
2284 }
2285 }
2286
2287 pub(crate) async fn new(
2288 config: gaxi::options::ClientConfig,
2289 ) -> crate::ClientBuilderResult<Self> {
2290 let inner = Self::build_inner(config).await?;
2291 Ok(Self { inner })
2292 }
2293
2294 async fn build_inner(
2295 conf: gaxi::options::ClientConfig,
2296 ) -> crate::ClientBuilderResult<
2297 std::sync::Arc<dyn super::stub::dynamic::FeaturestoreOnlineServingService>,
2298 > {
2299 if gaxi::options::tracing_enabled(&conf) {
2300 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2301 }
2302 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2303 }
2304
2305 async fn build_transport(
2306 conf: gaxi::options::ClientConfig,
2307 ) -> crate::ClientBuilderResult<impl super::stub::FeaturestoreOnlineServingService> {
2308 super::transport::FeaturestoreOnlineServingService::new(conf).await
2309 }
2310
2311 async fn build_with_tracing(
2312 conf: gaxi::options::ClientConfig,
2313 ) -> crate::ClientBuilderResult<impl super::stub::FeaturestoreOnlineServingService> {
2314 Self::build_transport(conf)
2315 .await
2316 .map(super::tracing::FeaturestoreOnlineServingService::new)
2317 }
2318
2319 /// Reads Feature values of a specific entity of an EntityType. For reading
2320 /// feature values of multiple entities of an EntityType, please use
2321 /// StreamingReadFeatureValues.
2322 pub fn read_feature_values(
2323 &self,
2324 ) -> super::builder::featurestore_online_serving_service::ReadFeatureValues {
2325 super::builder::featurestore_online_serving_service::ReadFeatureValues::new(
2326 self.inner.clone(),
2327 )
2328 }
2329
2330 /// Writes Feature values of one or more entities of an EntityType.
2331 ///
2332 /// The Feature values are merged into existing entities if any. The Feature
2333 /// values to be written must have timestamp within the online storage
2334 /// retention.
2335 pub fn write_feature_values(
2336 &self,
2337 ) -> super::builder::featurestore_online_serving_service::WriteFeatureValues {
2338 super::builder::featurestore_online_serving_service::WriteFeatureValues::new(
2339 self.inner.clone(),
2340 )
2341 }
2342
2343 /// Lists information about the supported locations for this service.
2344 pub fn list_locations(
2345 &self,
2346 ) -> super::builder::featurestore_online_serving_service::ListLocations {
2347 super::builder::featurestore_online_serving_service::ListLocations::new(self.inner.clone())
2348 }
2349
2350 /// Gets information about a location.
2351 pub fn get_location(&self) -> super::builder::featurestore_online_serving_service::GetLocation {
2352 super::builder::featurestore_online_serving_service::GetLocation::new(self.inner.clone())
2353 }
2354
2355 /// Sets the access control policy on the specified resource. Replaces
2356 /// any existing policy.
2357 ///
2358 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
2359 /// errors.
2360 pub fn set_iam_policy(
2361 &self,
2362 ) -> super::builder::featurestore_online_serving_service::SetIamPolicy {
2363 super::builder::featurestore_online_serving_service::SetIamPolicy::new(self.inner.clone())
2364 }
2365
2366 /// Gets the access control policy for a resource. Returns an empty policy
2367 /// if the resource exists and does not have a policy set.
2368 pub fn get_iam_policy(
2369 &self,
2370 ) -> super::builder::featurestore_online_serving_service::GetIamPolicy {
2371 super::builder::featurestore_online_serving_service::GetIamPolicy::new(self.inner.clone())
2372 }
2373
2374 /// Returns permissions that a caller has on the specified resource. If the
2375 /// resource does not exist, this will return an empty set of
2376 /// permissions, not a `NOT_FOUND` error.
2377 ///
2378 /// Note: This operation is designed to be used for building
2379 /// permission-aware UIs and command-line tools, not for authorization
2380 /// checking. This operation may "fail open" without warning.
2381 pub fn test_iam_permissions(
2382 &self,
2383 ) -> super::builder::featurestore_online_serving_service::TestIamPermissions {
2384 super::builder::featurestore_online_serving_service::TestIamPermissions::new(
2385 self.inner.clone(),
2386 )
2387 }
2388
2389 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2390 ///
2391 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2392 pub fn list_operations(
2393 &self,
2394 ) -> super::builder::featurestore_online_serving_service::ListOperations {
2395 super::builder::featurestore_online_serving_service::ListOperations::new(self.inner.clone())
2396 }
2397
2398 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2399 ///
2400 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2401 pub fn get_operation(
2402 &self,
2403 ) -> super::builder::featurestore_online_serving_service::GetOperation {
2404 super::builder::featurestore_online_serving_service::GetOperation::new(self.inner.clone())
2405 }
2406
2407 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2408 ///
2409 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2410 pub fn delete_operation(
2411 &self,
2412 ) -> super::builder::featurestore_online_serving_service::DeleteOperation {
2413 super::builder::featurestore_online_serving_service::DeleteOperation::new(
2414 self.inner.clone(),
2415 )
2416 }
2417
2418 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2419 ///
2420 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2421 pub fn cancel_operation(
2422 &self,
2423 ) -> super::builder::featurestore_online_serving_service::CancelOperation {
2424 super::builder::featurestore_online_serving_service::CancelOperation::new(
2425 self.inner.clone(),
2426 )
2427 }
2428
2429 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2430 ///
2431 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2432 pub fn wait_operation(
2433 &self,
2434 ) -> super::builder::featurestore_online_serving_service::WaitOperation {
2435 super::builder::featurestore_online_serving_service::WaitOperation::new(self.inner.clone())
2436 }
2437}
2438
2439/// Implements a client for the Vertex AI API.
2440///
2441/// # Example
2442/// ```
2443/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2444/// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
2445/// let client = FeaturestoreService::builder().build().await?;
2446/// // use `client` to make requests to the Vertex AI API.
2447/// # Ok(()) }
2448/// ```
2449///
2450/// # Service Description
2451///
2452/// The service that handles CRUD and List for resources for Featurestore.
2453///
2454/// # Configuration
2455///
2456/// To configure `FeaturestoreService` use the `with_*` methods in the type returned
2457/// by [builder()][FeaturestoreService::builder]. The default configuration should
2458/// work for most applications. Common configuration changes include
2459///
2460/// * [with_endpoint()]: by default this client uses the global default endpoint
2461/// (`https://aiplatform.googleapis.com`). Applications using regional
2462/// endpoints or running in restricted networks (e.g. a network configured
2463// with [Private Google Access with VPC Service Controls]) may want to
2464/// override this default.
2465/// * [with_credentials()]: by default this client uses
2466/// [Application Default Credentials]. Applications using custom
2467/// authentication may need to override this default.
2468///
2469/// [with_endpoint()]: super::builder::featurestore_service::ClientBuilder::with_endpoint
2470/// [with_credentials()]: super::builder::featurestore_service::ClientBuilder::credentials
2471/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2472/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2473///
2474/// # Pooling and Cloning
2475///
2476/// `FeaturestoreService` holds a connection pool internally, it is advised to
2477/// create one and the reuse it. You do not need to wrap `FeaturestoreService` in
2478/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2479/// already uses an `Arc` internally.
2480#[cfg(feature = "featurestore-service")]
2481#[cfg_attr(docsrs, doc(cfg(feature = "featurestore-service")))]
2482#[derive(Clone, Debug)]
2483pub struct FeaturestoreService {
2484 inner: std::sync::Arc<dyn super::stub::dynamic::FeaturestoreService>,
2485}
2486
2487#[cfg(feature = "featurestore-service")]
2488impl FeaturestoreService {
2489 /// Returns a builder for [FeaturestoreService].
2490 ///
2491 /// ```
2492 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2493 /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
2494 /// let client = FeaturestoreService::builder().build().await?;
2495 /// # Ok(()) }
2496 /// ```
2497 pub fn builder() -> super::builder::featurestore_service::ClientBuilder {
2498 crate::new_client_builder(super::builder::featurestore_service::client::Factory)
2499 }
2500
2501 /// Creates a new client from the provided stub.
2502 ///
2503 /// The most common case for calling this function is in tests mocking the
2504 /// client's behavior.
2505 pub fn from_stub<T>(stub: T) -> Self
2506 where
2507 T: super::stub::FeaturestoreService + 'static,
2508 {
2509 Self {
2510 inner: std::sync::Arc::new(stub),
2511 }
2512 }
2513
2514 pub(crate) async fn new(
2515 config: gaxi::options::ClientConfig,
2516 ) -> crate::ClientBuilderResult<Self> {
2517 let inner = Self::build_inner(config).await?;
2518 Ok(Self { inner })
2519 }
2520
2521 async fn build_inner(
2522 conf: gaxi::options::ClientConfig,
2523 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FeaturestoreService>>
2524 {
2525 if gaxi::options::tracing_enabled(&conf) {
2526 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2527 }
2528 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2529 }
2530
2531 async fn build_transport(
2532 conf: gaxi::options::ClientConfig,
2533 ) -> crate::ClientBuilderResult<impl super::stub::FeaturestoreService> {
2534 super::transport::FeaturestoreService::new(conf).await
2535 }
2536
2537 async fn build_with_tracing(
2538 conf: gaxi::options::ClientConfig,
2539 ) -> crate::ClientBuilderResult<impl super::stub::FeaturestoreService> {
2540 Self::build_transport(conf)
2541 .await
2542 .map(super::tracing::FeaturestoreService::new)
2543 }
2544
2545 /// Creates a new Featurestore in a given project and location.
2546 ///
2547 /// # Long running operations
2548 ///
2549 /// This method is used to start, and/or poll a [long-running Operation].
2550 /// The [Working with long-running operations] chapter in the [user guide]
2551 /// covers these operations in detail.
2552 ///
2553 /// [long-running operation]: https://google.aip.dev/151
2554 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2555 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2556 pub fn create_featurestore(&self) -> super::builder::featurestore_service::CreateFeaturestore {
2557 super::builder::featurestore_service::CreateFeaturestore::new(self.inner.clone())
2558 }
2559
2560 /// Gets details of a single Featurestore.
2561 pub fn get_featurestore(&self) -> super::builder::featurestore_service::GetFeaturestore {
2562 super::builder::featurestore_service::GetFeaturestore::new(self.inner.clone())
2563 }
2564
2565 /// Lists Featurestores in a given project and location.
2566 pub fn list_featurestores(&self) -> super::builder::featurestore_service::ListFeaturestores {
2567 super::builder::featurestore_service::ListFeaturestores::new(self.inner.clone())
2568 }
2569
2570 /// Updates the parameters of a single Featurestore.
2571 ///
2572 /// # Long running operations
2573 ///
2574 /// This method is used to start, and/or poll a [long-running Operation].
2575 /// The [Working with long-running operations] chapter in the [user guide]
2576 /// covers these operations in detail.
2577 ///
2578 /// [long-running operation]: https://google.aip.dev/151
2579 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2580 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2581 pub fn update_featurestore(&self) -> super::builder::featurestore_service::UpdateFeaturestore {
2582 super::builder::featurestore_service::UpdateFeaturestore::new(self.inner.clone())
2583 }
2584
2585 /// Deletes a single Featurestore. The Featurestore must not contain any
2586 /// EntityTypes or `force` must be set to true for the request to succeed.
2587 ///
2588 /// # Long running operations
2589 ///
2590 /// This method is used to start, and/or poll a [long-running Operation].
2591 /// The [Working with long-running operations] chapter in the [user guide]
2592 /// covers these operations in detail.
2593 ///
2594 /// [long-running operation]: https://google.aip.dev/151
2595 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2596 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2597 pub fn delete_featurestore(&self) -> super::builder::featurestore_service::DeleteFeaturestore {
2598 super::builder::featurestore_service::DeleteFeaturestore::new(self.inner.clone())
2599 }
2600
2601 /// Creates a new EntityType in a given Featurestore.
2602 ///
2603 /// # Long running operations
2604 ///
2605 /// This method is used to start, and/or poll a [long-running Operation].
2606 /// The [Working with long-running operations] chapter in the [user guide]
2607 /// covers these operations in detail.
2608 ///
2609 /// [long-running operation]: https://google.aip.dev/151
2610 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2611 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2612 pub fn create_entity_type(&self) -> super::builder::featurestore_service::CreateEntityType {
2613 super::builder::featurestore_service::CreateEntityType::new(self.inner.clone())
2614 }
2615
2616 /// Gets details of a single EntityType.
2617 pub fn get_entity_type(&self) -> super::builder::featurestore_service::GetEntityType {
2618 super::builder::featurestore_service::GetEntityType::new(self.inner.clone())
2619 }
2620
2621 /// Lists EntityTypes in a given Featurestore.
2622 pub fn list_entity_types(&self) -> super::builder::featurestore_service::ListEntityTypes {
2623 super::builder::featurestore_service::ListEntityTypes::new(self.inner.clone())
2624 }
2625
2626 /// Updates the parameters of a single EntityType.
2627 pub fn update_entity_type(&self) -> super::builder::featurestore_service::UpdateEntityType {
2628 super::builder::featurestore_service::UpdateEntityType::new(self.inner.clone())
2629 }
2630
2631 /// Deletes a single EntityType. The EntityType must not have any Features
2632 /// or `force` must be set to true for the request to succeed.
2633 ///
2634 /// # Long running operations
2635 ///
2636 /// This method is used to start, and/or poll a [long-running Operation].
2637 /// The [Working with long-running operations] chapter in the [user guide]
2638 /// covers these operations in detail.
2639 ///
2640 /// [long-running operation]: https://google.aip.dev/151
2641 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2642 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2643 pub fn delete_entity_type(&self) -> super::builder::featurestore_service::DeleteEntityType {
2644 super::builder::featurestore_service::DeleteEntityType::new(self.inner.clone())
2645 }
2646
2647 /// Creates a new Feature in a given EntityType.
2648 ///
2649 /// # Long running operations
2650 ///
2651 /// This method is used to start, and/or poll a [long-running Operation].
2652 /// The [Working with long-running operations] chapter in the [user guide]
2653 /// covers these operations in detail.
2654 ///
2655 /// [long-running operation]: https://google.aip.dev/151
2656 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2657 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2658 pub fn create_feature(&self) -> super::builder::featurestore_service::CreateFeature {
2659 super::builder::featurestore_service::CreateFeature::new(self.inner.clone())
2660 }
2661
2662 /// Creates a batch of Features in a given EntityType.
2663 ///
2664 /// # Long running operations
2665 ///
2666 /// This method is used to start, and/or poll a [long-running Operation].
2667 /// The [Working with long-running operations] chapter in the [user guide]
2668 /// covers these operations in detail.
2669 ///
2670 /// [long-running operation]: https://google.aip.dev/151
2671 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2672 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2673 pub fn batch_create_features(
2674 &self,
2675 ) -> super::builder::featurestore_service::BatchCreateFeatures {
2676 super::builder::featurestore_service::BatchCreateFeatures::new(self.inner.clone())
2677 }
2678
2679 /// Gets details of a single Feature.
2680 pub fn get_feature(&self) -> super::builder::featurestore_service::GetFeature {
2681 super::builder::featurestore_service::GetFeature::new(self.inner.clone())
2682 }
2683
2684 /// Lists Features in a given EntityType.
2685 pub fn list_features(&self) -> super::builder::featurestore_service::ListFeatures {
2686 super::builder::featurestore_service::ListFeatures::new(self.inner.clone())
2687 }
2688
2689 /// Updates the parameters of a single Feature.
2690 pub fn update_feature(&self) -> super::builder::featurestore_service::UpdateFeature {
2691 super::builder::featurestore_service::UpdateFeature::new(self.inner.clone())
2692 }
2693
2694 /// Deletes a single Feature.
2695 ///
2696 /// # Long running operations
2697 ///
2698 /// This method is used to start, and/or poll a [long-running Operation].
2699 /// The [Working with long-running operations] chapter in the [user guide]
2700 /// covers these operations in detail.
2701 ///
2702 /// [long-running operation]: https://google.aip.dev/151
2703 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2704 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2705 pub fn delete_feature(&self) -> super::builder::featurestore_service::DeleteFeature {
2706 super::builder::featurestore_service::DeleteFeature::new(self.inner.clone())
2707 }
2708
2709 /// Imports Feature values into the Featurestore from a source storage.
2710 ///
2711 /// The progress of the import is tracked by the returned operation. The
2712 /// imported features are guaranteed to be visible to subsequent read
2713 /// operations after the operation is marked as successfully done.
2714 ///
2715 /// If an import operation fails, the Feature values returned from
2716 /// reads and exports may be inconsistent. If consistency is
2717 /// required, the caller must retry the same import request again and wait till
2718 /// the new operation returned is marked as successfully done.
2719 ///
2720 /// There are also scenarios where the caller can cause inconsistency.
2721 ///
2722 /// - Source data for import contains multiple distinct Feature values for
2723 /// the same entity ID and timestamp.
2724 /// - Source is modified during an import. This includes adding, updating, or
2725 /// removing source data and/or metadata. Examples of updating metadata
2726 /// include but are not limited to changing storage location, storage class,
2727 /// or retention policy.
2728 /// - Online serving cluster is under-provisioned.
2729 ///
2730 /// # Long running operations
2731 ///
2732 /// This method is used to start, and/or poll a [long-running Operation].
2733 /// The [Working with long-running operations] chapter in the [user guide]
2734 /// covers these operations in detail.
2735 ///
2736 /// [long-running operation]: https://google.aip.dev/151
2737 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2738 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2739 pub fn import_feature_values(
2740 &self,
2741 ) -> super::builder::featurestore_service::ImportFeatureValues {
2742 super::builder::featurestore_service::ImportFeatureValues::new(self.inner.clone())
2743 }
2744
2745 /// Batch reads Feature values from a Featurestore.
2746 ///
2747 /// This API enables batch reading Feature values, where each read
2748 /// instance in the batch may read Feature values of entities from one or
2749 /// more EntityTypes. Point-in-time correctness is guaranteed for Feature
2750 /// values of each read instance as of each instance's read timestamp.
2751 ///
2752 /// # Long running operations
2753 ///
2754 /// This method is used to start, and/or poll a [long-running Operation].
2755 /// The [Working with long-running operations] chapter in the [user guide]
2756 /// covers these operations in detail.
2757 ///
2758 /// [long-running operation]: https://google.aip.dev/151
2759 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2760 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2761 pub fn batch_read_feature_values(
2762 &self,
2763 ) -> super::builder::featurestore_service::BatchReadFeatureValues {
2764 super::builder::featurestore_service::BatchReadFeatureValues::new(self.inner.clone())
2765 }
2766
2767 /// Exports Feature values from all the entities of a target EntityType.
2768 ///
2769 /// # Long running operations
2770 ///
2771 /// This method is used to start, and/or poll a [long-running Operation].
2772 /// The [Working with long-running operations] chapter in the [user guide]
2773 /// covers these operations in detail.
2774 ///
2775 /// [long-running operation]: https://google.aip.dev/151
2776 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2777 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2778 pub fn export_feature_values(
2779 &self,
2780 ) -> super::builder::featurestore_service::ExportFeatureValues {
2781 super::builder::featurestore_service::ExportFeatureValues::new(self.inner.clone())
2782 }
2783
2784 /// Delete Feature values from Featurestore.
2785 ///
2786 /// The progress of the deletion is tracked by the returned operation. The
2787 /// deleted feature values are guaranteed to be invisible to subsequent read
2788 /// operations after the operation is marked as successfully done.
2789 ///
2790 /// If a delete feature values operation fails, the feature values
2791 /// returned from reads and exports may be inconsistent. If consistency is
2792 /// required, the caller must retry the same delete request again and wait till
2793 /// the new operation returned is marked as successfully done.
2794 ///
2795 /// # Long running operations
2796 ///
2797 /// This method is used to start, and/or poll a [long-running Operation].
2798 /// The [Working with long-running operations] chapter in the [user guide]
2799 /// covers these operations in detail.
2800 ///
2801 /// [long-running operation]: https://google.aip.dev/151
2802 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2803 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2804 pub fn delete_feature_values(
2805 &self,
2806 ) -> super::builder::featurestore_service::DeleteFeatureValues {
2807 super::builder::featurestore_service::DeleteFeatureValues::new(self.inner.clone())
2808 }
2809
2810 /// Searches Features matching a query in a given project.
2811 pub fn search_features(&self) -> super::builder::featurestore_service::SearchFeatures {
2812 super::builder::featurestore_service::SearchFeatures::new(self.inner.clone())
2813 }
2814
2815 /// Lists information about the supported locations for this service.
2816 pub fn list_locations(&self) -> super::builder::featurestore_service::ListLocations {
2817 super::builder::featurestore_service::ListLocations::new(self.inner.clone())
2818 }
2819
2820 /// Gets information about a location.
2821 pub fn get_location(&self) -> super::builder::featurestore_service::GetLocation {
2822 super::builder::featurestore_service::GetLocation::new(self.inner.clone())
2823 }
2824
2825 /// Sets the access control policy on the specified resource. Replaces
2826 /// any existing policy.
2827 ///
2828 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
2829 /// errors.
2830 pub fn set_iam_policy(&self) -> super::builder::featurestore_service::SetIamPolicy {
2831 super::builder::featurestore_service::SetIamPolicy::new(self.inner.clone())
2832 }
2833
2834 /// Gets the access control policy for a resource. Returns an empty policy
2835 /// if the resource exists and does not have a policy set.
2836 pub fn get_iam_policy(&self) -> super::builder::featurestore_service::GetIamPolicy {
2837 super::builder::featurestore_service::GetIamPolicy::new(self.inner.clone())
2838 }
2839
2840 /// Returns permissions that a caller has on the specified resource. If the
2841 /// resource does not exist, this will return an empty set of
2842 /// permissions, not a `NOT_FOUND` error.
2843 ///
2844 /// Note: This operation is designed to be used for building
2845 /// permission-aware UIs and command-line tools, not for authorization
2846 /// checking. This operation may "fail open" without warning.
2847 pub fn test_iam_permissions(&self) -> super::builder::featurestore_service::TestIamPermissions {
2848 super::builder::featurestore_service::TestIamPermissions::new(self.inner.clone())
2849 }
2850
2851 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2852 ///
2853 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2854 pub fn list_operations(&self) -> super::builder::featurestore_service::ListOperations {
2855 super::builder::featurestore_service::ListOperations::new(self.inner.clone())
2856 }
2857
2858 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2859 ///
2860 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2861 pub fn get_operation(&self) -> super::builder::featurestore_service::GetOperation {
2862 super::builder::featurestore_service::GetOperation::new(self.inner.clone())
2863 }
2864
2865 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2866 ///
2867 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2868 pub fn delete_operation(&self) -> super::builder::featurestore_service::DeleteOperation {
2869 super::builder::featurestore_service::DeleteOperation::new(self.inner.clone())
2870 }
2871
2872 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2873 ///
2874 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2875 pub fn cancel_operation(&self) -> super::builder::featurestore_service::CancelOperation {
2876 super::builder::featurestore_service::CancelOperation::new(self.inner.clone())
2877 }
2878
2879 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2880 ///
2881 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2882 pub fn wait_operation(&self) -> super::builder::featurestore_service::WaitOperation {
2883 super::builder::featurestore_service::WaitOperation::new(self.inner.clone())
2884 }
2885}
2886
2887/// Implements a client for the Vertex AI API.
2888///
2889/// # Example
2890/// ```
2891/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2892/// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
2893/// let client = GenAiCacheService::builder().build().await?;
2894/// // use `client` to make requests to the Vertex AI API.
2895/// # Ok(()) }
2896/// ```
2897///
2898/// # Service Description
2899///
2900/// Service for managing Vertex AI's CachedContent resource.
2901///
2902/// # Configuration
2903///
2904/// To configure `GenAiCacheService` use the `with_*` methods in the type returned
2905/// by [builder()][GenAiCacheService::builder]. The default configuration should
2906/// work for most applications. Common configuration changes include
2907///
2908/// * [with_endpoint()]: by default this client uses the global default endpoint
2909/// (`https://aiplatform.googleapis.com`). Applications using regional
2910/// endpoints or running in restricted networks (e.g. a network configured
2911// with [Private Google Access with VPC Service Controls]) may want to
2912/// override this default.
2913/// * [with_credentials()]: by default this client uses
2914/// [Application Default Credentials]. Applications using custom
2915/// authentication may need to override this default.
2916///
2917/// [with_endpoint()]: super::builder::gen_ai_cache_service::ClientBuilder::with_endpoint
2918/// [with_credentials()]: super::builder::gen_ai_cache_service::ClientBuilder::credentials
2919/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2920/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2921///
2922/// # Pooling and Cloning
2923///
2924/// `GenAiCacheService` holds a connection pool internally, it is advised to
2925/// create one and the reuse it. You do not need to wrap `GenAiCacheService` in
2926/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2927/// already uses an `Arc` internally.
2928#[cfg(feature = "gen-ai-cache-service")]
2929#[cfg_attr(docsrs, doc(cfg(feature = "gen-ai-cache-service")))]
2930#[derive(Clone, Debug)]
2931pub struct GenAiCacheService {
2932 inner: std::sync::Arc<dyn super::stub::dynamic::GenAiCacheService>,
2933}
2934
2935#[cfg(feature = "gen-ai-cache-service")]
2936impl GenAiCacheService {
2937 /// Returns a builder for [GenAiCacheService].
2938 ///
2939 /// ```
2940 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2941 /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
2942 /// let client = GenAiCacheService::builder().build().await?;
2943 /// # Ok(()) }
2944 /// ```
2945 pub fn builder() -> super::builder::gen_ai_cache_service::ClientBuilder {
2946 crate::new_client_builder(super::builder::gen_ai_cache_service::client::Factory)
2947 }
2948
2949 /// Creates a new client from the provided stub.
2950 ///
2951 /// The most common case for calling this function is in tests mocking the
2952 /// client's behavior.
2953 pub fn from_stub<T>(stub: T) -> Self
2954 where
2955 T: super::stub::GenAiCacheService + 'static,
2956 {
2957 Self {
2958 inner: std::sync::Arc::new(stub),
2959 }
2960 }
2961
2962 pub(crate) async fn new(
2963 config: gaxi::options::ClientConfig,
2964 ) -> crate::ClientBuilderResult<Self> {
2965 let inner = Self::build_inner(config).await?;
2966 Ok(Self { inner })
2967 }
2968
2969 async fn build_inner(
2970 conf: gaxi::options::ClientConfig,
2971 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GenAiCacheService>>
2972 {
2973 if gaxi::options::tracing_enabled(&conf) {
2974 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2975 }
2976 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2977 }
2978
2979 async fn build_transport(
2980 conf: gaxi::options::ClientConfig,
2981 ) -> crate::ClientBuilderResult<impl super::stub::GenAiCacheService> {
2982 super::transport::GenAiCacheService::new(conf).await
2983 }
2984
2985 async fn build_with_tracing(
2986 conf: gaxi::options::ClientConfig,
2987 ) -> crate::ClientBuilderResult<impl super::stub::GenAiCacheService> {
2988 Self::build_transport(conf)
2989 .await
2990 .map(super::tracing::GenAiCacheService::new)
2991 }
2992
2993 /// Creates cached content, this call will initialize the cached content in the
2994 /// data storage, and users need to pay for the cache data storage.
2995 pub fn create_cached_content(
2996 &self,
2997 ) -> super::builder::gen_ai_cache_service::CreateCachedContent {
2998 super::builder::gen_ai_cache_service::CreateCachedContent::new(self.inner.clone())
2999 }
3000
3001 /// Gets cached content configurations
3002 pub fn get_cached_content(&self) -> super::builder::gen_ai_cache_service::GetCachedContent {
3003 super::builder::gen_ai_cache_service::GetCachedContent::new(self.inner.clone())
3004 }
3005
3006 /// Updates cached content configurations
3007 pub fn update_cached_content(
3008 &self,
3009 ) -> super::builder::gen_ai_cache_service::UpdateCachedContent {
3010 super::builder::gen_ai_cache_service::UpdateCachedContent::new(self.inner.clone())
3011 }
3012
3013 /// Deletes cached content
3014 pub fn delete_cached_content(
3015 &self,
3016 ) -> super::builder::gen_ai_cache_service::DeleteCachedContent {
3017 super::builder::gen_ai_cache_service::DeleteCachedContent::new(self.inner.clone())
3018 }
3019
3020 /// Lists cached contents in a project
3021 pub fn list_cached_contents(&self) -> super::builder::gen_ai_cache_service::ListCachedContents {
3022 super::builder::gen_ai_cache_service::ListCachedContents::new(self.inner.clone())
3023 }
3024
3025 /// Lists information about the supported locations for this service.
3026 pub fn list_locations(&self) -> super::builder::gen_ai_cache_service::ListLocations {
3027 super::builder::gen_ai_cache_service::ListLocations::new(self.inner.clone())
3028 }
3029
3030 /// Gets information about a location.
3031 pub fn get_location(&self) -> super::builder::gen_ai_cache_service::GetLocation {
3032 super::builder::gen_ai_cache_service::GetLocation::new(self.inner.clone())
3033 }
3034
3035 /// Sets the access control policy on the specified resource. Replaces
3036 /// any existing policy.
3037 ///
3038 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
3039 /// errors.
3040 pub fn set_iam_policy(&self) -> super::builder::gen_ai_cache_service::SetIamPolicy {
3041 super::builder::gen_ai_cache_service::SetIamPolicy::new(self.inner.clone())
3042 }
3043
3044 /// Gets the access control policy for a resource. Returns an empty policy
3045 /// if the resource exists and does not have a policy set.
3046 pub fn get_iam_policy(&self) -> super::builder::gen_ai_cache_service::GetIamPolicy {
3047 super::builder::gen_ai_cache_service::GetIamPolicy::new(self.inner.clone())
3048 }
3049
3050 /// Returns permissions that a caller has on the specified resource. If the
3051 /// resource does not exist, this will return an empty set of
3052 /// permissions, not a `NOT_FOUND` error.
3053 ///
3054 /// Note: This operation is designed to be used for building
3055 /// permission-aware UIs and command-line tools, not for authorization
3056 /// checking. This operation may "fail open" without warning.
3057 pub fn test_iam_permissions(&self) -> super::builder::gen_ai_cache_service::TestIamPermissions {
3058 super::builder::gen_ai_cache_service::TestIamPermissions::new(self.inner.clone())
3059 }
3060
3061 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3062 ///
3063 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3064 pub fn list_operations(&self) -> super::builder::gen_ai_cache_service::ListOperations {
3065 super::builder::gen_ai_cache_service::ListOperations::new(self.inner.clone())
3066 }
3067
3068 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3069 ///
3070 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3071 pub fn get_operation(&self) -> super::builder::gen_ai_cache_service::GetOperation {
3072 super::builder::gen_ai_cache_service::GetOperation::new(self.inner.clone())
3073 }
3074
3075 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3076 ///
3077 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3078 pub fn delete_operation(&self) -> super::builder::gen_ai_cache_service::DeleteOperation {
3079 super::builder::gen_ai_cache_service::DeleteOperation::new(self.inner.clone())
3080 }
3081
3082 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3083 ///
3084 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3085 pub fn cancel_operation(&self) -> super::builder::gen_ai_cache_service::CancelOperation {
3086 super::builder::gen_ai_cache_service::CancelOperation::new(self.inner.clone())
3087 }
3088
3089 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3090 ///
3091 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3092 pub fn wait_operation(&self) -> super::builder::gen_ai_cache_service::WaitOperation {
3093 super::builder::gen_ai_cache_service::WaitOperation::new(self.inner.clone())
3094 }
3095}
3096
3097/// Implements a client for the Vertex AI API.
3098///
3099/// # Example
3100/// ```
3101/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3102/// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
3103/// let client = GenAiTuningService::builder().build().await?;
3104/// // use `client` to make requests to the Vertex AI API.
3105/// # Ok(()) }
3106/// ```
3107///
3108/// # Service Description
3109///
3110/// A service for creating and managing GenAI Tuning Jobs.
3111///
3112/// # Configuration
3113///
3114/// To configure `GenAiTuningService` use the `with_*` methods in the type returned
3115/// by [builder()][GenAiTuningService::builder]. The default configuration should
3116/// work for most applications. Common configuration changes include
3117///
3118/// * [with_endpoint()]: by default this client uses the global default endpoint
3119/// (`https://aiplatform.googleapis.com`). Applications using regional
3120/// endpoints or running in restricted networks (e.g. a network configured
3121// with [Private Google Access with VPC Service Controls]) may want to
3122/// override this default.
3123/// * [with_credentials()]: by default this client uses
3124/// [Application Default Credentials]. Applications using custom
3125/// authentication may need to override this default.
3126///
3127/// [with_endpoint()]: super::builder::gen_ai_tuning_service::ClientBuilder::with_endpoint
3128/// [with_credentials()]: super::builder::gen_ai_tuning_service::ClientBuilder::credentials
3129/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3130/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3131///
3132/// # Pooling and Cloning
3133///
3134/// `GenAiTuningService` holds a connection pool internally, it is advised to
3135/// create one and the reuse it. You do not need to wrap `GenAiTuningService` in
3136/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3137/// already uses an `Arc` internally.
3138#[cfg(feature = "gen-ai-tuning-service")]
3139#[cfg_attr(docsrs, doc(cfg(feature = "gen-ai-tuning-service")))]
3140#[derive(Clone, Debug)]
3141pub struct GenAiTuningService {
3142 inner: std::sync::Arc<dyn super::stub::dynamic::GenAiTuningService>,
3143}
3144
3145#[cfg(feature = "gen-ai-tuning-service")]
3146impl GenAiTuningService {
3147 /// Returns a builder for [GenAiTuningService].
3148 ///
3149 /// ```
3150 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3151 /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
3152 /// let client = GenAiTuningService::builder().build().await?;
3153 /// # Ok(()) }
3154 /// ```
3155 pub fn builder() -> super::builder::gen_ai_tuning_service::ClientBuilder {
3156 crate::new_client_builder(super::builder::gen_ai_tuning_service::client::Factory)
3157 }
3158
3159 /// Creates a new client from the provided stub.
3160 ///
3161 /// The most common case for calling this function is in tests mocking the
3162 /// client's behavior.
3163 pub fn from_stub<T>(stub: T) -> Self
3164 where
3165 T: super::stub::GenAiTuningService + 'static,
3166 {
3167 Self {
3168 inner: std::sync::Arc::new(stub),
3169 }
3170 }
3171
3172 pub(crate) async fn new(
3173 config: gaxi::options::ClientConfig,
3174 ) -> crate::ClientBuilderResult<Self> {
3175 let inner = Self::build_inner(config).await?;
3176 Ok(Self { inner })
3177 }
3178
3179 async fn build_inner(
3180 conf: gaxi::options::ClientConfig,
3181 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GenAiTuningService>>
3182 {
3183 if gaxi::options::tracing_enabled(&conf) {
3184 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3185 }
3186 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3187 }
3188
3189 async fn build_transport(
3190 conf: gaxi::options::ClientConfig,
3191 ) -> crate::ClientBuilderResult<impl super::stub::GenAiTuningService> {
3192 super::transport::GenAiTuningService::new(conf).await
3193 }
3194
3195 async fn build_with_tracing(
3196 conf: gaxi::options::ClientConfig,
3197 ) -> crate::ClientBuilderResult<impl super::stub::GenAiTuningService> {
3198 Self::build_transport(conf)
3199 .await
3200 .map(super::tracing::GenAiTuningService::new)
3201 }
3202
3203 /// Creates a TuningJob. A created TuningJob right away will be attempted to
3204 /// be run.
3205 pub fn create_tuning_job(&self) -> super::builder::gen_ai_tuning_service::CreateTuningJob {
3206 super::builder::gen_ai_tuning_service::CreateTuningJob::new(self.inner.clone())
3207 }
3208
3209 /// Gets a TuningJob.
3210 pub fn get_tuning_job(&self) -> super::builder::gen_ai_tuning_service::GetTuningJob {
3211 super::builder::gen_ai_tuning_service::GetTuningJob::new(self.inner.clone())
3212 }
3213
3214 /// Lists TuningJobs in a Location.
3215 pub fn list_tuning_jobs(&self) -> super::builder::gen_ai_tuning_service::ListTuningJobs {
3216 super::builder::gen_ai_tuning_service::ListTuningJobs::new(self.inner.clone())
3217 }
3218
3219 /// Cancels a TuningJob.
3220 /// Starts asynchronous cancellation on the TuningJob. The server makes a best
3221 /// effort to cancel the job, but success is not guaranteed. Clients can use
3222 /// [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob]
3223 /// or other methods to check whether the cancellation succeeded or whether the
3224 /// job completed despite cancellation. On successful cancellation, the
3225 /// TuningJob is not deleted; instead it becomes a job with a
3226 /// [TuningJob.error][google.cloud.aiplatform.v1.TuningJob.error] value with a
3227 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
3228 /// `Code.CANCELLED`, and
3229 /// [TuningJob.state][google.cloud.aiplatform.v1.TuningJob.state] is set to
3230 /// `CANCELLED`.
3231 ///
3232 /// [google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob]: crate::client::GenAiTuningService::get_tuning_job
3233 /// [google.cloud.aiplatform.v1.TuningJob.error]: crate::model::TuningJob::error
3234 /// [google.cloud.aiplatform.v1.TuningJob.state]: crate::model::TuningJob::state
3235 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
3236 pub fn cancel_tuning_job(&self) -> super::builder::gen_ai_tuning_service::CancelTuningJob {
3237 super::builder::gen_ai_tuning_service::CancelTuningJob::new(self.inner.clone())
3238 }
3239
3240 /// Rebase a TunedModel.
3241 ///
3242 /// # Long running operations
3243 ///
3244 /// This method is used to start, and/or poll a [long-running Operation].
3245 /// The [Working with long-running operations] chapter in the [user guide]
3246 /// covers these operations in detail.
3247 ///
3248 /// [long-running operation]: https://google.aip.dev/151
3249 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3250 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3251 pub fn rebase_tuned_model(&self) -> super::builder::gen_ai_tuning_service::RebaseTunedModel {
3252 super::builder::gen_ai_tuning_service::RebaseTunedModel::new(self.inner.clone())
3253 }
3254
3255 /// Lists information about the supported locations for this service.
3256 pub fn list_locations(&self) -> super::builder::gen_ai_tuning_service::ListLocations {
3257 super::builder::gen_ai_tuning_service::ListLocations::new(self.inner.clone())
3258 }
3259
3260 /// Gets information about a location.
3261 pub fn get_location(&self) -> super::builder::gen_ai_tuning_service::GetLocation {
3262 super::builder::gen_ai_tuning_service::GetLocation::new(self.inner.clone())
3263 }
3264
3265 /// Sets the access control policy on the specified resource. Replaces
3266 /// any existing policy.
3267 ///
3268 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
3269 /// errors.
3270 pub fn set_iam_policy(&self) -> super::builder::gen_ai_tuning_service::SetIamPolicy {
3271 super::builder::gen_ai_tuning_service::SetIamPolicy::new(self.inner.clone())
3272 }
3273
3274 /// Gets the access control policy for a resource. Returns an empty policy
3275 /// if the resource exists and does not have a policy set.
3276 pub fn get_iam_policy(&self) -> super::builder::gen_ai_tuning_service::GetIamPolicy {
3277 super::builder::gen_ai_tuning_service::GetIamPolicy::new(self.inner.clone())
3278 }
3279
3280 /// Returns permissions that a caller has on the specified resource. If the
3281 /// resource does not exist, this will return an empty set of
3282 /// permissions, not a `NOT_FOUND` error.
3283 ///
3284 /// Note: This operation is designed to be used for building
3285 /// permission-aware UIs and command-line tools, not for authorization
3286 /// checking. This operation may "fail open" without warning.
3287 pub fn test_iam_permissions(
3288 &self,
3289 ) -> super::builder::gen_ai_tuning_service::TestIamPermissions {
3290 super::builder::gen_ai_tuning_service::TestIamPermissions::new(self.inner.clone())
3291 }
3292
3293 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3294 ///
3295 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3296 pub fn list_operations(&self) -> super::builder::gen_ai_tuning_service::ListOperations {
3297 super::builder::gen_ai_tuning_service::ListOperations::new(self.inner.clone())
3298 }
3299
3300 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3301 ///
3302 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3303 pub fn get_operation(&self) -> super::builder::gen_ai_tuning_service::GetOperation {
3304 super::builder::gen_ai_tuning_service::GetOperation::new(self.inner.clone())
3305 }
3306
3307 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3308 ///
3309 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3310 pub fn delete_operation(&self) -> super::builder::gen_ai_tuning_service::DeleteOperation {
3311 super::builder::gen_ai_tuning_service::DeleteOperation::new(self.inner.clone())
3312 }
3313
3314 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3315 ///
3316 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3317 pub fn cancel_operation(&self) -> super::builder::gen_ai_tuning_service::CancelOperation {
3318 super::builder::gen_ai_tuning_service::CancelOperation::new(self.inner.clone())
3319 }
3320
3321 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3322 ///
3323 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3324 pub fn wait_operation(&self) -> super::builder::gen_ai_tuning_service::WaitOperation {
3325 super::builder::gen_ai_tuning_service::WaitOperation::new(self.inner.clone())
3326 }
3327}
3328
3329/// Implements a client for the Vertex AI API.
3330///
3331/// # Example
3332/// ```
3333/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3334/// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
3335/// let client = IndexEndpointService::builder().build().await?;
3336/// // use `client` to make requests to the Vertex AI API.
3337/// # Ok(()) }
3338/// ```
3339///
3340/// # Service Description
3341///
3342/// A service for managing Vertex AI's IndexEndpoints.
3343///
3344/// # Configuration
3345///
3346/// To configure `IndexEndpointService` use the `with_*` methods in the type returned
3347/// by [builder()][IndexEndpointService::builder]. The default configuration should
3348/// work for most applications. Common configuration changes include
3349///
3350/// * [with_endpoint()]: by default this client uses the global default endpoint
3351/// (`https://aiplatform.googleapis.com`). Applications using regional
3352/// endpoints or running in restricted networks (e.g. a network configured
3353// with [Private Google Access with VPC Service Controls]) may want to
3354/// override this default.
3355/// * [with_credentials()]: by default this client uses
3356/// [Application Default Credentials]. Applications using custom
3357/// authentication may need to override this default.
3358///
3359/// [with_endpoint()]: super::builder::index_endpoint_service::ClientBuilder::with_endpoint
3360/// [with_credentials()]: super::builder::index_endpoint_service::ClientBuilder::credentials
3361/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3362/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3363///
3364/// # Pooling and Cloning
3365///
3366/// `IndexEndpointService` holds a connection pool internally, it is advised to
3367/// create one and the reuse it. You do not need to wrap `IndexEndpointService` in
3368/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3369/// already uses an `Arc` internally.
3370#[cfg(feature = "index-endpoint-service")]
3371#[cfg_attr(docsrs, doc(cfg(feature = "index-endpoint-service")))]
3372#[derive(Clone, Debug)]
3373pub struct IndexEndpointService {
3374 inner: std::sync::Arc<dyn super::stub::dynamic::IndexEndpointService>,
3375}
3376
3377#[cfg(feature = "index-endpoint-service")]
3378impl IndexEndpointService {
3379 /// Returns a builder for [IndexEndpointService].
3380 ///
3381 /// ```
3382 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3383 /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
3384 /// let client = IndexEndpointService::builder().build().await?;
3385 /// # Ok(()) }
3386 /// ```
3387 pub fn builder() -> super::builder::index_endpoint_service::ClientBuilder {
3388 crate::new_client_builder(super::builder::index_endpoint_service::client::Factory)
3389 }
3390
3391 /// Creates a new client from the provided stub.
3392 ///
3393 /// The most common case for calling this function is in tests mocking the
3394 /// client's behavior.
3395 pub fn from_stub<T>(stub: T) -> Self
3396 where
3397 T: super::stub::IndexEndpointService + 'static,
3398 {
3399 Self {
3400 inner: std::sync::Arc::new(stub),
3401 }
3402 }
3403
3404 pub(crate) async fn new(
3405 config: gaxi::options::ClientConfig,
3406 ) -> crate::ClientBuilderResult<Self> {
3407 let inner = Self::build_inner(config).await?;
3408 Ok(Self { inner })
3409 }
3410
3411 async fn build_inner(
3412 conf: gaxi::options::ClientConfig,
3413 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::IndexEndpointService>>
3414 {
3415 if gaxi::options::tracing_enabled(&conf) {
3416 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3417 }
3418 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3419 }
3420
3421 async fn build_transport(
3422 conf: gaxi::options::ClientConfig,
3423 ) -> crate::ClientBuilderResult<impl super::stub::IndexEndpointService> {
3424 super::transport::IndexEndpointService::new(conf).await
3425 }
3426
3427 async fn build_with_tracing(
3428 conf: gaxi::options::ClientConfig,
3429 ) -> crate::ClientBuilderResult<impl super::stub::IndexEndpointService> {
3430 Self::build_transport(conf)
3431 .await
3432 .map(super::tracing::IndexEndpointService::new)
3433 }
3434
3435 /// Creates an IndexEndpoint.
3436 ///
3437 /// # Long running operations
3438 ///
3439 /// This method is used to start, and/or poll a [long-running Operation].
3440 /// The [Working with long-running operations] chapter in the [user guide]
3441 /// covers these operations in detail.
3442 ///
3443 /// [long-running operation]: https://google.aip.dev/151
3444 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3445 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3446 pub fn create_index_endpoint(
3447 &self,
3448 ) -> super::builder::index_endpoint_service::CreateIndexEndpoint {
3449 super::builder::index_endpoint_service::CreateIndexEndpoint::new(self.inner.clone())
3450 }
3451
3452 /// Gets an IndexEndpoint.
3453 pub fn get_index_endpoint(&self) -> super::builder::index_endpoint_service::GetIndexEndpoint {
3454 super::builder::index_endpoint_service::GetIndexEndpoint::new(self.inner.clone())
3455 }
3456
3457 /// Lists IndexEndpoints in a Location.
3458 pub fn list_index_endpoints(
3459 &self,
3460 ) -> super::builder::index_endpoint_service::ListIndexEndpoints {
3461 super::builder::index_endpoint_service::ListIndexEndpoints::new(self.inner.clone())
3462 }
3463
3464 /// Updates an IndexEndpoint.
3465 pub fn update_index_endpoint(
3466 &self,
3467 ) -> super::builder::index_endpoint_service::UpdateIndexEndpoint {
3468 super::builder::index_endpoint_service::UpdateIndexEndpoint::new(self.inner.clone())
3469 }
3470
3471 /// Deletes an IndexEndpoint.
3472 ///
3473 /// # Long running operations
3474 ///
3475 /// This method is used to start, and/or poll a [long-running Operation].
3476 /// The [Working with long-running operations] chapter in the [user guide]
3477 /// covers these operations in detail.
3478 ///
3479 /// [long-running operation]: https://google.aip.dev/151
3480 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3481 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3482 pub fn delete_index_endpoint(
3483 &self,
3484 ) -> super::builder::index_endpoint_service::DeleteIndexEndpoint {
3485 super::builder::index_endpoint_service::DeleteIndexEndpoint::new(self.inner.clone())
3486 }
3487
3488 /// Deploys an Index into this IndexEndpoint, creating a DeployedIndex within
3489 /// it.
3490 /// Only non-empty Indexes can be deployed.
3491 ///
3492 /// # Long running operations
3493 ///
3494 /// This method is used to start, and/or poll a [long-running Operation].
3495 /// The [Working with long-running operations] chapter in the [user guide]
3496 /// covers these operations in detail.
3497 ///
3498 /// [long-running operation]: https://google.aip.dev/151
3499 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3500 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3501 pub fn deploy_index(&self) -> super::builder::index_endpoint_service::DeployIndex {
3502 super::builder::index_endpoint_service::DeployIndex::new(self.inner.clone())
3503 }
3504
3505 /// Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it,
3506 /// and freeing all resources it's using.
3507 ///
3508 /// # Long running operations
3509 ///
3510 /// This method is used to start, and/or poll a [long-running Operation].
3511 /// The [Working with long-running operations] chapter in the [user guide]
3512 /// covers these operations in detail.
3513 ///
3514 /// [long-running operation]: https://google.aip.dev/151
3515 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3516 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3517 pub fn undeploy_index(&self) -> super::builder::index_endpoint_service::UndeployIndex {
3518 super::builder::index_endpoint_service::UndeployIndex::new(self.inner.clone())
3519 }
3520
3521 /// Update an existing DeployedIndex under an IndexEndpoint.
3522 ///
3523 /// # Long running operations
3524 ///
3525 /// This method is used to start, and/or poll a [long-running Operation].
3526 /// The [Working with long-running operations] chapter in the [user guide]
3527 /// covers these operations in detail.
3528 ///
3529 /// [long-running operation]: https://google.aip.dev/151
3530 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3531 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3532 pub fn mutate_deployed_index(
3533 &self,
3534 ) -> super::builder::index_endpoint_service::MutateDeployedIndex {
3535 super::builder::index_endpoint_service::MutateDeployedIndex::new(self.inner.clone())
3536 }
3537
3538 /// Lists information about the supported locations for this service.
3539 pub fn list_locations(&self) -> super::builder::index_endpoint_service::ListLocations {
3540 super::builder::index_endpoint_service::ListLocations::new(self.inner.clone())
3541 }
3542
3543 /// Gets information about a location.
3544 pub fn get_location(&self) -> super::builder::index_endpoint_service::GetLocation {
3545 super::builder::index_endpoint_service::GetLocation::new(self.inner.clone())
3546 }
3547
3548 /// Sets the access control policy on the specified resource. Replaces
3549 /// any existing policy.
3550 ///
3551 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
3552 /// errors.
3553 pub fn set_iam_policy(&self) -> super::builder::index_endpoint_service::SetIamPolicy {
3554 super::builder::index_endpoint_service::SetIamPolicy::new(self.inner.clone())
3555 }
3556
3557 /// Gets the access control policy for a resource. Returns an empty policy
3558 /// if the resource exists and does not have a policy set.
3559 pub fn get_iam_policy(&self) -> super::builder::index_endpoint_service::GetIamPolicy {
3560 super::builder::index_endpoint_service::GetIamPolicy::new(self.inner.clone())
3561 }
3562
3563 /// Returns permissions that a caller has on the specified resource. If the
3564 /// resource does not exist, this will return an empty set of
3565 /// permissions, not a `NOT_FOUND` error.
3566 ///
3567 /// Note: This operation is designed to be used for building
3568 /// permission-aware UIs and command-line tools, not for authorization
3569 /// checking. This operation may "fail open" without warning.
3570 pub fn test_iam_permissions(
3571 &self,
3572 ) -> super::builder::index_endpoint_service::TestIamPermissions {
3573 super::builder::index_endpoint_service::TestIamPermissions::new(self.inner.clone())
3574 }
3575
3576 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3577 ///
3578 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3579 pub fn list_operations(&self) -> super::builder::index_endpoint_service::ListOperations {
3580 super::builder::index_endpoint_service::ListOperations::new(self.inner.clone())
3581 }
3582
3583 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3584 ///
3585 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3586 pub fn get_operation(&self) -> super::builder::index_endpoint_service::GetOperation {
3587 super::builder::index_endpoint_service::GetOperation::new(self.inner.clone())
3588 }
3589
3590 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3591 ///
3592 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3593 pub fn delete_operation(&self) -> super::builder::index_endpoint_service::DeleteOperation {
3594 super::builder::index_endpoint_service::DeleteOperation::new(self.inner.clone())
3595 }
3596
3597 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3598 ///
3599 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3600 pub fn cancel_operation(&self) -> super::builder::index_endpoint_service::CancelOperation {
3601 super::builder::index_endpoint_service::CancelOperation::new(self.inner.clone())
3602 }
3603
3604 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3605 ///
3606 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3607 pub fn wait_operation(&self) -> super::builder::index_endpoint_service::WaitOperation {
3608 super::builder::index_endpoint_service::WaitOperation::new(self.inner.clone())
3609 }
3610}
3611
3612/// Implements a client for the Vertex AI API.
3613///
3614/// # Example
3615/// ```
3616/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3617/// # use google_cloud_aiplatform_v1::client::IndexService;
3618/// let client = IndexService::builder().build().await?;
3619/// // use `client` to make requests to the Vertex AI API.
3620/// # Ok(()) }
3621/// ```
3622///
3623/// # Service Description
3624///
3625/// A service for creating and managing Vertex AI's Index resources.
3626///
3627/// # Configuration
3628///
3629/// To configure `IndexService` use the `with_*` methods in the type returned
3630/// by [builder()][IndexService::builder]. The default configuration should
3631/// work for most applications. Common configuration changes include
3632///
3633/// * [with_endpoint()]: by default this client uses the global default endpoint
3634/// (`https://aiplatform.googleapis.com`). Applications using regional
3635/// endpoints or running in restricted networks (e.g. a network configured
3636// with [Private Google Access with VPC Service Controls]) may want to
3637/// override this default.
3638/// * [with_credentials()]: by default this client uses
3639/// [Application Default Credentials]. Applications using custom
3640/// authentication may need to override this default.
3641///
3642/// [with_endpoint()]: super::builder::index_service::ClientBuilder::with_endpoint
3643/// [with_credentials()]: super::builder::index_service::ClientBuilder::credentials
3644/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3645/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3646///
3647/// # Pooling and Cloning
3648///
3649/// `IndexService` holds a connection pool internally, it is advised to
3650/// create one and the reuse it. You do not need to wrap `IndexService` in
3651/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3652/// already uses an `Arc` internally.
3653#[cfg(feature = "index-service")]
3654#[cfg_attr(docsrs, doc(cfg(feature = "index-service")))]
3655#[derive(Clone, Debug)]
3656pub struct IndexService {
3657 inner: std::sync::Arc<dyn super::stub::dynamic::IndexService>,
3658}
3659
3660#[cfg(feature = "index-service")]
3661impl IndexService {
3662 /// Returns a builder for [IndexService].
3663 ///
3664 /// ```
3665 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3666 /// # use google_cloud_aiplatform_v1::client::IndexService;
3667 /// let client = IndexService::builder().build().await?;
3668 /// # Ok(()) }
3669 /// ```
3670 pub fn builder() -> super::builder::index_service::ClientBuilder {
3671 crate::new_client_builder(super::builder::index_service::client::Factory)
3672 }
3673
3674 /// Creates a new client from the provided stub.
3675 ///
3676 /// The most common case for calling this function is in tests mocking the
3677 /// client's behavior.
3678 pub fn from_stub<T>(stub: T) -> Self
3679 where
3680 T: super::stub::IndexService + 'static,
3681 {
3682 Self {
3683 inner: std::sync::Arc::new(stub),
3684 }
3685 }
3686
3687 pub(crate) async fn new(
3688 config: gaxi::options::ClientConfig,
3689 ) -> crate::ClientBuilderResult<Self> {
3690 let inner = Self::build_inner(config).await?;
3691 Ok(Self { inner })
3692 }
3693
3694 async fn build_inner(
3695 conf: gaxi::options::ClientConfig,
3696 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::IndexService>> {
3697 if gaxi::options::tracing_enabled(&conf) {
3698 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3699 }
3700 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3701 }
3702
3703 async fn build_transport(
3704 conf: gaxi::options::ClientConfig,
3705 ) -> crate::ClientBuilderResult<impl super::stub::IndexService> {
3706 super::transport::IndexService::new(conf).await
3707 }
3708
3709 async fn build_with_tracing(
3710 conf: gaxi::options::ClientConfig,
3711 ) -> crate::ClientBuilderResult<impl super::stub::IndexService> {
3712 Self::build_transport(conf)
3713 .await
3714 .map(super::tracing::IndexService::new)
3715 }
3716
3717 /// Creates an Index.
3718 ///
3719 /// # Long running operations
3720 ///
3721 /// This method is used to start, and/or poll a [long-running Operation].
3722 /// The [Working with long-running operations] chapter in the [user guide]
3723 /// covers these operations in detail.
3724 ///
3725 /// [long-running operation]: https://google.aip.dev/151
3726 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3727 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3728 pub fn create_index(&self) -> super::builder::index_service::CreateIndex {
3729 super::builder::index_service::CreateIndex::new(self.inner.clone())
3730 }
3731
3732 /// Gets an Index.
3733 pub fn get_index(&self) -> super::builder::index_service::GetIndex {
3734 super::builder::index_service::GetIndex::new(self.inner.clone())
3735 }
3736
3737 /// Lists Indexes in a Location.
3738 pub fn list_indexes(&self) -> super::builder::index_service::ListIndexes {
3739 super::builder::index_service::ListIndexes::new(self.inner.clone())
3740 }
3741
3742 /// Updates an Index.
3743 ///
3744 /// # Long running operations
3745 ///
3746 /// This method is used to start, and/or poll a [long-running Operation].
3747 /// The [Working with long-running operations] chapter in the [user guide]
3748 /// covers these operations in detail.
3749 ///
3750 /// [long-running operation]: https://google.aip.dev/151
3751 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3752 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3753 pub fn update_index(&self) -> super::builder::index_service::UpdateIndex {
3754 super::builder::index_service::UpdateIndex::new(self.inner.clone())
3755 }
3756
3757 /// Deletes an Index.
3758 /// An Index can only be deleted when all its
3759 /// [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had
3760 /// been undeployed.
3761 ///
3762 /// [google.cloud.aiplatform.v1.Index.deployed_indexes]: crate::model::Index::deployed_indexes
3763 ///
3764 /// # Long running operations
3765 ///
3766 /// This method is used to start, and/or poll a [long-running Operation].
3767 /// The [Working with long-running operations] chapter in the [user guide]
3768 /// covers these operations in detail.
3769 ///
3770 /// [long-running operation]: https://google.aip.dev/151
3771 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3772 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3773 pub fn delete_index(&self) -> super::builder::index_service::DeleteIndex {
3774 super::builder::index_service::DeleteIndex::new(self.inner.clone())
3775 }
3776
3777 /// Add/update Datapoints into an Index.
3778 pub fn upsert_datapoints(&self) -> super::builder::index_service::UpsertDatapoints {
3779 super::builder::index_service::UpsertDatapoints::new(self.inner.clone())
3780 }
3781
3782 /// Remove Datapoints from an Index.
3783 pub fn remove_datapoints(&self) -> super::builder::index_service::RemoveDatapoints {
3784 super::builder::index_service::RemoveDatapoints::new(self.inner.clone())
3785 }
3786
3787 /// Lists information about the supported locations for this service.
3788 pub fn list_locations(&self) -> super::builder::index_service::ListLocations {
3789 super::builder::index_service::ListLocations::new(self.inner.clone())
3790 }
3791
3792 /// Gets information about a location.
3793 pub fn get_location(&self) -> super::builder::index_service::GetLocation {
3794 super::builder::index_service::GetLocation::new(self.inner.clone())
3795 }
3796
3797 /// Sets the access control policy on the specified resource. Replaces
3798 /// any existing policy.
3799 ///
3800 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
3801 /// errors.
3802 pub fn set_iam_policy(&self) -> super::builder::index_service::SetIamPolicy {
3803 super::builder::index_service::SetIamPolicy::new(self.inner.clone())
3804 }
3805
3806 /// Gets the access control policy for a resource. Returns an empty policy
3807 /// if the resource exists and does not have a policy set.
3808 pub fn get_iam_policy(&self) -> super::builder::index_service::GetIamPolicy {
3809 super::builder::index_service::GetIamPolicy::new(self.inner.clone())
3810 }
3811
3812 /// Returns permissions that a caller has on the specified resource. If the
3813 /// resource does not exist, this will return an empty set of
3814 /// permissions, not a `NOT_FOUND` error.
3815 ///
3816 /// Note: This operation is designed to be used for building
3817 /// permission-aware UIs and command-line tools, not for authorization
3818 /// checking. This operation may "fail open" without warning.
3819 pub fn test_iam_permissions(&self) -> super::builder::index_service::TestIamPermissions {
3820 super::builder::index_service::TestIamPermissions::new(self.inner.clone())
3821 }
3822
3823 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3824 ///
3825 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3826 pub fn list_operations(&self) -> super::builder::index_service::ListOperations {
3827 super::builder::index_service::ListOperations::new(self.inner.clone())
3828 }
3829
3830 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3831 ///
3832 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3833 pub fn get_operation(&self) -> super::builder::index_service::GetOperation {
3834 super::builder::index_service::GetOperation::new(self.inner.clone())
3835 }
3836
3837 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3838 ///
3839 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3840 pub fn delete_operation(&self) -> super::builder::index_service::DeleteOperation {
3841 super::builder::index_service::DeleteOperation::new(self.inner.clone())
3842 }
3843
3844 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3845 ///
3846 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3847 pub fn cancel_operation(&self) -> super::builder::index_service::CancelOperation {
3848 super::builder::index_service::CancelOperation::new(self.inner.clone())
3849 }
3850
3851 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3852 ///
3853 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3854 pub fn wait_operation(&self) -> super::builder::index_service::WaitOperation {
3855 super::builder::index_service::WaitOperation::new(self.inner.clone())
3856 }
3857}
3858
3859/// Implements a client for the Vertex AI API.
3860///
3861/// # Example
3862/// ```
3863/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3864/// # use google_cloud_aiplatform_v1::client::JobService;
3865/// let client = JobService::builder().build().await?;
3866/// // use `client` to make requests to the Vertex AI API.
3867/// # Ok(()) }
3868/// ```
3869///
3870/// # Service Description
3871///
3872/// A service for creating and managing Vertex AI's jobs.
3873///
3874/// # Configuration
3875///
3876/// To configure `JobService` use the `with_*` methods in the type returned
3877/// by [builder()][JobService::builder]. The default configuration should
3878/// work for most applications. Common configuration changes include
3879///
3880/// * [with_endpoint()]: by default this client uses the global default endpoint
3881/// (`https://aiplatform.googleapis.com`). Applications using regional
3882/// endpoints or running in restricted networks (e.g. a network configured
3883// with [Private Google Access with VPC Service Controls]) may want to
3884/// override this default.
3885/// * [with_credentials()]: by default this client uses
3886/// [Application Default Credentials]. Applications using custom
3887/// authentication may need to override this default.
3888///
3889/// [with_endpoint()]: super::builder::job_service::ClientBuilder::with_endpoint
3890/// [with_credentials()]: super::builder::job_service::ClientBuilder::credentials
3891/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3892/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3893///
3894/// # Pooling and Cloning
3895///
3896/// `JobService` holds a connection pool internally, it is advised to
3897/// create one and the reuse it. You do not need to wrap `JobService` in
3898/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3899/// already uses an `Arc` internally.
3900#[cfg(feature = "job-service")]
3901#[cfg_attr(docsrs, doc(cfg(feature = "job-service")))]
3902#[derive(Clone, Debug)]
3903pub struct JobService {
3904 inner: std::sync::Arc<dyn super::stub::dynamic::JobService>,
3905}
3906
3907#[cfg(feature = "job-service")]
3908impl JobService {
3909 /// Returns a builder for [JobService].
3910 ///
3911 /// ```
3912 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3913 /// # use google_cloud_aiplatform_v1::client::JobService;
3914 /// let client = JobService::builder().build().await?;
3915 /// # Ok(()) }
3916 /// ```
3917 pub fn builder() -> super::builder::job_service::ClientBuilder {
3918 crate::new_client_builder(super::builder::job_service::client::Factory)
3919 }
3920
3921 /// Creates a new client from the provided stub.
3922 ///
3923 /// The most common case for calling this function is in tests mocking the
3924 /// client's behavior.
3925 pub fn from_stub<T>(stub: T) -> Self
3926 where
3927 T: super::stub::JobService + 'static,
3928 {
3929 Self {
3930 inner: std::sync::Arc::new(stub),
3931 }
3932 }
3933
3934 pub(crate) async fn new(
3935 config: gaxi::options::ClientConfig,
3936 ) -> crate::ClientBuilderResult<Self> {
3937 let inner = Self::build_inner(config).await?;
3938 Ok(Self { inner })
3939 }
3940
3941 async fn build_inner(
3942 conf: gaxi::options::ClientConfig,
3943 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::JobService>> {
3944 if gaxi::options::tracing_enabled(&conf) {
3945 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3946 }
3947 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3948 }
3949
3950 async fn build_transport(
3951 conf: gaxi::options::ClientConfig,
3952 ) -> crate::ClientBuilderResult<impl super::stub::JobService> {
3953 super::transport::JobService::new(conf).await
3954 }
3955
3956 async fn build_with_tracing(
3957 conf: gaxi::options::ClientConfig,
3958 ) -> crate::ClientBuilderResult<impl super::stub::JobService> {
3959 Self::build_transport(conf)
3960 .await
3961 .map(super::tracing::JobService::new)
3962 }
3963
3964 /// Creates a CustomJob. A created CustomJob right away
3965 /// will be attempted to be run.
3966 pub fn create_custom_job(&self) -> super::builder::job_service::CreateCustomJob {
3967 super::builder::job_service::CreateCustomJob::new(self.inner.clone())
3968 }
3969
3970 /// Gets a CustomJob.
3971 pub fn get_custom_job(&self) -> super::builder::job_service::GetCustomJob {
3972 super::builder::job_service::GetCustomJob::new(self.inner.clone())
3973 }
3974
3975 /// Lists CustomJobs in a Location.
3976 pub fn list_custom_jobs(&self) -> super::builder::job_service::ListCustomJobs {
3977 super::builder::job_service::ListCustomJobs::new(self.inner.clone())
3978 }
3979
3980 /// Deletes a CustomJob.
3981 ///
3982 /// # Long running operations
3983 ///
3984 /// This method is used to start, and/or poll a [long-running Operation].
3985 /// The [Working with long-running operations] chapter in the [user guide]
3986 /// covers these operations in detail.
3987 ///
3988 /// [long-running operation]: https://google.aip.dev/151
3989 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3990 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3991 pub fn delete_custom_job(&self) -> super::builder::job_service::DeleteCustomJob {
3992 super::builder::job_service::DeleteCustomJob::new(self.inner.clone())
3993 }
3994
3995 /// Cancels a CustomJob.
3996 /// Starts asynchronous cancellation on the CustomJob. The server
3997 /// makes a best effort to cancel the job, but success is not
3998 /// guaranteed. Clients can use
3999 /// [JobService.GetCustomJob][google.cloud.aiplatform.v1.JobService.GetCustomJob]
4000 /// or other methods to check whether the cancellation succeeded or whether the
4001 /// job completed despite cancellation. On successful cancellation,
4002 /// the CustomJob is not deleted; instead it becomes a job with
4003 /// a [CustomJob.error][google.cloud.aiplatform.v1.CustomJob.error] value with
4004 /// a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
4005 /// `Code.CANCELLED`, and
4006 /// [CustomJob.state][google.cloud.aiplatform.v1.CustomJob.state] is set to
4007 /// `CANCELLED`.
4008 ///
4009 /// [google.cloud.aiplatform.v1.CustomJob.error]: crate::model::CustomJob::error
4010 /// [google.cloud.aiplatform.v1.CustomJob.state]: crate::model::CustomJob::state
4011 /// [google.cloud.aiplatform.v1.JobService.GetCustomJob]: crate::client::JobService::get_custom_job
4012 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4013 pub fn cancel_custom_job(&self) -> super::builder::job_service::CancelCustomJob {
4014 super::builder::job_service::CancelCustomJob::new(self.inner.clone())
4015 }
4016
4017 /// Creates a DataLabelingJob.
4018 pub fn create_data_labeling_job(&self) -> super::builder::job_service::CreateDataLabelingJob {
4019 super::builder::job_service::CreateDataLabelingJob::new(self.inner.clone())
4020 }
4021
4022 /// Gets a DataLabelingJob.
4023 pub fn get_data_labeling_job(&self) -> super::builder::job_service::GetDataLabelingJob {
4024 super::builder::job_service::GetDataLabelingJob::new(self.inner.clone())
4025 }
4026
4027 /// Lists DataLabelingJobs in a Location.
4028 pub fn list_data_labeling_jobs(&self) -> super::builder::job_service::ListDataLabelingJobs {
4029 super::builder::job_service::ListDataLabelingJobs::new(self.inner.clone())
4030 }
4031
4032 /// Deletes a DataLabelingJob.
4033 ///
4034 /// # Long running operations
4035 ///
4036 /// This method is used to start, and/or poll a [long-running Operation].
4037 /// The [Working with long-running operations] chapter in the [user guide]
4038 /// covers these operations in detail.
4039 ///
4040 /// [long-running operation]: https://google.aip.dev/151
4041 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4042 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4043 pub fn delete_data_labeling_job(&self) -> super::builder::job_service::DeleteDataLabelingJob {
4044 super::builder::job_service::DeleteDataLabelingJob::new(self.inner.clone())
4045 }
4046
4047 /// Cancels a DataLabelingJob. Success of cancellation is not guaranteed.
4048 pub fn cancel_data_labeling_job(&self) -> super::builder::job_service::CancelDataLabelingJob {
4049 super::builder::job_service::CancelDataLabelingJob::new(self.inner.clone())
4050 }
4051
4052 /// Creates a HyperparameterTuningJob
4053 pub fn create_hyperparameter_tuning_job(
4054 &self,
4055 ) -> super::builder::job_service::CreateHyperparameterTuningJob {
4056 super::builder::job_service::CreateHyperparameterTuningJob::new(self.inner.clone())
4057 }
4058
4059 /// Gets a HyperparameterTuningJob
4060 pub fn get_hyperparameter_tuning_job(
4061 &self,
4062 ) -> super::builder::job_service::GetHyperparameterTuningJob {
4063 super::builder::job_service::GetHyperparameterTuningJob::new(self.inner.clone())
4064 }
4065
4066 /// Lists HyperparameterTuningJobs in a Location.
4067 pub fn list_hyperparameter_tuning_jobs(
4068 &self,
4069 ) -> super::builder::job_service::ListHyperparameterTuningJobs {
4070 super::builder::job_service::ListHyperparameterTuningJobs::new(self.inner.clone())
4071 }
4072
4073 /// Deletes a HyperparameterTuningJob.
4074 ///
4075 /// # Long running operations
4076 ///
4077 /// This method is used to start, and/or poll a [long-running Operation].
4078 /// The [Working with long-running operations] chapter in the [user guide]
4079 /// covers these operations in detail.
4080 ///
4081 /// [long-running operation]: https://google.aip.dev/151
4082 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4083 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4084 pub fn delete_hyperparameter_tuning_job(
4085 &self,
4086 ) -> super::builder::job_service::DeleteHyperparameterTuningJob {
4087 super::builder::job_service::DeleteHyperparameterTuningJob::new(self.inner.clone())
4088 }
4089
4090 /// Cancels a HyperparameterTuningJob.
4091 /// Starts asynchronous cancellation on the HyperparameterTuningJob. The server
4092 /// makes a best effort to cancel the job, but success is not
4093 /// guaranteed. Clients can use
4094 /// [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob]
4095 /// or other methods to check whether the cancellation succeeded or whether the
4096 /// job completed despite cancellation. On successful cancellation,
4097 /// the HyperparameterTuningJob is not deleted; instead it becomes a job with
4098 /// a
4099 /// [HyperparameterTuningJob.error][google.cloud.aiplatform.v1.HyperparameterTuningJob.error]
4100 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
4101 /// corresponding to `Code.CANCELLED`, and
4102 /// [HyperparameterTuningJob.state][google.cloud.aiplatform.v1.HyperparameterTuningJob.state]
4103 /// is set to `CANCELLED`.
4104 ///
4105 /// [google.cloud.aiplatform.v1.HyperparameterTuningJob.error]: crate::model::HyperparameterTuningJob::error
4106 /// [google.cloud.aiplatform.v1.HyperparameterTuningJob.state]: crate::model::HyperparameterTuningJob::state
4107 /// [google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob]: crate::client::JobService::get_hyperparameter_tuning_job
4108 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4109 pub fn cancel_hyperparameter_tuning_job(
4110 &self,
4111 ) -> super::builder::job_service::CancelHyperparameterTuningJob {
4112 super::builder::job_service::CancelHyperparameterTuningJob::new(self.inner.clone())
4113 }
4114
4115 /// Creates a NasJob
4116 pub fn create_nas_job(&self) -> super::builder::job_service::CreateNasJob {
4117 super::builder::job_service::CreateNasJob::new(self.inner.clone())
4118 }
4119
4120 /// Gets a NasJob
4121 pub fn get_nas_job(&self) -> super::builder::job_service::GetNasJob {
4122 super::builder::job_service::GetNasJob::new(self.inner.clone())
4123 }
4124
4125 /// Lists NasJobs in a Location.
4126 pub fn list_nas_jobs(&self) -> super::builder::job_service::ListNasJobs {
4127 super::builder::job_service::ListNasJobs::new(self.inner.clone())
4128 }
4129
4130 /// Deletes a NasJob.
4131 ///
4132 /// # Long running operations
4133 ///
4134 /// This method is used to start, and/or poll a [long-running Operation].
4135 /// The [Working with long-running operations] chapter in the [user guide]
4136 /// covers these operations in detail.
4137 ///
4138 /// [long-running operation]: https://google.aip.dev/151
4139 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4140 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4141 pub fn delete_nas_job(&self) -> super::builder::job_service::DeleteNasJob {
4142 super::builder::job_service::DeleteNasJob::new(self.inner.clone())
4143 }
4144
4145 /// Cancels a NasJob.
4146 /// Starts asynchronous cancellation on the NasJob. The server
4147 /// makes a best effort to cancel the job, but success is not
4148 /// guaranteed. Clients can use
4149 /// [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob] or
4150 /// other methods to check whether the cancellation succeeded or whether the
4151 /// job completed despite cancellation. On successful cancellation,
4152 /// the NasJob is not deleted; instead it becomes a job with
4153 /// a [NasJob.error][google.cloud.aiplatform.v1.NasJob.error] value with a
4154 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
4155 /// `Code.CANCELLED`, and
4156 /// [NasJob.state][google.cloud.aiplatform.v1.NasJob.state] is set to
4157 /// `CANCELLED`.
4158 ///
4159 /// [google.cloud.aiplatform.v1.JobService.GetNasJob]: crate::client::JobService::get_nas_job
4160 /// [google.cloud.aiplatform.v1.NasJob.error]: crate::model::NasJob::error
4161 /// [google.cloud.aiplatform.v1.NasJob.state]: crate::model::NasJob::state
4162 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4163 pub fn cancel_nas_job(&self) -> super::builder::job_service::CancelNasJob {
4164 super::builder::job_service::CancelNasJob::new(self.inner.clone())
4165 }
4166
4167 /// Gets a NasTrialDetail.
4168 pub fn get_nas_trial_detail(&self) -> super::builder::job_service::GetNasTrialDetail {
4169 super::builder::job_service::GetNasTrialDetail::new(self.inner.clone())
4170 }
4171
4172 /// List top NasTrialDetails of a NasJob.
4173 pub fn list_nas_trial_details(&self) -> super::builder::job_service::ListNasTrialDetails {
4174 super::builder::job_service::ListNasTrialDetails::new(self.inner.clone())
4175 }
4176
4177 /// Creates a BatchPredictionJob. A BatchPredictionJob once created will
4178 /// right away be attempted to start.
4179 pub fn create_batch_prediction_job(
4180 &self,
4181 ) -> super::builder::job_service::CreateBatchPredictionJob {
4182 super::builder::job_service::CreateBatchPredictionJob::new(self.inner.clone())
4183 }
4184
4185 /// Gets a BatchPredictionJob
4186 pub fn get_batch_prediction_job(&self) -> super::builder::job_service::GetBatchPredictionJob {
4187 super::builder::job_service::GetBatchPredictionJob::new(self.inner.clone())
4188 }
4189
4190 /// Lists BatchPredictionJobs in a Location.
4191 pub fn list_batch_prediction_jobs(
4192 &self,
4193 ) -> super::builder::job_service::ListBatchPredictionJobs {
4194 super::builder::job_service::ListBatchPredictionJobs::new(self.inner.clone())
4195 }
4196
4197 /// Deletes a BatchPredictionJob. Can only be called on jobs that already
4198 /// finished.
4199 ///
4200 /// # Long running operations
4201 ///
4202 /// This method is used to start, and/or poll a [long-running Operation].
4203 /// The [Working with long-running operations] chapter in the [user guide]
4204 /// covers these operations in detail.
4205 ///
4206 /// [long-running operation]: https://google.aip.dev/151
4207 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4208 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4209 pub fn delete_batch_prediction_job(
4210 &self,
4211 ) -> super::builder::job_service::DeleteBatchPredictionJob {
4212 super::builder::job_service::DeleteBatchPredictionJob::new(self.inner.clone())
4213 }
4214
4215 /// Cancels a BatchPredictionJob.
4216 ///
4217 /// Starts asynchronous cancellation on the BatchPredictionJob. The server
4218 /// makes the best effort to cancel the job, but success is not
4219 /// guaranteed. Clients can use
4220 /// [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob]
4221 /// or other methods to check whether the cancellation succeeded or whether the
4222 /// job completed despite cancellation. On a successful cancellation,
4223 /// the BatchPredictionJob is not deleted;instead its
4224 /// [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state]
4225 /// is set to `CANCELLED`. Any files already outputted by the job are not
4226 /// deleted.
4227 ///
4228 /// [google.cloud.aiplatform.v1.BatchPredictionJob.state]: crate::model::BatchPredictionJob::state
4229 /// [google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob]: crate::client::JobService::get_batch_prediction_job
4230 pub fn cancel_batch_prediction_job(
4231 &self,
4232 ) -> super::builder::job_service::CancelBatchPredictionJob {
4233 super::builder::job_service::CancelBatchPredictionJob::new(self.inner.clone())
4234 }
4235
4236 /// Creates a ModelDeploymentMonitoringJob. It will run periodically on a
4237 /// configured interval.
4238 pub fn create_model_deployment_monitoring_job(
4239 &self,
4240 ) -> super::builder::job_service::CreateModelDeploymentMonitoringJob {
4241 super::builder::job_service::CreateModelDeploymentMonitoringJob::new(self.inner.clone())
4242 }
4243
4244 /// Searches Model Monitoring Statistics generated within a given time window.
4245 pub fn search_model_deployment_monitoring_stats_anomalies(
4246 &self,
4247 ) -> super::builder::job_service::SearchModelDeploymentMonitoringStatsAnomalies {
4248 super::builder::job_service::SearchModelDeploymentMonitoringStatsAnomalies::new(
4249 self.inner.clone(),
4250 )
4251 }
4252
4253 /// Gets a ModelDeploymentMonitoringJob.
4254 pub fn get_model_deployment_monitoring_job(
4255 &self,
4256 ) -> super::builder::job_service::GetModelDeploymentMonitoringJob {
4257 super::builder::job_service::GetModelDeploymentMonitoringJob::new(self.inner.clone())
4258 }
4259
4260 /// Lists ModelDeploymentMonitoringJobs in a Location.
4261 pub fn list_model_deployment_monitoring_jobs(
4262 &self,
4263 ) -> super::builder::job_service::ListModelDeploymentMonitoringJobs {
4264 super::builder::job_service::ListModelDeploymentMonitoringJobs::new(self.inner.clone())
4265 }
4266
4267 /// Updates a ModelDeploymentMonitoringJob.
4268 ///
4269 /// # Long running operations
4270 ///
4271 /// This method is used to start, and/or poll a [long-running Operation].
4272 /// The [Working with long-running operations] chapter in the [user guide]
4273 /// covers these operations in detail.
4274 ///
4275 /// [long-running operation]: https://google.aip.dev/151
4276 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4277 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4278 pub fn update_model_deployment_monitoring_job(
4279 &self,
4280 ) -> super::builder::job_service::UpdateModelDeploymentMonitoringJob {
4281 super::builder::job_service::UpdateModelDeploymentMonitoringJob::new(self.inner.clone())
4282 }
4283
4284 /// Deletes a ModelDeploymentMonitoringJob.
4285 ///
4286 /// # Long running operations
4287 ///
4288 /// This method is used to start, and/or poll a [long-running Operation].
4289 /// The [Working with long-running operations] chapter in the [user guide]
4290 /// covers these operations in detail.
4291 ///
4292 /// [long-running operation]: https://google.aip.dev/151
4293 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4294 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4295 pub fn delete_model_deployment_monitoring_job(
4296 &self,
4297 ) -> super::builder::job_service::DeleteModelDeploymentMonitoringJob {
4298 super::builder::job_service::DeleteModelDeploymentMonitoringJob::new(self.inner.clone())
4299 }
4300
4301 /// Pauses a ModelDeploymentMonitoringJob. If the job is running, the server
4302 /// makes a best effort to cancel the job. Will mark
4303 /// [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state]
4304 /// to 'PAUSED'.
4305 ///
4306 /// [google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state]: crate::model::ModelDeploymentMonitoringJob::state
4307 pub fn pause_model_deployment_monitoring_job(
4308 &self,
4309 ) -> super::builder::job_service::PauseModelDeploymentMonitoringJob {
4310 super::builder::job_service::PauseModelDeploymentMonitoringJob::new(self.inner.clone())
4311 }
4312
4313 /// Resumes a paused ModelDeploymentMonitoringJob. It will start to run from
4314 /// next scheduled time. A deleted ModelDeploymentMonitoringJob can't be
4315 /// resumed.
4316 pub fn resume_model_deployment_monitoring_job(
4317 &self,
4318 ) -> super::builder::job_service::ResumeModelDeploymentMonitoringJob {
4319 super::builder::job_service::ResumeModelDeploymentMonitoringJob::new(self.inner.clone())
4320 }
4321
4322 /// Lists information about the supported locations for this service.
4323 pub fn list_locations(&self) -> super::builder::job_service::ListLocations {
4324 super::builder::job_service::ListLocations::new(self.inner.clone())
4325 }
4326
4327 /// Gets information about a location.
4328 pub fn get_location(&self) -> super::builder::job_service::GetLocation {
4329 super::builder::job_service::GetLocation::new(self.inner.clone())
4330 }
4331
4332 /// Sets the access control policy on the specified resource. Replaces
4333 /// any existing policy.
4334 ///
4335 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
4336 /// errors.
4337 pub fn set_iam_policy(&self) -> super::builder::job_service::SetIamPolicy {
4338 super::builder::job_service::SetIamPolicy::new(self.inner.clone())
4339 }
4340
4341 /// Gets the access control policy for a resource. Returns an empty policy
4342 /// if the resource exists and does not have a policy set.
4343 pub fn get_iam_policy(&self) -> super::builder::job_service::GetIamPolicy {
4344 super::builder::job_service::GetIamPolicy::new(self.inner.clone())
4345 }
4346
4347 /// Returns permissions that a caller has on the specified resource. If the
4348 /// resource does not exist, this will return an empty set of
4349 /// permissions, not a `NOT_FOUND` error.
4350 ///
4351 /// Note: This operation is designed to be used for building
4352 /// permission-aware UIs and command-line tools, not for authorization
4353 /// checking. This operation may "fail open" without warning.
4354 pub fn test_iam_permissions(&self) -> super::builder::job_service::TestIamPermissions {
4355 super::builder::job_service::TestIamPermissions::new(self.inner.clone())
4356 }
4357
4358 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4359 ///
4360 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4361 pub fn list_operations(&self) -> super::builder::job_service::ListOperations {
4362 super::builder::job_service::ListOperations::new(self.inner.clone())
4363 }
4364
4365 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4366 ///
4367 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4368 pub fn get_operation(&self) -> super::builder::job_service::GetOperation {
4369 super::builder::job_service::GetOperation::new(self.inner.clone())
4370 }
4371
4372 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4373 ///
4374 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4375 pub fn delete_operation(&self) -> super::builder::job_service::DeleteOperation {
4376 super::builder::job_service::DeleteOperation::new(self.inner.clone())
4377 }
4378
4379 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4380 ///
4381 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4382 pub fn cancel_operation(&self) -> super::builder::job_service::CancelOperation {
4383 super::builder::job_service::CancelOperation::new(self.inner.clone())
4384 }
4385
4386 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4387 ///
4388 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4389 pub fn wait_operation(&self) -> super::builder::job_service::WaitOperation {
4390 super::builder::job_service::WaitOperation::new(self.inner.clone())
4391 }
4392}
4393
4394/// Implements a client for the Vertex AI API.
4395///
4396/// # Example
4397/// ```
4398/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4399/// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
4400/// let client = LlmUtilityService::builder().build().await?;
4401/// // use `client` to make requests to the Vertex AI API.
4402/// # Ok(()) }
4403/// ```
4404///
4405/// # Service Description
4406///
4407/// Service for LLM related utility functions.
4408///
4409/// # Configuration
4410///
4411/// To configure `LlmUtilityService` use the `with_*` methods in the type returned
4412/// by [builder()][LlmUtilityService::builder]. The default configuration should
4413/// work for most applications. Common configuration changes include
4414///
4415/// * [with_endpoint()]: by default this client uses the global default endpoint
4416/// (`https://aiplatform.googleapis.com`). Applications using regional
4417/// endpoints or running in restricted networks (e.g. a network configured
4418// with [Private Google Access with VPC Service Controls]) may want to
4419/// override this default.
4420/// * [with_credentials()]: by default this client uses
4421/// [Application Default Credentials]. Applications using custom
4422/// authentication may need to override this default.
4423///
4424/// [with_endpoint()]: super::builder::llm_utility_service::ClientBuilder::with_endpoint
4425/// [with_credentials()]: super::builder::llm_utility_service::ClientBuilder::credentials
4426/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4427/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4428///
4429/// # Pooling and Cloning
4430///
4431/// `LlmUtilityService` holds a connection pool internally, it is advised to
4432/// create one and the reuse it. You do not need to wrap `LlmUtilityService` in
4433/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4434/// already uses an `Arc` internally.
4435#[cfg(feature = "llm-utility-service")]
4436#[cfg_attr(docsrs, doc(cfg(feature = "llm-utility-service")))]
4437#[derive(Clone, Debug)]
4438pub struct LlmUtilityService {
4439 inner: std::sync::Arc<dyn super::stub::dynamic::LlmUtilityService>,
4440}
4441
4442#[cfg(feature = "llm-utility-service")]
4443impl LlmUtilityService {
4444 /// Returns a builder for [LlmUtilityService].
4445 ///
4446 /// ```
4447 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4448 /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
4449 /// let client = LlmUtilityService::builder().build().await?;
4450 /// # Ok(()) }
4451 /// ```
4452 pub fn builder() -> super::builder::llm_utility_service::ClientBuilder {
4453 crate::new_client_builder(super::builder::llm_utility_service::client::Factory)
4454 }
4455
4456 /// Creates a new client from the provided stub.
4457 ///
4458 /// The most common case for calling this function is in tests mocking the
4459 /// client's behavior.
4460 pub fn from_stub<T>(stub: T) -> Self
4461 where
4462 T: super::stub::LlmUtilityService + 'static,
4463 {
4464 Self {
4465 inner: std::sync::Arc::new(stub),
4466 }
4467 }
4468
4469 pub(crate) async fn new(
4470 config: gaxi::options::ClientConfig,
4471 ) -> crate::ClientBuilderResult<Self> {
4472 let inner = Self::build_inner(config).await?;
4473 Ok(Self { inner })
4474 }
4475
4476 async fn build_inner(
4477 conf: gaxi::options::ClientConfig,
4478 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::LlmUtilityService>>
4479 {
4480 if gaxi::options::tracing_enabled(&conf) {
4481 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4482 }
4483 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4484 }
4485
4486 async fn build_transport(
4487 conf: gaxi::options::ClientConfig,
4488 ) -> crate::ClientBuilderResult<impl super::stub::LlmUtilityService> {
4489 super::transport::LlmUtilityService::new(conf).await
4490 }
4491
4492 async fn build_with_tracing(
4493 conf: gaxi::options::ClientConfig,
4494 ) -> crate::ClientBuilderResult<impl super::stub::LlmUtilityService> {
4495 Self::build_transport(conf)
4496 .await
4497 .map(super::tracing::LlmUtilityService::new)
4498 }
4499
4500 /// Perform a token counting.
4501 pub fn count_tokens(&self) -> super::builder::llm_utility_service::CountTokens {
4502 super::builder::llm_utility_service::CountTokens::new(self.inner.clone())
4503 }
4504
4505 /// Return a list of tokens based on the input text.
4506 pub fn compute_tokens(&self) -> super::builder::llm_utility_service::ComputeTokens {
4507 super::builder::llm_utility_service::ComputeTokens::new(self.inner.clone())
4508 }
4509
4510 /// Lists information about the supported locations for this service.
4511 pub fn list_locations(&self) -> super::builder::llm_utility_service::ListLocations {
4512 super::builder::llm_utility_service::ListLocations::new(self.inner.clone())
4513 }
4514
4515 /// Gets information about a location.
4516 pub fn get_location(&self) -> super::builder::llm_utility_service::GetLocation {
4517 super::builder::llm_utility_service::GetLocation::new(self.inner.clone())
4518 }
4519
4520 /// Sets the access control policy on the specified resource. Replaces
4521 /// any existing policy.
4522 ///
4523 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
4524 /// errors.
4525 pub fn set_iam_policy(&self) -> super::builder::llm_utility_service::SetIamPolicy {
4526 super::builder::llm_utility_service::SetIamPolicy::new(self.inner.clone())
4527 }
4528
4529 /// Gets the access control policy for a resource. Returns an empty policy
4530 /// if the resource exists and does not have a policy set.
4531 pub fn get_iam_policy(&self) -> super::builder::llm_utility_service::GetIamPolicy {
4532 super::builder::llm_utility_service::GetIamPolicy::new(self.inner.clone())
4533 }
4534
4535 /// Returns permissions that a caller has on the specified resource. If the
4536 /// resource does not exist, this will return an empty set of
4537 /// permissions, not a `NOT_FOUND` error.
4538 ///
4539 /// Note: This operation is designed to be used for building
4540 /// permission-aware UIs and command-line tools, not for authorization
4541 /// checking. This operation may "fail open" without warning.
4542 pub fn test_iam_permissions(&self) -> super::builder::llm_utility_service::TestIamPermissions {
4543 super::builder::llm_utility_service::TestIamPermissions::new(self.inner.clone())
4544 }
4545
4546 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4547 ///
4548 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4549 pub fn list_operations(&self) -> super::builder::llm_utility_service::ListOperations {
4550 super::builder::llm_utility_service::ListOperations::new(self.inner.clone())
4551 }
4552
4553 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4554 ///
4555 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4556 pub fn get_operation(&self) -> super::builder::llm_utility_service::GetOperation {
4557 super::builder::llm_utility_service::GetOperation::new(self.inner.clone())
4558 }
4559
4560 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4561 ///
4562 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4563 pub fn delete_operation(&self) -> super::builder::llm_utility_service::DeleteOperation {
4564 super::builder::llm_utility_service::DeleteOperation::new(self.inner.clone())
4565 }
4566
4567 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4568 ///
4569 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4570 pub fn cancel_operation(&self) -> super::builder::llm_utility_service::CancelOperation {
4571 super::builder::llm_utility_service::CancelOperation::new(self.inner.clone())
4572 }
4573
4574 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4575 ///
4576 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4577 pub fn wait_operation(&self) -> super::builder::llm_utility_service::WaitOperation {
4578 super::builder::llm_utility_service::WaitOperation::new(self.inner.clone())
4579 }
4580}
4581
4582/// Implements a client for the Vertex AI API.
4583///
4584/// # Example
4585/// ```
4586/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4587/// # use google_cloud_aiplatform_v1::client::MatchService;
4588/// let client = MatchService::builder().build().await?;
4589/// // use `client` to make requests to the Vertex AI API.
4590/// # Ok(()) }
4591/// ```
4592///
4593/// # Service Description
4594///
4595/// MatchService is a Google managed service for efficient vector similarity
4596/// search at scale.
4597///
4598/// # Configuration
4599///
4600/// To configure `MatchService` use the `with_*` methods in the type returned
4601/// by [builder()][MatchService::builder]. The default configuration should
4602/// work for most applications. Common configuration changes include
4603///
4604/// * [with_endpoint()]: by default this client uses the global default endpoint
4605/// (`https://aiplatform.googleapis.com`). Applications using regional
4606/// endpoints or running in restricted networks (e.g. a network configured
4607// with [Private Google Access with VPC Service Controls]) may want to
4608/// override this default.
4609/// * [with_credentials()]: by default this client uses
4610/// [Application Default Credentials]. Applications using custom
4611/// authentication may need to override this default.
4612///
4613/// [with_endpoint()]: super::builder::match_service::ClientBuilder::with_endpoint
4614/// [with_credentials()]: super::builder::match_service::ClientBuilder::credentials
4615/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4616/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4617///
4618/// # Pooling and Cloning
4619///
4620/// `MatchService` holds a connection pool internally, it is advised to
4621/// create one and the reuse it. You do not need to wrap `MatchService` in
4622/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4623/// already uses an `Arc` internally.
4624#[cfg(feature = "match-service")]
4625#[cfg_attr(docsrs, doc(cfg(feature = "match-service")))]
4626#[derive(Clone, Debug)]
4627pub struct MatchService {
4628 inner: std::sync::Arc<dyn super::stub::dynamic::MatchService>,
4629}
4630
4631#[cfg(feature = "match-service")]
4632impl MatchService {
4633 /// Returns a builder for [MatchService].
4634 ///
4635 /// ```
4636 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4637 /// # use google_cloud_aiplatform_v1::client::MatchService;
4638 /// let client = MatchService::builder().build().await?;
4639 /// # Ok(()) }
4640 /// ```
4641 pub fn builder() -> super::builder::match_service::ClientBuilder {
4642 crate::new_client_builder(super::builder::match_service::client::Factory)
4643 }
4644
4645 /// Creates a new client from the provided stub.
4646 ///
4647 /// The most common case for calling this function is in tests mocking the
4648 /// client's behavior.
4649 pub fn from_stub<T>(stub: T) -> Self
4650 where
4651 T: super::stub::MatchService + 'static,
4652 {
4653 Self {
4654 inner: std::sync::Arc::new(stub),
4655 }
4656 }
4657
4658 pub(crate) async fn new(
4659 config: gaxi::options::ClientConfig,
4660 ) -> crate::ClientBuilderResult<Self> {
4661 let inner = Self::build_inner(config).await?;
4662 Ok(Self { inner })
4663 }
4664
4665 async fn build_inner(
4666 conf: gaxi::options::ClientConfig,
4667 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MatchService>> {
4668 if gaxi::options::tracing_enabled(&conf) {
4669 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4670 }
4671 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4672 }
4673
4674 async fn build_transport(
4675 conf: gaxi::options::ClientConfig,
4676 ) -> crate::ClientBuilderResult<impl super::stub::MatchService> {
4677 super::transport::MatchService::new(conf).await
4678 }
4679
4680 async fn build_with_tracing(
4681 conf: gaxi::options::ClientConfig,
4682 ) -> crate::ClientBuilderResult<impl super::stub::MatchService> {
4683 Self::build_transport(conf)
4684 .await
4685 .map(super::tracing::MatchService::new)
4686 }
4687
4688 /// Finds the nearest neighbors of each vector within the request.
4689 pub fn find_neighbors(&self) -> super::builder::match_service::FindNeighbors {
4690 super::builder::match_service::FindNeighbors::new(self.inner.clone())
4691 }
4692
4693 /// Reads the datapoints/vectors of the given IDs.
4694 /// A maximum of 1000 datapoints can be retrieved in a batch.
4695 pub fn read_index_datapoints(&self) -> super::builder::match_service::ReadIndexDatapoints {
4696 super::builder::match_service::ReadIndexDatapoints::new(self.inner.clone())
4697 }
4698
4699 /// Lists information about the supported locations for this service.
4700 pub fn list_locations(&self) -> super::builder::match_service::ListLocations {
4701 super::builder::match_service::ListLocations::new(self.inner.clone())
4702 }
4703
4704 /// Gets information about a location.
4705 pub fn get_location(&self) -> super::builder::match_service::GetLocation {
4706 super::builder::match_service::GetLocation::new(self.inner.clone())
4707 }
4708
4709 /// Sets the access control policy on the specified resource. Replaces
4710 /// any existing policy.
4711 ///
4712 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
4713 /// errors.
4714 pub fn set_iam_policy(&self) -> super::builder::match_service::SetIamPolicy {
4715 super::builder::match_service::SetIamPolicy::new(self.inner.clone())
4716 }
4717
4718 /// Gets the access control policy for a resource. Returns an empty policy
4719 /// if the resource exists and does not have a policy set.
4720 pub fn get_iam_policy(&self) -> super::builder::match_service::GetIamPolicy {
4721 super::builder::match_service::GetIamPolicy::new(self.inner.clone())
4722 }
4723
4724 /// Returns permissions that a caller has on the specified resource. If the
4725 /// resource does not exist, this will return an empty set of
4726 /// permissions, not a `NOT_FOUND` error.
4727 ///
4728 /// Note: This operation is designed to be used for building
4729 /// permission-aware UIs and command-line tools, not for authorization
4730 /// checking. This operation may "fail open" without warning.
4731 pub fn test_iam_permissions(&self) -> super::builder::match_service::TestIamPermissions {
4732 super::builder::match_service::TestIamPermissions::new(self.inner.clone())
4733 }
4734
4735 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4736 ///
4737 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4738 pub fn list_operations(&self) -> super::builder::match_service::ListOperations {
4739 super::builder::match_service::ListOperations::new(self.inner.clone())
4740 }
4741
4742 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4743 ///
4744 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4745 pub fn get_operation(&self) -> super::builder::match_service::GetOperation {
4746 super::builder::match_service::GetOperation::new(self.inner.clone())
4747 }
4748
4749 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4750 ///
4751 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4752 pub fn delete_operation(&self) -> super::builder::match_service::DeleteOperation {
4753 super::builder::match_service::DeleteOperation::new(self.inner.clone())
4754 }
4755
4756 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4757 ///
4758 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4759 pub fn cancel_operation(&self) -> super::builder::match_service::CancelOperation {
4760 super::builder::match_service::CancelOperation::new(self.inner.clone())
4761 }
4762
4763 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4764 ///
4765 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4766 pub fn wait_operation(&self) -> super::builder::match_service::WaitOperation {
4767 super::builder::match_service::WaitOperation::new(self.inner.clone())
4768 }
4769}
4770
4771/// Implements a client for the Vertex AI API.
4772///
4773/// # Example
4774/// ```
4775/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4776/// # use google_cloud_aiplatform_v1::client::MetadataService;
4777/// let client = MetadataService::builder().build().await?;
4778/// // use `client` to make requests to the Vertex AI API.
4779/// # Ok(()) }
4780/// ```
4781///
4782/// # Service Description
4783///
4784/// Service for reading and writing metadata entries.
4785///
4786/// # Configuration
4787///
4788/// To configure `MetadataService` use the `with_*` methods in the type returned
4789/// by [builder()][MetadataService::builder]. The default configuration should
4790/// work for most applications. Common configuration changes include
4791///
4792/// * [with_endpoint()]: by default this client uses the global default endpoint
4793/// (`https://aiplatform.googleapis.com`). Applications using regional
4794/// endpoints or running in restricted networks (e.g. a network configured
4795// with [Private Google Access with VPC Service Controls]) may want to
4796/// override this default.
4797/// * [with_credentials()]: by default this client uses
4798/// [Application Default Credentials]. Applications using custom
4799/// authentication may need to override this default.
4800///
4801/// [with_endpoint()]: super::builder::metadata_service::ClientBuilder::with_endpoint
4802/// [with_credentials()]: super::builder::metadata_service::ClientBuilder::credentials
4803/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4804/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4805///
4806/// # Pooling and Cloning
4807///
4808/// `MetadataService` holds a connection pool internally, it is advised to
4809/// create one and the reuse it. You do not need to wrap `MetadataService` in
4810/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4811/// already uses an `Arc` internally.
4812#[cfg(feature = "metadata-service")]
4813#[cfg_attr(docsrs, doc(cfg(feature = "metadata-service")))]
4814#[derive(Clone, Debug)]
4815pub struct MetadataService {
4816 inner: std::sync::Arc<dyn super::stub::dynamic::MetadataService>,
4817}
4818
4819#[cfg(feature = "metadata-service")]
4820impl MetadataService {
4821 /// Returns a builder for [MetadataService].
4822 ///
4823 /// ```
4824 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4825 /// # use google_cloud_aiplatform_v1::client::MetadataService;
4826 /// let client = MetadataService::builder().build().await?;
4827 /// # Ok(()) }
4828 /// ```
4829 pub fn builder() -> super::builder::metadata_service::ClientBuilder {
4830 crate::new_client_builder(super::builder::metadata_service::client::Factory)
4831 }
4832
4833 /// Creates a new client from the provided stub.
4834 ///
4835 /// The most common case for calling this function is in tests mocking the
4836 /// client's behavior.
4837 pub fn from_stub<T>(stub: T) -> Self
4838 where
4839 T: super::stub::MetadataService + 'static,
4840 {
4841 Self {
4842 inner: std::sync::Arc::new(stub),
4843 }
4844 }
4845
4846 pub(crate) async fn new(
4847 config: gaxi::options::ClientConfig,
4848 ) -> crate::ClientBuilderResult<Self> {
4849 let inner = Self::build_inner(config).await?;
4850 Ok(Self { inner })
4851 }
4852
4853 async fn build_inner(
4854 conf: gaxi::options::ClientConfig,
4855 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MetadataService>> {
4856 if gaxi::options::tracing_enabled(&conf) {
4857 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4858 }
4859 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4860 }
4861
4862 async fn build_transport(
4863 conf: gaxi::options::ClientConfig,
4864 ) -> crate::ClientBuilderResult<impl super::stub::MetadataService> {
4865 super::transport::MetadataService::new(conf).await
4866 }
4867
4868 async fn build_with_tracing(
4869 conf: gaxi::options::ClientConfig,
4870 ) -> crate::ClientBuilderResult<impl super::stub::MetadataService> {
4871 Self::build_transport(conf)
4872 .await
4873 .map(super::tracing::MetadataService::new)
4874 }
4875
4876 /// Initializes a MetadataStore, including allocation of resources.
4877 ///
4878 /// # Long running operations
4879 ///
4880 /// This method is used to start, and/or poll a [long-running Operation].
4881 /// The [Working with long-running operations] chapter in the [user guide]
4882 /// covers these operations in detail.
4883 ///
4884 /// [long-running operation]: https://google.aip.dev/151
4885 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4886 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4887 pub fn create_metadata_store(&self) -> super::builder::metadata_service::CreateMetadataStore {
4888 super::builder::metadata_service::CreateMetadataStore::new(self.inner.clone())
4889 }
4890
4891 /// Retrieves a specific MetadataStore.
4892 pub fn get_metadata_store(&self) -> super::builder::metadata_service::GetMetadataStore {
4893 super::builder::metadata_service::GetMetadataStore::new(self.inner.clone())
4894 }
4895
4896 /// Lists MetadataStores for a Location.
4897 pub fn list_metadata_stores(&self) -> super::builder::metadata_service::ListMetadataStores {
4898 super::builder::metadata_service::ListMetadataStores::new(self.inner.clone())
4899 }
4900
4901 /// Deletes a single MetadataStore and all its child resources (Artifacts,
4902 /// Executions, and Contexts).
4903 ///
4904 /// # Long running operations
4905 ///
4906 /// This method is used to start, and/or poll a [long-running Operation].
4907 /// The [Working with long-running operations] chapter in the [user guide]
4908 /// covers these operations in detail.
4909 ///
4910 /// [long-running operation]: https://google.aip.dev/151
4911 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4912 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4913 pub fn delete_metadata_store(&self) -> super::builder::metadata_service::DeleteMetadataStore {
4914 super::builder::metadata_service::DeleteMetadataStore::new(self.inner.clone())
4915 }
4916
4917 /// Creates an Artifact associated with a MetadataStore.
4918 pub fn create_artifact(&self) -> super::builder::metadata_service::CreateArtifact {
4919 super::builder::metadata_service::CreateArtifact::new(self.inner.clone())
4920 }
4921
4922 /// Retrieves a specific Artifact.
4923 pub fn get_artifact(&self) -> super::builder::metadata_service::GetArtifact {
4924 super::builder::metadata_service::GetArtifact::new(self.inner.clone())
4925 }
4926
4927 /// Lists Artifacts in the MetadataStore.
4928 pub fn list_artifacts(&self) -> super::builder::metadata_service::ListArtifacts {
4929 super::builder::metadata_service::ListArtifacts::new(self.inner.clone())
4930 }
4931
4932 /// Updates a stored Artifact.
4933 pub fn update_artifact(&self) -> super::builder::metadata_service::UpdateArtifact {
4934 super::builder::metadata_service::UpdateArtifact::new(self.inner.clone())
4935 }
4936
4937 /// Deletes an Artifact.
4938 ///
4939 /// # Long running operations
4940 ///
4941 /// This method is used to start, and/or poll a [long-running Operation].
4942 /// The [Working with long-running operations] chapter in the [user guide]
4943 /// covers these operations in detail.
4944 ///
4945 /// [long-running operation]: https://google.aip.dev/151
4946 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4947 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4948 pub fn delete_artifact(&self) -> super::builder::metadata_service::DeleteArtifact {
4949 super::builder::metadata_service::DeleteArtifact::new(self.inner.clone())
4950 }
4951
4952 /// Purges Artifacts.
4953 ///
4954 /// # Long running operations
4955 ///
4956 /// This method is used to start, and/or poll a [long-running Operation].
4957 /// The [Working with long-running operations] chapter in the [user guide]
4958 /// covers these operations in detail.
4959 ///
4960 /// [long-running operation]: https://google.aip.dev/151
4961 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4962 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4963 pub fn purge_artifacts(&self) -> super::builder::metadata_service::PurgeArtifacts {
4964 super::builder::metadata_service::PurgeArtifacts::new(self.inner.clone())
4965 }
4966
4967 /// Creates a Context associated with a MetadataStore.
4968 pub fn create_context(&self) -> super::builder::metadata_service::CreateContext {
4969 super::builder::metadata_service::CreateContext::new(self.inner.clone())
4970 }
4971
4972 /// Retrieves a specific Context.
4973 pub fn get_context(&self) -> super::builder::metadata_service::GetContext {
4974 super::builder::metadata_service::GetContext::new(self.inner.clone())
4975 }
4976
4977 /// Lists Contexts on the MetadataStore.
4978 pub fn list_contexts(&self) -> super::builder::metadata_service::ListContexts {
4979 super::builder::metadata_service::ListContexts::new(self.inner.clone())
4980 }
4981
4982 /// Updates a stored Context.
4983 pub fn update_context(&self) -> super::builder::metadata_service::UpdateContext {
4984 super::builder::metadata_service::UpdateContext::new(self.inner.clone())
4985 }
4986
4987 /// Deletes a stored Context.
4988 ///
4989 /// # Long running operations
4990 ///
4991 /// This method is used to start, and/or poll a [long-running Operation].
4992 /// The [Working with long-running operations] chapter in the [user guide]
4993 /// covers these operations in detail.
4994 ///
4995 /// [long-running operation]: https://google.aip.dev/151
4996 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4997 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4998 pub fn delete_context(&self) -> super::builder::metadata_service::DeleteContext {
4999 super::builder::metadata_service::DeleteContext::new(self.inner.clone())
5000 }
5001
5002 /// Purges Contexts.
5003 ///
5004 /// # Long running operations
5005 ///
5006 /// This method is used to start, and/or poll a [long-running Operation].
5007 /// The [Working with long-running operations] chapter in the [user guide]
5008 /// covers these operations in detail.
5009 ///
5010 /// [long-running operation]: https://google.aip.dev/151
5011 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5012 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5013 pub fn purge_contexts(&self) -> super::builder::metadata_service::PurgeContexts {
5014 super::builder::metadata_service::PurgeContexts::new(self.inner.clone())
5015 }
5016
5017 /// Adds a set of Artifacts and Executions to a Context. If any of the
5018 /// Artifacts or Executions have already been added to a Context, they are
5019 /// simply skipped.
5020 pub fn add_context_artifacts_and_executions(
5021 &self,
5022 ) -> super::builder::metadata_service::AddContextArtifactsAndExecutions {
5023 super::builder::metadata_service::AddContextArtifactsAndExecutions::new(self.inner.clone())
5024 }
5025
5026 /// Adds a set of Contexts as children to a parent Context. If any of the
5027 /// child Contexts have already been added to the parent Context, they are
5028 /// simply skipped. If this call would create a cycle or cause any Context to
5029 /// have more than 10 parents, the request will fail with an INVALID_ARGUMENT
5030 /// error.
5031 pub fn add_context_children(&self) -> super::builder::metadata_service::AddContextChildren {
5032 super::builder::metadata_service::AddContextChildren::new(self.inner.clone())
5033 }
5034
5035 /// Remove a set of children contexts from a parent Context. If any of the
5036 /// child Contexts were NOT added to the parent Context, they are
5037 /// simply skipped.
5038 pub fn remove_context_children(
5039 &self,
5040 ) -> super::builder::metadata_service::RemoveContextChildren {
5041 super::builder::metadata_service::RemoveContextChildren::new(self.inner.clone())
5042 }
5043
5044 /// Retrieves Artifacts and Executions within the specified Context, connected
5045 /// by Event edges and returned as a LineageSubgraph.
5046 pub fn query_context_lineage_subgraph(
5047 &self,
5048 ) -> super::builder::metadata_service::QueryContextLineageSubgraph {
5049 super::builder::metadata_service::QueryContextLineageSubgraph::new(self.inner.clone())
5050 }
5051
5052 /// Creates an Execution associated with a MetadataStore.
5053 pub fn create_execution(&self) -> super::builder::metadata_service::CreateExecution {
5054 super::builder::metadata_service::CreateExecution::new(self.inner.clone())
5055 }
5056
5057 /// Retrieves a specific Execution.
5058 pub fn get_execution(&self) -> super::builder::metadata_service::GetExecution {
5059 super::builder::metadata_service::GetExecution::new(self.inner.clone())
5060 }
5061
5062 /// Lists Executions in the MetadataStore.
5063 pub fn list_executions(&self) -> super::builder::metadata_service::ListExecutions {
5064 super::builder::metadata_service::ListExecutions::new(self.inner.clone())
5065 }
5066
5067 /// Updates a stored Execution.
5068 pub fn update_execution(&self) -> super::builder::metadata_service::UpdateExecution {
5069 super::builder::metadata_service::UpdateExecution::new(self.inner.clone())
5070 }
5071
5072 /// Deletes an Execution.
5073 ///
5074 /// # Long running operations
5075 ///
5076 /// This method is used to start, and/or poll a [long-running Operation].
5077 /// The [Working with long-running operations] chapter in the [user guide]
5078 /// covers these operations in detail.
5079 ///
5080 /// [long-running operation]: https://google.aip.dev/151
5081 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5082 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5083 pub fn delete_execution(&self) -> super::builder::metadata_service::DeleteExecution {
5084 super::builder::metadata_service::DeleteExecution::new(self.inner.clone())
5085 }
5086
5087 /// Purges Executions.
5088 ///
5089 /// # Long running operations
5090 ///
5091 /// This method is used to start, and/or poll a [long-running Operation].
5092 /// The [Working with long-running operations] chapter in the [user guide]
5093 /// covers these operations in detail.
5094 ///
5095 /// [long-running operation]: https://google.aip.dev/151
5096 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5097 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5098 pub fn purge_executions(&self) -> super::builder::metadata_service::PurgeExecutions {
5099 super::builder::metadata_service::PurgeExecutions::new(self.inner.clone())
5100 }
5101
5102 /// Adds Events to the specified Execution. An Event indicates whether an
5103 /// Artifact was used as an input or output for an Execution. If an Event
5104 /// already exists between the Execution and the Artifact, the Event is
5105 /// skipped.
5106 pub fn add_execution_events(&self) -> super::builder::metadata_service::AddExecutionEvents {
5107 super::builder::metadata_service::AddExecutionEvents::new(self.inner.clone())
5108 }
5109
5110 /// Obtains the set of input and output Artifacts for this Execution, in the
5111 /// form of LineageSubgraph that also contains the Execution and connecting
5112 /// Events.
5113 pub fn query_execution_inputs_and_outputs(
5114 &self,
5115 ) -> super::builder::metadata_service::QueryExecutionInputsAndOutputs {
5116 super::builder::metadata_service::QueryExecutionInputsAndOutputs::new(self.inner.clone())
5117 }
5118
5119 /// Creates a MetadataSchema.
5120 pub fn create_metadata_schema(&self) -> super::builder::metadata_service::CreateMetadataSchema {
5121 super::builder::metadata_service::CreateMetadataSchema::new(self.inner.clone())
5122 }
5123
5124 /// Retrieves a specific MetadataSchema.
5125 pub fn get_metadata_schema(&self) -> super::builder::metadata_service::GetMetadataSchema {
5126 super::builder::metadata_service::GetMetadataSchema::new(self.inner.clone())
5127 }
5128
5129 /// Lists MetadataSchemas.
5130 pub fn list_metadata_schemas(&self) -> super::builder::metadata_service::ListMetadataSchemas {
5131 super::builder::metadata_service::ListMetadataSchemas::new(self.inner.clone())
5132 }
5133
5134 /// Retrieves lineage of an Artifact represented through Artifacts and
5135 /// Executions connected by Event edges and returned as a LineageSubgraph.
5136 pub fn query_artifact_lineage_subgraph(
5137 &self,
5138 ) -> super::builder::metadata_service::QueryArtifactLineageSubgraph {
5139 super::builder::metadata_service::QueryArtifactLineageSubgraph::new(self.inner.clone())
5140 }
5141
5142 /// Lists information about the supported locations for this service.
5143 pub fn list_locations(&self) -> super::builder::metadata_service::ListLocations {
5144 super::builder::metadata_service::ListLocations::new(self.inner.clone())
5145 }
5146
5147 /// Gets information about a location.
5148 pub fn get_location(&self) -> super::builder::metadata_service::GetLocation {
5149 super::builder::metadata_service::GetLocation::new(self.inner.clone())
5150 }
5151
5152 /// Sets the access control policy on the specified resource. Replaces
5153 /// any existing policy.
5154 ///
5155 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
5156 /// errors.
5157 pub fn set_iam_policy(&self) -> super::builder::metadata_service::SetIamPolicy {
5158 super::builder::metadata_service::SetIamPolicy::new(self.inner.clone())
5159 }
5160
5161 /// Gets the access control policy for a resource. Returns an empty policy
5162 /// if the resource exists and does not have a policy set.
5163 pub fn get_iam_policy(&self) -> super::builder::metadata_service::GetIamPolicy {
5164 super::builder::metadata_service::GetIamPolicy::new(self.inner.clone())
5165 }
5166
5167 /// Returns permissions that a caller has on the specified resource. If the
5168 /// resource does not exist, this will return an empty set of
5169 /// permissions, not a `NOT_FOUND` error.
5170 ///
5171 /// Note: This operation is designed to be used for building
5172 /// permission-aware UIs and command-line tools, not for authorization
5173 /// checking. This operation may "fail open" without warning.
5174 pub fn test_iam_permissions(&self) -> super::builder::metadata_service::TestIamPermissions {
5175 super::builder::metadata_service::TestIamPermissions::new(self.inner.clone())
5176 }
5177
5178 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5179 ///
5180 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5181 pub fn list_operations(&self) -> super::builder::metadata_service::ListOperations {
5182 super::builder::metadata_service::ListOperations::new(self.inner.clone())
5183 }
5184
5185 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5186 ///
5187 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5188 pub fn get_operation(&self) -> super::builder::metadata_service::GetOperation {
5189 super::builder::metadata_service::GetOperation::new(self.inner.clone())
5190 }
5191
5192 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5193 ///
5194 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5195 pub fn delete_operation(&self) -> super::builder::metadata_service::DeleteOperation {
5196 super::builder::metadata_service::DeleteOperation::new(self.inner.clone())
5197 }
5198
5199 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5200 ///
5201 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5202 pub fn cancel_operation(&self) -> super::builder::metadata_service::CancelOperation {
5203 super::builder::metadata_service::CancelOperation::new(self.inner.clone())
5204 }
5205
5206 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5207 ///
5208 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5209 pub fn wait_operation(&self) -> super::builder::metadata_service::WaitOperation {
5210 super::builder::metadata_service::WaitOperation::new(self.inner.clone())
5211 }
5212}
5213
5214/// Implements a client for the Vertex AI API.
5215///
5216/// # Example
5217/// ```
5218/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5219/// # use google_cloud_aiplatform_v1::client::MigrationService;
5220/// let client = MigrationService::builder().build().await?;
5221/// // use `client` to make requests to the Vertex AI API.
5222/// # Ok(()) }
5223/// ```
5224///
5225/// # Service Description
5226///
5227/// A service that migrates resources from automl.googleapis.com,
5228/// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI.
5229///
5230/// # Configuration
5231///
5232/// To configure `MigrationService` use the `with_*` methods in the type returned
5233/// by [builder()][MigrationService::builder]. The default configuration should
5234/// work for most applications. Common configuration changes include
5235///
5236/// * [with_endpoint()]: by default this client uses the global default endpoint
5237/// (`https://aiplatform.googleapis.com`). Applications using regional
5238/// endpoints or running in restricted networks (e.g. a network configured
5239// with [Private Google Access with VPC Service Controls]) may want to
5240/// override this default.
5241/// * [with_credentials()]: by default this client uses
5242/// [Application Default Credentials]. Applications using custom
5243/// authentication may need to override this default.
5244///
5245/// [with_endpoint()]: super::builder::migration_service::ClientBuilder::with_endpoint
5246/// [with_credentials()]: super::builder::migration_service::ClientBuilder::credentials
5247/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5248/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5249///
5250/// # Pooling and Cloning
5251///
5252/// `MigrationService` holds a connection pool internally, it is advised to
5253/// create one and the reuse it. You do not need to wrap `MigrationService` in
5254/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5255/// already uses an `Arc` internally.
5256#[cfg(feature = "migration-service")]
5257#[cfg_attr(docsrs, doc(cfg(feature = "migration-service")))]
5258#[derive(Clone, Debug)]
5259pub struct MigrationService {
5260 inner: std::sync::Arc<dyn super::stub::dynamic::MigrationService>,
5261}
5262
5263#[cfg(feature = "migration-service")]
5264impl MigrationService {
5265 /// Returns a builder for [MigrationService].
5266 ///
5267 /// ```
5268 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5269 /// # use google_cloud_aiplatform_v1::client::MigrationService;
5270 /// let client = MigrationService::builder().build().await?;
5271 /// # Ok(()) }
5272 /// ```
5273 pub fn builder() -> super::builder::migration_service::ClientBuilder {
5274 crate::new_client_builder(super::builder::migration_service::client::Factory)
5275 }
5276
5277 /// Creates a new client from the provided stub.
5278 ///
5279 /// The most common case for calling this function is in tests mocking the
5280 /// client's behavior.
5281 pub fn from_stub<T>(stub: T) -> Self
5282 where
5283 T: super::stub::MigrationService + 'static,
5284 {
5285 Self {
5286 inner: std::sync::Arc::new(stub),
5287 }
5288 }
5289
5290 pub(crate) async fn new(
5291 config: gaxi::options::ClientConfig,
5292 ) -> crate::ClientBuilderResult<Self> {
5293 let inner = Self::build_inner(config).await?;
5294 Ok(Self { inner })
5295 }
5296
5297 async fn build_inner(
5298 conf: gaxi::options::ClientConfig,
5299 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MigrationService>>
5300 {
5301 if gaxi::options::tracing_enabled(&conf) {
5302 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5303 }
5304 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5305 }
5306
5307 async fn build_transport(
5308 conf: gaxi::options::ClientConfig,
5309 ) -> crate::ClientBuilderResult<impl super::stub::MigrationService> {
5310 super::transport::MigrationService::new(conf).await
5311 }
5312
5313 async fn build_with_tracing(
5314 conf: gaxi::options::ClientConfig,
5315 ) -> crate::ClientBuilderResult<impl super::stub::MigrationService> {
5316 Self::build_transport(conf)
5317 .await
5318 .map(super::tracing::MigrationService::new)
5319 }
5320
5321 /// Searches all of the resources in automl.googleapis.com,
5322 /// datalabeling.googleapis.com and ml.googleapis.com that can be migrated to
5323 /// Vertex AI's given location.
5324 pub fn search_migratable_resources(
5325 &self,
5326 ) -> super::builder::migration_service::SearchMigratableResources {
5327 super::builder::migration_service::SearchMigratableResources::new(self.inner.clone())
5328 }
5329
5330 /// Batch migrates resources from ml.googleapis.com, automl.googleapis.com,
5331 /// and datalabeling.googleapis.com to Vertex AI.
5332 ///
5333 /// # Long running operations
5334 ///
5335 /// This method is used to start, and/or poll a [long-running Operation].
5336 /// The [Working with long-running operations] chapter in the [user guide]
5337 /// covers these operations in detail.
5338 ///
5339 /// [long-running operation]: https://google.aip.dev/151
5340 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5341 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5342 pub fn batch_migrate_resources(
5343 &self,
5344 ) -> super::builder::migration_service::BatchMigrateResources {
5345 super::builder::migration_service::BatchMigrateResources::new(self.inner.clone())
5346 }
5347
5348 /// Lists information about the supported locations for this service.
5349 pub fn list_locations(&self) -> super::builder::migration_service::ListLocations {
5350 super::builder::migration_service::ListLocations::new(self.inner.clone())
5351 }
5352
5353 /// Gets information about a location.
5354 pub fn get_location(&self) -> super::builder::migration_service::GetLocation {
5355 super::builder::migration_service::GetLocation::new(self.inner.clone())
5356 }
5357
5358 /// Sets the access control policy on the specified resource. Replaces
5359 /// any existing policy.
5360 ///
5361 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
5362 /// errors.
5363 pub fn set_iam_policy(&self) -> super::builder::migration_service::SetIamPolicy {
5364 super::builder::migration_service::SetIamPolicy::new(self.inner.clone())
5365 }
5366
5367 /// Gets the access control policy for a resource. Returns an empty policy
5368 /// if the resource exists and does not have a policy set.
5369 pub fn get_iam_policy(&self) -> super::builder::migration_service::GetIamPolicy {
5370 super::builder::migration_service::GetIamPolicy::new(self.inner.clone())
5371 }
5372
5373 /// Returns permissions that a caller has on the specified resource. If the
5374 /// resource does not exist, this will return an empty set of
5375 /// permissions, not a `NOT_FOUND` error.
5376 ///
5377 /// Note: This operation is designed to be used for building
5378 /// permission-aware UIs and command-line tools, not for authorization
5379 /// checking. This operation may "fail open" without warning.
5380 pub fn test_iam_permissions(&self) -> super::builder::migration_service::TestIamPermissions {
5381 super::builder::migration_service::TestIamPermissions::new(self.inner.clone())
5382 }
5383
5384 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5385 ///
5386 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5387 pub fn list_operations(&self) -> super::builder::migration_service::ListOperations {
5388 super::builder::migration_service::ListOperations::new(self.inner.clone())
5389 }
5390
5391 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5392 ///
5393 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5394 pub fn get_operation(&self) -> super::builder::migration_service::GetOperation {
5395 super::builder::migration_service::GetOperation::new(self.inner.clone())
5396 }
5397
5398 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5399 ///
5400 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5401 pub fn delete_operation(&self) -> super::builder::migration_service::DeleteOperation {
5402 super::builder::migration_service::DeleteOperation::new(self.inner.clone())
5403 }
5404
5405 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5406 ///
5407 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5408 pub fn cancel_operation(&self) -> super::builder::migration_service::CancelOperation {
5409 super::builder::migration_service::CancelOperation::new(self.inner.clone())
5410 }
5411
5412 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5413 ///
5414 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5415 pub fn wait_operation(&self) -> super::builder::migration_service::WaitOperation {
5416 super::builder::migration_service::WaitOperation::new(self.inner.clone())
5417 }
5418}
5419
5420/// Implements a client for the Vertex AI API.
5421///
5422/// # Example
5423/// ```
5424/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5425/// # use google_cloud_aiplatform_v1::client::ModelGardenService;
5426/// let client = ModelGardenService::builder().build().await?;
5427/// // use `client` to make requests to the Vertex AI API.
5428/// # Ok(()) }
5429/// ```
5430///
5431/// # Service Description
5432///
5433/// The interface of Model Garden Service.
5434///
5435/// # Configuration
5436///
5437/// To configure `ModelGardenService` use the `with_*` methods in the type returned
5438/// by [builder()][ModelGardenService::builder]. The default configuration should
5439/// work for most applications. Common configuration changes include
5440///
5441/// * [with_endpoint()]: by default this client uses the global default endpoint
5442/// (`https://aiplatform.googleapis.com`). Applications using regional
5443/// endpoints or running in restricted networks (e.g. a network configured
5444// with [Private Google Access with VPC Service Controls]) may want to
5445/// override this default.
5446/// * [with_credentials()]: by default this client uses
5447/// [Application Default Credentials]. Applications using custom
5448/// authentication may need to override this default.
5449///
5450/// [with_endpoint()]: super::builder::model_garden_service::ClientBuilder::with_endpoint
5451/// [with_credentials()]: super::builder::model_garden_service::ClientBuilder::credentials
5452/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5453/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5454///
5455/// # Pooling and Cloning
5456///
5457/// `ModelGardenService` holds a connection pool internally, it is advised to
5458/// create one and the reuse it. You do not need to wrap `ModelGardenService` in
5459/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5460/// already uses an `Arc` internally.
5461#[cfg(feature = "model-garden-service")]
5462#[cfg_attr(docsrs, doc(cfg(feature = "model-garden-service")))]
5463#[derive(Clone, Debug)]
5464pub struct ModelGardenService {
5465 inner: std::sync::Arc<dyn super::stub::dynamic::ModelGardenService>,
5466}
5467
5468#[cfg(feature = "model-garden-service")]
5469impl ModelGardenService {
5470 /// Returns a builder for [ModelGardenService].
5471 ///
5472 /// ```
5473 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5474 /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
5475 /// let client = ModelGardenService::builder().build().await?;
5476 /// # Ok(()) }
5477 /// ```
5478 pub fn builder() -> super::builder::model_garden_service::ClientBuilder {
5479 crate::new_client_builder(super::builder::model_garden_service::client::Factory)
5480 }
5481
5482 /// Creates a new client from the provided stub.
5483 ///
5484 /// The most common case for calling this function is in tests mocking the
5485 /// client's behavior.
5486 pub fn from_stub<T>(stub: T) -> Self
5487 where
5488 T: super::stub::ModelGardenService + 'static,
5489 {
5490 Self {
5491 inner: std::sync::Arc::new(stub),
5492 }
5493 }
5494
5495 pub(crate) async fn new(
5496 config: gaxi::options::ClientConfig,
5497 ) -> crate::ClientBuilderResult<Self> {
5498 let inner = Self::build_inner(config).await?;
5499 Ok(Self { inner })
5500 }
5501
5502 async fn build_inner(
5503 conf: gaxi::options::ClientConfig,
5504 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ModelGardenService>>
5505 {
5506 if gaxi::options::tracing_enabled(&conf) {
5507 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5508 }
5509 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5510 }
5511
5512 async fn build_transport(
5513 conf: gaxi::options::ClientConfig,
5514 ) -> crate::ClientBuilderResult<impl super::stub::ModelGardenService> {
5515 super::transport::ModelGardenService::new(conf).await
5516 }
5517
5518 async fn build_with_tracing(
5519 conf: gaxi::options::ClientConfig,
5520 ) -> crate::ClientBuilderResult<impl super::stub::ModelGardenService> {
5521 Self::build_transport(conf)
5522 .await
5523 .map(super::tracing::ModelGardenService::new)
5524 }
5525
5526 /// Gets a Model Garden publisher model.
5527 pub fn get_publisher_model(&self) -> super::builder::model_garden_service::GetPublisherModel {
5528 super::builder::model_garden_service::GetPublisherModel::new(self.inner.clone())
5529 }
5530
5531 /// Deploys a model to a new endpoint.
5532 ///
5533 /// # Long running operations
5534 ///
5535 /// This method is used to start, and/or poll a [long-running Operation].
5536 /// The [Working with long-running operations] chapter in the [user guide]
5537 /// covers these operations in detail.
5538 ///
5539 /// [long-running operation]: https://google.aip.dev/151
5540 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5541 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5542 pub fn deploy(&self) -> super::builder::model_garden_service::Deploy {
5543 super::builder::model_garden_service::Deploy::new(self.inner.clone())
5544 }
5545
5546 /// Lists information about the supported locations for this service.
5547 pub fn list_locations(&self) -> super::builder::model_garden_service::ListLocations {
5548 super::builder::model_garden_service::ListLocations::new(self.inner.clone())
5549 }
5550
5551 /// Gets information about a location.
5552 pub fn get_location(&self) -> super::builder::model_garden_service::GetLocation {
5553 super::builder::model_garden_service::GetLocation::new(self.inner.clone())
5554 }
5555
5556 /// Sets the access control policy on the specified resource. Replaces
5557 /// any existing policy.
5558 ///
5559 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
5560 /// errors.
5561 pub fn set_iam_policy(&self) -> super::builder::model_garden_service::SetIamPolicy {
5562 super::builder::model_garden_service::SetIamPolicy::new(self.inner.clone())
5563 }
5564
5565 /// Gets the access control policy for a resource. Returns an empty policy
5566 /// if the resource exists and does not have a policy set.
5567 pub fn get_iam_policy(&self) -> super::builder::model_garden_service::GetIamPolicy {
5568 super::builder::model_garden_service::GetIamPolicy::new(self.inner.clone())
5569 }
5570
5571 /// Returns permissions that a caller has on the specified resource. If the
5572 /// resource does not exist, this will return an empty set of
5573 /// permissions, not a `NOT_FOUND` error.
5574 ///
5575 /// Note: This operation is designed to be used for building
5576 /// permission-aware UIs and command-line tools, not for authorization
5577 /// checking. This operation may "fail open" without warning.
5578 pub fn test_iam_permissions(&self) -> super::builder::model_garden_service::TestIamPermissions {
5579 super::builder::model_garden_service::TestIamPermissions::new(self.inner.clone())
5580 }
5581
5582 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5583 ///
5584 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5585 pub fn list_operations(&self) -> super::builder::model_garden_service::ListOperations {
5586 super::builder::model_garden_service::ListOperations::new(self.inner.clone())
5587 }
5588
5589 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5590 ///
5591 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5592 pub fn get_operation(&self) -> super::builder::model_garden_service::GetOperation {
5593 super::builder::model_garden_service::GetOperation::new(self.inner.clone())
5594 }
5595
5596 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5597 ///
5598 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5599 pub fn delete_operation(&self) -> super::builder::model_garden_service::DeleteOperation {
5600 super::builder::model_garden_service::DeleteOperation::new(self.inner.clone())
5601 }
5602
5603 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5604 ///
5605 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5606 pub fn cancel_operation(&self) -> super::builder::model_garden_service::CancelOperation {
5607 super::builder::model_garden_service::CancelOperation::new(self.inner.clone())
5608 }
5609
5610 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5611 ///
5612 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5613 pub fn wait_operation(&self) -> super::builder::model_garden_service::WaitOperation {
5614 super::builder::model_garden_service::WaitOperation::new(self.inner.clone())
5615 }
5616}
5617
5618/// Implements a client for the Vertex AI API.
5619///
5620/// # Example
5621/// ```
5622/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5623/// # use google_cloud_aiplatform_v1::client::ModelService;
5624/// let client = ModelService::builder().build().await?;
5625/// // use `client` to make requests to the Vertex AI API.
5626/// # Ok(()) }
5627/// ```
5628///
5629/// # Service Description
5630///
5631/// A service for managing Vertex AI's machine learning Models.
5632///
5633/// # Configuration
5634///
5635/// To configure `ModelService` use the `with_*` methods in the type returned
5636/// by [builder()][ModelService::builder]. The default configuration should
5637/// work for most applications. Common configuration changes include
5638///
5639/// * [with_endpoint()]: by default this client uses the global default endpoint
5640/// (`https://aiplatform.googleapis.com`). Applications using regional
5641/// endpoints or running in restricted networks (e.g. a network configured
5642// with [Private Google Access with VPC Service Controls]) may want to
5643/// override this default.
5644/// * [with_credentials()]: by default this client uses
5645/// [Application Default Credentials]. Applications using custom
5646/// authentication may need to override this default.
5647///
5648/// [with_endpoint()]: super::builder::model_service::ClientBuilder::with_endpoint
5649/// [with_credentials()]: super::builder::model_service::ClientBuilder::credentials
5650/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5651/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5652///
5653/// # Pooling and Cloning
5654///
5655/// `ModelService` holds a connection pool internally, it is advised to
5656/// create one and the reuse it. You do not need to wrap `ModelService` in
5657/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5658/// already uses an `Arc` internally.
5659#[cfg(feature = "model-service")]
5660#[cfg_attr(docsrs, doc(cfg(feature = "model-service")))]
5661#[derive(Clone, Debug)]
5662pub struct ModelService {
5663 inner: std::sync::Arc<dyn super::stub::dynamic::ModelService>,
5664}
5665
5666#[cfg(feature = "model-service")]
5667impl ModelService {
5668 /// Returns a builder for [ModelService].
5669 ///
5670 /// ```
5671 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5672 /// # use google_cloud_aiplatform_v1::client::ModelService;
5673 /// let client = ModelService::builder().build().await?;
5674 /// # Ok(()) }
5675 /// ```
5676 pub fn builder() -> super::builder::model_service::ClientBuilder {
5677 crate::new_client_builder(super::builder::model_service::client::Factory)
5678 }
5679
5680 /// Creates a new client from the provided stub.
5681 ///
5682 /// The most common case for calling this function is in tests mocking the
5683 /// client's behavior.
5684 pub fn from_stub<T>(stub: T) -> Self
5685 where
5686 T: super::stub::ModelService + 'static,
5687 {
5688 Self {
5689 inner: std::sync::Arc::new(stub),
5690 }
5691 }
5692
5693 pub(crate) async fn new(
5694 config: gaxi::options::ClientConfig,
5695 ) -> crate::ClientBuilderResult<Self> {
5696 let inner = Self::build_inner(config).await?;
5697 Ok(Self { inner })
5698 }
5699
5700 async fn build_inner(
5701 conf: gaxi::options::ClientConfig,
5702 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ModelService>> {
5703 if gaxi::options::tracing_enabled(&conf) {
5704 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5705 }
5706 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5707 }
5708
5709 async fn build_transport(
5710 conf: gaxi::options::ClientConfig,
5711 ) -> crate::ClientBuilderResult<impl super::stub::ModelService> {
5712 super::transport::ModelService::new(conf).await
5713 }
5714
5715 async fn build_with_tracing(
5716 conf: gaxi::options::ClientConfig,
5717 ) -> crate::ClientBuilderResult<impl super::stub::ModelService> {
5718 Self::build_transport(conf)
5719 .await
5720 .map(super::tracing::ModelService::new)
5721 }
5722
5723 /// Uploads a Model artifact into Vertex AI.
5724 ///
5725 /// # Long running operations
5726 ///
5727 /// This method is used to start, and/or poll a [long-running Operation].
5728 /// The [Working with long-running operations] chapter in the [user guide]
5729 /// covers these operations in detail.
5730 ///
5731 /// [long-running operation]: https://google.aip.dev/151
5732 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5733 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5734 pub fn upload_model(&self) -> super::builder::model_service::UploadModel {
5735 super::builder::model_service::UploadModel::new(self.inner.clone())
5736 }
5737
5738 /// Gets a Model.
5739 pub fn get_model(&self) -> super::builder::model_service::GetModel {
5740 super::builder::model_service::GetModel::new(self.inner.clone())
5741 }
5742
5743 /// Lists Models in a Location.
5744 pub fn list_models(&self) -> super::builder::model_service::ListModels {
5745 super::builder::model_service::ListModels::new(self.inner.clone())
5746 }
5747
5748 /// Lists versions of the specified model.
5749 pub fn list_model_versions(&self) -> super::builder::model_service::ListModelVersions {
5750 super::builder::model_service::ListModelVersions::new(self.inner.clone())
5751 }
5752
5753 /// Lists checkpoints of the specified model version.
5754 pub fn list_model_version_checkpoints(
5755 &self,
5756 ) -> super::builder::model_service::ListModelVersionCheckpoints {
5757 super::builder::model_service::ListModelVersionCheckpoints::new(self.inner.clone())
5758 }
5759
5760 /// Updates a Model.
5761 pub fn update_model(&self) -> super::builder::model_service::UpdateModel {
5762 super::builder::model_service::UpdateModel::new(self.inner.clone())
5763 }
5764
5765 /// Incrementally update the dataset used for an examples model.
5766 ///
5767 /// # Long running operations
5768 ///
5769 /// This method is used to start, and/or poll a [long-running Operation].
5770 /// The [Working with long-running operations] chapter in the [user guide]
5771 /// covers these operations in detail.
5772 ///
5773 /// [long-running operation]: https://google.aip.dev/151
5774 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5775 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5776 pub fn update_explanation_dataset(
5777 &self,
5778 ) -> super::builder::model_service::UpdateExplanationDataset {
5779 super::builder::model_service::UpdateExplanationDataset::new(self.inner.clone())
5780 }
5781
5782 /// Deletes a Model.
5783 ///
5784 /// A model cannot be deleted if any
5785 /// [Endpoint][google.cloud.aiplatform.v1.Endpoint] resource has a
5786 /// [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] based on the
5787 /// model in its
5788 /// [deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models]
5789 /// field.
5790 ///
5791 /// [google.cloud.aiplatform.v1.DeployedModel]: crate::model::DeployedModel
5792 /// [google.cloud.aiplatform.v1.Endpoint]: crate::model::Endpoint
5793 /// [google.cloud.aiplatform.v1.Endpoint.deployed_models]: crate::model::Endpoint::deployed_models
5794 ///
5795 /// # Long running operations
5796 ///
5797 /// This method is used to start, and/or poll a [long-running Operation].
5798 /// The [Working with long-running operations] chapter in the [user guide]
5799 /// covers these operations in detail.
5800 ///
5801 /// [long-running operation]: https://google.aip.dev/151
5802 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5803 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5804 pub fn delete_model(&self) -> super::builder::model_service::DeleteModel {
5805 super::builder::model_service::DeleteModel::new(self.inner.clone())
5806 }
5807
5808 /// Deletes a Model version.
5809 ///
5810 /// Model version can only be deleted if there are no
5811 /// [DeployedModels][google.cloud.aiplatform.v1.DeployedModel] created from it.
5812 /// Deleting the only version in the Model is not allowed. Use
5813 /// [DeleteModel][google.cloud.aiplatform.v1.ModelService.DeleteModel] for
5814 /// deleting the Model instead.
5815 ///
5816 /// [google.cloud.aiplatform.v1.DeployedModel]: crate::model::DeployedModel
5817 /// [google.cloud.aiplatform.v1.ModelService.DeleteModel]: crate::client::ModelService::delete_model
5818 ///
5819 /// # Long running operations
5820 ///
5821 /// This method is used to start, and/or poll a [long-running Operation].
5822 /// The [Working with long-running operations] chapter in the [user guide]
5823 /// covers these operations in detail.
5824 ///
5825 /// [long-running operation]: https://google.aip.dev/151
5826 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5827 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5828 pub fn delete_model_version(&self) -> super::builder::model_service::DeleteModelVersion {
5829 super::builder::model_service::DeleteModelVersion::new(self.inner.clone())
5830 }
5831
5832 /// Merges a set of aliases for a Model version.
5833 pub fn merge_version_aliases(&self) -> super::builder::model_service::MergeVersionAliases {
5834 super::builder::model_service::MergeVersionAliases::new(self.inner.clone())
5835 }
5836
5837 /// Exports a trained, exportable Model to a location specified by the
5838 /// user. A Model is considered to be exportable if it has at least one
5839 /// [supported export
5840 /// format][google.cloud.aiplatform.v1.Model.supported_export_formats].
5841 ///
5842 /// [google.cloud.aiplatform.v1.Model.supported_export_formats]: crate::model::Model::supported_export_formats
5843 ///
5844 /// # Long running operations
5845 ///
5846 /// This method is used to start, and/or poll a [long-running Operation].
5847 /// The [Working with long-running operations] chapter in the [user guide]
5848 /// covers these operations in detail.
5849 ///
5850 /// [long-running operation]: https://google.aip.dev/151
5851 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5852 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5853 pub fn export_model(&self) -> super::builder::model_service::ExportModel {
5854 super::builder::model_service::ExportModel::new(self.inner.clone())
5855 }
5856
5857 /// Copies an already existing Vertex AI Model into the specified Location.
5858 /// The source Model must exist in the same Project.
5859 /// When copying custom Models, the users themselves are responsible for
5860 /// [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be
5861 /// region-agnostic, as well as making sure that any resources (e.g. files) it
5862 /// depends on remain accessible.
5863 ///
5864 /// [google.cloud.aiplatform.v1.Model.metadata]: crate::model::Model::metadata
5865 ///
5866 /// # Long running operations
5867 ///
5868 /// This method is used to start, and/or poll a [long-running Operation].
5869 /// The [Working with long-running operations] chapter in the [user guide]
5870 /// covers these operations in detail.
5871 ///
5872 /// [long-running operation]: https://google.aip.dev/151
5873 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5874 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5875 pub fn copy_model(&self) -> super::builder::model_service::CopyModel {
5876 super::builder::model_service::CopyModel::new(self.inner.clone())
5877 }
5878
5879 /// Imports an externally generated ModelEvaluation.
5880 pub fn import_model_evaluation(&self) -> super::builder::model_service::ImportModelEvaluation {
5881 super::builder::model_service::ImportModelEvaluation::new(self.inner.clone())
5882 }
5883
5884 /// Imports a list of externally generated ModelEvaluationSlice.
5885 pub fn batch_import_model_evaluation_slices(
5886 &self,
5887 ) -> super::builder::model_service::BatchImportModelEvaluationSlices {
5888 super::builder::model_service::BatchImportModelEvaluationSlices::new(self.inner.clone())
5889 }
5890
5891 /// Imports a list of externally generated EvaluatedAnnotations.
5892 pub fn batch_import_evaluated_annotations(
5893 &self,
5894 ) -> super::builder::model_service::BatchImportEvaluatedAnnotations {
5895 super::builder::model_service::BatchImportEvaluatedAnnotations::new(self.inner.clone())
5896 }
5897
5898 /// Gets a ModelEvaluation.
5899 pub fn get_model_evaluation(&self) -> super::builder::model_service::GetModelEvaluation {
5900 super::builder::model_service::GetModelEvaluation::new(self.inner.clone())
5901 }
5902
5903 /// Lists ModelEvaluations in a Model.
5904 pub fn list_model_evaluations(&self) -> super::builder::model_service::ListModelEvaluations {
5905 super::builder::model_service::ListModelEvaluations::new(self.inner.clone())
5906 }
5907
5908 /// Gets a ModelEvaluationSlice.
5909 pub fn get_model_evaluation_slice(
5910 &self,
5911 ) -> super::builder::model_service::GetModelEvaluationSlice {
5912 super::builder::model_service::GetModelEvaluationSlice::new(self.inner.clone())
5913 }
5914
5915 /// Lists ModelEvaluationSlices in a ModelEvaluation.
5916 pub fn list_model_evaluation_slices(
5917 &self,
5918 ) -> super::builder::model_service::ListModelEvaluationSlices {
5919 super::builder::model_service::ListModelEvaluationSlices::new(self.inner.clone())
5920 }
5921
5922 /// Lists information about the supported locations for this service.
5923 pub fn list_locations(&self) -> super::builder::model_service::ListLocations {
5924 super::builder::model_service::ListLocations::new(self.inner.clone())
5925 }
5926
5927 /// Gets information about a location.
5928 pub fn get_location(&self) -> super::builder::model_service::GetLocation {
5929 super::builder::model_service::GetLocation::new(self.inner.clone())
5930 }
5931
5932 /// Sets the access control policy on the specified resource. Replaces
5933 /// any existing policy.
5934 ///
5935 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
5936 /// errors.
5937 pub fn set_iam_policy(&self) -> super::builder::model_service::SetIamPolicy {
5938 super::builder::model_service::SetIamPolicy::new(self.inner.clone())
5939 }
5940
5941 /// Gets the access control policy for a resource. Returns an empty policy
5942 /// if the resource exists and does not have a policy set.
5943 pub fn get_iam_policy(&self) -> super::builder::model_service::GetIamPolicy {
5944 super::builder::model_service::GetIamPolicy::new(self.inner.clone())
5945 }
5946
5947 /// Returns permissions that a caller has on the specified resource. If the
5948 /// resource does not exist, this will return an empty set of
5949 /// permissions, not a `NOT_FOUND` error.
5950 ///
5951 /// Note: This operation is designed to be used for building
5952 /// permission-aware UIs and command-line tools, not for authorization
5953 /// checking. This operation may "fail open" without warning.
5954 pub fn test_iam_permissions(&self) -> super::builder::model_service::TestIamPermissions {
5955 super::builder::model_service::TestIamPermissions::new(self.inner.clone())
5956 }
5957
5958 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5959 ///
5960 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5961 pub fn list_operations(&self) -> super::builder::model_service::ListOperations {
5962 super::builder::model_service::ListOperations::new(self.inner.clone())
5963 }
5964
5965 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5966 ///
5967 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5968 pub fn get_operation(&self) -> super::builder::model_service::GetOperation {
5969 super::builder::model_service::GetOperation::new(self.inner.clone())
5970 }
5971
5972 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5973 ///
5974 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5975 pub fn delete_operation(&self) -> super::builder::model_service::DeleteOperation {
5976 super::builder::model_service::DeleteOperation::new(self.inner.clone())
5977 }
5978
5979 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5980 ///
5981 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5982 pub fn cancel_operation(&self) -> super::builder::model_service::CancelOperation {
5983 super::builder::model_service::CancelOperation::new(self.inner.clone())
5984 }
5985
5986 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5987 ///
5988 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5989 pub fn wait_operation(&self) -> super::builder::model_service::WaitOperation {
5990 super::builder::model_service::WaitOperation::new(self.inner.clone())
5991 }
5992}
5993
5994/// Implements a client for the Vertex AI API.
5995///
5996/// # Example
5997/// ```
5998/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5999/// # use google_cloud_aiplatform_v1::client::NotebookService;
6000/// let client = NotebookService::builder().build().await?;
6001/// // use `client` to make requests to the Vertex AI API.
6002/// # Ok(()) }
6003/// ```
6004///
6005/// # Service Description
6006///
6007/// The interface for Vertex Notebook service (a.k.a. Colab on Workbench).
6008///
6009/// # Configuration
6010///
6011/// To configure `NotebookService` use the `with_*` methods in the type returned
6012/// by [builder()][NotebookService::builder]. The default configuration should
6013/// work for most applications. Common configuration changes include
6014///
6015/// * [with_endpoint()]: by default this client uses the global default endpoint
6016/// (`https://aiplatform.googleapis.com`). Applications using regional
6017/// endpoints or running in restricted networks (e.g. a network configured
6018// with [Private Google Access with VPC Service Controls]) may want to
6019/// override this default.
6020/// * [with_credentials()]: by default this client uses
6021/// [Application Default Credentials]. Applications using custom
6022/// authentication may need to override this default.
6023///
6024/// [with_endpoint()]: super::builder::notebook_service::ClientBuilder::with_endpoint
6025/// [with_credentials()]: super::builder::notebook_service::ClientBuilder::credentials
6026/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6027/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6028///
6029/// # Pooling and Cloning
6030///
6031/// `NotebookService` holds a connection pool internally, it is advised to
6032/// create one and the reuse it. You do not need to wrap `NotebookService` in
6033/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6034/// already uses an `Arc` internally.
6035#[cfg(feature = "notebook-service")]
6036#[cfg_attr(docsrs, doc(cfg(feature = "notebook-service")))]
6037#[derive(Clone, Debug)]
6038pub struct NotebookService {
6039 inner: std::sync::Arc<dyn super::stub::dynamic::NotebookService>,
6040}
6041
6042#[cfg(feature = "notebook-service")]
6043impl NotebookService {
6044 /// Returns a builder for [NotebookService].
6045 ///
6046 /// ```
6047 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6048 /// # use google_cloud_aiplatform_v1::client::NotebookService;
6049 /// let client = NotebookService::builder().build().await?;
6050 /// # Ok(()) }
6051 /// ```
6052 pub fn builder() -> super::builder::notebook_service::ClientBuilder {
6053 crate::new_client_builder(super::builder::notebook_service::client::Factory)
6054 }
6055
6056 /// Creates a new client from the provided stub.
6057 ///
6058 /// The most common case for calling this function is in tests mocking the
6059 /// client's behavior.
6060 pub fn from_stub<T>(stub: T) -> Self
6061 where
6062 T: super::stub::NotebookService + 'static,
6063 {
6064 Self {
6065 inner: std::sync::Arc::new(stub),
6066 }
6067 }
6068
6069 pub(crate) async fn new(
6070 config: gaxi::options::ClientConfig,
6071 ) -> crate::ClientBuilderResult<Self> {
6072 let inner = Self::build_inner(config).await?;
6073 Ok(Self { inner })
6074 }
6075
6076 async fn build_inner(
6077 conf: gaxi::options::ClientConfig,
6078 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NotebookService>> {
6079 if gaxi::options::tracing_enabled(&conf) {
6080 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6081 }
6082 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6083 }
6084
6085 async fn build_transport(
6086 conf: gaxi::options::ClientConfig,
6087 ) -> crate::ClientBuilderResult<impl super::stub::NotebookService> {
6088 super::transport::NotebookService::new(conf).await
6089 }
6090
6091 async fn build_with_tracing(
6092 conf: gaxi::options::ClientConfig,
6093 ) -> crate::ClientBuilderResult<impl super::stub::NotebookService> {
6094 Self::build_transport(conf)
6095 .await
6096 .map(super::tracing::NotebookService::new)
6097 }
6098
6099 /// Creates a NotebookRuntimeTemplate.
6100 ///
6101 /// # Long running operations
6102 ///
6103 /// This method is used to start, and/or poll a [long-running Operation].
6104 /// The [Working with long-running operations] chapter in the [user guide]
6105 /// covers these operations in detail.
6106 ///
6107 /// [long-running operation]: https://google.aip.dev/151
6108 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6109 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6110 pub fn create_notebook_runtime_template(
6111 &self,
6112 ) -> super::builder::notebook_service::CreateNotebookRuntimeTemplate {
6113 super::builder::notebook_service::CreateNotebookRuntimeTemplate::new(self.inner.clone())
6114 }
6115
6116 /// Gets a NotebookRuntimeTemplate.
6117 pub fn get_notebook_runtime_template(
6118 &self,
6119 ) -> super::builder::notebook_service::GetNotebookRuntimeTemplate {
6120 super::builder::notebook_service::GetNotebookRuntimeTemplate::new(self.inner.clone())
6121 }
6122
6123 /// Lists NotebookRuntimeTemplates in a Location.
6124 pub fn list_notebook_runtime_templates(
6125 &self,
6126 ) -> super::builder::notebook_service::ListNotebookRuntimeTemplates {
6127 super::builder::notebook_service::ListNotebookRuntimeTemplates::new(self.inner.clone())
6128 }
6129
6130 /// Deletes a NotebookRuntimeTemplate.
6131 ///
6132 /// # Long running operations
6133 ///
6134 /// This method is used to start, and/or poll a [long-running Operation].
6135 /// The [Working with long-running operations] chapter in the [user guide]
6136 /// covers these operations in detail.
6137 ///
6138 /// [long-running operation]: https://google.aip.dev/151
6139 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6140 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6141 pub fn delete_notebook_runtime_template(
6142 &self,
6143 ) -> super::builder::notebook_service::DeleteNotebookRuntimeTemplate {
6144 super::builder::notebook_service::DeleteNotebookRuntimeTemplate::new(self.inner.clone())
6145 }
6146
6147 /// Updates a NotebookRuntimeTemplate.
6148 pub fn update_notebook_runtime_template(
6149 &self,
6150 ) -> super::builder::notebook_service::UpdateNotebookRuntimeTemplate {
6151 super::builder::notebook_service::UpdateNotebookRuntimeTemplate::new(self.inner.clone())
6152 }
6153
6154 /// Assigns a NotebookRuntime to a user for a particular Notebook file. This
6155 /// method will either returns an existing assignment or generates a new one.
6156 ///
6157 /// # Long running operations
6158 ///
6159 /// This method is used to start, and/or poll a [long-running Operation].
6160 /// The [Working with long-running operations] chapter in the [user guide]
6161 /// covers these operations in detail.
6162 ///
6163 /// [long-running operation]: https://google.aip.dev/151
6164 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6165 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6166 pub fn assign_notebook_runtime(
6167 &self,
6168 ) -> super::builder::notebook_service::AssignNotebookRuntime {
6169 super::builder::notebook_service::AssignNotebookRuntime::new(self.inner.clone())
6170 }
6171
6172 /// Gets a NotebookRuntime.
6173 pub fn get_notebook_runtime(&self) -> super::builder::notebook_service::GetNotebookRuntime {
6174 super::builder::notebook_service::GetNotebookRuntime::new(self.inner.clone())
6175 }
6176
6177 /// Lists NotebookRuntimes in a Location.
6178 pub fn list_notebook_runtimes(&self) -> super::builder::notebook_service::ListNotebookRuntimes {
6179 super::builder::notebook_service::ListNotebookRuntimes::new(self.inner.clone())
6180 }
6181
6182 /// Deletes a NotebookRuntime.
6183 ///
6184 /// # Long running operations
6185 ///
6186 /// This method is used to start, and/or poll a [long-running Operation].
6187 /// The [Working with long-running operations] chapter in the [user guide]
6188 /// covers these operations in detail.
6189 ///
6190 /// [long-running operation]: https://google.aip.dev/151
6191 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6192 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6193 pub fn delete_notebook_runtime(
6194 &self,
6195 ) -> super::builder::notebook_service::DeleteNotebookRuntime {
6196 super::builder::notebook_service::DeleteNotebookRuntime::new(self.inner.clone())
6197 }
6198
6199 /// Upgrades a NotebookRuntime.
6200 ///
6201 /// # Long running operations
6202 ///
6203 /// This method is used to start, and/or poll a [long-running Operation].
6204 /// The [Working with long-running operations] chapter in the [user guide]
6205 /// covers these operations in detail.
6206 ///
6207 /// [long-running operation]: https://google.aip.dev/151
6208 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6209 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6210 pub fn upgrade_notebook_runtime(
6211 &self,
6212 ) -> super::builder::notebook_service::UpgradeNotebookRuntime {
6213 super::builder::notebook_service::UpgradeNotebookRuntime::new(self.inner.clone())
6214 }
6215
6216 /// Starts a NotebookRuntime.
6217 ///
6218 /// # Long running operations
6219 ///
6220 /// This method is used to start, and/or poll a [long-running Operation].
6221 /// The [Working with long-running operations] chapter in the [user guide]
6222 /// covers these operations in detail.
6223 ///
6224 /// [long-running operation]: https://google.aip.dev/151
6225 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6226 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6227 pub fn start_notebook_runtime(&self) -> super::builder::notebook_service::StartNotebookRuntime {
6228 super::builder::notebook_service::StartNotebookRuntime::new(self.inner.clone())
6229 }
6230
6231 /// Stops a NotebookRuntime.
6232 ///
6233 /// # Long running operations
6234 ///
6235 /// This method is used to start, and/or poll a [long-running Operation].
6236 /// The [Working with long-running operations] chapter in the [user guide]
6237 /// covers these operations in detail.
6238 ///
6239 /// [long-running operation]: https://google.aip.dev/151
6240 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6241 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6242 pub fn stop_notebook_runtime(&self) -> super::builder::notebook_service::StopNotebookRuntime {
6243 super::builder::notebook_service::StopNotebookRuntime::new(self.inner.clone())
6244 }
6245
6246 /// Creates a NotebookExecutionJob.
6247 ///
6248 /// # Long running operations
6249 ///
6250 /// This method is used to start, and/or poll a [long-running Operation].
6251 /// The [Working with long-running operations] chapter in the [user guide]
6252 /// covers these operations in detail.
6253 ///
6254 /// [long-running operation]: https://google.aip.dev/151
6255 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6256 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6257 pub fn create_notebook_execution_job(
6258 &self,
6259 ) -> super::builder::notebook_service::CreateNotebookExecutionJob {
6260 super::builder::notebook_service::CreateNotebookExecutionJob::new(self.inner.clone())
6261 }
6262
6263 /// Gets a NotebookExecutionJob.
6264 pub fn get_notebook_execution_job(
6265 &self,
6266 ) -> super::builder::notebook_service::GetNotebookExecutionJob {
6267 super::builder::notebook_service::GetNotebookExecutionJob::new(self.inner.clone())
6268 }
6269
6270 /// Lists NotebookExecutionJobs in a Location.
6271 pub fn list_notebook_execution_jobs(
6272 &self,
6273 ) -> super::builder::notebook_service::ListNotebookExecutionJobs {
6274 super::builder::notebook_service::ListNotebookExecutionJobs::new(self.inner.clone())
6275 }
6276
6277 /// Deletes a NotebookExecutionJob.
6278 ///
6279 /// # Long running operations
6280 ///
6281 /// This method is used to start, and/or poll a [long-running Operation].
6282 /// The [Working with long-running operations] chapter in the [user guide]
6283 /// covers these operations in detail.
6284 ///
6285 /// [long-running operation]: https://google.aip.dev/151
6286 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6287 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6288 pub fn delete_notebook_execution_job(
6289 &self,
6290 ) -> super::builder::notebook_service::DeleteNotebookExecutionJob {
6291 super::builder::notebook_service::DeleteNotebookExecutionJob::new(self.inner.clone())
6292 }
6293
6294 /// Lists information about the supported locations for this service.
6295 pub fn list_locations(&self) -> super::builder::notebook_service::ListLocations {
6296 super::builder::notebook_service::ListLocations::new(self.inner.clone())
6297 }
6298
6299 /// Gets information about a location.
6300 pub fn get_location(&self) -> super::builder::notebook_service::GetLocation {
6301 super::builder::notebook_service::GetLocation::new(self.inner.clone())
6302 }
6303
6304 /// Sets the access control policy on the specified resource. Replaces
6305 /// any existing policy.
6306 ///
6307 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
6308 /// errors.
6309 pub fn set_iam_policy(&self) -> super::builder::notebook_service::SetIamPolicy {
6310 super::builder::notebook_service::SetIamPolicy::new(self.inner.clone())
6311 }
6312
6313 /// Gets the access control policy for a resource. Returns an empty policy
6314 /// if the resource exists and does not have a policy set.
6315 pub fn get_iam_policy(&self) -> super::builder::notebook_service::GetIamPolicy {
6316 super::builder::notebook_service::GetIamPolicy::new(self.inner.clone())
6317 }
6318
6319 /// Returns permissions that a caller has on the specified resource. If the
6320 /// resource does not exist, this will return an empty set of
6321 /// permissions, not a `NOT_FOUND` error.
6322 ///
6323 /// Note: This operation is designed to be used for building
6324 /// permission-aware UIs and command-line tools, not for authorization
6325 /// checking. This operation may "fail open" without warning.
6326 pub fn test_iam_permissions(&self) -> super::builder::notebook_service::TestIamPermissions {
6327 super::builder::notebook_service::TestIamPermissions::new(self.inner.clone())
6328 }
6329
6330 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6331 ///
6332 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6333 pub fn list_operations(&self) -> super::builder::notebook_service::ListOperations {
6334 super::builder::notebook_service::ListOperations::new(self.inner.clone())
6335 }
6336
6337 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6338 ///
6339 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6340 pub fn get_operation(&self) -> super::builder::notebook_service::GetOperation {
6341 super::builder::notebook_service::GetOperation::new(self.inner.clone())
6342 }
6343
6344 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6345 ///
6346 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6347 pub fn delete_operation(&self) -> super::builder::notebook_service::DeleteOperation {
6348 super::builder::notebook_service::DeleteOperation::new(self.inner.clone())
6349 }
6350
6351 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6352 ///
6353 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6354 pub fn cancel_operation(&self) -> super::builder::notebook_service::CancelOperation {
6355 super::builder::notebook_service::CancelOperation::new(self.inner.clone())
6356 }
6357
6358 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6359 ///
6360 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6361 pub fn wait_operation(&self) -> super::builder::notebook_service::WaitOperation {
6362 super::builder::notebook_service::WaitOperation::new(self.inner.clone())
6363 }
6364}
6365
6366/// Implements a client for the Vertex AI API.
6367///
6368/// # Example
6369/// ```
6370/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6371/// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
6372/// let client = PersistentResourceService::builder().build().await?;
6373/// // use `client` to make requests to the Vertex AI API.
6374/// # Ok(()) }
6375/// ```
6376///
6377/// # Service Description
6378///
6379/// A service for managing Vertex AI's machine learning PersistentResource.
6380///
6381/// # Configuration
6382///
6383/// To configure `PersistentResourceService` use the `with_*` methods in the type returned
6384/// by [builder()][PersistentResourceService::builder]. The default configuration should
6385/// work for most applications. Common configuration changes include
6386///
6387/// * [with_endpoint()]: by default this client uses the global default endpoint
6388/// (`https://aiplatform.googleapis.com`). Applications using regional
6389/// endpoints or running in restricted networks (e.g. a network configured
6390// with [Private Google Access with VPC Service Controls]) may want to
6391/// override this default.
6392/// * [with_credentials()]: by default this client uses
6393/// [Application Default Credentials]. Applications using custom
6394/// authentication may need to override this default.
6395///
6396/// [with_endpoint()]: super::builder::persistent_resource_service::ClientBuilder::with_endpoint
6397/// [with_credentials()]: super::builder::persistent_resource_service::ClientBuilder::credentials
6398/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6399/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6400///
6401/// # Pooling and Cloning
6402///
6403/// `PersistentResourceService` holds a connection pool internally, it is advised to
6404/// create one and the reuse it. You do not need to wrap `PersistentResourceService` in
6405/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6406/// already uses an `Arc` internally.
6407#[cfg(feature = "persistent-resource-service")]
6408#[cfg_attr(docsrs, doc(cfg(feature = "persistent-resource-service")))]
6409#[derive(Clone, Debug)]
6410pub struct PersistentResourceService {
6411 inner: std::sync::Arc<dyn super::stub::dynamic::PersistentResourceService>,
6412}
6413
6414#[cfg(feature = "persistent-resource-service")]
6415impl PersistentResourceService {
6416 /// Returns a builder for [PersistentResourceService].
6417 ///
6418 /// ```
6419 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6420 /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
6421 /// let client = PersistentResourceService::builder().build().await?;
6422 /// # Ok(()) }
6423 /// ```
6424 pub fn builder() -> super::builder::persistent_resource_service::ClientBuilder {
6425 crate::new_client_builder(super::builder::persistent_resource_service::client::Factory)
6426 }
6427
6428 /// Creates a new client from the provided stub.
6429 ///
6430 /// The most common case for calling this function is in tests mocking the
6431 /// client's behavior.
6432 pub fn from_stub<T>(stub: T) -> Self
6433 where
6434 T: super::stub::PersistentResourceService + 'static,
6435 {
6436 Self {
6437 inner: std::sync::Arc::new(stub),
6438 }
6439 }
6440
6441 pub(crate) async fn new(
6442 config: gaxi::options::ClientConfig,
6443 ) -> crate::ClientBuilderResult<Self> {
6444 let inner = Self::build_inner(config).await?;
6445 Ok(Self { inner })
6446 }
6447
6448 async fn build_inner(
6449 conf: gaxi::options::ClientConfig,
6450 ) -> crate::ClientBuilderResult<
6451 std::sync::Arc<dyn super::stub::dynamic::PersistentResourceService>,
6452 > {
6453 if gaxi::options::tracing_enabled(&conf) {
6454 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6455 }
6456 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6457 }
6458
6459 async fn build_transport(
6460 conf: gaxi::options::ClientConfig,
6461 ) -> crate::ClientBuilderResult<impl super::stub::PersistentResourceService> {
6462 super::transport::PersistentResourceService::new(conf).await
6463 }
6464
6465 async fn build_with_tracing(
6466 conf: gaxi::options::ClientConfig,
6467 ) -> crate::ClientBuilderResult<impl super::stub::PersistentResourceService> {
6468 Self::build_transport(conf)
6469 .await
6470 .map(super::tracing::PersistentResourceService::new)
6471 }
6472
6473 /// Creates a PersistentResource.
6474 ///
6475 /// # Long running operations
6476 ///
6477 /// This method is used to start, and/or poll a [long-running Operation].
6478 /// The [Working with long-running operations] chapter in the [user guide]
6479 /// covers these operations in detail.
6480 ///
6481 /// [long-running operation]: https://google.aip.dev/151
6482 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6483 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6484 pub fn create_persistent_resource(
6485 &self,
6486 ) -> super::builder::persistent_resource_service::CreatePersistentResource {
6487 super::builder::persistent_resource_service::CreatePersistentResource::new(
6488 self.inner.clone(),
6489 )
6490 }
6491
6492 /// Gets a PersistentResource.
6493 pub fn get_persistent_resource(
6494 &self,
6495 ) -> super::builder::persistent_resource_service::GetPersistentResource {
6496 super::builder::persistent_resource_service::GetPersistentResource::new(self.inner.clone())
6497 }
6498
6499 /// Lists PersistentResources in a Location.
6500 pub fn list_persistent_resources(
6501 &self,
6502 ) -> super::builder::persistent_resource_service::ListPersistentResources {
6503 super::builder::persistent_resource_service::ListPersistentResources::new(
6504 self.inner.clone(),
6505 )
6506 }
6507
6508 /// Deletes a PersistentResource.
6509 ///
6510 /// # Long running operations
6511 ///
6512 /// This method is used to start, and/or poll a [long-running Operation].
6513 /// The [Working with long-running operations] chapter in the [user guide]
6514 /// covers these operations in detail.
6515 ///
6516 /// [long-running operation]: https://google.aip.dev/151
6517 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6518 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6519 pub fn delete_persistent_resource(
6520 &self,
6521 ) -> super::builder::persistent_resource_service::DeletePersistentResource {
6522 super::builder::persistent_resource_service::DeletePersistentResource::new(
6523 self.inner.clone(),
6524 )
6525 }
6526
6527 /// Updates a PersistentResource.
6528 ///
6529 /// # Long running operations
6530 ///
6531 /// This method is used to start, and/or poll a [long-running Operation].
6532 /// The [Working with long-running operations] chapter in the [user guide]
6533 /// covers these operations in detail.
6534 ///
6535 /// [long-running operation]: https://google.aip.dev/151
6536 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6537 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6538 pub fn update_persistent_resource(
6539 &self,
6540 ) -> super::builder::persistent_resource_service::UpdatePersistentResource {
6541 super::builder::persistent_resource_service::UpdatePersistentResource::new(
6542 self.inner.clone(),
6543 )
6544 }
6545
6546 /// Reboots a PersistentResource.
6547 ///
6548 /// # Long running operations
6549 ///
6550 /// This method is used to start, and/or poll a [long-running Operation].
6551 /// The [Working with long-running operations] chapter in the [user guide]
6552 /// covers these operations in detail.
6553 ///
6554 /// [long-running operation]: https://google.aip.dev/151
6555 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6556 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6557 pub fn reboot_persistent_resource(
6558 &self,
6559 ) -> super::builder::persistent_resource_service::RebootPersistentResource {
6560 super::builder::persistent_resource_service::RebootPersistentResource::new(
6561 self.inner.clone(),
6562 )
6563 }
6564
6565 /// Lists information about the supported locations for this service.
6566 pub fn list_locations(&self) -> super::builder::persistent_resource_service::ListLocations {
6567 super::builder::persistent_resource_service::ListLocations::new(self.inner.clone())
6568 }
6569
6570 /// Gets information about a location.
6571 pub fn get_location(&self) -> super::builder::persistent_resource_service::GetLocation {
6572 super::builder::persistent_resource_service::GetLocation::new(self.inner.clone())
6573 }
6574
6575 /// Sets the access control policy on the specified resource. Replaces
6576 /// any existing policy.
6577 ///
6578 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
6579 /// errors.
6580 pub fn set_iam_policy(&self) -> super::builder::persistent_resource_service::SetIamPolicy {
6581 super::builder::persistent_resource_service::SetIamPolicy::new(self.inner.clone())
6582 }
6583
6584 /// Gets the access control policy for a resource. Returns an empty policy
6585 /// if the resource exists and does not have a policy set.
6586 pub fn get_iam_policy(&self) -> super::builder::persistent_resource_service::GetIamPolicy {
6587 super::builder::persistent_resource_service::GetIamPolicy::new(self.inner.clone())
6588 }
6589
6590 /// Returns permissions that a caller has on the specified resource. If the
6591 /// resource does not exist, this will return an empty set of
6592 /// permissions, not a `NOT_FOUND` error.
6593 ///
6594 /// Note: This operation is designed to be used for building
6595 /// permission-aware UIs and command-line tools, not for authorization
6596 /// checking. This operation may "fail open" without warning.
6597 pub fn test_iam_permissions(
6598 &self,
6599 ) -> super::builder::persistent_resource_service::TestIamPermissions {
6600 super::builder::persistent_resource_service::TestIamPermissions::new(self.inner.clone())
6601 }
6602
6603 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6604 ///
6605 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6606 pub fn list_operations(&self) -> super::builder::persistent_resource_service::ListOperations {
6607 super::builder::persistent_resource_service::ListOperations::new(self.inner.clone())
6608 }
6609
6610 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6611 ///
6612 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6613 pub fn get_operation(&self) -> super::builder::persistent_resource_service::GetOperation {
6614 super::builder::persistent_resource_service::GetOperation::new(self.inner.clone())
6615 }
6616
6617 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6618 ///
6619 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6620 pub fn delete_operation(&self) -> super::builder::persistent_resource_service::DeleteOperation {
6621 super::builder::persistent_resource_service::DeleteOperation::new(self.inner.clone())
6622 }
6623
6624 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6625 ///
6626 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6627 pub fn cancel_operation(&self) -> super::builder::persistent_resource_service::CancelOperation {
6628 super::builder::persistent_resource_service::CancelOperation::new(self.inner.clone())
6629 }
6630
6631 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6632 ///
6633 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6634 pub fn wait_operation(&self) -> super::builder::persistent_resource_service::WaitOperation {
6635 super::builder::persistent_resource_service::WaitOperation::new(self.inner.clone())
6636 }
6637}
6638
6639/// Implements a client for the Vertex AI API.
6640///
6641/// # Example
6642/// ```
6643/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6644/// # use google_cloud_aiplatform_v1::client::PipelineService;
6645/// let client = PipelineService::builder().build().await?;
6646/// // use `client` to make requests to the Vertex AI API.
6647/// # Ok(()) }
6648/// ```
6649///
6650/// # Service Description
6651///
6652/// A service for creating and managing Vertex AI's pipelines. This includes both
6653/// `TrainingPipeline` resources (used for AutoML and custom training) and
6654/// `PipelineJob` resources (used for Vertex AI Pipelines).
6655///
6656/// # Configuration
6657///
6658/// To configure `PipelineService` use the `with_*` methods in the type returned
6659/// by [builder()][PipelineService::builder]. The default configuration should
6660/// work for most applications. Common configuration changes include
6661///
6662/// * [with_endpoint()]: by default this client uses the global default endpoint
6663/// (`https://aiplatform.googleapis.com`). Applications using regional
6664/// endpoints or running in restricted networks (e.g. a network configured
6665// with [Private Google Access with VPC Service Controls]) may want to
6666/// override this default.
6667/// * [with_credentials()]: by default this client uses
6668/// [Application Default Credentials]. Applications using custom
6669/// authentication may need to override this default.
6670///
6671/// [with_endpoint()]: super::builder::pipeline_service::ClientBuilder::with_endpoint
6672/// [with_credentials()]: super::builder::pipeline_service::ClientBuilder::credentials
6673/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6674/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6675///
6676/// # Pooling and Cloning
6677///
6678/// `PipelineService` holds a connection pool internally, it is advised to
6679/// create one and the reuse it. You do not need to wrap `PipelineService` in
6680/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6681/// already uses an `Arc` internally.
6682#[cfg(feature = "pipeline-service")]
6683#[cfg_attr(docsrs, doc(cfg(feature = "pipeline-service")))]
6684#[derive(Clone, Debug)]
6685pub struct PipelineService {
6686 inner: std::sync::Arc<dyn super::stub::dynamic::PipelineService>,
6687}
6688
6689#[cfg(feature = "pipeline-service")]
6690impl PipelineService {
6691 /// Returns a builder for [PipelineService].
6692 ///
6693 /// ```
6694 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6695 /// # use google_cloud_aiplatform_v1::client::PipelineService;
6696 /// let client = PipelineService::builder().build().await?;
6697 /// # Ok(()) }
6698 /// ```
6699 pub fn builder() -> super::builder::pipeline_service::ClientBuilder {
6700 crate::new_client_builder(super::builder::pipeline_service::client::Factory)
6701 }
6702
6703 /// Creates a new client from the provided stub.
6704 ///
6705 /// The most common case for calling this function is in tests mocking the
6706 /// client's behavior.
6707 pub fn from_stub<T>(stub: T) -> Self
6708 where
6709 T: super::stub::PipelineService + 'static,
6710 {
6711 Self {
6712 inner: std::sync::Arc::new(stub),
6713 }
6714 }
6715
6716 pub(crate) async fn new(
6717 config: gaxi::options::ClientConfig,
6718 ) -> crate::ClientBuilderResult<Self> {
6719 let inner = Self::build_inner(config).await?;
6720 Ok(Self { inner })
6721 }
6722
6723 async fn build_inner(
6724 conf: gaxi::options::ClientConfig,
6725 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PipelineService>> {
6726 if gaxi::options::tracing_enabled(&conf) {
6727 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6728 }
6729 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6730 }
6731
6732 async fn build_transport(
6733 conf: gaxi::options::ClientConfig,
6734 ) -> crate::ClientBuilderResult<impl super::stub::PipelineService> {
6735 super::transport::PipelineService::new(conf).await
6736 }
6737
6738 async fn build_with_tracing(
6739 conf: gaxi::options::ClientConfig,
6740 ) -> crate::ClientBuilderResult<impl super::stub::PipelineService> {
6741 Self::build_transport(conf)
6742 .await
6743 .map(super::tracing::PipelineService::new)
6744 }
6745
6746 /// Creates a TrainingPipeline. A created TrainingPipeline right away will be
6747 /// attempted to be run.
6748 pub fn create_training_pipeline(
6749 &self,
6750 ) -> super::builder::pipeline_service::CreateTrainingPipeline {
6751 super::builder::pipeline_service::CreateTrainingPipeline::new(self.inner.clone())
6752 }
6753
6754 /// Gets a TrainingPipeline.
6755 pub fn get_training_pipeline(&self) -> super::builder::pipeline_service::GetTrainingPipeline {
6756 super::builder::pipeline_service::GetTrainingPipeline::new(self.inner.clone())
6757 }
6758
6759 /// Lists TrainingPipelines in a Location.
6760 pub fn list_training_pipelines(
6761 &self,
6762 ) -> super::builder::pipeline_service::ListTrainingPipelines {
6763 super::builder::pipeline_service::ListTrainingPipelines::new(self.inner.clone())
6764 }
6765
6766 /// Deletes a TrainingPipeline.
6767 ///
6768 /// # Long running operations
6769 ///
6770 /// This method is used to start, and/or poll a [long-running Operation].
6771 /// The [Working with long-running operations] chapter in the [user guide]
6772 /// covers these operations in detail.
6773 ///
6774 /// [long-running operation]: https://google.aip.dev/151
6775 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6776 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6777 pub fn delete_training_pipeline(
6778 &self,
6779 ) -> super::builder::pipeline_service::DeleteTrainingPipeline {
6780 super::builder::pipeline_service::DeleteTrainingPipeline::new(self.inner.clone())
6781 }
6782
6783 /// Cancels a TrainingPipeline.
6784 /// Starts asynchronous cancellation on the TrainingPipeline. The server
6785 /// makes a best effort to cancel the pipeline, but success is not
6786 /// guaranteed. Clients can use
6787 /// [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]
6788 /// or other methods to check whether the cancellation succeeded or whether the
6789 /// pipeline completed despite cancellation. On successful cancellation,
6790 /// the TrainingPipeline is not deleted; instead it becomes a pipeline with
6791 /// a
6792 /// [TrainingPipeline.error][google.cloud.aiplatform.v1.TrainingPipeline.error]
6793 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
6794 /// corresponding to `Code.CANCELLED`, and
6795 /// [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state]
6796 /// is set to `CANCELLED`.
6797 ///
6798 /// [google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]: crate::client::PipelineService::get_training_pipeline
6799 /// [google.cloud.aiplatform.v1.TrainingPipeline.error]: crate::model::TrainingPipeline::error
6800 /// [google.cloud.aiplatform.v1.TrainingPipeline.state]: crate::model::TrainingPipeline::state
6801 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
6802 pub fn cancel_training_pipeline(
6803 &self,
6804 ) -> super::builder::pipeline_service::CancelTrainingPipeline {
6805 super::builder::pipeline_service::CancelTrainingPipeline::new(self.inner.clone())
6806 }
6807
6808 /// Creates a PipelineJob. A PipelineJob will run immediately when created.
6809 pub fn create_pipeline_job(&self) -> super::builder::pipeline_service::CreatePipelineJob {
6810 super::builder::pipeline_service::CreatePipelineJob::new(self.inner.clone())
6811 }
6812
6813 /// Gets a PipelineJob.
6814 pub fn get_pipeline_job(&self) -> super::builder::pipeline_service::GetPipelineJob {
6815 super::builder::pipeline_service::GetPipelineJob::new(self.inner.clone())
6816 }
6817
6818 /// Lists PipelineJobs in a Location.
6819 pub fn list_pipeline_jobs(&self) -> super::builder::pipeline_service::ListPipelineJobs {
6820 super::builder::pipeline_service::ListPipelineJobs::new(self.inner.clone())
6821 }
6822
6823 /// Deletes a PipelineJob.
6824 ///
6825 /// # Long running operations
6826 ///
6827 /// This method is used to start, and/or poll a [long-running Operation].
6828 /// The [Working with long-running operations] chapter in the [user guide]
6829 /// covers these operations in detail.
6830 ///
6831 /// [long-running operation]: https://google.aip.dev/151
6832 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6833 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6834 pub fn delete_pipeline_job(&self) -> super::builder::pipeline_service::DeletePipelineJob {
6835 super::builder::pipeline_service::DeletePipelineJob::new(self.inner.clone())
6836 }
6837
6838 /// Batch deletes PipelineJobs
6839 /// The Operation is atomic. If it fails, none of the PipelineJobs are deleted.
6840 /// If it succeeds, all of the PipelineJobs are deleted.
6841 ///
6842 /// # Long running operations
6843 ///
6844 /// This method is used to start, and/or poll a [long-running Operation].
6845 /// The [Working with long-running operations] chapter in the [user guide]
6846 /// covers these operations in detail.
6847 ///
6848 /// [long-running operation]: https://google.aip.dev/151
6849 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6850 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6851 pub fn batch_delete_pipeline_jobs(
6852 &self,
6853 ) -> super::builder::pipeline_service::BatchDeletePipelineJobs {
6854 super::builder::pipeline_service::BatchDeletePipelineJobs::new(self.inner.clone())
6855 }
6856
6857 /// Cancels a PipelineJob.
6858 /// Starts asynchronous cancellation on the PipelineJob. The server
6859 /// makes a best effort to cancel the pipeline, but success is not
6860 /// guaranteed. Clients can use
6861 /// [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob]
6862 /// or other methods to check whether the cancellation succeeded or whether the
6863 /// pipeline completed despite cancellation. On successful cancellation,
6864 /// the PipelineJob is not deleted; instead it becomes a pipeline with
6865 /// a [PipelineJob.error][google.cloud.aiplatform.v1.PipelineJob.error] value
6866 /// with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding
6867 /// to `Code.CANCELLED`, and
6868 /// [PipelineJob.state][google.cloud.aiplatform.v1.PipelineJob.state] is set to
6869 /// `CANCELLED`.
6870 ///
6871 /// [google.cloud.aiplatform.v1.PipelineJob.error]: crate::model::PipelineJob::error
6872 /// [google.cloud.aiplatform.v1.PipelineJob.state]: crate::model::PipelineJob::state
6873 /// [google.cloud.aiplatform.v1.PipelineService.GetPipelineJob]: crate::client::PipelineService::get_pipeline_job
6874 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
6875 pub fn cancel_pipeline_job(&self) -> super::builder::pipeline_service::CancelPipelineJob {
6876 super::builder::pipeline_service::CancelPipelineJob::new(self.inner.clone())
6877 }
6878
6879 /// Batch cancel PipelineJobs.
6880 /// Firstly the server will check if all the jobs are in non-terminal states,
6881 /// and skip the jobs that are already terminated.
6882 /// If the operation failed, none of the pipeline jobs are cancelled.
6883 /// The server will poll the states of all the pipeline jobs periodically
6884 /// to check the cancellation status.
6885 /// This operation will return an LRO.
6886 ///
6887 /// # Long running operations
6888 ///
6889 /// This method is used to start, and/or poll a [long-running Operation].
6890 /// The [Working with long-running operations] chapter in the [user guide]
6891 /// covers these operations in detail.
6892 ///
6893 /// [long-running operation]: https://google.aip.dev/151
6894 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6895 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6896 pub fn batch_cancel_pipeline_jobs(
6897 &self,
6898 ) -> super::builder::pipeline_service::BatchCancelPipelineJobs {
6899 super::builder::pipeline_service::BatchCancelPipelineJobs::new(self.inner.clone())
6900 }
6901
6902 /// Lists information about the supported locations for this service.
6903 pub fn list_locations(&self) -> super::builder::pipeline_service::ListLocations {
6904 super::builder::pipeline_service::ListLocations::new(self.inner.clone())
6905 }
6906
6907 /// Gets information about a location.
6908 pub fn get_location(&self) -> super::builder::pipeline_service::GetLocation {
6909 super::builder::pipeline_service::GetLocation::new(self.inner.clone())
6910 }
6911
6912 /// Sets the access control policy on the specified resource. Replaces
6913 /// any existing policy.
6914 ///
6915 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
6916 /// errors.
6917 pub fn set_iam_policy(&self) -> super::builder::pipeline_service::SetIamPolicy {
6918 super::builder::pipeline_service::SetIamPolicy::new(self.inner.clone())
6919 }
6920
6921 /// Gets the access control policy for a resource. Returns an empty policy
6922 /// if the resource exists and does not have a policy set.
6923 pub fn get_iam_policy(&self) -> super::builder::pipeline_service::GetIamPolicy {
6924 super::builder::pipeline_service::GetIamPolicy::new(self.inner.clone())
6925 }
6926
6927 /// Returns permissions that a caller has on the specified resource. If the
6928 /// resource does not exist, this will return an empty set of
6929 /// permissions, not a `NOT_FOUND` error.
6930 ///
6931 /// Note: This operation is designed to be used for building
6932 /// permission-aware UIs and command-line tools, not for authorization
6933 /// checking. This operation may "fail open" without warning.
6934 pub fn test_iam_permissions(&self) -> super::builder::pipeline_service::TestIamPermissions {
6935 super::builder::pipeline_service::TestIamPermissions::new(self.inner.clone())
6936 }
6937
6938 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6939 ///
6940 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6941 pub fn list_operations(&self) -> super::builder::pipeline_service::ListOperations {
6942 super::builder::pipeline_service::ListOperations::new(self.inner.clone())
6943 }
6944
6945 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6946 ///
6947 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6948 pub fn get_operation(&self) -> super::builder::pipeline_service::GetOperation {
6949 super::builder::pipeline_service::GetOperation::new(self.inner.clone())
6950 }
6951
6952 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6953 ///
6954 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6955 pub fn delete_operation(&self) -> super::builder::pipeline_service::DeleteOperation {
6956 super::builder::pipeline_service::DeleteOperation::new(self.inner.clone())
6957 }
6958
6959 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6960 ///
6961 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6962 pub fn cancel_operation(&self) -> super::builder::pipeline_service::CancelOperation {
6963 super::builder::pipeline_service::CancelOperation::new(self.inner.clone())
6964 }
6965
6966 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6967 ///
6968 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6969 pub fn wait_operation(&self) -> super::builder::pipeline_service::WaitOperation {
6970 super::builder::pipeline_service::WaitOperation::new(self.inner.clone())
6971 }
6972}
6973
6974/// Implements a client for the Vertex AI API.
6975///
6976/// # Example
6977/// ```
6978/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6979/// # use google_cloud_aiplatform_v1::client::PredictionService;
6980/// let client = PredictionService::builder().build().await?;
6981/// // use `client` to make requests to the Vertex AI API.
6982/// # Ok(()) }
6983/// ```
6984///
6985/// # Service Description
6986///
6987/// A service for online predictions and explanations.
6988///
6989/// # Configuration
6990///
6991/// To configure `PredictionService` use the `with_*` methods in the type returned
6992/// by [builder()][PredictionService::builder]. The default configuration should
6993/// work for most applications. Common configuration changes include
6994///
6995/// * [with_endpoint()]: by default this client uses the global default endpoint
6996/// (`https://aiplatform.googleapis.com`). Applications using regional
6997/// endpoints or running in restricted networks (e.g. a network configured
6998// with [Private Google Access with VPC Service Controls]) may want to
6999/// override this default.
7000/// * [with_credentials()]: by default this client uses
7001/// [Application Default Credentials]. Applications using custom
7002/// authentication may need to override this default.
7003///
7004/// [with_endpoint()]: super::builder::prediction_service::ClientBuilder::with_endpoint
7005/// [with_credentials()]: super::builder::prediction_service::ClientBuilder::credentials
7006/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7007/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7008///
7009/// # Pooling and Cloning
7010///
7011/// `PredictionService` holds a connection pool internally, it is advised to
7012/// create one and the reuse it. You do not need to wrap `PredictionService` in
7013/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7014/// already uses an `Arc` internally.
7015#[cfg(feature = "prediction-service")]
7016#[cfg_attr(docsrs, doc(cfg(feature = "prediction-service")))]
7017#[derive(Clone, Debug)]
7018pub struct PredictionService {
7019 inner: std::sync::Arc<dyn super::stub::dynamic::PredictionService>,
7020}
7021
7022#[cfg(feature = "prediction-service")]
7023impl PredictionService {
7024 /// Returns a builder for [PredictionService].
7025 ///
7026 /// ```
7027 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7028 /// # use google_cloud_aiplatform_v1::client::PredictionService;
7029 /// let client = PredictionService::builder().build().await?;
7030 /// # Ok(()) }
7031 /// ```
7032 pub fn builder() -> super::builder::prediction_service::ClientBuilder {
7033 crate::new_client_builder(super::builder::prediction_service::client::Factory)
7034 }
7035
7036 /// Creates a new client from the provided stub.
7037 ///
7038 /// The most common case for calling this function is in tests mocking the
7039 /// client's behavior.
7040 pub fn from_stub<T>(stub: T) -> Self
7041 where
7042 T: super::stub::PredictionService + 'static,
7043 {
7044 Self {
7045 inner: std::sync::Arc::new(stub),
7046 }
7047 }
7048
7049 pub(crate) async fn new(
7050 config: gaxi::options::ClientConfig,
7051 ) -> crate::ClientBuilderResult<Self> {
7052 let inner = Self::build_inner(config).await?;
7053 Ok(Self { inner })
7054 }
7055
7056 async fn build_inner(
7057 conf: gaxi::options::ClientConfig,
7058 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PredictionService>>
7059 {
7060 if gaxi::options::tracing_enabled(&conf) {
7061 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7062 }
7063 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7064 }
7065
7066 async fn build_transport(
7067 conf: gaxi::options::ClientConfig,
7068 ) -> crate::ClientBuilderResult<impl super::stub::PredictionService> {
7069 super::transport::PredictionService::new(conf).await
7070 }
7071
7072 async fn build_with_tracing(
7073 conf: gaxi::options::ClientConfig,
7074 ) -> crate::ClientBuilderResult<impl super::stub::PredictionService> {
7075 Self::build_transport(conf)
7076 .await
7077 .map(super::tracing::PredictionService::new)
7078 }
7079
7080 /// Perform an online prediction.
7081 pub fn predict(&self) -> super::builder::prediction_service::Predict {
7082 super::builder::prediction_service::Predict::new(self.inner.clone())
7083 }
7084
7085 /// Perform an online prediction with an arbitrary HTTP payload.
7086 ///
7087 /// The response includes the following HTTP headers:
7088 ///
7089 /// * `X-Vertex-AI-Endpoint-Id`: ID of the
7090 /// [Endpoint][google.cloud.aiplatform.v1.Endpoint] that served this
7091 /// prediction.
7092 ///
7093 /// * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's
7094 /// [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] that served this
7095 /// prediction.
7096 ///
7097 ///
7098 /// [google.cloud.aiplatform.v1.DeployedModel]: crate::model::DeployedModel
7099 /// [google.cloud.aiplatform.v1.Endpoint]: crate::model::Endpoint
7100 pub fn raw_predict(&self) -> super::builder::prediction_service::RawPredict {
7101 super::builder::prediction_service::RawPredict::new(self.inner.clone())
7102 }
7103
7104 /// Perform an unary online prediction request to a gRPC model server for
7105 /// Vertex first-party products and frameworks.
7106 pub fn direct_predict(&self) -> super::builder::prediction_service::DirectPredict {
7107 super::builder::prediction_service::DirectPredict::new(self.inner.clone())
7108 }
7109
7110 /// Perform an unary online prediction request to a gRPC model server for
7111 /// custom containers.
7112 pub fn direct_raw_predict(&self) -> super::builder::prediction_service::DirectRawPredict {
7113 super::builder::prediction_service::DirectRawPredict::new(self.inner.clone())
7114 }
7115
7116 /// Perform an online explanation.
7117 ///
7118 /// If
7119 /// [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]
7120 /// is specified, the corresponding DeployModel must have
7121 /// [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec]
7122 /// populated. If
7123 /// [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]
7124 /// is not specified, all DeployedModels must have
7125 /// [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec]
7126 /// populated.
7127 ///
7128 /// [google.cloud.aiplatform.v1.DeployedModel.explanation_spec]: crate::model::DeployedModel::explanation_spec
7129 /// [google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]: crate::model::ExplainRequest::deployed_model_id
7130 pub fn explain(&self) -> super::builder::prediction_service::Explain {
7131 super::builder::prediction_service::Explain::new(self.inner.clone())
7132 }
7133
7134 /// Generate content with multimodal inputs.
7135 pub fn generate_content(&self) -> super::builder::prediction_service::GenerateContent {
7136 super::builder::prediction_service::GenerateContent::new(self.inner.clone())
7137 }
7138
7139 /// Embed content with multimodal inputs.
7140 pub fn embed_content(&self) -> super::builder::prediction_service::EmbedContent {
7141 super::builder::prediction_service::EmbedContent::new(self.inner.clone())
7142 }
7143
7144 /// Lists information about the supported locations for this service.
7145 pub fn list_locations(&self) -> super::builder::prediction_service::ListLocations {
7146 super::builder::prediction_service::ListLocations::new(self.inner.clone())
7147 }
7148
7149 /// Gets information about a location.
7150 pub fn get_location(&self) -> super::builder::prediction_service::GetLocation {
7151 super::builder::prediction_service::GetLocation::new(self.inner.clone())
7152 }
7153
7154 /// Sets the access control policy on the specified resource. Replaces
7155 /// any existing policy.
7156 ///
7157 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
7158 /// errors.
7159 pub fn set_iam_policy(&self) -> super::builder::prediction_service::SetIamPolicy {
7160 super::builder::prediction_service::SetIamPolicy::new(self.inner.clone())
7161 }
7162
7163 /// Gets the access control policy for a resource. Returns an empty policy
7164 /// if the resource exists and does not have a policy set.
7165 pub fn get_iam_policy(&self) -> super::builder::prediction_service::GetIamPolicy {
7166 super::builder::prediction_service::GetIamPolicy::new(self.inner.clone())
7167 }
7168
7169 /// Returns permissions that a caller has on the specified resource. If the
7170 /// resource does not exist, this will return an empty set of
7171 /// permissions, not a `NOT_FOUND` error.
7172 ///
7173 /// Note: This operation is designed to be used for building
7174 /// permission-aware UIs and command-line tools, not for authorization
7175 /// checking. This operation may "fail open" without warning.
7176 pub fn test_iam_permissions(&self) -> super::builder::prediction_service::TestIamPermissions {
7177 super::builder::prediction_service::TestIamPermissions::new(self.inner.clone())
7178 }
7179
7180 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7181 ///
7182 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7183 pub fn list_operations(&self) -> super::builder::prediction_service::ListOperations {
7184 super::builder::prediction_service::ListOperations::new(self.inner.clone())
7185 }
7186
7187 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7188 ///
7189 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7190 pub fn get_operation(&self) -> super::builder::prediction_service::GetOperation {
7191 super::builder::prediction_service::GetOperation::new(self.inner.clone())
7192 }
7193
7194 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7195 ///
7196 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7197 pub fn delete_operation(&self) -> super::builder::prediction_service::DeleteOperation {
7198 super::builder::prediction_service::DeleteOperation::new(self.inner.clone())
7199 }
7200
7201 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7202 ///
7203 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7204 pub fn cancel_operation(&self) -> super::builder::prediction_service::CancelOperation {
7205 super::builder::prediction_service::CancelOperation::new(self.inner.clone())
7206 }
7207
7208 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7209 ///
7210 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7211 pub fn wait_operation(&self) -> super::builder::prediction_service::WaitOperation {
7212 super::builder::prediction_service::WaitOperation::new(self.inner.clone())
7213 }
7214}
7215
7216/// Implements a client for the Vertex AI API.
7217///
7218/// # Example
7219/// ```
7220/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7221/// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
7222/// let client = ReasoningEngineExecutionService::builder().build().await?;
7223/// // use `client` to make requests to the Vertex AI API.
7224/// # Ok(()) }
7225/// ```
7226///
7227/// # Service Description
7228///
7229/// A service for executing queries on Reasoning Engine.
7230///
7231/// # Configuration
7232///
7233/// To configure `ReasoningEngineExecutionService` use the `with_*` methods in the type returned
7234/// by [builder()][ReasoningEngineExecutionService::builder]. The default configuration should
7235/// work for most applications. Common configuration changes include
7236///
7237/// * [with_endpoint()]: by default this client uses the global default endpoint
7238/// (`https://aiplatform.googleapis.com`). Applications using regional
7239/// endpoints or running in restricted networks (e.g. a network configured
7240// with [Private Google Access with VPC Service Controls]) may want to
7241/// override this default.
7242/// * [with_credentials()]: by default this client uses
7243/// [Application Default Credentials]. Applications using custom
7244/// authentication may need to override this default.
7245///
7246/// [with_endpoint()]: super::builder::reasoning_engine_execution_service::ClientBuilder::with_endpoint
7247/// [with_credentials()]: super::builder::reasoning_engine_execution_service::ClientBuilder::credentials
7248/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7249/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7250///
7251/// # Pooling and Cloning
7252///
7253/// `ReasoningEngineExecutionService` holds a connection pool internally, it is advised to
7254/// create one and the reuse it. You do not need to wrap `ReasoningEngineExecutionService` in
7255/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7256/// already uses an `Arc` internally.
7257#[cfg(feature = "reasoning-engine-execution-service")]
7258#[cfg_attr(docsrs, doc(cfg(feature = "reasoning-engine-execution-service")))]
7259#[derive(Clone, Debug)]
7260pub struct ReasoningEngineExecutionService {
7261 inner: std::sync::Arc<dyn super::stub::dynamic::ReasoningEngineExecutionService>,
7262}
7263
7264#[cfg(feature = "reasoning-engine-execution-service")]
7265impl ReasoningEngineExecutionService {
7266 /// Returns a builder for [ReasoningEngineExecutionService].
7267 ///
7268 /// ```
7269 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7270 /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
7271 /// let client = ReasoningEngineExecutionService::builder().build().await?;
7272 /// # Ok(()) }
7273 /// ```
7274 pub fn builder() -> super::builder::reasoning_engine_execution_service::ClientBuilder {
7275 crate::new_client_builder(
7276 super::builder::reasoning_engine_execution_service::client::Factory,
7277 )
7278 }
7279
7280 /// Creates a new client from the provided stub.
7281 ///
7282 /// The most common case for calling this function is in tests mocking the
7283 /// client's behavior.
7284 pub fn from_stub<T>(stub: T) -> Self
7285 where
7286 T: super::stub::ReasoningEngineExecutionService + 'static,
7287 {
7288 Self {
7289 inner: std::sync::Arc::new(stub),
7290 }
7291 }
7292
7293 pub(crate) async fn new(
7294 config: gaxi::options::ClientConfig,
7295 ) -> crate::ClientBuilderResult<Self> {
7296 let inner = Self::build_inner(config).await?;
7297 Ok(Self { inner })
7298 }
7299
7300 async fn build_inner(
7301 conf: gaxi::options::ClientConfig,
7302 ) -> crate::ClientBuilderResult<
7303 std::sync::Arc<dyn super::stub::dynamic::ReasoningEngineExecutionService>,
7304 > {
7305 if gaxi::options::tracing_enabled(&conf) {
7306 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7307 }
7308 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7309 }
7310
7311 async fn build_transport(
7312 conf: gaxi::options::ClientConfig,
7313 ) -> crate::ClientBuilderResult<impl super::stub::ReasoningEngineExecutionService> {
7314 super::transport::ReasoningEngineExecutionService::new(conf).await
7315 }
7316
7317 async fn build_with_tracing(
7318 conf: gaxi::options::ClientConfig,
7319 ) -> crate::ClientBuilderResult<impl super::stub::ReasoningEngineExecutionService> {
7320 Self::build_transport(conf)
7321 .await
7322 .map(super::tracing::ReasoningEngineExecutionService::new)
7323 }
7324
7325 /// Queries using a reasoning engine.
7326 pub fn query_reasoning_engine(
7327 &self,
7328 ) -> super::builder::reasoning_engine_execution_service::QueryReasoningEngine {
7329 super::builder::reasoning_engine_execution_service::QueryReasoningEngine::new(
7330 self.inner.clone(),
7331 )
7332 }
7333
7334 /// Lists information about the supported locations for this service.
7335 pub fn list_locations(
7336 &self,
7337 ) -> super::builder::reasoning_engine_execution_service::ListLocations {
7338 super::builder::reasoning_engine_execution_service::ListLocations::new(self.inner.clone())
7339 }
7340
7341 /// Gets information about a location.
7342 pub fn get_location(&self) -> super::builder::reasoning_engine_execution_service::GetLocation {
7343 super::builder::reasoning_engine_execution_service::GetLocation::new(self.inner.clone())
7344 }
7345
7346 /// Sets the access control policy on the specified resource. Replaces
7347 /// any existing policy.
7348 ///
7349 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
7350 /// errors.
7351 pub fn set_iam_policy(
7352 &self,
7353 ) -> super::builder::reasoning_engine_execution_service::SetIamPolicy {
7354 super::builder::reasoning_engine_execution_service::SetIamPolicy::new(self.inner.clone())
7355 }
7356
7357 /// Gets the access control policy for a resource. Returns an empty policy
7358 /// if the resource exists and does not have a policy set.
7359 pub fn get_iam_policy(
7360 &self,
7361 ) -> super::builder::reasoning_engine_execution_service::GetIamPolicy {
7362 super::builder::reasoning_engine_execution_service::GetIamPolicy::new(self.inner.clone())
7363 }
7364
7365 /// Returns permissions that a caller has on the specified resource. If the
7366 /// resource does not exist, this will return an empty set of
7367 /// permissions, not a `NOT_FOUND` error.
7368 ///
7369 /// Note: This operation is designed to be used for building
7370 /// permission-aware UIs and command-line tools, not for authorization
7371 /// checking. This operation may "fail open" without warning.
7372 pub fn test_iam_permissions(
7373 &self,
7374 ) -> super::builder::reasoning_engine_execution_service::TestIamPermissions {
7375 super::builder::reasoning_engine_execution_service::TestIamPermissions::new(
7376 self.inner.clone(),
7377 )
7378 }
7379
7380 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7381 ///
7382 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7383 pub fn list_operations(
7384 &self,
7385 ) -> super::builder::reasoning_engine_execution_service::ListOperations {
7386 super::builder::reasoning_engine_execution_service::ListOperations::new(self.inner.clone())
7387 }
7388
7389 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7390 ///
7391 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7392 pub fn get_operation(
7393 &self,
7394 ) -> super::builder::reasoning_engine_execution_service::GetOperation {
7395 super::builder::reasoning_engine_execution_service::GetOperation::new(self.inner.clone())
7396 }
7397
7398 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7399 ///
7400 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7401 pub fn delete_operation(
7402 &self,
7403 ) -> super::builder::reasoning_engine_execution_service::DeleteOperation {
7404 super::builder::reasoning_engine_execution_service::DeleteOperation::new(self.inner.clone())
7405 }
7406
7407 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7408 ///
7409 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7410 pub fn cancel_operation(
7411 &self,
7412 ) -> super::builder::reasoning_engine_execution_service::CancelOperation {
7413 super::builder::reasoning_engine_execution_service::CancelOperation::new(self.inner.clone())
7414 }
7415
7416 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7417 ///
7418 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7419 pub fn wait_operation(
7420 &self,
7421 ) -> super::builder::reasoning_engine_execution_service::WaitOperation {
7422 super::builder::reasoning_engine_execution_service::WaitOperation::new(self.inner.clone())
7423 }
7424}
7425
7426/// Implements a client for the Vertex AI API.
7427///
7428/// # Example
7429/// ```
7430/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7431/// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
7432/// let client = ReasoningEngineService::builder().build().await?;
7433/// // use `client` to make requests to the Vertex AI API.
7434/// # Ok(()) }
7435/// ```
7436///
7437/// # Service Description
7438///
7439/// A service for managing Vertex AI's Reasoning Engines.
7440///
7441/// # Configuration
7442///
7443/// To configure `ReasoningEngineService` use the `with_*` methods in the type returned
7444/// by [builder()][ReasoningEngineService::builder]. The default configuration should
7445/// work for most applications. Common configuration changes include
7446///
7447/// * [with_endpoint()]: by default this client uses the global default endpoint
7448/// (`https://aiplatform.googleapis.com`). Applications using regional
7449/// endpoints or running in restricted networks (e.g. a network configured
7450// with [Private Google Access with VPC Service Controls]) may want to
7451/// override this default.
7452/// * [with_credentials()]: by default this client uses
7453/// [Application Default Credentials]. Applications using custom
7454/// authentication may need to override this default.
7455///
7456/// [with_endpoint()]: super::builder::reasoning_engine_service::ClientBuilder::with_endpoint
7457/// [with_credentials()]: super::builder::reasoning_engine_service::ClientBuilder::credentials
7458/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7459/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7460///
7461/// # Pooling and Cloning
7462///
7463/// `ReasoningEngineService` holds a connection pool internally, it is advised to
7464/// create one and the reuse it. You do not need to wrap `ReasoningEngineService` in
7465/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7466/// already uses an `Arc` internally.
7467#[cfg(feature = "reasoning-engine-service")]
7468#[cfg_attr(docsrs, doc(cfg(feature = "reasoning-engine-service")))]
7469#[derive(Clone, Debug)]
7470pub struct ReasoningEngineService {
7471 inner: std::sync::Arc<dyn super::stub::dynamic::ReasoningEngineService>,
7472}
7473
7474#[cfg(feature = "reasoning-engine-service")]
7475impl ReasoningEngineService {
7476 /// Returns a builder for [ReasoningEngineService].
7477 ///
7478 /// ```
7479 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7480 /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
7481 /// let client = ReasoningEngineService::builder().build().await?;
7482 /// # Ok(()) }
7483 /// ```
7484 pub fn builder() -> super::builder::reasoning_engine_service::ClientBuilder {
7485 crate::new_client_builder(super::builder::reasoning_engine_service::client::Factory)
7486 }
7487
7488 /// Creates a new client from the provided stub.
7489 ///
7490 /// The most common case for calling this function is in tests mocking the
7491 /// client's behavior.
7492 pub fn from_stub<T>(stub: T) -> Self
7493 where
7494 T: super::stub::ReasoningEngineService + 'static,
7495 {
7496 Self {
7497 inner: std::sync::Arc::new(stub),
7498 }
7499 }
7500
7501 pub(crate) async fn new(
7502 config: gaxi::options::ClientConfig,
7503 ) -> crate::ClientBuilderResult<Self> {
7504 let inner = Self::build_inner(config).await?;
7505 Ok(Self { inner })
7506 }
7507
7508 async fn build_inner(
7509 conf: gaxi::options::ClientConfig,
7510 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReasoningEngineService>>
7511 {
7512 if gaxi::options::tracing_enabled(&conf) {
7513 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7514 }
7515 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7516 }
7517
7518 async fn build_transport(
7519 conf: gaxi::options::ClientConfig,
7520 ) -> crate::ClientBuilderResult<impl super::stub::ReasoningEngineService> {
7521 super::transport::ReasoningEngineService::new(conf).await
7522 }
7523
7524 async fn build_with_tracing(
7525 conf: gaxi::options::ClientConfig,
7526 ) -> crate::ClientBuilderResult<impl super::stub::ReasoningEngineService> {
7527 Self::build_transport(conf)
7528 .await
7529 .map(super::tracing::ReasoningEngineService::new)
7530 }
7531
7532 /// Creates a reasoning engine.
7533 ///
7534 /// # Long running operations
7535 ///
7536 /// This method is used to start, and/or poll a [long-running Operation].
7537 /// The [Working with long-running operations] chapter in the [user guide]
7538 /// covers these operations in detail.
7539 ///
7540 /// [long-running operation]: https://google.aip.dev/151
7541 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7542 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7543 pub fn create_reasoning_engine(
7544 &self,
7545 ) -> super::builder::reasoning_engine_service::CreateReasoningEngine {
7546 super::builder::reasoning_engine_service::CreateReasoningEngine::new(self.inner.clone())
7547 }
7548
7549 /// Gets a reasoning engine.
7550 pub fn get_reasoning_engine(
7551 &self,
7552 ) -> super::builder::reasoning_engine_service::GetReasoningEngine {
7553 super::builder::reasoning_engine_service::GetReasoningEngine::new(self.inner.clone())
7554 }
7555
7556 /// Lists reasoning engines in a location.
7557 pub fn list_reasoning_engines(
7558 &self,
7559 ) -> super::builder::reasoning_engine_service::ListReasoningEngines {
7560 super::builder::reasoning_engine_service::ListReasoningEngines::new(self.inner.clone())
7561 }
7562
7563 /// Updates a reasoning engine.
7564 ///
7565 /// # Long running operations
7566 ///
7567 /// This method is used to start, and/or poll a [long-running Operation].
7568 /// The [Working with long-running operations] chapter in the [user guide]
7569 /// covers these operations in detail.
7570 ///
7571 /// [long-running operation]: https://google.aip.dev/151
7572 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7573 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7574 pub fn update_reasoning_engine(
7575 &self,
7576 ) -> super::builder::reasoning_engine_service::UpdateReasoningEngine {
7577 super::builder::reasoning_engine_service::UpdateReasoningEngine::new(self.inner.clone())
7578 }
7579
7580 /// Deletes a reasoning engine.
7581 ///
7582 /// # Long running operations
7583 ///
7584 /// This method is used to start, and/or poll a [long-running Operation].
7585 /// The [Working with long-running operations] chapter in the [user guide]
7586 /// covers these operations in detail.
7587 ///
7588 /// [long-running operation]: https://google.aip.dev/151
7589 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7590 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7591 pub fn delete_reasoning_engine(
7592 &self,
7593 ) -> super::builder::reasoning_engine_service::DeleteReasoningEngine {
7594 super::builder::reasoning_engine_service::DeleteReasoningEngine::new(self.inner.clone())
7595 }
7596
7597 /// Lists information about the supported locations for this service.
7598 pub fn list_locations(&self) -> super::builder::reasoning_engine_service::ListLocations {
7599 super::builder::reasoning_engine_service::ListLocations::new(self.inner.clone())
7600 }
7601
7602 /// Gets information about a location.
7603 pub fn get_location(&self) -> super::builder::reasoning_engine_service::GetLocation {
7604 super::builder::reasoning_engine_service::GetLocation::new(self.inner.clone())
7605 }
7606
7607 /// Sets the access control policy on the specified resource. Replaces
7608 /// any existing policy.
7609 ///
7610 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
7611 /// errors.
7612 pub fn set_iam_policy(&self) -> super::builder::reasoning_engine_service::SetIamPolicy {
7613 super::builder::reasoning_engine_service::SetIamPolicy::new(self.inner.clone())
7614 }
7615
7616 /// Gets the access control policy for a resource. Returns an empty policy
7617 /// if the resource exists and does not have a policy set.
7618 pub fn get_iam_policy(&self) -> super::builder::reasoning_engine_service::GetIamPolicy {
7619 super::builder::reasoning_engine_service::GetIamPolicy::new(self.inner.clone())
7620 }
7621
7622 /// Returns permissions that a caller has on the specified resource. If the
7623 /// resource does not exist, this will return an empty set of
7624 /// permissions, not a `NOT_FOUND` error.
7625 ///
7626 /// Note: This operation is designed to be used for building
7627 /// permission-aware UIs and command-line tools, not for authorization
7628 /// checking. This operation may "fail open" without warning.
7629 pub fn test_iam_permissions(
7630 &self,
7631 ) -> super::builder::reasoning_engine_service::TestIamPermissions {
7632 super::builder::reasoning_engine_service::TestIamPermissions::new(self.inner.clone())
7633 }
7634
7635 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7636 ///
7637 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7638 pub fn list_operations(&self) -> super::builder::reasoning_engine_service::ListOperations {
7639 super::builder::reasoning_engine_service::ListOperations::new(self.inner.clone())
7640 }
7641
7642 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7643 ///
7644 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7645 pub fn get_operation(&self) -> super::builder::reasoning_engine_service::GetOperation {
7646 super::builder::reasoning_engine_service::GetOperation::new(self.inner.clone())
7647 }
7648
7649 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7650 ///
7651 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7652 pub fn delete_operation(&self) -> super::builder::reasoning_engine_service::DeleteOperation {
7653 super::builder::reasoning_engine_service::DeleteOperation::new(self.inner.clone())
7654 }
7655
7656 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7657 ///
7658 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7659 pub fn cancel_operation(&self) -> super::builder::reasoning_engine_service::CancelOperation {
7660 super::builder::reasoning_engine_service::CancelOperation::new(self.inner.clone())
7661 }
7662
7663 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7664 ///
7665 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7666 pub fn wait_operation(&self) -> super::builder::reasoning_engine_service::WaitOperation {
7667 super::builder::reasoning_engine_service::WaitOperation::new(self.inner.clone())
7668 }
7669}
7670
7671/// Implements a client for the Vertex AI API.
7672///
7673/// # Example
7674/// ```
7675/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7676/// # use google_cloud_aiplatform_v1::client::ScheduleService;
7677/// let client = ScheduleService::builder().build().await?;
7678/// // use `client` to make requests to the Vertex AI API.
7679/// # Ok(()) }
7680/// ```
7681///
7682/// # Service Description
7683///
7684/// A service for creating and managing Vertex AI's Schedule resources to
7685/// periodically launch shceudled runs to make API calls.
7686///
7687/// # Configuration
7688///
7689/// To configure `ScheduleService` use the `with_*` methods in the type returned
7690/// by [builder()][ScheduleService::builder]. The default configuration should
7691/// work for most applications. Common configuration changes include
7692///
7693/// * [with_endpoint()]: by default this client uses the global default endpoint
7694/// (`https://aiplatform.googleapis.com`). Applications using regional
7695/// endpoints or running in restricted networks (e.g. a network configured
7696// with [Private Google Access with VPC Service Controls]) may want to
7697/// override this default.
7698/// * [with_credentials()]: by default this client uses
7699/// [Application Default Credentials]. Applications using custom
7700/// authentication may need to override this default.
7701///
7702/// [with_endpoint()]: super::builder::schedule_service::ClientBuilder::with_endpoint
7703/// [with_credentials()]: super::builder::schedule_service::ClientBuilder::credentials
7704/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7705/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7706///
7707/// # Pooling and Cloning
7708///
7709/// `ScheduleService` holds a connection pool internally, it is advised to
7710/// create one and the reuse it. You do not need to wrap `ScheduleService` in
7711/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7712/// already uses an `Arc` internally.
7713#[cfg(feature = "schedule-service")]
7714#[cfg_attr(docsrs, doc(cfg(feature = "schedule-service")))]
7715#[derive(Clone, Debug)]
7716pub struct ScheduleService {
7717 inner: std::sync::Arc<dyn super::stub::dynamic::ScheduleService>,
7718}
7719
7720#[cfg(feature = "schedule-service")]
7721impl ScheduleService {
7722 /// Returns a builder for [ScheduleService].
7723 ///
7724 /// ```
7725 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7726 /// # use google_cloud_aiplatform_v1::client::ScheduleService;
7727 /// let client = ScheduleService::builder().build().await?;
7728 /// # Ok(()) }
7729 /// ```
7730 pub fn builder() -> super::builder::schedule_service::ClientBuilder {
7731 crate::new_client_builder(super::builder::schedule_service::client::Factory)
7732 }
7733
7734 /// Creates a new client from the provided stub.
7735 ///
7736 /// The most common case for calling this function is in tests mocking the
7737 /// client's behavior.
7738 pub fn from_stub<T>(stub: T) -> Self
7739 where
7740 T: super::stub::ScheduleService + 'static,
7741 {
7742 Self {
7743 inner: std::sync::Arc::new(stub),
7744 }
7745 }
7746
7747 pub(crate) async fn new(
7748 config: gaxi::options::ClientConfig,
7749 ) -> crate::ClientBuilderResult<Self> {
7750 let inner = Self::build_inner(config).await?;
7751 Ok(Self { inner })
7752 }
7753
7754 async fn build_inner(
7755 conf: gaxi::options::ClientConfig,
7756 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ScheduleService>> {
7757 if gaxi::options::tracing_enabled(&conf) {
7758 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7759 }
7760 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7761 }
7762
7763 async fn build_transport(
7764 conf: gaxi::options::ClientConfig,
7765 ) -> crate::ClientBuilderResult<impl super::stub::ScheduleService> {
7766 super::transport::ScheduleService::new(conf).await
7767 }
7768
7769 async fn build_with_tracing(
7770 conf: gaxi::options::ClientConfig,
7771 ) -> crate::ClientBuilderResult<impl super::stub::ScheduleService> {
7772 Self::build_transport(conf)
7773 .await
7774 .map(super::tracing::ScheduleService::new)
7775 }
7776
7777 /// Creates a Schedule.
7778 pub fn create_schedule(&self) -> super::builder::schedule_service::CreateSchedule {
7779 super::builder::schedule_service::CreateSchedule::new(self.inner.clone())
7780 }
7781
7782 /// Deletes a Schedule.
7783 ///
7784 /// # Long running operations
7785 ///
7786 /// This method is used to start, and/or poll a [long-running Operation].
7787 /// The [Working with long-running operations] chapter in the [user guide]
7788 /// covers these operations in detail.
7789 ///
7790 /// [long-running operation]: https://google.aip.dev/151
7791 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7792 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7793 pub fn delete_schedule(&self) -> super::builder::schedule_service::DeleteSchedule {
7794 super::builder::schedule_service::DeleteSchedule::new(self.inner.clone())
7795 }
7796
7797 /// Gets a Schedule.
7798 pub fn get_schedule(&self) -> super::builder::schedule_service::GetSchedule {
7799 super::builder::schedule_service::GetSchedule::new(self.inner.clone())
7800 }
7801
7802 /// Lists Schedules in a Location.
7803 pub fn list_schedules(&self) -> super::builder::schedule_service::ListSchedules {
7804 super::builder::schedule_service::ListSchedules::new(self.inner.clone())
7805 }
7806
7807 /// Pauses a Schedule. Will mark
7808 /// [Schedule.state][google.cloud.aiplatform.v1.Schedule.state] to 'PAUSED'. If
7809 /// the schedule is paused, no new runs will be created. Already created runs
7810 /// will NOT be paused or canceled.
7811 ///
7812 /// [google.cloud.aiplatform.v1.Schedule.state]: crate::model::Schedule::state
7813 pub fn pause_schedule(&self) -> super::builder::schedule_service::PauseSchedule {
7814 super::builder::schedule_service::PauseSchedule::new(self.inner.clone())
7815 }
7816
7817 /// Resumes a paused Schedule to start scheduling new runs. Will mark
7818 /// [Schedule.state][google.cloud.aiplatform.v1.Schedule.state] to 'ACTIVE'.
7819 /// Only paused Schedule can be resumed.
7820 ///
7821 /// When the Schedule is resumed, new runs will be scheduled starting from the
7822 /// next execution time after the current time based on the time_specification
7823 /// in the Schedule. If
7824 /// [Schedule.catch_up][google.cloud.aiplatform.v1.Schedule.catch_up] is set up
7825 /// true, all missed runs will be scheduled for backfill first.
7826 ///
7827 /// [google.cloud.aiplatform.v1.Schedule.catch_up]: crate::model::Schedule::catch_up
7828 /// [google.cloud.aiplatform.v1.Schedule.state]: crate::model::Schedule::state
7829 pub fn resume_schedule(&self) -> super::builder::schedule_service::ResumeSchedule {
7830 super::builder::schedule_service::ResumeSchedule::new(self.inner.clone())
7831 }
7832
7833 /// Updates an active or paused Schedule.
7834 ///
7835 /// When the Schedule is updated, new runs will be scheduled starting from the
7836 /// updated next execution time after the update time based on the
7837 /// time_specification in the updated Schedule. All unstarted runs before the
7838 /// update time will be skipped while already created runs will NOT be paused
7839 /// or canceled.
7840 pub fn update_schedule(&self) -> super::builder::schedule_service::UpdateSchedule {
7841 super::builder::schedule_service::UpdateSchedule::new(self.inner.clone())
7842 }
7843
7844 /// Lists information about the supported locations for this service.
7845 pub fn list_locations(&self) -> super::builder::schedule_service::ListLocations {
7846 super::builder::schedule_service::ListLocations::new(self.inner.clone())
7847 }
7848
7849 /// Gets information about a location.
7850 pub fn get_location(&self) -> super::builder::schedule_service::GetLocation {
7851 super::builder::schedule_service::GetLocation::new(self.inner.clone())
7852 }
7853
7854 /// Sets the access control policy on the specified resource. Replaces
7855 /// any existing policy.
7856 ///
7857 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
7858 /// errors.
7859 pub fn set_iam_policy(&self) -> super::builder::schedule_service::SetIamPolicy {
7860 super::builder::schedule_service::SetIamPolicy::new(self.inner.clone())
7861 }
7862
7863 /// Gets the access control policy for a resource. Returns an empty policy
7864 /// if the resource exists and does not have a policy set.
7865 pub fn get_iam_policy(&self) -> super::builder::schedule_service::GetIamPolicy {
7866 super::builder::schedule_service::GetIamPolicy::new(self.inner.clone())
7867 }
7868
7869 /// Returns permissions that a caller has on the specified resource. If the
7870 /// resource does not exist, this will return an empty set of
7871 /// permissions, not a `NOT_FOUND` error.
7872 ///
7873 /// Note: This operation is designed to be used for building
7874 /// permission-aware UIs and command-line tools, not for authorization
7875 /// checking. This operation may "fail open" without warning.
7876 pub fn test_iam_permissions(&self) -> super::builder::schedule_service::TestIamPermissions {
7877 super::builder::schedule_service::TestIamPermissions::new(self.inner.clone())
7878 }
7879
7880 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7881 ///
7882 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7883 pub fn list_operations(&self) -> super::builder::schedule_service::ListOperations {
7884 super::builder::schedule_service::ListOperations::new(self.inner.clone())
7885 }
7886
7887 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7888 ///
7889 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7890 pub fn get_operation(&self) -> super::builder::schedule_service::GetOperation {
7891 super::builder::schedule_service::GetOperation::new(self.inner.clone())
7892 }
7893
7894 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7895 ///
7896 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7897 pub fn delete_operation(&self) -> super::builder::schedule_service::DeleteOperation {
7898 super::builder::schedule_service::DeleteOperation::new(self.inner.clone())
7899 }
7900
7901 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7902 ///
7903 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7904 pub fn cancel_operation(&self) -> super::builder::schedule_service::CancelOperation {
7905 super::builder::schedule_service::CancelOperation::new(self.inner.clone())
7906 }
7907
7908 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7909 ///
7910 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7911 pub fn wait_operation(&self) -> super::builder::schedule_service::WaitOperation {
7912 super::builder::schedule_service::WaitOperation::new(self.inner.clone())
7913 }
7914}
7915
7916/// Implements a client for the Vertex AI API.
7917///
7918/// # Example
7919/// ```
7920/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7921/// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
7922/// let client = SpecialistPoolService::builder().build().await?;
7923/// // use `client` to make requests to the Vertex AI API.
7924/// # Ok(()) }
7925/// ```
7926///
7927/// # Service Description
7928///
7929/// A service for creating and managing Customer SpecialistPools.
7930/// When customers start Data Labeling jobs, they can reuse/create Specialist
7931/// Pools to bring their own Specialists to label the data.
7932/// Customers can add/remove Managers for the Specialist Pool on Cloud console,
7933/// then Managers will get email notifications to manage Specialists and tasks on
7934/// CrowdCompute console.
7935///
7936/// # Configuration
7937///
7938/// To configure `SpecialistPoolService` use the `with_*` methods in the type returned
7939/// by [builder()][SpecialistPoolService::builder]. The default configuration should
7940/// work for most applications. Common configuration changes include
7941///
7942/// * [with_endpoint()]: by default this client uses the global default endpoint
7943/// (`https://aiplatform.googleapis.com`). Applications using regional
7944/// endpoints or running in restricted networks (e.g. a network configured
7945// with [Private Google Access with VPC Service Controls]) may want to
7946/// override this default.
7947/// * [with_credentials()]: by default this client uses
7948/// [Application Default Credentials]. Applications using custom
7949/// authentication may need to override this default.
7950///
7951/// [with_endpoint()]: super::builder::specialist_pool_service::ClientBuilder::with_endpoint
7952/// [with_credentials()]: super::builder::specialist_pool_service::ClientBuilder::credentials
7953/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7954/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7955///
7956/// # Pooling and Cloning
7957///
7958/// `SpecialistPoolService` holds a connection pool internally, it is advised to
7959/// create one and the reuse it. You do not need to wrap `SpecialistPoolService` in
7960/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7961/// already uses an `Arc` internally.
7962#[cfg(feature = "specialist-pool-service")]
7963#[cfg_attr(docsrs, doc(cfg(feature = "specialist-pool-service")))]
7964#[derive(Clone, Debug)]
7965pub struct SpecialistPoolService {
7966 inner: std::sync::Arc<dyn super::stub::dynamic::SpecialistPoolService>,
7967}
7968
7969#[cfg(feature = "specialist-pool-service")]
7970impl SpecialistPoolService {
7971 /// Returns a builder for [SpecialistPoolService].
7972 ///
7973 /// ```
7974 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7975 /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
7976 /// let client = SpecialistPoolService::builder().build().await?;
7977 /// # Ok(()) }
7978 /// ```
7979 pub fn builder() -> super::builder::specialist_pool_service::ClientBuilder {
7980 crate::new_client_builder(super::builder::specialist_pool_service::client::Factory)
7981 }
7982
7983 /// Creates a new client from the provided stub.
7984 ///
7985 /// The most common case for calling this function is in tests mocking the
7986 /// client's behavior.
7987 pub fn from_stub<T>(stub: T) -> Self
7988 where
7989 T: super::stub::SpecialistPoolService + 'static,
7990 {
7991 Self {
7992 inner: std::sync::Arc::new(stub),
7993 }
7994 }
7995
7996 pub(crate) async fn new(
7997 config: gaxi::options::ClientConfig,
7998 ) -> crate::ClientBuilderResult<Self> {
7999 let inner = Self::build_inner(config).await?;
8000 Ok(Self { inner })
8001 }
8002
8003 async fn build_inner(
8004 conf: gaxi::options::ClientConfig,
8005 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SpecialistPoolService>>
8006 {
8007 if gaxi::options::tracing_enabled(&conf) {
8008 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8009 }
8010 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8011 }
8012
8013 async fn build_transport(
8014 conf: gaxi::options::ClientConfig,
8015 ) -> crate::ClientBuilderResult<impl super::stub::SpecialistPoolService> {
8016 super::transport::SpecialistPoolService::new(conf).await
8017 }
8018
8019 async fn build_with_tracing(
8020 conf: gaxi::options::ClientConfig,
8021 ) -> crate::ClientBuilderResult<impl super::stub::SpecialistPoolService> {
8022 Self::build_transport(conf)
8023 .await
8024 .map(super::tracing::SpecialistPoolService::new)
8025 }
8026
8027 /// Creates a SpecialistPool.
8028 ///
8029 /// # Long running operations
8030 ///
8031 /// This method is used to start, and/or poll a [long-running Operation].
8032 /// The [Working with long-running operations] chapter in the [user guide]
8033 /// covers these operations in detail.
8034 ///
8035 /// [long-running operation]: https://google.aip.dev/151
8036 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8037 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8038 pub fn create_specialist_pool(
8039 &self,
8040 ) -> super::builder::specialist_pool_service::CreateSpecialistPool {
8041 super::builder::specialist_pool_service::CreateSpecialistPool::new(self.inner.clone())
8042 }
8043
8044 /// Gets a SpecialistPool.
8045 pub fn get_specialist_pool(
8046 &self,
8047 ) -> super::builder::specialist_pool_service::GetSpecialistPool {
8048 super::builder::specialist_pool_service::GetSpecialistPool::new(self.inner.clone())
8049 }
8050
8051 /// Lists SpecialistPools in a Location.
8052 pub fn list_specialist_pools(
8053 &self,
8054 ) -> super::builder::specialist_pool_service::ListSpecialistPools {
8055 super::builder::specialist_pool_service::ListSpecialistPools::new(self.inner.clone())
8056 }
8057
8058 /// Deletes a SpecialistPool as well as all Specialists in the pool.
8059 ///
8060 /// # Long running operations
8061 ///
8062 /// This method is used to start, and/or poll a [long-running Operation].
8063 /// The [Working with long-running operations] chapter in the [user guide]
8064 /// covers these operations in detail.
8065 ///
8066 /// [long-running operation]: https://google.aip.dev/151
8067 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8068 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8069 pub fn delete_specialist_pool(
8070 &self,
8071 ) -> super::builder::specialist_pool_service::DeleteSpecialistPool {
8072 super::builder::specialist_pool_service::DeleteSpecialistPool::new(self.inner.clone())
8073 }
8074
8075 /// Updates a SpecialistPool.
8076 ///
8077 /// # Long running operations
8078 ///
8079 /// This method is used to start, and/or poll a [long-running Operation].
8080 /// The [Working with long-running operations] chapter in the [user guide]
8081 /// covers these operations in detail.
8082 ///
8083 /// [long-running operation]: https://google.aip.dev/151
8084 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8085 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8086 pub fn update_specialist_pool(
8087 &self,
8088 ) -> super::builder::specialist_pool_service::UpdateSpecialistPool {
8089 super::builder::specialist_pool_service::UpdateSpecialistPool::new(self.inner.clone())
8090 }
8091
8092 /// Lists information about the supported locations for this service.
8093 pub fn list_locations(&self) -> super::builder::specialist_pool_service::ListLocations {
8094 super::builder::specialist_pool_service::ListLocations::new(self.inner.clone())
8095 }
8096
8097 /// Gets information about a location.
8098 pub fn get_location(&self) -> super::builder::specialist_pool_service::GetLocation {
8099 super::builder::specialist_pool_service::GetLocation::new(self.inner.clone())
8100 }
8101
8102 /// Sets the access control policy on the specified resource. Replaces
8103 /// any existing policy.
8104 ///
8105 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
8106 /// errors.
8107 pub fn set_iam_policy(&self) -> super::builder::specialist_pool_service::SetIamPolicy {
8108 super::builder::specialist_pool_service::SetIamPolicy::new(self.inner.clone())
8109 }
8110
8111 /// Gets the access control policy for a resource. Returns an empty policy
8112 /// if the resource exists and does not have a policy set.
8113 pub fn get_iam_policy(&self) -> super::builder::specialist_pool_service::GetIamPolicy {
8114 super::builder::specialist_pool_service::GetIamPolicy::new(self.inner.clone())
8115 }
8116
8117 /// Returns permissions that a caller has on the specified resource. If the
8118 /// resource does not exist, this will return an empty set of
8119 /// permissions, not a `NOT_FOUND` error.
8120 ///
8121 /// Note: This operation is designed to be used for building
8122 /// permission-aware UIs and command-line tools, not for authorization
8123 /// checking. This operation may "fail open" without warning.
8124 pub fn test_iam_permissions(
8125 &self,
8126 ) -> super::builder::specialist_pool_service::TestIamPermissions {
8127 super::builder::specialist_pool_service::TestIamPermissions::new(self.inner.clone())
8128 }
8129
8130 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8131 ///
8132 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8133 pub fn list_operations(&self) -> super::builder::specialist_pool_service::ListOperations {
8134 super::builder::specialist_pool_service::ListOperations::new(self.inner.clone())
8135 }
8136
8137 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8138 ///
8139 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8140 pub fn get_operation(&self) -> super::builder::specialist_pool_service::GetOperation {
8141 super::builder::specialist_pool_service::GetOperation::new(self.inner.clone())
8142 }
8143
8144 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8145 ///
8146 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8147 pub fn delete_operation(&self) -> super::builder::specialist_pool_service::DeleteOperation {
8148 super::builder::specialist_pool_service::DeleteOperation::new(self.inner.clone())
8149 }
8150
8151 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8152 ///
8153 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8154 pub fn cancel_operation(&self) -> super::builder::specialist_pool_service::CancelOperation {
8155 super::builder::specialist_pool_service::CancelOperation::new(self.inner.clone())
8156 }
8157
8158 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8159 ///
8160 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8161 pub fn wait_operation(&self) -> super::builder::specialist_pool_service::WaitOperation {
8162 super::builder::specialist_pool_service::WaitOperation::new(self.inner.clone())
8163 }
8164}
8165
8166/// Implements a client for the Vertex AI API.
8167///
8168/// # Example
8169/// ```
8170/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8171/// # use google_cloud_aiplatform_v1::client::TensorboardService;
8172/// let client = TensorboardService::builder().build().await?;
8173/// // use `client` to make requests to the Vertex AI API.
8174/// # Ok(()) }
8175/// ```
8176///
8177/// # Service Description
8178///
8179/// TensorboardService
8180///
8181/// # Configuration
8182///
8183/// To configure `TensorboardService` use the `with_*` methods in the type returned
8184/// by [builder()][TensorboardService::builder]. The default configuration should
8185/// work for most applications. Common configuration changes include
8186///
8187/// * [with_endpoint()]: by default this client uses the global default endpoint
8188/// (`https://aiplatform.googleapis.com`). Applications using regional
8189/// endpoints or running in restricted networks (e.g. a network configured
8190// with [Private Google Access with VPC Service Controls]) may want to
8191/// override this default.
8192/// * [with_credentials()]: by default this client uses
8193/// [Application Default Credentials]. Applications using custom
8194/// authentication may need to override this default.
8195///
8196/// [with_endpoint()]: super::builder::tensorboard_service::ClientBuilder::with_endpoint
8197/// [with_credentials()]: super::builder::tensorboard_service::ClientBuilder::credentials
8198/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8199/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8200///
8201/// # Pooling and Cloning
8202///
8203/// `TensorboardService` holds a connection pool internally, it is advised to
8204/// create one and the reuse it. You do not need to wrap `TensorboardService` in
8205/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8206/// already uses an `Arc` internally.
8207#[cfg(feature = "tensorboard-service")]
8208#[cfg_attr(docsrs, doc(cfg(feature = "tensorboard-service")))]
8209#[derive(Clone, Debug)]
8210pub struct TensorboardService {
8211 inner: std::sync::Arc<dyn super::stub::dynamic::TensorboardService>,
8212}
8213
8214#[cfg(feature = "tensorboard-service")]
8215impl TensorboardService {
8216 /// Returns a builder for [TensorboardService].
8217 ///
8218 /// ```
8219 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8220 /// # use google_cloud_aiplatform_v1::client::TensorboardService;
8221 /// let client = TensorboardService::builder().build().await?;
8222 /// # Ok(()) }
8223 /// ```
8224 pub fn builder() -> super::builder::tensorboard_service::ClientBuilder {
8225 crate::new_client_builder(super::builder::tensorboard_service::client::Factory)
8226 }
8227
8228 /// Creates a new client from the provided stub.
8229 ///
8230 /// The most common case for calling this function is in tests mocking the
8231 /// client's behavior.
8232 pub fn from_stub<T>(stub: T) -> Self
8233 where
8234 T: super::stub::TensorboardService + 'static,
8235 {
8236 Self {
8237 inner: std::sync::Arc::new(stub),
8238 }
8239 }
8240
8241 pub(crate) async fn new(
8242 config: gaxi::options::ClientConfig,
8243 ) -> crate::ClientBuilderResult<Self> {
8244 let inner = Self::build_inner(config).await?;
8245 Ok(Self { inner })
8246 }
8247
8248 async fn build_inner(
8249 conf: gaxi::options::ClientConfig,
8250 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TensorboardService>>
8251 {
8252 if gaxi::options::tracing_enabled(&conf) {
8253 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8254 }
8255 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8256 }
8257
8258 async fn build_transport(
8259 conf: gaxi::options::ClientConfig,
8260 ) -> crate::ClientBuilderResult<impl super::stub::TensorboardService> {
8261 super::transport::TensorboardService::new(conf).await
8262 }
8263
8264 async fn build_with_tracing(
8265 conf: gaxi::options::ClientConfig,
8266 ) -> crate::ClientBuilderResult<impl super::stub::TensorboardService> {
8267 Self::build_transport(conf)
8268 .await
8269 .map(super::tracing::TensorboardService::new)
8270 }
8271
8272 /// Creates a Tensorboard.
8273 ///
8274 /// # Long running operations
8275 ///
8276 /// This method is used to start, and/or poll a [long-running Operation].
8277 /// The [Working with long-running operations] chapter in the [user guide]
8278 /// covers these operations in detail.
8279 ///
8280 /// [long-running operation]: https://google.aip.dev/151
8281 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8282 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8283 pub fn create_tensorboard(&self) -> super::builder::tensorboard_service::CreateTensorboard {
8284 super::builder::tensorboard_service::CreateTensorboard::new(self.inner.clone())
8285 }
8286
8287 /// Gets a Tensorboard.
8288 pub fn get_tensorboard(&self) -> super::builder::tensorboard_service::GetTensorboard {
8289 super::builder::tensorboard_service::GetTensorboard::new(self.inner.clone())
8290 }
8291
8292 /// Updates a Tensorboard.
8293 ///
8294 /// # Long running operations
8295 ///
8296 /// This method is used to start, and/or poll a [long-running Operation].
8297 /// The [Working with long-running operations] chapter in the [user guide]
8298 /// covers these operations in detail.
8299 ///
8300 /// [long-running operation]: https://google.aip.dev/151
8301 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8302 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8303 pub fn update_tensorboard(&self) -> super::builder::tensorboard_service::UpdateTensorboard {
8304 super::builder::tensorboard_service::UpdateTensorboard::new(self.inner.clone())
8305 }
8306
8307 /// Lists Tensorboards in a Location.
8308 pub fn list_tensorboards(&self) -> super::builder::tensorboard_service::ListTensorboards {
8309 super::builder::tensorboard_service::ListTensorboards::new(self.inner.clone())
8310 }
8311
8312 /// Deletes a Tensorboard.
8313 ///
8314 /// # Long running operations
8315 ///
8316 /// This method is used to start, and/or poll a [long-running Operation].
8317 /// The [Working with long-running operations] chapter in the [user guide]
8318 /// covers these operations in detail.
8319 ///
8320 /// [long-running operation]: https://google.aip.dev/151
8321 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8322 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8323 pub fn delete_tensorboard(&self) -> super::builder::tensorboard_service::DeleteTensorboard {
8324 super::builder::tensorboard_service::DeleteTensorboard::new(self.inner.clone())
8325 }
8326
8327 /// Returns a list of monthly active users for a given TensorBoard instance.
8328 pub fn read_tensorboard_usage(
8329 &self,
8330 ) -> super::builder::tensorboard_service::ReadTensorboardUsage {
8331 super::builder::tensorboard_service::ReadTensorboardUsage::new(self.inner.clone())
8332 }
8333
8334 /// Returns the storage size for a given TensorBoard instance.
8335 pub fn read_tensorboard_size(
8336 &self,
8337 ) -> super::builder::tensorboard_service::ReadTensorboardSize {
8338 super::builder::tensorboard_service::ReadTensorboardSize::new(self.inner.clone())
8339 }
8340
8341 /// Creates a TensorboardExperiment.
8342 pub fn create_tensorboard_experiment(
8343 &self,
8344 ) -> super::builder::tensorboard_service::CreateTensorboardExperiment {
8345 super::builder::tensorboard_service::CreateTensorboardExperiment::new(self.inner.clone())
8346 }
8347
8348 /// Gets a TensorboardExperiment.
8349 pub fn get_tensorboard_experiment(
8350 &self,
8351 ) -> super::builder::tensorboard_service::GetTensorboardExperiment {
8352 super::builder::tensorboard_service::GetTensorboardExperiment::new(self.inner.clone())
8353 }
8354
8355 /// Updates a TensorboardExperiment.
8356 pub fn update_tensorboard_experiment(
8357 &self,
8358 ) -> super::builder::tensorboard_service::UpdateTensorboardExperiment {
8359 super::builder::tensorboard_service::UpdateTensorboardExperiment::new(self.inner.clone())
8360 }
8361
8362 /// Lists TensorboardExperiments in a Location.
8363 pub fn list_tensorboard_experiments(
8364 &self,
8365 ) -> super::builder::tensorboard_service::ListTensorboardExperiments {
8366 super::builder::tensorboard_service::ListTensorboardExperiments::new(self.inner.clone())
8367 }
8368
8369 /// Deletes a TensorboardExperiment.
8370 ///
8371 /// # Long running operations
8372 ///
8373 /// This method is used to start, and/or poll a [long-running Operation].
8374 /// The [Working with long-running operations] chapter in the [user guide]
8375 /// covers these operations in detail.
8376 ///
8377 /// [long-running operation]: https://google.aip.dev/151
8378 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8379 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8380 pub fn delete_tensorboard_experiment(
8381 &self,
8382 ) -> super::builder::tensorboard_service::DeleteTensorboardExperiment {
8383 super::builder::tensorboard_service::DeleteTensorboardExperiment::new(self.inner.clone())
8384 }
8385
8386 /// Creates a TensorboardRun.
8387 pub fn create_tensorboard_run(
8388 &self,
8389 ) -> super::builder::tensorboard_service::CreateTensorboardRun {
8390 super::builder::tensorboard_service::CreateTensorboardRun::new(self.inner.clone())
8391 }
8392
8393 /// Batch create TensorboardRuns.
8394 pub fn batch_create_tensorboard_runs(
8395 &self,
8396 ) -> super::builder::tensorboard_service::BatchCreateTensorboardRuns {
8397 super::builder::tensorboard_service::BatchCreateTensorboardRuns::new(self.inner.clone())
8398 }
8399
8400 /// Gets a TensorboardRun.
8401 pub fn get_tensorboard_run(&self) -> super::builder::tensorboard_service::GetTensorboardRun {
8402 super::builder::tensorboard_service::GetTensorboardRun::new(self.inner.clone())
8403 }
8404
8405 /// Updates a TensorboardRun.
8406 pub fn update_tensorboard_run(
8407 &self,
8408 ) -> super::builder::tensorboard_service::UpdateTensorboardRun {
8409 super::builder::tensorboard_service::UpdateTensorboardRun::new(self.inner.clone())
8410 }
8411
8412 /// Lists TensorboardRuns in a Location.
8413 pub fn list_tensorboard_runs(
8414 &self,
8415 ) -> super::builder::tensorboard_service::ListTensorboardRuns {
8416 super::builder::tensorboard_service::ListTensorboardRuns::new(self.inner.clone())
8417 }
8418
8419 /// Deletes a TensorboardRun.
8420 ///
8421 /// # Long running operations
8422 ///
8423 /// This method is used to start, and/or poll a [long-running Operation].
8424 /// The [Working with long-running operations] chapter in the [user guide]
8425 /// covers these operations in detail.
8426 ///
8427 /// [long-running operation]: https://google.aip.dev/151
8428 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8429 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8430 pub fn delete_tensorboard_run(
8431 &self,
8432 ) -> super::builder::tensorboard_service::DeleteTensorboardRun {
8433 super::builder::tensorboard_service::DeleteTensorboardRun::new(self.inner.clone())
8434 }
8435
8436 /// Batch create TensorboardTimeSeries that belong to a TensorboardExperiment.
8437 pub fn batch_create_tensorboard_time_series(
8438 &self,
8439 ) -> super::builder::tensorboard_service::BatchCreateTensorboardTimeSeries {
8440 super::builder::tensorboard_service::BatchCreateTensorboardTimeSeries::new(
8441 self.inner.clone(),
8442 )
8443 }
8444
8445 /// Creates a TensorboardTimeSeries.
8446 pub fn create_tensorboard_time_series(
8447 &self,
8448 ) -> super::builder::tensorboard_service::CreateTensorboardTimeSeries {
8449 super::builder::tensorboard_service::CreateTensorboardTimeSeries::new(self.inner.clone())
8450 }
8451
8452 /// Gets a TensorboardTimeSeries.
8453 pub fn get_tensorboard_time_series(
8454 &self,
8455 ) -> super::builder::tensorboard_service::GetTensorboardTimeSeries {
8456 super::builder::tensorboard_service::GetTensorboardTimeSeries::new(self.inner.clone())
8457 }
8458
8459 /// Updates a TensorboardTimeSeries.
8460 pub fn update_tensorboard_time_series(
8461 &self,
8462 ) -> super::builder::tensorboard_service::UpdateTensorboardTimeSeries {
8463 super::builder::tensorboard_service::UpdateTensorboardTimeSeries::new(self.inner.clone())
8464 }
8465
8466 /// Lists TensorboardTimeSeries in a Location.
8467 pub fn list_tensorboard_time_series(
8468 &self,
8469 ) -> super::builder::tensorboard_service::ListTensorboardTimeSeries {
8470 super::builder::tensorboard_service::ListTensorboardTimeSeries::new(self.inner.clone())
8471 }
8472
8473 /// Deletes a TensorboardTimeSeries.
8474 ///
8475 /// # Long running operations
8476 ///
8477 /// This method is used to start, and/or poll a [long-running Operation].
8478 /// The [Working with long-running operations] chapter in the [user guide]
8479 /// covers these operations in detail.
8480 ///
8481 /// [long-running operation]: https://google.aip.dev/151
8482 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8483 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8484 pub fn delete_tensorboard_time_series(
8485 &self,
8486 ) -> super::builder::tensorboard_service::DeleteTensorboardTimeSeries {
8487 super::builder::tensorboard_service::DeleteTensorboardTimeSeries::new(self.inner.clone())
8488 }
8489
8490 /// Reads multiple TensorboardTimeSeries' data. The data point number limit is
8491 /// 1000 for scalars, 100 for tensors and blob references. If the number of
8492 /// data points stored is less than the limit, all data is returned.
8493 /// Otherwise, the number limit of data points is randomly selected from
8494 /// this time series and returned.
8495 pub fn batch_read_tensorboard_time_series_data(
8496 &self,
8497 ) -> super::builder::tensorboard_service::BatchReadTensorboardTimeSeriesData {
8498 super::builder::tensorboard_service::BatchReadTensorboardTimeSeriesData::new(
8499 self.inner.clone(),
8500 )
8501 }
8502
8503 /// Reads a TensorboardTimeSeries' data. By default, if the number of data
8504 /// points stored is less than 1000, all data is returned. Otherwise, 1000
8505 /// data points is randomly selected from this time series and returned.
8506 /// This value can be changed by changing max_data_points, which can't be
8507 /// greater than 10k.
8508 pub fn read_tensorboard_time_series_data(
8509 &self,
8510 ) -> super::builder::tensorboard_service::ReadTensorboardTimeSeriesData {
8511 super::builder::tensorboard_service::ReadTensorboardTimeSeriesData::new(self.inner.clone())
8512 }
8513
8514 /// Write time series data points of multiple TensorboardTimeSeries in multiple
8515 /// TensorboardRun's. If any data fail to be ingested, an error is returned.
8516 pub fn write_tensorboard_experiment_data(
8517 &self,
8518 ) -> super::builder::tensorboard_service::WriteTensorboardExperimentData {
8519 super::builder::tensorboard_service::WriteTensorboardExperimentData::new(self.inner.clone())
8520 }
8521
8522 /// Write time series data points into multiple TensorboardTimeSeries under
8523 /// a TensorboardRun. If any data fail to be ingested, an error is returned.
8524 pub fn write_tensorboard_run_data(
8525 &self,
8526 ) -> super::builder::tensorboard_service::WriteTensorboardRunData {
8527 super::builder::tensorboard_service::WriteTensorboardRunData::new(self.inner.clone())
8528 }
8529
8530 /// Exports a TensorboardTimeSeries' data. Data is returned in paginated
8531 /// responses.
8532 pub fn export_tensorboard_time_series_data(
8533 &self,
8534 ) -> super::builder::tensorboard_service::ExportTensorboardTimeSeriesData {
8535 super::builder::tensorboard_service::ExportTensorboardTimeSeriesData::new(
8536 self.inner.clone(),
8537 )
8538 }
8539
8540 /// Lists information about the supported locations for this service.
8541 pub fn list_locations(&self) -> super::builder::tensorboard_service::ListLocations {
8542 super::builder::tensorboard_service::ListLocations::new(self.inner.clone())
8543 }
8544
8545 /// Gets information about a location.
8546 pub fn get_location(&self) -> super::builder::tensorboard_service::GetLocation {
8547 super::builder::tensorboard_service::GetLocation::new(self.inner.clone())
8548 }
8549
8550 /// Sets the access control policy on the specified resource. Replaces
8551 /// any existing policy.
8552 ///
8553 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
8554 /// errors.
8555 pub fn set_iam_policy(&self) -> super::builder::tensorboard_service::SetIamPolicy {
8556 super::builder::tensorboard_service::SetIamPolicy::new(self.inner.clone())
8557 }
8558
8559 /// Gets the access control policy for a resource. Returns an empty policy
8560 /// if the resource exists and does not have a policy set.
8561 pub fn get_iam_policy(&self) -> super::builder::tensorboard_service::GetIamPolicy {
8562 super::builder::tensorboard_service::GetIamPolicy::new(self.inner.clone())
8563 }
8564
8565 /// Returns permissions that a caller has on the specified resource. If the
8566 /// resource does not exist, this will return an empty set of
8567 /// permissions, not a `NOT_FOUND` error.
8568 ///
8569 /// Note: This operation is designed to be used for building
8570 /// permission-aware UIs and command-line tools, not for authorization
8571 /// checking. This operation may "fail open" without warning.
8572 pub fn test_iam_permissions(&self) -> super::builder::tensorboard_service::TestIamPermissions {
8573 super::builder::tensorboard_service::TestIamPermissions::new(self.inner.clone())
8574 }
8575
8576 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8577 ///
8578 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8579 pub fn list_operations(&self) -> super::builder::tensorboard_service::ListOperations {
8580 super::builder::tensorboard_service::ListOperations::new(self.inner.clone())
8581 }
8582
8583 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8584 ///
8585 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8586 pub fn get_operation(&self) -> super::builder::tensorboard_service::GetOperation {
8587 super::builder::tensorboard_service::GetOperation::new(self.inner.clone())
8588 }
8589
8590 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8591 ///
8592 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8593 pub fn delete_operation(&self) -> super::builder::tensorboard_service::DeleteOperation {
8594 super::builder::tensorboard_service::DeleteOperation::new(self.inner.clone())
8595 }
8596
8597 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8598 ///
8599 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8600 pub fn cancel_operation(&self) -> super::builder::tensorboard_service::CancelOperation {
8601 super::builder::tensorboard_service::CancelOperation::new(self.inner.clone())
8602 }
8603
8604 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8605 ///
8606 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8607 pub fn wait_operation(&self) -> super::builder::tensorboard_service::WaitOperation {
8608 super::builder::tensorboard_service::WaitOperation::new(self.inner.clone())
8609 }
8610}
8611
8612/// Implements a client for the Vertex AI API.
8613///
8614/// # Example
8615/// ```
8616/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8617/// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
8618/// let client = VertexRagDataService::builder().build().await?;
8619/// // use `client` to make requests to the Vertex AI API.
8620/// # Ok(()) }
8621/// ```
8622///
8623/// # Service Description
8624///
8625/// A service for managing user data for RAG.
8626///
8627/// # Configuration
8628///
8629/// To configure `VertexRagDataService` use the `with_*` methods in the type returned
8630/// by [builder()][VertexRagDataService::builder]. The default configuration should
8631/// work for most applications. Common configuration changes include
8632///
8633/// * [with_endpoint()]: by default this client uses the global default endpoint
8634/// (`https://aiplatform.googleapis.com`). Applications using regional
8635/// endpoints or running in restricted networks (e.g. a network configured
8636// with [Private Google Access with VPC Service Controls]) may want to
8637/// override this default.
8638/// * [with_credentials()]: by default this client uses
8639/// [Application Default Credentials]. Applications using custom
8640/// authentication may need to override this default.
8641///
8642/// [with_endpoint()]: super::builder::vertex_rag_data_service::ClientBuilder::with_endpoint
8643/// [with_credentials()]: super::builder::vertex_rag_data_service::ClientBuilder::credentials
8644/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8645/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8646///
8647/// # Pooling and Cloning
8648///
8649/// `VertexRagDataService` holds a connection pool internally, it is advised to
8650/// create one and the reuse it. You do not need to wrap `VertexRagDataService` in
8651/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8652/// already uses an `Arc` internally.
8653#[cfg(feature = "vertex-rag-data-service")]
8654#[cfg_attr(docsrs, doc(cfg(feature = "vertex-rag-data-service")))]
8655#[derive(Clone, Debug)]
8656pub struct VertexRagDataService {
8657 inner: std::sync::Arc<dyn super::stub::dynamic::VertexRagDataService>,
8658}
8659
8660#[cfg(feature = "vertex-rag-data-service")]
8661impl VertexRagDataService {
8662 /// Returns a builder for [VertexRagDataService].
8663 ///
8664 /// ```
8665 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8666 /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
8667 /// let client = VertexRagDataService::builder().build().await?;
8668 /// # Ok(()) }
8669 /// ```
8670 pub fn builder() -> super::builder::vertex_rag_data_service::ClientBuilder {
8671 crate::new_client_builder(super::builder::vertex_rag_data_service::client::Factory)
8672 }
8673
8674 /// Creates a new client from the provided stub.
8675 ///
8676 /// The most common case for calling this function is in tests mocking the
8677 /// client's behavior.
8678 pub fn from_stub<T>(stub: T) -> Self
8679 where
8680 T: super::stub::VertexRagDataService + 'static,
8681 {
8682 Self {
8683 inner: std::sync::Arc::new(stub),
8684 }
8685 }
8686
8687 pub(crate) async fn new(
8688 config: gaxi::options::ClientConfig,
8689 ) -> crate::ClientBuilderResult<Self> {
8690 let inner = Self::build_inner(config).await?;
8691 Ok(Self { inner })
8692 }
8693
8694 async fn build_inner(
8695 conf: gaxi::options::ClientConfig,
8696 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VertexRagDataService>>
8697 {
8698 if gaxi::options::tracing_enabled(&conf) {
8699 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8700 }
8701 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8702 }
8703
8704 async fn build_transport(
8705 conf: gaxi::options::ClientConfig,
8706 ) -> crate::ClientBuilderResult<impl super::stub::VertexRagDataService> {
8707 super::transport::VertexRagDataService::new(conf).await
8708 }
8709
8710 async fn build_with_tracing(
8711 conf: gaxi::options::ClientConfig,
8712 ) -> crate::ClientBuilderResult<impl super::stub::VertexRagDataService> {
8713 Self::build_transport(conf)
8714 .await
8715 .map(super::tracing::VertexRagDataService::new)
8716 }
8717
8718 /// Creates a RagCorpus.
8719 ///
8720 /// # Long running operations
8721 ///
8722 /// This method is used to start, and/or poll a [long-running Operation].
8723 /// The [Working with long-running operations] chapter in the [user guide]
8724 /// covers these operations in detail.
8725 ///
8726 /// [long-running operation]: https://google.aip.dev/151
8727 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8728 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8729 pub fn create_rag_corpus(&self) -> super::builder::vertex_rag_data_service::CreateRagCorpus {
8730 super::builder::vertex_rag_data_service::CreateRagCorpus::new(self.inner.clone())
8731 }
8732
8733 /// Updates a RagCorpus.
8734 ///
8735 /// # Long running operations
8736 ///
8737 /// This method is used to start, and/or poll a [long-running Operation].
8738 /// The [Working with long-running operations] chapter in the [user guide]
8739 /// covers these operations in detail.
8740 ///
8741 /// [long-running operation]: https://google.aip.dev/151
8742 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8743 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8744 pub fn update_rag_corpus(&self) -> super::builder::vertex_rag_data_service::UpdateRagCorpus {
8745 super::builder::vertex_rag_data_service::UpdateRagCorpus::new(self.inner.clone())
8746 }
8747
8748 /// Gets a RagCorpus.
8749 pub fn get_rag_corpus(&self) -> super::builder::vertex_rag_data_service::GetRagCorpus {
8750 super::builder::vertex_rag_data_service::GetRagCorpus::new(self.inner.clone())
8751 }
8752
8753 /// Lists RagCorpora in a Location.
8754 pub fn list_rag_corpora(&self) -> super::builder::vertex_rag_data_service::ListRagCorpora {
8755 super::builder::vertex_rag_data_service::ListRagCorpora::new(self.inner.clone())
8756 }
8757
8758 /// Deletes a RagCorpus.
8759 ///
8760 /// # Long running operations
8761 ///
8762 /// This method is used to start, and/or poll a [long-running Operation].
8763 /// The [Working with long-running operations] chapter in the [user guide]
8764 /// covers these operations in detail.
8765 ///
8766 /// [long-running operation]: https://google.aip.dev/151
8767 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8768 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8769 pub fn delete_rag_corpus(&self) -> super::builder::vertex_rag_data_service::DeleteRagCorpus {
8770 super::builder::vertex_rag_data_service::DeleteRagCorpus::new(self.inner.clone())
8771 }
8772
8773 /// Upload a file into a RagCorpus.
8774 pub fn upload_rag_file(&self) -> super::builder::vertex_rag_data_service::UploadRagFile {
8775 super::builder::vertex_rag_data_service::UploadRagFile::new(self.inner.clone())
8776 }
8777
8778 /// Import files from Google Cloud Storage or Google Drive into a RagCorpus.
8779 ///
8780 /// # Long running operations
8781 ///
8782 /// This method is used to start, and/or poll a [long-running Operation].
8783 /// The [Working with long-running operations] chapter in the [user guide]
8784 /// covers these operations in detail.
8785 ///
8786 /// [long-running operation]: https://google.aip.dev/151
8787 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8788 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8789 pub fn import_rag_files(&self) -> super::builder::vertex_rag_data_service::ImportRagFiles {
8790 super::builder::vertex_rag_data_service::ImportRagFiles::new(self.inner.clone())
8791 }
8792
8793 /// Gets a RagFile.
8794 pub fn get_rag_file(&self) -> super::builder::vertex_rag_data_service::GetRagFile {
8795 super::builder::vertex_rag_data_service::GetRagFile::new(self.inner.clone())
8796 }
8797
8798 /// Lists RagFiles in a RagCorpus.
8799 pub fn list_rag_files(&self) -> super::builder::vertex_rag_data_service::ListRagFiles {
8800 super::builder::vertex_rag_data_service::ListRagFiles::new(self.inner.clone())
8801 }
8802
8803 /// Deletes a RagFile.
8804 ///
8805 /// # Long running operations
8806 ///
8807 /// This method is used to start, and/or poll a [long-running Operation].
8808 /// The [Working with long-running operations] chapter in the [user guide]
8809 /// covers these operations in detail.
8810 ///
8811 /// [long-running operation]: https://google.aip.dev/151
8812 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8813 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8814 pub fn delete_rag_file(&self) -> super::builder::vertex_rag_data_service::DeleteRagFile {
8815 super::builder::vertex_rag_data_service::DeleteRagFile::new(self.inner.clone())
8816 }
8817
8818 /// Updates a RagEngineConfig.
8819 ///
8820 /// # Long running operations
8821 ///
8822 /// This method is used to start, and/or poll a [long-running Operation].
8823 /// The [Working with long-running operations] chapter in the [user guide]
8824 /// covers these operations in detail.
8825 ///
8826 /// [long-running operation]: https://google.aip.dev/151
8827 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8828 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8829 pub fn update_rag_engine_config(
8830 &self,
8831 ) -> super::builder::vertex_rag_data_service::UpdateRagEngineConfig {
8832 super::builder::vertex_rag_data_service::UpdateRagEngineConfig::new(self.inner.clone())
8833 }
8834
8835 /// Gets a RagEngineConfig.
8836 pub fn get_rag_engine_config(
8837 &self,
8838 ) -> super::builder::vertex_rag_data_service::GetRagEngineConfig {
8839 super::builder::vertex_rag_data_service::GetRagEngineConfig::new(self.inner.clone())
8840 }
8841
8842 /// Lists information about the supported locations for this service.
8843 pub fn list_locations(&self) -> super::builder::vertex_rag_data_service::ListLocations {
8844 super::builder::vertex_rag_data_service::ListLocations::new(self.inner.clone())
8845 }
8846
8847 /// Gets information about a location.
8848 pub fn get_location(&self) -> super::builder::vertex_rag_data_service::GetLocation {
8849 super::builder::vertex_rag_data_service::GetLocation::new(self.inner.clone())
8850 }
8851
8852 /// Sets the access control policy on the specified resource. Replaces
8853 /// any existing policy.
8854 ///
8855 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
8856 /// errors.
8857 pub fn set_iam_policy(&self) -> super::builder::vertex_rag_data_service::SetIamPolicy {
8858 super::builder::vertex_rag_data_service::SetIamPolicy::new(self.inner.clone())
8859 }
8860
8861 /// Gets the access control policy for a resource. Returns an empty policy
8862 /// if the resource exists and does not have a policy set.
8863 pub fn get_iam_policy(&self) -> super::builder::vertex_rag_data_service::GetIamPolicy {
8864 super::builder::vertex_rag_data_service::GetIamPolicy::new(self.inner.clone())
8865 }
8866
8867 /// Returns permissions that a caller has on the specified resource. If the
8868 /// resource does not exist, this will return an empty set of
8869 /// permissions, not a `NOT_FOUND` error.
8870 ///
8871 /// Note: This operation is designed to be used for building
8872 /// permission-aware UIs and command-line tools, not for authorization
8873 /// checking. This operation may "fail open" without warning.
8874 pub fn test_iam_permissions(
8875 &self,
8876 ) -> super::builder::vertex_rag_data_service::TestIamPermissions {
8877 super::builder::vertex_rag_data_service::TestIamPermissions::new(self.inner.clone())
8878 }
8879
8880 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8881 ///
8882 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8883 pub fn list_operations(&self) -> super::builder::vertex_rag_data_service::ListOperations {
8884 super::builder::vertex_rag_data_service::ListOperations::new(self.inner.clone())
8885 }
8886
8887 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8888 ///
8889 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8890 pub fn get_operation(&self) -> super::builder::vertex_rag_data_service::GetOperation {
8891 super::builder::vertex_rag_data_service::GetOperation::new(self.inner.clone())
8892 }
8893
8894 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8895 ///
8896 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8897 pub fn delete_operation(&self) -> super::builder::vertex_rag_data_service::DeleteOperation {
8898 super::builder::vertex_rag_data_service::DeleteOperation::new(self.inner.clone())
8899 }
8900
8901 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8902 ///
8903 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8904 pub fn cancel_operation(&self) -> super::builder::vertex_rag_data_service::CancelOperation {
8905 super::builder::vertex_rag_data_service::CancelOperation::new(self.inner.clone())
8906 }
8907
8908 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8909 ///
8910 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
8911 pub fn wait_operation(&self) -> super::builder::vertex_rag_data_service::WaitOperation {
8912 super::builder::vertex_rag_data_service::WaitOperation::new(self.inner.clone())
8913 }
8914}
8915
8916/// Implements a client for the Vertex AI API.
8917///
8918/// # Example
8919/// ```
8920/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8921/// # use google_cloud_aiplatform_v1::client::VertexRagService;
8922/// let client = VertexRagService::builder().build().await?;
8923/// // use `client` to make requests to the Vertex AI API.
8924/// # Ok(()) }
8925/// ```
8926///
8927/// # Service Description
8928///
8929/// A service for retrieving relevant contexts.
8930///
8931/// # Configuration
8932///
8933/// To configure `VertexRagService` use the `with_*` methods in the type returned
8934/// by [builder()][VertexRagService::builder]. The default configuration should
8935/// work for most applications. Common configuration changes include
8936///
8937/// * [with_endpoint()]: by default this client uses the global default endpoint
8938/// (`https://aiplatform.googleapis.com`). Applications using regional
8939/// endpoints or running in restricted networks (e.g. a network configured
8940// with [Private Google Access with VPC Service Controls]) may want to
8941/// override this default.
8942/// * [with_credentials()]: by default this client uses
8943/// [Application Default Credentials]. Applications using custom
8944/// authentication may need to override this default.
8945///
8946/// [with_endpoint()]: super::builder::vertex_rag_service::ClientBuilder::with_endpoint
8947/// [with_credentials()]: super::builder::vertex_rag_service::ClientBuilder::credentials
8948/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8949/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8950///
8951/// # Pooling and Cloning
8952///
8953/// `VertexRagService` holds a connection pool internally, it is advised to
8954/// create one and the reuse it. You do not need to wrap `VertexRagService` in
8955/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8956/// already uses an `Arc` internally.
8957#[cfg(feature = "vertex-rag-service")]
8958#[cfg_attr(docsrs, doc(cfg(feature = "vertex-rag-service")))]
8959#[derive(Clone, Debug)]
8960pub struct VertexRagService {
8961 inner: std::sync::Arc<dyn super::stub::dynamic::VertexRagService>,
8962}
8963
8964#[cfg(feature = "vertex-rag-service")]
8965impl VertexRagService {
8966 /// Returns a builder for [VertexRagService].
8967 ///
8968 /// ```
8969 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8970 /// # use google_cloud_aiplatform_v1::client::VertexRagService;
8971 /// let client = VertexRagService::builder().build().await?;
8972 /// # Ok(()) }
8973 /// ```
8974 pub fn builder() -> super::builder::vertex_rag_service::ClientBuilder {
8975 crate::new_client_builder(super::builder::vertex_rag_service::client::Factory)
8976 }
8977
8978 /// Creates a new client from the provided stub.
8979 ///
8980 /// The most common case for calling this function is in tests mocking the
8981 /// client's behavior.
8982 pub fn from_stub<T>(stub: T) -> Self
8983 where
8984 T: super::stub::VertexRagService + 'static,
8985 {
8986 Self {
8987 inner: std::sync::Arc::new(stub),
8988 }
8989 }
8990
8991 pub(crate) async fn new(
8992 config: gaxi::options::ClientConfig,
8993 ) -> crate::ClientBuilderResult<Self> {
8994 let inner = Self::build_inner(config).await?;
8995 Ok(Self { inner })
8996 }
8997
8998 async fn build_inner(
8999 conf: gaxi::options::ClientConfig,
9000 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VertexRagService>>
9001 {
9002 if gaxi::options::tracing_enabled(&conf) {
9003 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9004 }
9005 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9006 }
9007
9008 async fn build_transport(
9009 conf: gaxi::options::ClientConfig,
9010 ) -> crate::ClientBuilderResult<impl super::stub::VertexRagService> {
9011 super::transport::VertexRagService::new(conf).await
9012 }
9013
9014 async fn build_with_tracing(
9015 conf: gaxi::options::ClientConfig,
9016 ) -> crate::ClientBuilderResult<impl super::stub::VertexRagService> {
9017 Self::build_transport(conf)
9018 .await
9019 .map(super::tracing::VertexRagService::new)
9020 }
9021
9022 /// Retrieves relevant contexts for a query.
9023 pub fn retrieve_contexts(&self) -> super::builder::vertex_rag_service::RetrieveContexts {
9024 super::builder::vertex_rag_service::RetrieveContexts::new(self.inner.clone())
9025 }
9026
9027 /// Given an input prompt, it returns augmented prompt from vertex rag store
9028 /// to guide LLM towards generating grounded responses.
9029 pub fn augment_prompt(&self) -> super::builder::vertex_rag_service::AugmentPrompt {
9030 super::builder::vertex_rag_service::AugmentPrompt::new(self.inner.clone())
9031 }
9032
9033 /// Given an input text, it returns a score that evaluates the factuality of
9034 /// the text. It also extracts and returns claims from the text and provides
9035 /// supporting facts.
9036 pub fn corroborate_content(&self) -> super::builder::vertex_rag_service::CorroborateContent {
9037 super::builder::vertex_rag_service::CorroborateContent::new(self.inner.clone())
9038 }
9039
9040 /// Lists information about the supported locations for this service.
9041 pub fn list_locations(&self) -> super::builder::vertex_rag_service::ListLocations {
9042 super::builder::vertex_rag_service::ListLocations::new(self.inner.clone())
9043 }
9044
9045 /// Gets information about a location.
9046 pub fn get_location(&self) -> super::builder::vertex_rag_service::GetLocation {
9047 super::builder::vertex_rag_service::GetLocation::new(self.inner.clone())
9048 }
9049
9050 /// Sets the access control policy on the specified resource. Replaces
9051 /// any existing policy.
9052 ///
9053 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
9054 /// errors.
9055 pub fn set_iam_policy(&self) -> super::builder::vertex_rag_service::SetIamPolicy {
9056 super::builder::vertex_rag_service::SetIamPolicy::new(self.inner.clone())
9057 }
9058
9059 /// Gets the access control policy for a resource. Returns an empty policy
9060 /// if the resource exists and does not have a policy set.
9061 pub fn get_iam_policy(&self) -> super::builder::vertex_rag_service::GetIamPolicy {
9062 super::builder::vertex_rag_service::GetIamPolicy::new(self.inner.clone())
9063 }
9064
9065 /// Returns permissions that a caller has on the specified resource. If the
9066 /// resource does not exist, this will return an empty set of
9067 /// permissions, not a `NOT_FOUND` error.
9068 ///
9069 /// Note: This operation is designed to be used for building
9070 /// permission-aware UIs and command-line tools, not for authorization
9071 /// checking. This operation may "fail open" without warning.
9072 pub fn test_iam_permissions(&self) -> super::builder::vertex_rag_service::TestIamPermissions {
9073 super::builder::vertex_rag_service::TestIamPermissions::new(self.inner.clone())
9074 }
9075
9076 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9077 ///
9078 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9079 pub fn list_operations(&self) -> super::builder::vertex_rag_service::ListOperations {
9080 super::builder::vertex_rag_service::ListOperations::new(self.inner.clone())
9081 }
9082
9083 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9084 ///
9085 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9086 pub fn get_operation(&self) -> super::builder::vertex_rag_service::GetOperation {
9087 super::builder::vertex_rag_service::GetOperation::new(self.inner.clone())
9088 }
9089
9090 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9091 ///
9092 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9093 pub fn delete_operation(&self) -> super::builder::vertex_rag_service::DeleteOperation {
9094 super::builder::vertex_rag_service::DeleteOperation::new(self.inner.clone())
9095 }
9096
9097 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9098 ///
9099 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9100 pub fn cancel_operation(&self) -> super::builder::vertex_rag_service::CancelOperation {
9101 super::builder::vertex_rag_service::CancelOperation::new(self.inner.clone())
9102 }
9103
9104 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9105 ///
9106 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9107 pub fn wait_operation(&self) -> super::builder::vertex_rag_service::WaitOperation {
9108 super::builder::vertex_rag_service::WaitOperation::new(self.inner.clone())
9109 }
9110}
9111
9112/// Implements a client for the Vertex AI API.
9113///
9114/// # Example
9115/// ```
9116/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9117/// # use google_cloud_aiplatform_v1::client::VizierService;
9118/// let client = VizierService::builder().build().await?;
9119/// // use `client` to make requests to the Vertex AI API.
9120/// # Ok(()) }
9121/// ```
9122///
9123/// # Service Description
9124///
9125/// Vertex AI Vizier API.
9126///
9127/// Vertex AI Vizier is a service to solve blackbox optimization problems,
9128/// such as tuning machine learning hyperparameters and searching over deep
9129/// learning architectures.
9130///
9131/// # Configuration
9132///
9133/// To configure `VizierService` use the `with_*` methods in the type returned
9134/// by [builder()][VizierService::builder]. The default configuration should
9135/// work for most applications. Common configuration changes include
9136///
9137/// * [with_endpoint()]: by default this client uses the global default endpoint
9138/// (`https://aiplatform.googleapis.com`). Applications using regional
9139/// endpoints or running in restricted networks (e.g. a network configured
9140// with [Private Google Access with VPC Service Controls]) may want to
9141/// override this default.
9142/// * [with_credentials()]: by default this client uses
9143/// [Application Default Credentials]. Applications using custom
9144/// authentication may need to override this default.
9145///
9146/// [with_endpoint()]: super::builder::vizier_service::ClientBuilder::with_endpoint
9147/// [with_credentials()]: super::builder::vizier_service::ClientBuilder::credentials
9148/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9149/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9150///
9151/// # Pooling and Cloning
9152///
9153/// `VizierService` holds a connection pool internally, it is advised to
9154/// create one and the reuse it. You do not need to wrap `VizierService` in
9155/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9156/// already uses an `Arc` internally.
9157#[cfg(feature = "vizier-service")]
9158#[cfg_attr(docsrs, doc(cfg(feature = "vizier-service")))]
9159#[derive(Clone, Debug)]
9160pub struct VizierService {
9161 inner: std::sync::Arc<dyn super::stub::dynamic::VizierService>,
9162}
9163
9164#[cfg(feature = "vizier-service")]
9165impl VizierService {
9166 /// Returns a builder for [VizierService].
9167 ///
9168 /// ```
9169 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9170 /// # use google_cloud_aiplatform_v1::client::VizierService;
9171 /// let client = VizierService::builder().build().await?;
9172 /// # Ok(()) }
9173 /// ```
9174 pub fn builder() -> super::builder::vizier_service::ClientBuilder {
9175 crate::new_client_builder(super::builder::vizier_service::client::Factory)
9176 }
9177
9178 /// Creates a new client from the provided stub.
9179 ///
9180 /// The most common case for calling this function is in tests mocking the
9181 /// client's behavior.
9182 pub fn from_stub<T>(stub: T) -> Self
9183 where
9184 T: super::stub::VizierService + 'static,
9185 {
9186 Self {
9187 inner: std::sync::Arc::new(stub),
9188 }
9189 }
9190
9191 pub(crate) async fn new(
9192 config: gaxi::options::ClientConfig,
9193 ) -> crate::ClientBuilderResult<Self> {
9194 let inner = Self::build_inner(config).await?;
9195 Ok(Self { inner })
9196 }
9197
9198 async fn build_inner(
9199 conf: gaxi::options::ClientConfig,
9200 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VizierService>> {
9201 if gaxi::options::tracing_enabled(&conf) {
9202 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9203 }
9204 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9205 }
9206
9207 async fn build_transport(
9208 conf: gaxi::options::ClientConfig,
9209 ) -> crate::ClientBuilderResult<impl super::stub::VizierService> {
9210 super::transport::VizierService::new(conf).await
9211 }
9212
9213 async fn build_with_tracing(
9214 conf: gaxi::options::ClientConfig,
9215 ) -> crate::ClientBuilderResult<impl super::stub::VizierService> {
9216 Self::build_transport(conf)
9217 .await
9218 .map(super::tracing::VizierService::new)
9219 }
9220
9221 /// Creates a Study. A resource name will be generated after creation of the
9222 /// Study.
9223 pub fn create_study(&self) -> super::builder::vizier_service::CreateStudy {
9224 super::builder::vizier_service::CreateStudy::new(self.inner.clone())
9225 }
9226
9227 /// Gets a Study by name.
9228 pub fn get_study(&self) -> super::builder::vizier_service::GetStudy {
9229 super::builder::vizier_service::GetStudy::new(self.inner.clone())
9230 }
9231
9232 /// Lists all the studies in a region for an associated project.
9233 pub fn list_studies(&self) -> super::builder::vizier_service::ListStudies {
9234 super::builder::vizier_service::ListStudies::new(self.inner.clone())
9235 }
9236
9237 /// Deletes a Study.
9238 pub fn delete_study(&self) -> super::builder::vizier_service::DeleteStudy {
9239 super::builder::vizier_service::DeleteStudy::new(self.inner.clone())
9240 }
9241
9242 /// Looks a study up using the user-defined display_name field instead of the
9243 /// fully qualified resource name.
9244 pub fn lookup_study(&self) -> super::builder::vizier_service::LookupStudy {
9245 super::builder::vizier_service::LookupStudy::new(self.inner.clone())
9246 }
9247
9248 /// Adds one or more Trials to a Study, with parameter values
9249 /// suggested by Vertex AI Vizier. Returns a long-running
9250 /// operation associated with the generation of Trial suggestions.
9251 /// When this long-running operation succeeds, it will contain
9252 /// a
9253 /// [SuggestTrialsResponse][google.cloud.aiplatform.v1.SuggestTrialsResponse].
9254 ///
9255 /// [google.cloud.aiplatform.v1.SuggestTrialsResponse]: crate::model::SuggestTrialsResponse
9256 ///
9257 /// # Long running operations
9258 ///
9259 /// This method is used to start, and/or poll a [long-running Operation].
9260 /// The [Working with long-running operations] chapter in the [user guide]
9261 /// covers these operations in detail.
9262 ///
9263 /// [long-running operation]: https://google.aip.dev/151
9264 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
9265 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
9266 pub fn suggest_trials(&self) -> super::builder::vizier_service::SuggestTrials {
9267 super::builder::vizier_service::SuggestTrials::new(self.inner.clone())
9268 }
9269
9270 /// Adds a user provided Trial to a Study.
9271 pub fn create_trial(&self) -> super::builder::vizier_service::CreateTrial {
9272 super::builder::vizier_service::CreateTrial::new(self.inner.clone())
9273 }
9274
9275 /// Gets a Trial.
9276 pub fn get_trial(&self) -> super::builder::vizier_service::GetTrial {
9277 super::builder::vizier_service::GetTrial::new(self.inner.clone())
9278 }
9279
9280 /// Lists the Trials associated with a Study.
9281 pub fn list_trials(&self) -> super::builder::vizier_service::ListTrials {
9282 super::builder::vizier_service::ListTrials::new(self.inner.clone())
9283 }
9284
9285 /// Adds a measurement of the objective metrics to a Trial. This measurement
9286 /// is assumed to have been taken before the Trial is complete.
9287 pub fn add_trial_measurement(&self) -> super::builder::vizier_service::AddTrialMeasurement {
9288 super::builder::vizier_service::AddTrialMeasurement::new(self.inner.clone())
9289 }
9290
9291 /// Marks a Trial as complete.
9292 pub fn complete_trial(&self) -> super::builder::vizier_service::CompleteTrial {
9293 super::builder::vizier_service::CompleteTrial::new(self.inner.clone())
9294 }
9295
9296 /// Deletes a Trial.
9297 pub fn delete_trial(&self) -> super::builder::vizier_service::DeleteTrial {
9298 super::builder::vizier_service::DeleteTrial::new(self.inner.clone())
9299 }
9300
9301 /// Checks whether a Trial should stop or not. Returns a
9302 /// long-running operation. When the operation is successful,
9303 /// it will contain a
9304 /// [CheckTrialEarlyStoppingStateResponse][google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateResponse].
9305 ///
9306 /// [google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateResponse]: crate::model::CheckTrialEarlyStoppingStateResponse
9307 ///
9308 /// # Long running operations
9309 ///
9310 /// This method is used to start, and/or poll a [long-running Operation].
9311 /// The [Working with long-running operations] chapter in the [user guide]
9312 /// covers these operations in detail.
9313 ///
9314 /// [long-running operation]: https://google.aip.dev/151
9315 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
9316 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
9317 pub fn check_trial_early_stopping_state(
9318 &self,
9319 ) -> super::builder::vizier_service::CheckTrialEarlyStoppingState {
9320 super::builder::vizier_service::CheckTrialEarlyStoppingState::new(self.inner.clone())
9321 }
9322
9323 /// Stops a Trial.
9324 pub fn stop_trial(&self) -> super::builder::vizier_service::StopTrial {
9325 super::builder::vizier_service::StopTrial::new(self.inner.clone())
9326 }
9327
9328 /// Lists the pareto-optimal Trials for multi-objective Study or the
9329 /// optimal Trials for single-objective Study. The definition of
9330 /// pareto-optimal can be checked in wiki page.
9331 /// <https://en.wikipedia.org/wiki/Pareto_efficiency>
9332 pub fn list_optimal_trials(&self) -> super::builder::vizier_service::ListOptimalTrials {
9333 super::builder::vizier_service::ListOptimalTrials::new(self.inner.clone())
9334 }
9335
9336 /// Lists information about the supported locations for this service.
9337 pub fn list_locations(&self) -> super::builder::vizier_service::ListLocations {
9338 super::builder::vizier_service::ListLocations::new(self.inner.clone())
9339 }
9340
9341 /// Gets information about a location.
9342 pub fn get_location(&self) -> super::builder::vizier_service::GetLocation {
9343 super::builder::vizier_service::GetLocation::new(self.inner.clone())
9344 }
9345
9346 /// Sets the access control policy on the specified resource. Replaces
9347 /// any existing policy.
9348 ///
9349 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
9350 /// errors.
9351 pub fn set_iam_policy(&self) -> super::builder::vizier_service::SetIamPolicy {
9352 super::builder::vizier_service::SetIamPolicy::new(self.inner.clone())
9353 }
9354
9355 /// Gets the access control policy for a resource. Returns an empty policy
9356 /// if the resource exists and does not have a policy set.
9357 pub fn get_iam_policy(&self) -> super::builder::vizier_service::GetIamPolicy {
9358 super::builder::vizier_service::GetIamPolicy::new(self.inner.clone())
9359 }
9360
9361 /// Returns permissions that a caller has on the specified resource. If the
9362 /// resource does not exist, this will return an empty set of
9363 /// permissions, not a `NOT_FOUND` error.
9364 ///
9365 /// Note: This operation is designed to be used for building
9366 /// permission-aware UIs and command-line tools, not for authorization
9367 /// checking. This operation may "fail open" without warning.
9368 pub fn test_iam_permissions(&self) -> super::builder::vizier_service::TestIamPermissions {
9369 super::builder::vizier_service::TestIamPermissions::new(self.inner.clone())
9370 }
9371
9372 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9373 ///
9374 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9375 pub fn list_operations(&self) -> super::builder::vizier_service::ListOperations {
9376 super::builder::vizier_service::ListOperations::new(self.inner.clone())
9377 }
9378
9379 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9380 ///
9381 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9382 pub fn get_operation(&self) -> super::builder::vizier_service::GetOperation {
9383 super::builder::vizier_service::GetOperation::new(self.inner.clone())
9384 }
9385
9386 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9387 ///
9388 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9389 pub fn delete_operation(&self) -> super::builder::vizier_service::DeleteOperation {
9390 super::builder::vizier_service::DeleteOperation::new(self.inner.clone())
9391 }
9392
9393 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9394 ///
9395 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9396 pub fn cancel_operation(&self) -> super::builder::vizier_service::CancelOperation {
9397 super::builder::vizier_service::CancelOperation::new(self.inner.clone())
9398 }
9399
9400 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9401 ///
9402 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9403 pub fn wait_operation(&self) -> super::builder::vizier_service::WaitOperation {
9404 super::builder::vizier_service::WaitOperation::new(self.inner.clone())
9405 }
9406}