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#[cfg(any(
21 feature = "dataset-service",
22 feature = "deployment-resource-pool-service",
23 feature = "endpoint-service",
24 feature = "evaluation-service",
25 feature = "feature-online-store-admin-service",
26 feature = "feature-online-store-service",
27 feature = "feature-registry-service",
28 feature = "featurestore-online-serving-service",
29 feature = "featurestore-service",
30 feature = "gen-ai-cache-service",
31 feature = "gen-ai-tuning-service",
32 feature = "index-endpoint-service",
33 feature = "index-service",
34 feature = "job-service",
35 feature = "llm-utility-service",
36 feature = "match-service",
37 feature = "metadata-service",
38 feature = "migration-service",
39 feature = "model-garden-service",
40 feature = "model-service",
41 feature = "notebook-service",
42 feature = "persistent-resource-service",
43 feature = "pipeline-service",
44 feature = "prediction-service",
45 feature = "reasoning-engine-execution-service",
46 feature = "reasoning-engine-service",
47 feature = "schedule-service",
48 feature = "specialist-pool-service",
49 feature = "tensorboard-service",
50 feature = "vertex-rag-data-service",
51 feature = "vertex-rag-service",
52 feature = "vizier-service",
53))]
54use crate::Result;
55
56/// Implements a client for the Vertex AI API.
57///
58/// # Example
59/// ```
60/// # tokio_test::block_on(async {
61/// # use google_cloud_aiplatform_v1::client::DatasetService;
62/// let client = DatasetService::builder().build().await?;
63/// // use `client` to make requests to the Vertex AI API.
64/// # gax::Result::<()>::Ok(()) });
65/// ```
66///
67/// # Service Description
68///
69/// The service that manages Vertex AI Dataset and its child resources.
70///
71/// # Configuration
72///
73/// To configure `DatasetService` use the `with_*` methods in the type returned
74/// by [builder()][DatasetService::builder]. The default configuration should
75/// work for most applications. Common configuration changes include
76///
77/// * [with_endpoint()]: by default this client uses the global default endpoint
78/// (`https://aiplatform.googleapis.com`). Applications using regional
79/// endpoints or running in restricted networks (e.g. a network configured
80// with [Private Google Access with VPC Service Controls]) may want to
81/// override this default.
82/// * [with_credentials()]: by default this client uses
83/// [Application Default Credentials]. Applications using custom
84/// authentication may need to override this default.
85///
86/// [with_endpoint()]: super::builder::dataset_service::ClientBuilder::with_endpoint
87/// [with_credentials()]: super::builder::dataset_service::ClientBuilder::credentials
88/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
89/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
90///
91/// # Pooling and Cloning
92///
93/// `DatasetService` holds a connection pool internally, it is advised to
94/// create one and the reuse it. You do not need to wrap `DatasetService` in
95/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
96/// already uses an `Arc` internally.
97#[cfg(feature = "dataset-service")]
98#[cfg_attr(docsrs, doc(cfg(feature = "dataset-service")))]
99#[derive(Clone, Debug)]
100pub struct DatasetService {
101 inner: std::sync::Arc<dyn super::stub::dynamic::DatasetService>,
102}
103
104#[cfg(feature = "dataset-service")]
105impl DatasetService {
106 /// Returns a builder for [DatasetService].
107 ///
108 /// ```
109 /// # tokio_test::block_on(async {
110 /// # use google_cloud_aiplatform_v1::client::DatasetService;
111 /// let client = DatasetService::builder().build().await?;
112 /// # gax::Result::<()>::Ok(()) });
113 /// ```
114 pub fn builder() -> super::builder::dataset_service::ClientBuilder {
115 gax::client_builder::internal::new_builder(super::builder::dataset_service::client::Factory)
116 }
117
118 /// Creates a new client from the provided stub.
119 ///
120 /// The most common case for calling this function is in tests mocking the
121 /// client's behavior.
122 pub fn from_stub<T>(stub: T) -> Self
123 where
124 T: super::stub::DatasetService + 'static,
125 {
126 Self {
127 inner: std::sync::Arc::new(stub),
128 }
129 }
130
131 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
132 let inner = Self::build_inner(config).await?;
133 Ok(Self { inner })
134 }
135
136 async fn build_inner(
137 conf: gaxi::options::ClientConfig,
138 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::DatasetService>> {
139 if gaxi::options::tracing_enabled(&conf) {
140 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
141 }
142 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
143 }
144
145 async fn build_transport(
146 conf: gaxi::options::ClientConfig,
147 ) -> Result<impl super::stub::DatasetService> {
148 super::transport::DatasetService::new(conf).await
149 }
150
151 async fn build_with_tracing(
152 conf: gaxi::options::ClientConfig,
153 ) -> Result<impl super::stub::DatasetService> {
154 Self::build_transport(conf)
155 .await
156 .map(super::tracing::DatasetService::new)
157 }
158
159 /// Creates a Dataset.
160 ///
161 /// # Long running operations
162 ///
163 /// This method is used to start, and/or poll a [long-running Operation].
164 /// The [Working with long-running operations] chapter in the [user guide]
165 /// covers these operations in detail.
166 ///
167 /// [long-running operation]: https://google.aip.dev/151
168 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
169 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
170 pub fn create_dataset(&self) -> super::builder::dataset_service::CreateDataset {
171 super::builder::dataset_service::CreateDataset::new(self.inner.clone())
172 }
173
174 /// Gets a Dataset.
175 pub fn get_dataset(&self) -> super::builder::dataset_service::GetDataset {
176 super::builder::dataset_service::GetDataset::new(self.inner.clone())
177 }
178
179 /// Updates a Dataset.
180 pub fn update_dataset(&self) -> super::builder::dataset_service::UpdateDataset {
181 super::builder::dataset_service::UpdateDataset::new(self.inner.clone())
182 }
183
184 /// Lists Datasets in a Location.
185 pub fn list_datasets(&self) -> super::builder::dataset_service::ListDatasets {
186 super::builder::dataset_service::ListDatasets::new(self.inner.clone())
187 }
188
189 /// Deletes a Dataset.
190 ///
191 /// # Long running operations
192 ///
193 /// This method is used to start, and/or poll a [long-running Operation].
194 /// The [Working with long-running operations] chapter in the [user guide]
195 /// covers these operations in detail.
196 ///
197 /// [long-running operation]: https://google.aip.dev/151
198 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
199 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
200 pub fn delete_dataset(&self) -> super::builder::dataset_service::DeleteDataset {
201 super::builder::dataset_service::DeleteDataset::new(self.inner.clone())
202 }
203
204 /// Imports data into a Dataset.
205 ///
206 /// # Long running operations
207 ///
208 /// This method is used to start, and/or poll a [long-running Operation].
209 /// The [Working with long-running operations] chapter in the [user guide]
210 /// covers these operations in detail.
211 ///
212 /// [long-running operation]: https://google.aip.dev/151
213 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
214 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
215 pub fn import_data(&self) -> super::builder::dataset_service::ImportData {
216 super::builder::dataset_service::ImportData::new(self.inner.clone())
217 }
218
219 /// Exports data from a Dataset.
220 ///
221 /// # Long running operations
222 ///
223 /// This method is used to start, and/or poll a [long-running Operation].
224 /// The [Working with long-running operations] chapter in the [user guide]
225 /// covers these operations in detail.
226 ///
227 /// [long-running operation]: https://google.aip.dev/151
228 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
229 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
230 pub fn export_data(&self) -> super::builder::dataset_service::ExportData {
231 super::builder::dataset_service::ExportData::new(self.inner.clone())
232 }
233
234 /// Create a version from a Dataset.
235 ///
236 /// # Long running operations
237 ///
238 /// This method is used to start, and/or poll a [long-running Operation].
239 /// The [Working with long-running operations] chapter in the [user guide]
240 /// covers these operations in detail.
241 ///
242 /// [long-running operation]: https://google.aip.dev/151
243 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
244 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
245 pub fn create_dataset_version(&self) -> super::builder::dataset_service::CreateDatasetVersion {
246 super::builder::dataset_service::CreateDatasetVersion::new(self.inner.clone())
247 }
248
249 /// Updates a DatasetVersion.
250 pub fn update_dataset_version(&self) -> super::builder::dataset_service::UpdateDatasetVersion {
251 super::builder::dataset_service::UpdateDatasetVersion::new(self.inner.clone())
252 }
253
254 /// Deletes a Dataset version.
255 ///
256 /// # Long running operations
257 ///
258 /// This method is used to start, and/or poll a [long-running Operation].
259 /// The [Working with long-running operations] chapter in the [user guide]
260 /// covers these operations in detail.
261 ///
262 /// [long-running operation]: https://google.aip.dev/151
263 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
264 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
265 pub fn delete_dataset_version(&self) -> super::builder::dataset_service::DeleteDatasetVersion {
266 super::builder::dataset_service::DeleteDatasetVersion::new(self.inner.clone())
267 }
268
269 /// Gets a Dataset version.
270 pub fn get_dataset_version(&self) -> super::builder::dataset_service::GetDatasetVersion {
271 super::builder::dataset_service::GetDatasetVersion::new(self.inner.clone())
272 }
273
274 /// Lists DatasetVersions in a Dataset.
275 pub fn list_dataset_versions(&self) -> super::builder::dataset_service::ListDatasetVersions {
276 super::builder::dataset_service::ListDatasetVersions::new(self.inner.clone())
277 }
278
279 /// Restores a dataset version.
280 ///
281 /// # Long running operations
282 ///
283 /// This method is used to start, and/or poll a [long-running Operation].
284 /// The [Working with long-running operations] chapter in the [user guide]
285 /// covers these operations in detail.
286 ///
287 /// [long-running operation]: https://google.aip.dev/151
288 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
289 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
290 pub fn restore_dataset_version(
291 &self,
292 ) -> super::builder::dataset_service::RestoreDatasetVersion {
293 super::builder::dataset_service::RestoreDatasetVersion::new(self.inner.clone())
294 }
295
296 /// Lists DataItems in a Dataset.
297 pub fn list_data_items(&self) -> super::builder::dataset_service::ListDataItems {
298 super::builder::dataset_service::ListDataItems::new(self.inner.clone())
299 }
300
301 /// Searches DataItems in a Dataset.
302 pub fn search_data_items(&self) -> super::builder::dataset_service::SearchDataItems {
303 super::builder::dataset_service::SearchDataItems::new(self.inner.clone())
304 }
305
306 /// Lists SavedQueries in a Dataset.
307 pub fn list_saved_queries(&self) -> super::builder::dataset_service::ListSavedQueries {
308 super::builder::dataset_service::ListSavedQueries::new(self.inner.clone())
309 }
310
311 /// Deletes a SavedQuery.
312 ///
313 /// # Long running operations
314 ///
315 /// This method is used to start, and/or poll a [long-running Operation].
316 /// The [Working with long-running operations] chapter in the [user guide]
317 /// covers these operations in detail.
318 ///
319 /// [long-running operation]: https://google.aip.dev/151
320 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
321 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
322 pub fn delete_saved_query(&self) -> super::builder::dataset_service::DeleteSavedQuery {
323 super::builder::dataset_service::DeleteSavedQuery::new(self.inner.clone())
324 }
325
326 /// Gets an AnnotationSpec.
327 pub fn get_annotation_spec(&self) -> super::builder::dataset_service::GetAnnotationSpec {
328 super::builder::dataset_service::GetAnnotationSpec::new(self.inner.clone())
329 }
330
331 /// Lists Annotations belongs to a dataitem
332 /// This RPC is only available in InternalDatasetService. It is only used for
333 /// exporting conversation data to CCAI Insights.
334 pub fn list_annotations(&self) -> super::builder::dataset_service::ListAnnotations {
335 super::builder::dataset_service::ListAnnotations::new(self.inner.clone())
336 }
337
338 /// Lists information about the supported locations for this service.
339 pub fn list_locations(&self) -> super::builder::dataset_service::ListLocations {
340 super::builder::dataset_service::ListLocations::new(self.inner.clone())
341 }
342
343 /// Gets information about a location.
344 pub fn get_location(&self) -> super::builder::dataset_service::GetLocation {
345 super::builder::dataset_service::GetLocation::new(self.inner.clone())
346 }
347
348 /// Sets the access control policy on the specified resource. Replaces
349 /// any existing policy.
350 ///
351 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
352 /// errors.
353 pub fn set_iam_policy(&self) -> super::builder::dataset_service::SetIamPolicy {
354 super::builder::dataset_service::SetIamPolicy::new(self.inner.clone())
355 }
356
357 /// Gets the access control policy for a resource. Returns an empty policy
358 /// if the resource exists and does not have a policy set.
359 pub fn get_iam_policy(&self) -> super::builder::dataset_service::GetIamPolicy {
360 super::builder::dataset_service::GetIamPolicy::new(self.inner.clone())
361 }
362
363 /// Returns permissions that a caller has on the specified resource. If the
364 /// resource does not exist, this will return an empty set of
365 /// permissions, not a `NOT_FOUND` error.
366 ///
367 /// Note: This operation is designed to be used for building
368 /// permission-aware UIs and command-line tools, not for authorization
369 /// checking. This operation may "fail open" without warning.
370 pub fn test_iam_permissions(&self) -> super::builder::dataset_service::TestIamPermissions {
371 super::builder::dataset_service::TestIamPermissions::new(self.inner.clone())
372 }
373
374 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
375 ///
376 /// [google.longrunning.Operations]: longrunning::client::Operations
377 pub fn list_operations(&self) -> super::builder::dataset_service::ListOperations {
378 super::builder::dataset_service::ListOperations::new(self.inner.clone())
379 }
380
381 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
382 ///
383 /// [google.longrunning.Operations]: longrunning::client::Operations
384 pub fn get_operation(&self) -> super::builder::dataset_service::GetOperation {
385 super::builder::dataset_service::GetOperation::new(self.inner.clone())
386 }
387
388 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
389 ///
390 /// [google.longrunning.Operations]: longrunning::client::Operations
391 pub fn delete_operation(&self) -> super::builder::dataset_service::DeleteOperation {
392 super::builder::dataset_service::DeleteOperation::new(self.inner.clone())
393 }
394
395 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
396 ///
397 /// [google.longrunning.Operations]: longrunning::client::Operations
398 pub fn cancel_operation(&self) -> super::builder::dataset_service::CancelOperation {
399 super::builder::dataset_service::CancelOperation::new(self.inner.clone())
400 }
401
402 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
403 ///
404 /// [google.longrunning.Operations]: longrunning::client::Operations
405 pub fn wait_operation(&self) -> super::builder::dataset_service::WaitOperation {
406 super::builder::dataset_service::WaitOperation::new(self.inner.clone())
407 }
408}
409
410/// Implements a client for the Vertex AI API.
411///
412/// # Example
413/// ```
414/// # tokio_test::block_on(async {
415/// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
416/// let client = DeploymentResourcePoolService::builder().build().await?;
417/// // use `client` to make requests to the Vertex AI API.
418/// # gax::Result::<()>::Ok(()) });
419/// ```
420///
421/// # Service Description
422///
423/// A service that manages the DeploymentResourcePool resource.
424///
425/// # Configuration
426///
427/// To configure `DeploymentResourcePoolService` use the `with_*` methods in the type returned
428/// by [builder()][DeploymentResourcePoolService::builder]. The default configuration should
429/// work for most applications. Common configuration changes include
430///
431/// * [with_endpoint()]: by default this client uses the global default endpoint
432/// (`https://aiplatform.googleapis.com`). Applications using regional
433/// endpoints or running in restricted networks (e.g. a network configured
434// with [Private Google Access with VPC Service Controls]) may want to
435/// override this default.
436/// * [with_credentials()]: by default this client uses
437/// [Application Default Credentials]. Applications using custom
438/// authentication may need to override this default.
439///
440/// [with_endpoint()]: super::builder::deployment_resource_pool_service::ClientBuilder::with_endpoint
441/// [with_credentials()]: super::builder::deployment_resource_pool_service::ClientBuilder::credentials
442/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
443/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
444///
445/// # Pooling and Cloning
446///
447/// `DeploymentResourcePoolService` holds a connection pool internally, it is advised to
448/// create one and the reuse it. You do not need to wrap `DeploymentResourcePoolService` in
449/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
450/// already uses an `Arc` internally.
451#[cfg(feature = "deployment-resource-pool-service")]
452#[cfg_attr(docsrs, doc(cfg(feature = "deployment-resource-pool-service")))]
453#[derive(Clone, Debug)]
454pub struct DeploymentResourcePoolService {
455 inner: std::sync::Arc<dyn super::stub::dynamic::DeploymentResourcePoolService>,
456}
457
458#[cfg(feature = "deployment-resource-pool-service")]
459impl DeploymentResourcePoolService {
460 /// Returns a builder for [DeploymentResourcePoolService].
461 ///
462 /// ```
463 /// # tokio_test::block_on(async {
464 /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
465 /// let client = DeploymentResourcePoolService::builder().build().await?;
466 /// # gax::Result::<()>::Ok(()) });
467 /// ```
468 pub fn builder() -> super::builder::deployment_resource_pool_service::ClientBuilder {
469 gax::client_builder::internal::new_builder(
470 super::builder::deployment_resource_pool_service::client::Factory,
471 )
472 }
473
474 /// Creates a new client from the provided stub.
475 ///
476 /// The most common case for calling this function is in tests mocking the
477 /// client's behavior.
478 pub fn from_stub<T>(stub: T) -> Self
479 where
480 T: super::stub::DeploymentResourcePoolService + 'static,
481 {
482 Self {
483 inner: std::sync::Arc::new(stub),
484 }
485 }
486
487 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
488 let inner = Self::build_inner(config).await?;
489 Ok(Self { inner })
490 }
491
492 async fn build_inner(
493 conf: gaxi::options::ClientConfig,
494 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::DeploymentResourcePoolService>> {
495 if gaxi::options::tracing_enabled(&conf) {
496 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
497 }
498 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
499 }
500
501 async fn build_transport(
502 conf: gaxi::options::ClientConfig,
503 ) -> Result<impl super::stub::DeploymentResourcePoolService> {
504 super::transport::DeploymentResourcePoolService::new(conf).await
505 }
506
507 async fn build_with_tracing(
508 conf: gaxi::options::ClientConfig,
509 ) -> Result<impl super::stub::DeploymentResourcePoolService> {
510 Self::build_transport(conf)
511 .await
512 .map(super::tracing::DeploymentResourcePoolService::new)
513 }
514
515 /// Create a DeploymentResourcePool.
516 ///
517 /// # Long running operations
518 ///
519 /// This method is used to start, and/or poll a [long-running Operation].
520 /// The [Working with long-running operations] chapter in the [user guide]
521 /// covers these operations in detail.
522 ///
523 /// [long-running operation]: https://google.aip.dev/151
524 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
525 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
526 pub fn create_deployment_resource_pool(
527 &self,
528 ) -> super::builder::deployment_resource_pool_service::CreateDeploymentResourcePool {
529 super::builder::deployment_resource_pool_service::CreateDeploymentResourcePool::new(
530 self.inner.clone(),
531 )
532 }
533
534 /// Get a DeploymentResourcePool.
535 pub fn get_deployment_resource_pool(
536 &self,
537 ) -> super::builder::deployment_resource_pool_service::GetDeploymentResourcePool {
538 super::builder::deployment_resource_pool_service::GetDeploymentResourcePool::new(
539 self.inner.clone(),
540 )
541 }
542
543 /// List DeploymentResourcePools in a location.
544 pub fn list_deployment_resource_pools(
545 &self,
546 ) -> super::builder::deployment_resource_pool_service::ListDeploymentResourcePools {
547 super::builder::deployment_resource_pool_service::ListDeploymentResourcePools::new(
548 self.inner.clone(),
549 )
550 }
551
552 /// Update a DeploymentResourcePool.
553 ///
554 /// # Long running operations
555 ///
556 /// This method is used to start, and/or poll a [long-running Operation].
557 /// The [Working with long-running operations] chapter in the [user guide]
558 /// covers these operations in detail.
559 ///
560 /// [long-running operation]: https://google.aip.dev/151
561 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
562 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
563 pub fn update_deployment_resource_pool(
564 &self,
565 ) -> super::builder::deployment_resource_pool_service::UpdateDeploymentResourcePool {
566 super::builder::deployment_resource_pool_service::UpdateDeploymentResourcePool::new(
567 self.inner.clone(),
568 )
569 }
570
571 /// Delete a DeploymentResourcePool.
572 ///
573 /// # Long running operations
574 ///
575 /// This method is used to start, and/or poll a [long-running Operation].
576 /// The [Working with long-running operations] chapter in the [user guide]
577 /// covers these operations in detail.
578 ///
579 /// [long-running operation]: https://google.aip.dev/151
580 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
581 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
582 pub fn delete_deployment_resource_pool(
583 &self,
584 ) -> super::builder::deployment_resource_pool_service::DeleteDeploymentResourcePool {
585 super::builder::deployment_resource_pool_service::DeleteDeploymentResourcePool::new(
586 self.inner.clone(),
587 )
588 }
589
590 /// List DeployedModels that have been deployed on this DeploymentResourcePool.
591 pub fn query_deployed_models(
592 &self,
593 ) -> super::builder::deployment_resource_pool_service::QueryDeployedModels {
594 super::builder::deployment_resource_pool_service::QueryDeployedModels::new(
595 self.inner.clone(),
596 )
597 }
598
599 /// Lists information about the supported locations for this service.
600 pub fn list_locations(
601 &self,
602 ) -> super::builder::deployment_resource_pool_service::ListLocations {
603 super::builder::deployment_resource_pool_service::ListLocations::new(self.inner.clone())
604 }
605
606 /// Gets information about a location.
607 pub fn get_location(&self) -> super::builder::deployment_resource_pool_service::GetLocation {
608 super::builder::deployment_resource_pool_service::GetLocation::new(self.inner.clone())
609 }
610
611 /// Sets the access control policy on the specified resource. Replaces
612 /// any existing policy.
613 ///
614 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
615 /// errors.
616 pub fn set_iam_policy(&self) -> super::builder::deployment_resource_pool_service::SetIamPolicy {
617 super::builder::deployment_resource_pool_service::SetIamPolicy::new(self.inner.clone())
618 }
619
620 /// Gets the access control policy for a resource. Returns an empty policy
621 /// if the resource exists and does not have a policy set.
622 pub fn get_iam_policy(&self) -> super::builder::deployment_resource_pool_service::GetIamPolicy {
623 super::builder::deployment_resource_pool_service::GetIamPolicy::new(self.inner.clone())
624 }
625
626 /// Returns permissions that a caller has on the specified resource. If the
627 /// resource does not exist, this will return an empty set of
628 /// permissions, not a `NOT_FOUND` error.
629 ///
630 /// Note: This operation is designed to be used for building
631 /// permission-aware UIs and command-line tools, not for authorization
632 /// checking. This operation may "fail open" without warning.
633 pub fn test_iam_permissions(
634 &self,
635 ) -> super::builder::deployment_resource_pool_service::TestIamPermissions {
636 super::builder::deployment_resource_pool_service::TestIamPermissions::new(
637 self.inner.clone(),
638 )
639 }
640
641 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
642 ///
643 /// [google.longrunning.Operations]: longrunning::client::Operations
644 pub fn list_operations(
645 &self,
646 ) -> super::builder::deployment_resource_pool_service::ListOperations {
647 super::builder::deployment_resource_pool_service::ListOperations::new(self.inner.clone())
648 }
649
650 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
651 ///
652 /// [google.longrunning.Operations]: longrunning::client::Operations
653 pub fn get_operation(&self) -> super::builder::deployment_resource_pool_service::GetOperation {
654 super::builder::deployment_resource_pool_service::GetOperation::new(self.inner.clone())
655 }
656
657 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
658 ///
659 /// [google.longrunning.Operations]: longrunning::client::Operations
660 pub fn delete_operation(
661 &self,
662 ) -> super::builder::deployment_resource_pool_service::DeleteOperation {
663 super::builder::deployment_resource_pool_service::DeleteOperation::new(self.inner.clone())
664 }
665
666 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
667 ///
668 /// [google.longrunning.Operations]: longrunning::client::Operations
669 pub fn cancel_operation(
670 &self,
671 ) -> super::builder::deployment_resource_pool_service::CancelOperation {
672 super::builder::deployment_resource_pool_service::CancelOperation::new(self.inner.clone())
673 }
674
675 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
676 ///
677 /// [google.longrunning.Operations]: longrunning::client::Operations
678 pub fn wait_operation(
679 &self,
680 ) -> super::builder::deployment_resource_pool_service::WaitOperation {
681 super::builder::deployment_resource_pool_service::WaitOperation::new(self.inner.clone())
682 }
683}
684
685/// Implements a client for the Vertex AI API.
686///
687/// # Example
688/// ```
689/// # tokio_test::block_on(async {
690/// # use google_cloud_aiplatform_v1::client::EndpointService;
691/// let client = EndpointService::builder().build().await?;
692/// // use `client` to make requests to the Vertex AI API.
693/// # gax::Result::<()>::Ok(()) });
694/// ```
695///
696/// # Service Description
697///
698/// A service for managing Vertex AI's Endpoints.
699///
700/// # Configuration
701///
702/// To configure `EndpointService` use the `with_*` methods in the type returned
703/// by [builder()][EndpointService::builder]. The default configuration should
704/// work for most applications. Common configuration changes include
705///
706/// * [with_endpoint()]: by default this client uses the global default endpoint
707/// (`https://aiplatform.googleapis.com`). Applications using regional
708/// endpoints or running in restricted networks (e.g. a network configured
709// with [Private Google Access with VPC Service Controls]) may want to
710/// override this default.
711/// * [with_credentials()]: by default this client uses
712/// [Application Default Credentials]. Applications using custom
713/// authentication may need to override this default.
714///
715/// [with_endpoint()]: super::builder::endpoint_service::ClientBuilder::with_endpoint
716/// [with_credentials()]: super::builder::endpoint_service::ClientBuilder::credentials
717/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
718/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
719///
720/// # Pooling and Cloning
721///
722/// `EndpointService` holds a connection pool internally, it is advised to
723/// create one and the reuse it. You do not need to wrap `EndpointService` in
724/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
725/// already uses an `Arc` internally.
726#[cfg(feature = "endpoint-service")]
727#[cfg_attr(docsrs, doc(cfg(feature = "endpoint-service")))]
728#[derive(Clone, Debug)]
729pub struct EndpointService {
730 inner: std::sync::Arc<dyn super::stub::dynamic::EndpointService>,
731}
732
733#[cfg(feature = "endpoint-service")]
734impl EndpointService {
735 /// Returns a builder for [EndpointService].
736 ///
737 /// ```
738 /// # tokio_test::block_on(async {
739 /// # use google_cloud_aiplatform_v1::client::EndpointService;
740 /// let client = EndpointService::builder().build().await?;
741 /// # gax::Result::<()>::Ok(()) });
742 /// ```
743 pub fn builder() -> super::builder::endpoint_service::ClientBuilder {
744 gax::client_builder::internal::new_builder(
745 super::builder::endpoint_service::client::Factory,
746 )
747 }
748
749 /// Creates a new client from the provided stub.
750 ///
751 /// The most common case for calling this function is in tests mocking the
752 /// client's behavior.
753 pub fn from_stub<T>(stub: T) -> Self
754 where
755 T: super::stub::EndpointService + 'static,
756 {
757 Self {
758 inner: std::sync::Arc::new(stub),
759 }
760 }
761
762 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
763 let inner = Self::build_inner(config).await?;
764 Ok(Self { inner })
765 }
766
767 async fn build_inner(
768 conf: gaxi::options::ClientConfig,
769 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::EndpointService>> {
770 if gaxi::options::tracing_enabled(&conf) {
771 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
772 }
773 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
774 }
775
776 async fn build_transport(
777 conf: gaxi::options::ClientConfig,
778 ) -> Result<impl super::stub::EndpointService> {
779 super::transport::EndpointService::new(conf).await
780 }
781
782 async fn build_with_tracing(
783 conf: gaxi::options::ClientConfig,
784 ) -> Result<impl super::stub::EndpointService> {
785 Self::build_transport(conf)
786 .await
787 .map(super::tracing::EndpointService::new)
788 }
789
790 /// Creates an Endpoint.
791 ///
792 /// # Long running operations
793 ///
794 /// This method is used to start, and/or poll a [long-running Operation].
795 /// The [Working with long-running operations] chapter in the [user guide]
796 /// covers these operations in detail.
797 ///
798 /// [long-running operation]: https://google.aip.dev/151
799 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
800 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
801 pub fn create_endpoint(&self) -> super::builder::endpoint_service::CreateEndpoint {
802 super::builder::endpoint_service::CreateEndpoint::new(self.inner.clone())
803 }
804
805 /// Gets an Endpoint.
806 pub fn get_endpoint(&self) -> super::builder::endpoint_service::GetEndpoint {
807 super::builder::endpoint_service::GetEndpoint::new(self.inner.clone())
808 }
809
810 /// Lists Endpoints in a Location.
811 pub fn list_endpoints(&self) -> super::builder::endpoint_service::ListEndpoints {
812 super::builder::endpoint_service::ListEndpoints::new(self.inner.clone())
813 }
814
815 /// Updates an Endpoint.
816 pub fn update_endpoint(&self) -> super::builder::endpoint_service::UpdateEndpoint {
817 super::builder::endpoint_service::UpdateEndpoint::new(self.inner.clone())
818 }
819
820 /// Updates an Endpoint with a long running operation.
821 ///
822 /// # Long running operations
823 ///
824 /// This method is used to start, and/or poll a [long-running Operation].
825 /// The [Working with long-running operations] chapter in the [user guide]
826 /// covers these operations in detail.
827 ///
828 /// [long-running operation]: https://google.aip.dev/151
829 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
830 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
831 pub fn update_endpoint_long_running(
832 &self,
833 ) -> super::builder::endpoint_service::UpdateEndpointLongRunning {
834 super::builder::endpoint_service::UpdateEndpointLongRunning::new(self.inner.clone())
835 }
836
837 /// Deletes an Endpoint.
838 ///
839 /// # Long running operations
840 ///
841 /// This method is used to start, and/or poll a [long-running Operation].
842 /// The [Working with long-running operations] chapter in the [user guide]
843 /// covers these operations in detail.
844 ///
845 /// [long-running operation]: https://google.aip.dev/151
846 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
847 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
848 pub fn delete_endpoint(&self) -> super::builder::endpoint_service::DeleteEndpoint {
849 super::builder::endpoint_service::DeleteEndpoint::new(self.inner.clone())
850 }
851
852 /// Deploys a Model into this Endpoint, creating a DeployedModel within it.
853 ///
854 /// # Long running operations
855 ///
856 /// This method is used to start, and/or poll a [long-running Operation].
857 /// The [Working with long-running operations] chapter in the [user guide]
858 /// covers these operations in detail.
859 ///
860 /// [long-running operation]: https://google.aip.dev/151
861 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
862 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
863 pub fn deploy_model(&self) -> super::builder::endpoint_service::DeployModel {
864 super::builder::endpoint_service::DeployModel::new(self.inner.clone())
865 }
866
867 /// Undeploys a Model from an Endpoint, removing a DeployedModel from it, and
868 /// freeing all resources it's using.
869 ///
870 /// # Long running operations
871 ///
872 /// This method is used to start, and/or poll a [long-running Operation].
873 /// The [Working with long-running operations] chapter in the [user guide]
874 /// covers these operations in detail.
875 ///
876 /// [long-running operation]: https://google.aip.dev/151
877 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
878 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
879 pub fn undeploy_model(&self) -> super::builder::endpoint_service::UndeployModel {
880 super::builder::endpoint_service::UndeployModel::new(self.inner.clone())
881 }
882
883 /// Updates an existing deployed model. Updatable fields include
884 /// `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`,
885 /// `disable_container_logging` (v1 only), and `enable_container_logging`
886 /// (v1beta1 only).
887 ///
888 /// # Long running operations
889 ///
890 /// This method is used to start, and/or poll a [long-running Operation].
891 /// The [Working with long-running operations] chapter in the [user guide]
892 /// covers these operations in detail.
893 ///
894 /// [long-running operation]: https://google.aip.dev/151
895 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
896 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
897 pub fn mutate_deployed_model(&self) -> super::builder::endpoint_service::MutateDeployedModel {
898 super::builder::endpoint_service::MutateDeployedModel::new(self.inner.clone())
899 }
900
901 /// Lists information about the supported locations for this service.
902 pub fn list_locations(&self) -> super::builder::endpoint_service::ListLocations {
903 super::builder::endpoint_service::ListLocations::new(self.inner.clone())
904 }
905
906 /// Gets information about a location.
907 pub fn get_location(&self) -> super::builder::endpoint_service::GetLocation {
908 super::builder::endpoint_service::GetLocation::new(self.inner.clone())
909 }
910
911 /// Sets the access control policy on the specified resource. Replaces
912 /// any existing policy.
913 ///
914 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
915 /// errors.
916 pub fn set_iam_policy(&self) -> super::builder::endpoint_service::SetIamPolicy {
917 super::builder::endpoint_service::SetIamPolicy::new(self.inner.clone())
918 }
919
920 /// Gets the access control policy for a resource. Returns an empty policy
921 /// if the resource exists and does not have a policy set.
922 pub fn get_iam_policy(&self) -> super::builder::endpoint_service::GetIamPolicy {
923 super::builder::endpoint_service::GetIamPolicy::new(self.inner.clone())
924 }
925
926 /// Returns permissions that a caller has on the specified resource. If the
927 /// resource does not exist, this will return an empty set of
928 /// permissions, not a `NOT_FOUND` error.
929 ///
930 /// Note: This operation is designed to be used for building
931 /// permission-aware UIs and command-line tools, not for authorization
932 /// checking. This operation may "fail open" without warning.
933 pub fn test_iam_permissions(&self) -> super::builder::endpoint_service::TestIamPermissions {
934 super::builder::endpoint_service::TestIamPermissions::new(self.inner.clone())
935 }
936
937 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
938 ///
939 /// [google.longrunning.Operations]: longrunning::client::Operations
940 pub fn list_operations(&self) -> super::builder::endpoint_service::ListOperations {
941 super::builder::endpoint_service::ListOperations::new(self.inner.clone())
942 }
943
944 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
945 ///
946 /// [google.longrunning.Operations]: longrunning::client::Operations
947 pub fn get_operation(&self) -> super::builder::endpoint_service::GetOperation {
948 super::builder::endpoint_service::GetOperation::new(self.inner.clone())
949 }
950
951 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
952 ///
953 /// [google.longrunning.Operations]: longrunning::client::Operations
954 pub fn delete_operation(&self) -> super::builder::endpoint_service::DeleteOperation {
955 super::builder::endpoint_service::DeleteOperation::new(self.inner.clone())
956 }
957
958 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
959 ///
960 /// [google.longrunning.Operations]: longrunning::client::Operations
961 pub fn cancel_operation(&self) -> super::builder::endpoint_service::CancelOperation {
962 super::builder::endpoint_service::CancelOperation::new(self.inner.clone())
963 }
964
965 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
966 ///
967 /// [google.longrunning.Operations]: longrunning::client::Operations
968 pub fn wait_operation(&self) -> super::builder::endpoint_service::WaitOperation {
969 super::builder::endpoint_service::WaitOperation::new(self.inner.clone())
970 }
971}
972
973/// Implements a client for the Vertex AI API.
974///
975/// # Example
976/// ```
977/// # tokio_test::block_on(async {
978/// # use google_cloud_aiplatform_v1::client::EvaluationService;
979/// let client = EvaluationService::builder().build().await?;
980/// // use `client` to make requests to the Vertex AI API.
981/// # gax::Result::<()>::Ok(()) });
982/// ```
983///
984/// # Service Description
985///
986/// Vertex AI Online Evaluation Service.
987///
988/// # Configuration
989///
990/// To configure `EvaluationService` use the `with_*` methods in the type returned
991/// by [builder()][EvaluationService::builder]. The default configuration should
992/// work for most applications. Common configuration changes include
993///
994/// * [with_endpoint()]: by default this client uses the global default endpoint
995/// (`https://aiplatform.googleapis.com`). Applications using regional
996/// endpoints or running in restricted networks (e.g. a network configured
997// with [Private Google Access with VPC Service Controls]) may want to
998/// override this default.
999/// * [with_credentials()]: by default this client uses
1000/// [Application Default Credentials]. Applications using custom
1001/// authentication may need to override this default.
1002///
1003/// [with_endpoint()]: super::builder::evaluation_service::ClientBuilder::with_endpoint
1004/// [with_credentials()]: super::builder::evaluation_service::ClientBuilder::credentials
1005/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1006/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1007///
1008/// # Pooling and Cloning
1009///
1010/// `EvaluationService` holds a connection pool internally, it is advised to
1011/// create one and the reuse it. You do not need to wrap `EvaluationService` in
1012/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1013/// already uses an `Arc` internally.
1014#[cfg(feature = "evaluation-service")]
1015#[cfg_attr(docsrs, doc(cfg(feature = "evaluation-service")))]
1016#[derive(Clone, Debug)]
1017pub struct EvaluationService {
1018 inner: std::sync::Arc<dyn super::stub::dynamic::EvaluationService>,
1019}
1020
1021#[cfg(feature = "evaluation-service")]
1022impl EvaluationService {
1023 /// Returns a builder for [EvaluationService].
1024 ///
1025 /// ```
1026 /// # tokio_test::block_on(async {
1027 /// # use google_cloud_aiplatform_v1::client::EvaluationService;
1028 /// let client = EvaluationService::builder().build().await?;
1029 /// # gax::Result::<()>::Ok(()) });
1030 /// ```
1031 pub fn builder() -> super::builder::evaluation_service::ClientBuilder {
1032 gax::client_builder::internal::new_builder(
1033 super::builder::evaluation_service::client::Factory,
1034 )
1035 }
1036
1037 /// Creates a new client from the provided stub.
1038 ///
1039 /// The most common case for calling this function is in tests mocking the
1040 /// client's behavior.
1041 pub fn from_stub<T>(stub: T) -> Self
1042 where
1043 T: super::stub::EvaluationService + 'static,
1044 {
1045 Self {
1046 inner: std::sync::Arc::new(stub),
1047 }
1048 }
1049
1050 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
1051 let inner = Self::build_inner(config).await?;
1052 Ok(Self { inner })
1053 }
1054
1055 async fn build_inner(
1056 conf: gaxi::options::ClientConfig,
1057 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::EvaluationService>> {
1058 if gaxi::options::tracing_enabled(&conf) {
1059 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1060 }
1061 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1062 }
1063
1064 async fn build_transport(
1065 conf: gaxi::options::ClientConfig,
1066 ) -> Result<impl super::stub::EvaluationService> {
1067 super::transport::EvaluationService::new(conf).await
1068 }
1069
1070 async fn build_with_tracing(
1071 conf: gaxi::options::ClientConfig,
1072 ) -> Result<impl super::stub::EvaluationService> {
1073 Self::build_transport(conf)
1074 .await
1075 .map(super::tracing::EvaluationService::new)
1076 }
1077
1078 /// Evaluates instances based on a given metric.
1079 pub fn evaluate_instances(&self) -> super::builder::evaluation_service::EvaluateInstances {
1080 super::builder::evaluation_service::EvaluateInstances::new(self.inner.clone())
1081 }
1082
1083 /// Lists information about the supported locations for this service.
1084 pub fn list_locations(&self) -> super::builder::evaluation_service::ListLocations {
1085 super::builder::evaluation_service::ListLocations::new(self.inner.clone())
1086 }
1087
1088 /// Gets information about a location.
1089 pub fn get_location(&self) -> super::builder::evaluation_service::GetLocation {
1090 super::builder::evaluation_service::GetLocation::new(self.inner.clone())
1091 }
1092
1093 /// Sets the access control policy on the specified resource. Replaces
1094 /// any existing policy.
1095 ///
1096 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1097 /// errors.
1098 pub fn set_iam_policy(&self) -> super::builder::evaluation_service::SetIamPolicy {
1099 super::builder::evaluation_service::SetIamPolicy::new(self.inner.clone())
1100 }
1101
1102 /// Gets the access control policy for a resource. Returns an empty policy
1103 /// if the resource exists and does not have a policy set.
1104 pub fn get_iam_policy(&self) -> super::builder::evaluation_service::GetIamPolicy {
1105 super::builder::evaluation_service::GetIamPolicy::new(self.inner.clone())
1106 }
1107
1108 /// Returns permissions that a caller has on the specified resource. If the
1109 /// resource does not exist, this will return an empty set of
1110 /// permissions, not a `NOT_FOUND` error.
1111 ///
1112 /// Note: This operation is designed to be used for building
1113 /// permission-aware UIs and command-line tools, not for authorization
1114 /// checking. This operation may "fail open" without warning.
1115 pub fn test_iam_permissions(&self) -> super::builder::evaluation_service::TestIamPermissions {
1116 super::builder::evaluation_service::TestIamPermissions::new(self.inner.clone())
1117 }
1118
1119 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1120 ///
1121 /// [google.longrunning.Operations]: longrunning::client::Operations
1122 pub fn list_operations(&self) -> super::builder::evaluation_service::ListOperations {
1123 super::builder::evaluation_service::ListOperations::new(self.inner.clone())
1124 }
1125
1126 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1127 ///
1128 /// [google.longrunning.Operations]: longrunning::client::Operations
1129 pub fn get_operation(&self) -> super::builder::evaluation_service::GetOperation {
1130 super::builder::evaluation_service::GetOperation::new(self.inner.clone())
1131 }
1132
1133 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1134 ///
1135 /// [google.longrunning.Operations]: longrunning::client::Operations
1136 pub fn delete_operation(&self) -> super::builder::evaluation_service::DeleteOperation {
1137 super::builder::evaluation_service::DeleteOperation::new(self.inner.clone())
1138 }
1139
1140 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1141 ///
1142 /// [google.longrunning.Operations]: longrunning::client::Operations
1143 pub fn cancel_operation(&self) -> super::builder::evaluation_service::CancelOperation {
1144 super::builder::evaluation_service::CancelOperation::new(self.inner.clone())
1145 }
1146
1147 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1148 ///
1149 /// [google.longrunning.Operations]: longrunning::client::Operations
1150 pub fn wait_operation(&self) -> super::builder::evaluation_service::WaitOperation {
1151 super::builder::evaluation_service::WaitOperation::new(self.inner.clone())
1152 }
1153}
1154
1155/// Implements a client for the Vertex AI API.
1156///
1157/// # Example
1158/// ```
1159/// # tokio_test::block_on(async {
1160/// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
1161/// let client = FeatureOnlineStoreAdminService::builder().build().await?;
1162/// // use `client` to make requests to the Vertex AI API.
1163/// # gax::Result::<()>::Ok(()) });
1164/// ```
1165///
1166/// # Service Description
1167///
1168/// The service that handles CRUD and List for resources for
1169/// FeatureOnlineStore.
1170///
1171/// # Configuration
1172///
1173/// To configure `FeatureOnlineStoreAdminService` use the `with_*` methods in the type returned
1174/// by [builder()][FeatureOnlineStoreAdminService::builder]. The default configuration should
1175/// work for most applications. Common configuration changes include
1176///
1177/// * [with_endpoint()]: by default this client uses the global default endpoint
1178/// (`https://aiplatform.googleapis.com`). Applications using regional
1179/// endpoints or running in restricted networks (e.g. a network configured
1180// with [Private Google Access with VPC Service Controls]) may want to
1181/// override this default.
1182/// * [with_credentials()]: by default this client uses
1183/// [Application Default Credentials]. Applications using custom
1184/// authentication may need to override this default.
1185///
1186/// [with_endpoint()]: super::builder::feature_online_store_admin_service::ClientBuilder::with_endpoint
1187/// [with_credentials()]: super::builder::feature_online_store_admin_service::ClientBuilder::credentials
1188/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1189/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1190///
1191/// # Pooling and Cloning
1192///
1193/// `FeatureOnlineStoreAdminService` holds a connection pool internally, it is advised to
1194/// create one and the reuse it. You do not need to wrap `FeatureOnlineStoreAdminService` in
1195/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1196/// already uses an `Arc` internally.
1197#[cfg(feature = "feature-online-store-admin-service")]
1198#[cfg_attr(docsrs, doc(cfg(feature = "feature-online-store-admin-service")))]
1199#[derive(Clone, Debug)]
1200pub struct FeatureOnlineStoreAdminService {
1201 inner: std::sync::Arc<dyn super::stub::dynamic::FeatureOnlineStoreAdminService>,
1202}
1203
1204#[cfg(feature = "feature-online-store-admin-service")]
1205impl FeatureOnlineStoreAdminService {
1206 /// Returns a builder for [FeatureOnlineStoreAdminService].
1207 ///
1208 /// ```
1209 /// # tokio_test::block_on(async {
1210 /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
1211 /// let client = FeatureOnlineStoreAdminService::builder().build().await?;
1212 /// # gax::Result::<()>::Ok(()) });
1213 /// ```
1214 pub fn builder() -> super::builder::feature_online_store_admin_service::ClientBuilder {
1215 gax::client_builder::internal::new_builder(
1216 super::builder::feature_online_store_admin_service::client::Factory,
1217 )
1218 }
1219
1220 /// Creates a new client from the provided stub.
1221 ///
1222 /// The most common case for calling this function is in tests mocking the
1223 /// client's behavior.
1224 pub fn from_stub<T>(stub: T) -> Self
1225 where
1226 T: super::stub::FeatureOnlineStoreAdminService + 'static,
1227 {
1228 Self {
1229 inner: std::sync::Arc::new(stub),
1230 }
1231 }
1232
1233 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
1234 let inner = Self::build_inner(config).await?;
1235 Ok(Self { inner })
1236 }
1237
1238 async fn build_inner(
1239 conf: gaxi::options::ClientConfig,
1240 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::FeatureOnlineStoreAdminService>> {
1241 if gaxi::options::tracing_enabled(&conf) {
1242 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1243 }
1244 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1245 }
1246
1247 async fn build_transport(
1248 conf: gaxi::options::ClientConfig,
1249 ) -> Result<impl super::stub::FeatureOnlineStoreAdminService> {
1250 super::transport::FeatureOnlineStoreAdminService::new(conf).await
1251 }
1252
1253 async fn build_with_tracing(
1254 conf: gaxi::options::ClientConfig,
1255 ) -> Result<impl super::stub::FeatureOnlineStoreAdminService> {
1256 Self::build_transport(conf)
1257 .await
1258 .map(super::tracing::FeatureOnlineStoreAdminService::new)
1259 }
1260
1261 /// Creates a new FeatureOnlineStore in a given project and location.
1262 ///
1263 /// # Long running operations
1264 ///
1265 /// This method is used to start, and/or poll a [long-running Operation].
1266 /// The [Working with long-running operations] chapter in the [user guide]
1267 /// covers these operations in detail.
1268 ///
1269 /// [long-running operation]: https://google.aip.dev/151
1270 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1271 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1272 pub fn create_feature_online_store(
1273 &self,
1274 ) -> super::builder::feature_online_store_admin_service::CreateFeatureOnlineStore {
1275 super::builder::feature_online_store_admin_service::CreateFeatureOnlineStore::new(
1276 self.inner.clone(),
1277 )
1278 }
1279
1280 /// Gets details of a single FeatureOnlineStore.
1281 pub fn get_feature_online_store(
1282 &self,
1283 ) -> super::builder::feature_online_store_admin_service::GetFeatureOnlineStore {
1284 super::builder::feature_online_store_admin_service::GetFeatureOnlineStore::new(
1285 self.inner.clone(),
1286 )
1287 }
1288
1289 /// Lists FeatureOnlineStores in a given project and location.
1290 pub fn list_feature_online_stores(
1291 &self,
1292 ) -> super::builder::feature_online_store_admin_service::ListFeatureOnlineStores {
1293 super::builder::feature_online_store_admin_service::ListFeatureOnlineStores::new(
1294 self.inner.clone(),
1295 )
1296 }
1297
1298 /// Updates the parameters of a single FeatureOnlineStore.
1299 ///
1300 /// # Long running operations
1301 ///
1302 /// This method is used to start, and/or poll a [long-running Operation].
1303 /// The [Working with long-running operations] chapter in the [user guide]
1304 /// covers these operations in detail.
1305 ///
1306 /// [long-running operation]: https://google.aip.dev/151
1307 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1308 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1309 pub fn update_feature_online_store(
1310 &self,
1311 ) -> super::builder::feature_online_store_admin_service::UpdateFeatureOnlineStore {
1312 super::builder::feature_online_store_admin_service::UpdateFeatureOnlineStore::new(
1313 self.inner.clone(),
1314 )
1315 }
1316
1317 /// Deletes a single FeatureOnlineStore. The FeatureOnlineStore must not
1318 /// contain any FeatureViews.
1319 ///
1320 /// # Long running operations
1321 ///
1322 /// This method is used to start, and/or poll a [long-running Operation].
1323 /// The [Working with long-running operations] chapter in the [user guide]
1324 /// covers these operations in detail.
1325 ///
1326 /// [long-running operation]: https://google.aip.dev/151
1327 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1328 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1329 pub fn delete_feature_online_store(
1330 &self,
1331 ) -> super::builder::feature_online_store_admin_service::DeleteFeatureOnlineStore {
1332 super::builder::feature_online_store_admin_service::DeleteFeatureOnlineStore::new(
1333 self.inner.clone(),
1334 )
1335 }
1336
1337 /// Creates a new FeatureView in a given FeatureOnlineStore.
1338 ///
1339 /// # Long running operations
1340 ///
1341 /// This method is used to start, and/or poll a [long-running Operation].
1342 /// The [Working with long-running operations] chapter in the [user guide]
1343 /// covers these operations in detail.
1344 ///
1345 /// [long-running operation]: https://google.aip.dev/151
1346 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1347 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1348 pub fn create_feature_view(
1349 &self,
1350 ) -> super::builder::feature_online_store_admin_service::CreateFeatureView {
1351 super::builder::feature_online_store_admin_service::CreateFeatureView::new(
1352 self.inner.clone(),
1353 )
1354 }
1355
1356 /// Gets details of a single FeatureView.
1357 pub fn get_feature_view(
1358 &self,
1359 ) -> super::builder::feature_online_store_admin_service::GetFeatureView {
1360 super::builder::feature_online_store_admin_service::GetFeatureView::new(self.inner.clone())
1361 }
1362
1363 /// Lists FeatureViews in a given FeatureOnlineStore.
1364 pub fn list_feature_views(
1365 &self,
1366 ) -> super::builder::feature_online_store_admin_service::ListFeatureViews {
1367 super::builder::feature_online_store_admin_service::ListFeatureViews::new(
1368 self.inner.clone(),
1369 )
1370 }
1371
1372 /// Updates the parameters of a single FeatureView.
1373 ///
1374 /// # Long running operations
1375 ///
1376 /// This method is used to start, and/or poll a [long-running Operation].
1377 /// The [Working with long-running operations] chapter in the [user guide]
1378 /// covers these operations in detail.
1379 ///
1380 /// [long-running operation]: https://google.aip.dev/151
1381 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1382 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1383 pub fn update_feature_view(
1384 &self,
1385 ) -> super::builder::feature_online_store_admin_service::UpdateFeatureView {
1386 super::builder::feature_online_store_admin_service::UpdateFeatureView::new(
1387 self.inner.clone(),
1388 )
1389 }
1390
1391 /// Deletes a single FeatureView.
1392 ///
1393 /// # Long running operations
1394 ///
1395 /// This method is used to start, and/or poll a [long-running Operation].
1396 /// The [Working with long-running operations] chapter in the [user guide]
1397 /// covers these operations in detail.
1398 ///
1399 /// [long-running operation]: https://google.aip.dev/151
1400 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1401 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1402 pub fn delete_feature_view(
1403 &self,
1404 ) -> super::builder::feature_online_store_admin_service::DeleteFeatureView {
1405 super::builder::feature_online_store_admin_service::DeleteFeatureView::new(
1406 self.inner.clone(),
1407 )
1408 }
1409
1410 /// Triggers on-demand sync for the FeatureView.
1411 pub fn sync_feature_view(
1412 &self,
1413 ) -> super::builder::feature_online_store_admin_service::SyncFeatureView {
1414 super::builder::feature_online_store_admin_service::SyncFeatureView::new(self.inner.clone())
1415 }
1416
1417 /// Gets details of a single FeatureViewSync.
1418 pub fn get_feature_view_sync(
1419 &self,
1420 ) -> super::builder::feature_online_store_admin_service::GetFeatureViewSync {
1421 super::builder::feature_online_store_admin_service::GetFeatureViewSync::new(
1422 self.inner.clone(),
1423 )
1424 }
1425
1426 /// Lists FeatureViewSyncs in a given FeatureView.
1427 pub fn list_feature_view_syncs(
1428 &self,
1429 ) -> super::builder::feature_online_store_admin_service::ListFeatureViewSyncs {
1430 super::builder::feature_online_store_admin_service::ListFeatureViewSyncs::new(
1431 self.inner.clone(),
1432 )
1433 }
1434
1435 /// Lists information about the supported locations for this service.
1436 pub fn list_locations(
1437 &self,
1438 ) -> super::builder::feature_online_store_admin_service::ListLocations {
1439 super::builder::feature_online_store_admin_service::ListLocations::new(self.inner.clone())
1440 }
1441
1442 /// Gets information about a location.
1443 pub fn get_location(&self) -> super::builder::feature_online_store_admin_service::GetLocation {
1444 super::builder::feature_online_store_admin_service::GetLocation::new(self.inner.clone())
1445 }
1446
1447 /// Sets the access control policy on the specified resource. Replaces
1448 /// any existing policy.
1449 ///
1450 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1451 /// errors.
1452 pub fn set_iam_policy(
1453 &self,
1454 ) -> super::builder::feature_online_store_admin_service::SetIamPolicy {
1455 super::builder::feature_online_store_admin_service::SetIamPolicy::new(self.inner.clone())
1456 }
1457
1458 /// Gets the access control policy for a resource. Returns an empty policy
1459 /// if the resource exists and does not have a policy set.
1460 pub fn get_iam_policy(
1461 &self,
1462 ) -> super::builder::feature_online_store_admin_service::GetIamPolicy {
1463 super::builder::feature_online_store_admin_service::GetIamPolicy::new(self.inner.clone())
1464 }
1465
1466 /// Returns permissions that a caller has on the specified resource. If the
1467 /// resource does not exist, this will return an empty set of
1468 /// permissions, not a `NOT_FOUND` error.
1469 ///
1470 /// Note: This operation is designed to be used for building
1471 /// permission-aware UIs and command-line tools, not for authorization
1472 /// checking. This operation may "fail open" without warning.
1473 pub fn test_iam_permissions(
1474 &self,
1475 ) -> super::builder::feature_online_store_admin_service::TestIamPermissions {
1476 super::builder::feature_online_store_admin_service::TestIamPermissions::new(
1477 self.inner.clone(),
1478 )
1479 }
1480
1481 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1482 ///
1483 /// [google.longrunning.Operations]: longrunning::client::Operations
1484 pub fn list_operations(
1485 &self,
1486 ) -> super::builder::feature_online_store_admin_service::ListOperations {
1487 super::builder::feature_online_store_admin_service::ListOperations::new(self.inner.clone())
1488 }
1489
1490 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1491 ///
1492 /// [google.longrunning.Operations]: longrunning::client::Operations
1493 pub fn get_operation(
1494 &self,
1495 ) -> super::builder::feature_online_store_admin_service::GetOperation {
1496 super::builder::feature_online_store_admin_service::GetOperation::new(self.inner.clone())
1497 }
1498
1499 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1500 ///
1501 /// [google.longrunning.Operations]: longrunning::client::Operations
1502 pub fn delete_operation(
1503 &self,
1504 ) -> super::builder::feature_online_store_admin_service::DeleteOperation {
1505 super::builder::feature_online_store_admin_service::DeleteOperation::new(self.inner.clone())
1506 }
1507
1508 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1509 ///
1510 /// [google.longrunning.Operations]: longrunning::client::Operations
1511 pub fn cancel_operation(
1512 &self,
1513 ) -> super::builder::feature_online_store_admin_service::CancelOperation {
1514 super::builder::feature_online_store_admin_service::CancelOperation::new(self.inner.clone())
1515 }
1516
1517 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1518 ///
1519 /// [google.longrunning.Operations]: longrunning::client::Operations
1520 pub fn wait_operation(
1521 &self,
1522 ) -> super::builder::feature_online_store_admin_service::WaitOperation {
1523 super::builder::feature_online_store_admin_service::WaitOperation::new(self.inner.clone())
1524 }
1525}
1526
1527/// Implements a client for the Vertex AI API.
1528///
1529/// # Example
1530/// ```
1531/// # tokio_test::block_on(async {
1532/// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
1533/// let client = FeatureOnlineStoreService::builder().build().await?;
1534/// // use `client` to make requests to the Vertex AI API.
1535/// # gax::Result::<()>::Ok(()) });
1536/// ```
1537///
1538/// # Service Description
1539///
1540/// A service for fetching feature values from the online store.
1541///
1542/// # Configuration
1543///
1544/// To configure `FeatureOnlineStoreService` use the `with_*` methods in the type returned
1545/// by [builder()][FeatureOnlineStoreService::builder]. The default configuration should
1546/// work for most applications. Common configuration changes include
1547///
1548/// * [with_endpoint()]: by default this client uses the global default endpoint
1549/// (`https://aiplatform.googleapis.com`). Applications using regional
1550/// endpoints or running in restricted networks (e.g. a network configured
1551// with [Private Google Access with VPC Service Controls]) may want to
1552/// override this default.
1553/// * [with_credentials()]: by default this client uses
1554/// [Application Default Credentials]. Applications using custom
1555/// authentication may need to override this default.
1556///
1557/// [with_endpoint()]: super::builder::feature_online_store_service::ClientBuilder::with_endpoint
1558/// [with_credentials()]: super::builder::feature_online_store_service::ClientBuilder::credentials
1559/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1560/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1561///
1562/// # Pooling and Cloning
1563///
1564/// `FeatureOnlineStoreService` holds a connection pool internally, it is advised to
1565/// create one and the reuse it. You do not need to wrap `FeatureOnlineStoreService` in
1566/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1567/// already uses an `Arc` internally.
1568#[cfg(feature = "feature-online-store-service")]
1569#[cfg_attr(docsrs, doc(cfg(feature = "feature-online-store-service")))]
1570#[derive(Clone, Debug)]
1571pub struct FeatureOnlineStoreService {
1572 inner: std::sync::Arc<dyn super::stub::dynamic::FeatureOnlineStoreService>,
1573}
1574
1575#[cfg(feature = "feature-online-store-service")]
1576impl FeatureOnlineStoreService {
1577 /// Returns a builder for [FeatureOnlineStoreService].
1578 ///
1579 /// ```
1580 /// # tokio_test::block_on(async {
1581 /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
1582 /// let client = FeatureOnlineStoreService::builder().build().await?;
1583 /// # gax::Result::<()>::Ok(()) });
1584 /// ```
1585 pub fn builder() -> super::builder::feature_online_store_service::ClientBuilder {
1586 gax::client_builder::internal::new_builder(
1587 super::builder::feature_online_store_service::client::Factory,
1588 )
1589 }
1590
1591 /// Creates a new client from the provided stub.
1592 ///
1593 /// The most common case for calling this function is in tests mocking the
1594 /// client's behavior.
1595 pub fn from_stub<T>(stub: T) -> Self
1596 where
1597 T: super::stub::FeatureOnlineStoreService + 'static,
1598 {
1599 Self {
1600 inner: std::sync::Arc::new(stub),
1601 }
1602 }
1603
1604 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
1605 let inner = Self::build_inner(config).await?;
1606 Ok(Self { inner })
1607 }
1608
1609 async fn build_inner(
1610 conf: gaxi::options::ClientConfig,
1611 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::FeatureOnlineStoreService>> {
1612 if gaxi::options::tracing_enabled(&conf) {
1613 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1614 }
1615 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1616 }
1617
1618 async fn build_transport(
1619 conf: gaxi::options::ClientConfig,
1620 ) -> Result<impl super::stub::FeatureOnlineStoreService> {
1621 super::transport::FeatureOnlineStoreService::new(conf).await
1622 }
1623
1624 async fn build_with_tracing(
1625 conf: gaxi::options::ClientConfig,
1626 ) -> Result<impl super::stub::FeatureOnlineStoreService> {
1627 Self::build_transport(conf)
1628 .await
1629 .map(super::tracing::FeatureOnlineStoreService::new)
1630 }
1631
1632 /// Fetch feature values under a FeatureView.
1633 pub fn fetch_feature_values(
1634 &self,
1635 ) -> super::builder::feature_online_store_service::FetchFeatureValues {
1636 super::builder::feature_online_store_service::FetchFeatureValues::new(self.inner.clone())
1637 }
1638
1639 /// Search the nearest entities under a FeatureView.
1640 /// Search only works for indexable feature view; if a feature view isn't
1641 /// indexable, returns Invalid argument response.
1642 pub fn search_nearest_entities(
1643 &self,
1644 ) -> super::builder::feature_online_store_service::SearchNearestEntities {
1645 super::builder::feature_online_store_service::SearchNearestEntities::new(self.inner.clone())
1646 }
1647
1648 /// Lists information about the supported locations for this service.
1649 pub fn list_locations(&self) -> super::builder::feature_online_store_service::ListLocations {
1650 super::builder::feature_online_store_service::ListLocations::new(self.inner.clone())
1651 }
1652
1653 /// Gets information about a location.
1654 pub fn get_location(&self) -> super::builder::feature_online_store_service::GetLocation {
1655 super::builder::feature_online_store_service::GetLocation::new(self.inner.clone())
1656 }
1657
1658 /// Sets the access control policy on the specified resource. Replaces
1659 /// any existing policy.
1660 ///
1661 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1662 /// errors.
1663 pub fn set_iam_policy(&self) -> super::builder::feature_online_store_service::SetIamPolicy {
1664 super::builder::feature_online_store_service::SetIamPolicy::new(self.inner.clone())
1665 }
1666
1667 /// Gets the access control policy for a resource. Returns an empty policy
1668 /// if the resource exists and does not have a policy set.
1669 pub fn get_iam_policy(&self) -> super::builder::feature_online_store_service::GetIamPolicy {
1670 super::builder::feature_online_store_service::GetIamPolicy::new(self.inner.clone())
1671 }
1672
1673 /// Returns permissions that a caller has on the specified resource. If the
1674 /// resource does not exist, this will return an empty set of
1675 /// permissions, not a `NOT_FOUND` error.
1676 ///
1677 /// Note: This operation is designed to be used for building
1678 /// permission-aware UIs and command-line tools, not for authorization
1679 /// checking. This operation may "fail open" without warning.
1680 pub fn test_iam_permissions(
1681 &self,
1682 ) -> super::builder::feature_online_store_service::TestIamPermissions {
1683 super::builder::feature_online_store_service::TestIamPermissions::new(self.inner.clone())
1684 }
1685
1686 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1687 ///
1688 /// [google.longrunning.Operations]: longrunning::client::Operations
1689 pub fn list_operations(&self) -> super::builder::feature_online_store_service::ListOperations {
1690 super::builder::feature_online_store_service::ListOperations::new(self.inner.clone())
1691 }
1692
1693 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1694 ///
1695 /// [google.longrunning.Operations]: longrunning::client::Operations
1696 pub fn get_operation(&self) -> super::builder::feature_online_store_service::GetOperation {
1697 super::builder::feature_online_store_service::GetOperation::new(self.inner.clone())
1698 }
1699
1700 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1701 ///
1702 /// [google.longrunning.Operations]: longrunning::client::Operations
1703 pub fn delete_operation(
1704 &self,
1705 ) -> super::builder::feature_online_store_service::DeleteOperation {
1706 super::builder::feature_online_store_service::DeleteOperation::new(self.inner.clone())
1707 }
1708
1709 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1710 ///
1711 /// [google.longrunning.Operations]: longrunning::client::Operations
1712 pub fn cancel_operation(
1713 &self,
1714 ) -> super::builder::feature_online_store_service::CancelOperation {
1715 super::builder::feature_online_store_service::CancelOperation::new(self.inner.clone())
1716 }
1717
1718 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1719 ///
1720 /// [google.longrunning.Operations]: longrunning::client::Operations
1721 pub fn wait_operation(&self) -> super::builder::feature_online_store_service::WaitOperation {
1722 super::builder::feature_online_store_service::WaitOperation::new(self.inner.clone())
1723 }
1724}
1725
1726/// Implements a client for the Vertex AI API.
1727///
1728/// # Example
1729/// ```
1730/// # tokio_test::block_on(async {
1731/// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
1732/// let client = FeatureRegistryService::builder().build().await?;
1733/// // use `client` to make requests to the Vertex AI API.
1734/// # gax::Result::<()>::Ok(()) });
1735/// ```
1736///
1737/// # Service Description
1738///
1739/// The service that handles CRUD and List for resources for
1740/// FeatureRegistry.
1741///
1742/// # Configuration
1743///
1744/// To configure `FeatureRegistryService` use the `with_*` methods in the type returned
1745/// by [builder()][FeatureRegistryService::builder]. The default configuration should
1746/// work for most applications. Common configuration changes include
1747///
1748/// * [with_endpoint()]: by default this client uses the global default endpoint
1749/// (`https://aiplatform.googleapis.com`). Applications using regional
1750/// endpoints or running in restricted networks (e.g. a network configured
1751// with [Private Google Access with VPC Service Controls]) may want to
1752/// override this default.
1753/// * [with_credentials()]: by default this client uses
1754/// [Application Default Credentials]. Applications using custom
1755/// authentication may need to override this default.
1756///
1757/// [with_endpoint()]: super::builder::feature_registry_service::ClientBuilder::with_endpoint
1758/// [with_credentials()]: super::builder::feature_registry_service::ClientBuilder::credentials
1759/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1760/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1761///
1762/// # Pooling and Cloning
1763///
1764/// `FeatureRegistryService` holds a connection pool internally, it is advised to
1765/// create one and the reuse it. You do not need to wrap `FeatureRegistryService` in
1766/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1767/// already uses an `Arc` internally.
1768#[cfg(feature = "feature-registry-service")]
1769#[cfg_attr(docsrs, doc(cfg(feature = "feature-registry-service")))]
1770#[derive(Clone, Debug)]
1771pub struct FeatureRegistryService {
1772 inner: std::sync::Arc<dyn super::stub::dynamic::FeatureRegistryService>,
1773}
1774
1775#[cfg(feature = "feature-registry-service")]
1776impl FeatureRegistryService {
1777 /// Returns a builder for [FeatureRegistryService].
1778 ///
1779 /// ```
1780 /// # tokio_test::block_on(async {
1781 /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
1782 /// let client = FeatureRegistryService::builder().build().await?;
1783 /// # gax::Result::<()>::Ok(()) });
1784 /// ```
1785 pub fn builder() -> super::builder::feature_registry_service::ClientBuilder {
1786 gax::client_builder::internal::new_builder(
1787 super::builder::feature_registry_service::client::Factory,
1788 )
1789 }
1790
1791 /// Creates a new client from the provided stub.
1792 ///
1793 /// The most common case for calling this function is in tests mocking the
1794 /// client's behavior.
1795 pub fn from_stub<T>(stub: T) -> Self
1796 where
1797 T: super::stub::FeatureRegistryService + 'static,
1798 {
1799 Self {
1800 inner: std::sync::Arc::new(stub),
1801 }
1802 }
1803
1804 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
1805 let inner = Self::build_inner(config).await?;
1806 Ok(Self { inner })
1807 }
1808
1809 async fn build_inner(
1810 conf: gaxi::options::ClientConfig,
1811 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::FeatureRegistryService>> {
1812 if gaxi::options::tracing_enabled(&conf) {
1813 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1814 }
1815 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1816 }
1817
1818 async fn build_transport(
1819 conf: gaxi::options::ClientConfig,
1820 ) -> Result<impl super::stub::FeatureRegistryService> {
1821 super::transport::FeatureRegistryService::new(conf).await
1822 }
1823
1824 async fn build_with_tracing(
1825 conf: gaxi::options::ClientConfig,
1826 ) -> Result<impl super::stub::FeatureRegistryService> {
1827 Self::build_transport(conf)
1828 .await
1829 .map(super::tracing::FeatureRegistryService::new)
1830 }
1831
1832 /// Creates a new FeatureGroup in a given project and location.
1833 ///
1834 /// # Long running operations
1835 ///
1836 /// This method is used to start, and/or poll a [long-running Operation].
1837 /// The [Working with long-running operations] chapter in the [user guide]
1838 /// covers these operations in detail.
1839 ///
1840 /// [long-running operation]: https://google.aip.dev/151
1841 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1842 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1843 pub fn create_feature_group(
1844 &self,
1845 ) -> super::builder::feature_registry_service::CreateFeatureGroup {
1846 super::builder::feature_registry_service::CreateFeatureGroup::new(self.inner.clone())
1847 }
1848
1849 /// Gets details of a single FeatureGroup.
1850 pub fn get_feature_group(&self) -> super::builder::feature_registry_service::GetFeatureGroup {
1851 super::builder::feature_registry_service::GetFeatureGroup::new(self.inner.clone())
1852 }
1853
1854 /// Lists FeatureGroups in a given project and location.
1855 pub fn list_feature_groups(
1856 &self,
1857 ) -> super::builder::feature_registry_service::ListFeatureGroups {
1858 super::builder::feature_registry_service::ListFeatureGroups::new(self.inner.clone())
1859 }
1860
1861 /// Updates the parameters of a single FeatureGroup.
1862 ///
1863 /// # Long running operations
1864 ///
1865 /// This method is used to start, and/or poll a [long-running Operation].
1866 /// The [Working with long-running operations] chapter in the [user guide]
1867 /// covers these operations in detail.
1868 ///
1869 /// [long-running operation]: https://google.aip.dev/151
1870 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1871 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1872 pub fn update_feature_group(
1873 &self,
1874 ) -> super::builder::feature_registry_service::UpdateFeatureGroup {
1875 super::builder::feature_registry_service::UpdateFeatureGroup::new(self.inner.clone())
1876 }
1877
1878 /// Deletes a single FeatureGroup.
1879 ///
1880 /// # Long running operations
1881 ///
1882 /// This method is used to start, and/or poll a [long-running Operation].
1883 /// The [Working with long-running operations] chapter in the [user guide]
1884 /// covers these operations in detail.
1885 ///
1886 /// [long-running operation]: https://google.aip.dev/151
1887 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1888 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1889 pub fn delete_feature_group(
1890 &self,
1891 ) -> super::builder::feature_registry_service::DeleteFeatureGroup {
1892 super::builder::feature_registry_service::DeleteFeatureGroup::new(self.inner.clone())
1893 }
1894
1895 /// Creates a new Feature in a given FeatureGroup.
1896 ///
1897 /// # Long running operations
1898 ///
1899 /// This method is used to start, and/or poll a [long-running Operation].
1900 /// The [Working with long-running operations] chapter in the [user guide]
1901 /// covers these operations in detail.
1902 ///
1903 /// [long-running operation]: https://google.aip.dev/151
1904 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1905 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1906 pub fn create_feature(&self) -> super::builder::feature_registry_service::CreateFeature {
1907 super::builder::feature_registry_service::CreateFeature::new(self.inner.clone())
1908 }
1909
1910 /// Creates a batch of Features in a given FeatureGroup.
1911 ///
1912 /// # Long running operations
1913 ///
1914 /// This method is used to start, and/or poll a [long-running Operation].
1915 /// The [Working with long-running operations] chapter in the [user guide]
1916 /// covers these operations in detail.
1917 ///
1918 /// [long-running operation]: https://google.aip.dev/151
1919 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1920 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1921 pub fn batch_create_features(
1922 &self,
1923 ) -> super::builder::feature_registry_service::BatchCreateFeatures {
1924 super::builder::feature_registry_service::BatchCreateFeatures::new(self.inner.clone())
1925 }
1926
1927 /// Gets details of a single Feature.
1928 pub fn get_feature(&self) -> super::builder::feature_registry_service::GetFeature {
1929 super::builder::feature_registry_service::GetFeature::new(self.inner.clone())
1930 }
1931
1932 /// Lists Features in a given FeatureGroup.
1933 pub fn list_features(&self) -> super::builder::feature_registry_service::ListFeatures {
1934 super::builder::feature_registry_service::ListFeatures::new(self.inner.clone())
1935 }
1936
1937 /// Updates the parameters of a single Feature.
1938 ///
1939 /// # Long running operations
1940 ///
1941 /// This method is used to start, and/or poll a [long-running Operation].
1942 /// The [Working with long-running operations] chapter in the [user guide]
1943 /// covers these operations in detail.
1944 ///
1945 /// [long-running operation]: https://google.aip.dev/151
1946 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1947 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1948 pub fn update_feature(&self) -> super::builder::feature_registry_service::UpdateFeature {
1949 super::builder::feature_registry_service::UpdateFeature::new(self.inner.clone())
1950 }
1951
1952 /// Deletes a single Feature.
1953 ///
1954 /// # Long running operations
1955 ///
1956 /// This method is used to start, and/or poll a [long-running Operation].
1957 /// The [Working with long-running operations] chapter in the [user guide]
1958 /// covers these operations in detail.
1959 ///
1960 /// [long-running operation]: https://google.aip.dev/151
1961 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1962 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1963 pub fn delete_feature(&self) -> super::builder::feature_registry_service::DeleteFeature {
1964 super::builder::feature_registry_service::DeleteFeature::new(self.inner.clone())
1965 }
1966
1967 /// Lists information about the supported locations for this service.
1968 pub fn list_locations(&self) -> super::builder::feature_registry_service::ListLocations {
1969 super::builder::feature_registry_service::ListLocations::new(self.inner.clone())
1970 }
1971
1972 /// Gets information about a location.
1973 pub fn get_location(&self) -> super::builder::feature_registry_service::GetLocation {
1974 super::builder::feature_registry_service::GetLocation::new(self.inner.clone())
1975 }
1976
1977 /// Sets the access control policy on the specified resource. Replaces
1978 /// any existing policy.
1979 ///
1980 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1981 /// errors.
1982 pub fn set_iam_policy(&self) -> super::builder::feature_registry_service::SetIamPolicy {
1983 super::builder::feature_registry_service::SetIamPolicy::new(self.inner.clone())
1984 }
1985
1986 /// Gets the access control policy for a resource. Returns an empty policy
1987 /// if the resource exists and does not have a policy set.
1988 pub fn get_iam_policy(&self) -> super::builder::feature_registry_service::GetIamPolicy {
1989 super::builder::feature_registry_service::GetIamPolicy::new(self.inner.clone())
1990 }
1991
1992 /// Returns permissions that a caller has on the specified resource. If the
1993 /// resource does not exist, this will return an empty set of
1994 /// permissions, not a `NOT_FOUND` error.
1995 ///
1996 /// Note: This operation is designed to be used for building
1997 /// permission-aware UIs and command-line tools, not for authorization
1998 /// checking. This operation may "fail open" without warning.
1999 pub fn test_iam_permissions(
2000 &self,
2001 ) -> super::builder::feature_registry_service::TestIamPermissions {
2002 super::builder::feature_registry_service::TestIamPermissions::new(self.inner.clone())
2003 }
2004
2005 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2006 ///
2007 /// [google.longrunning.Operations]: longrunning::client::Operations
2008 pub fn list_operations(&self) -> super::builder::feature_registry_service::ListOperations {
2009 super::builder::feature_registry_service::ListOperations::new(self.inner.clone())
2010 }
2011
2012 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2013 ///
2014 /// [google.longrunning.Operations]: longrunning::client::Operations
2015 pub fn get_operation(&self) -> super::builder::feature_registry_service::GetOperation {
2016 super::builder::feature_registry_service::GetOperation::new(self.inner.clone())
2017 }
2018
2019 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2020 ///
2021 /// [google.longrunning.Operations]: longrunning::client::Operations
2022 pub fn delete_operation(&self) -> super::builder::feature_registry_service::DeleteOperation {
2023 super::builder::feature_registry_service::DeleteOperation::new(self.inner.clone())
2024 }
2025
2026 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2027 ///
2028 /// [google.longrunning.Operations]: longrunning::client::Operations
2029 pub fn cancel_operation(&self) -> super::builder::feature_registry_service::CancelOperation {
2030 super::builder::feature_registry_service::CancelOperation::new(self.inner.clone())
2031 }
2032
2033 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2034 ///
2035 /// [google.longrunning.Operations]: longrunning::client::Operations
2036 pub fn wait_operation(&self) -> super::builder::feature_registry_service::WaitOperation {
2037 super::builder::feature_registry_service::WaitOperation::new(self.inner.clone())
2038 }
2039}
2040
2041/// Implements a client for the Vertex AI API.
2042///
2043/// # Example
2044/// ```
2045/// # tokio_test::block_on(async {
2046/// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
2047/// let client = FeaturestoreOnlineServingService::builder().build().await?;
2048/// // use `client` to make requests to the Vertex AI API.
2049/// # gax::Result::<()>::Ok(()) });
2050/// ```
2051///
2052/// # Service Description
2053///
2054/// A service for serving online feature values.
2055///
2056/// # Configuration
2057///
2058/// To configure `FeaturestoreOnlineServingService` use the `with_*` methods in the type returned
2059/// by [builder()][FeaturestoreOnlineServingService::builder]. The default configuration should
2060/// work for most applications. Common configuration changes include
2061///
2062/// * [with_endpoint()]: by default this client uses the global default endpoint
2063/// (`https://aiplatform.googleapis.com`). Applications using regional
2064/// endpoints or running in restricted networks (e.g. a network configured
2065// with [Private Google Access with VPC Service Controls]) may want to
2066/// override this default.
2067/// * [with_credentials()]: by default this client uses
2068/// [Application Default Credentials]. Applications using custom
2069/// authentication may need to override this default.
2070///
2071/// [with_endpoint()]: super::builder::featurestore_online_serving_service::ClientBuilder::with_endpoint
2072/// [with_credentials()]: super::builder::featurestore_online_serving_service::ClientBuilder::credentials
2073/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2074/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2075///
2076/// # Pooling and Cloning
2077///
2078/// `FeaturestoreOnlineServingService` holds a connection pool internally, it is advised to
2079/// create one and the reuse it. You do not need to wrap `FeaturestoreOnlineServingService` in
2080/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2081/// already uses an `Arc` internally.
2082#[cfg(feature = "featurestore-online-serving-service")]
2083#[cfg_attr(docsrs, doc(cfg(feature = "featurestore-online-serving-service")))]
2084#[derive(Clone, Debug)]
2085pub struct FeaturestoreOnlineServingService {
2086 inner: std::sync::Arc<dyn super::stub::dynamic::FeaturestoreOnlineServingService>,
2087}
2088
2089#[cfg(feature = "featurestore-online-serving-service")]
2090impl FeaturestoreOnlineServingService {
2091 /// Returns a builder for [FeaturestoreOnlineServingService].
2092 ///
2093 /// ```
2094 /// # tokio_test::block_on(async {
2095 /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
2096 /// let client = FeaturestoreOnlineServingService::builder().build().await?;
2097 /// # gax::Result::<()>::Ok(()) });
2098 /// ```
2099 pub fn builder() -> super::builder::featurestore_online_serving_service::ClientBuilder {
2100 gax::client_builder::internal::new_builder(
2101 super::builder::featurestore_online_serving_service::client::Factory,
2102 )
2103 }
2104
2105 /// Creates a new client from the provided stub.
2106 ///
2107 /// The most common case for calling this function is in tests mocking the
2108 /// client's behavior.
2109 pub fn from_stub<T>(stub: T) -> Self
2110 where
2111 T: super::stub::FeaturestoreOnlineServingService + 'static,
2112 {
2113 Self {
2114 inner: std::sync::Arc::new(stub),
2115 }
2116 }
2117
2118 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
2119 let inner = Self::build_inner(config).await?;
2120 Ok(Self { inner })
2121 }
2122
2123 async fn build_inner(
2124 conf: gaxi::options::ClientConfig,
2125 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::FeaturestoreOnlineServingService>> {
2126 if gaxi::options::tracing_enabled(&conf) {
2127 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2128 }
2129 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2130 }
2131
2132 async fn build_transport(
2133 conf: gaxi::options::ClientConfig,
2134 ) -> Result<impl super::stub::FeaturestoreOnlineServingService> {
2135 super::transport::FeaturestoreOnlineServingService::new(conf).await
2136 }
2137
2138 async fn build_with_tracing(
2139 conf: gaxi::options::ClientConfig,
2140 ) -> Result<impl super::stub::FeaturestoreOnlineServingService> {
2141 Self::build_transport(conf)
2142 .await
2143 .map(super::tracing::FeaturestoreOnlineServingService::new)
2144 }
2145
2146 /// Reads Feature values of a specific entity of an EntityType. For reading
2147 /// feature values of multiple entities of an EntityType, please use
2148 /// StreamingReadFeatureValues.
2149 pub fn read_feature_values(
2150 &self,
2151 ) -> super::builder::featurestore_online_serving_service::ReadFeatureValues {
2152 super::builder::featurestore_online_serving_service::ReadFeatureValues::new(
2153 self.inner.clone(),
2154 )
2155 }
2156
2157 /// Writes Feature values of one or more entities of an EntityType.
2158 ///
2159 /// The Feature values are merged into existing entities if any. The Feature
2160 /// values to be written must have timestamp within the online storage
2161 /// retention.
2162 pub fn write_feature_values(
2163 &self,
2164 ) -> super::builder::featurestore_online_serving_service::WriteFeatureValues {
2165 super::builder::featurestore_online_serving_service::WriteFeatureValues::new(
2166 self.inner.clone(),
2167 )
2168 }
2169
2170 /// Lists information about the supported locations for this service.
2171 pub fn list_locations(
2172 &self,
2173 ) -> super::builder::featurestore_online_serving_service::ListLocations {
2174 super::builder::featurestore_online_serving_service::ListLocations::new(self.inner.clone())
2175 }
2176
2177 /// Gets information about a location.
2178 pub fn get_location(&self) -> super::builder::featurestore_online_serving_service::GetLocation {
2179 super::builder::featurestore_online_serving_service::GetLocation::new(self.inner.clone())
2180 }
2181
2182 /// Sets the access control policy on the specified resource. Replaces
2183 /// any existing policy.
2184 ///
2185 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
2186 /// errors.
2187 pub fn set_iam_policy(
2188 &self,
2189 ) -> super::builder::featurestore_online_serving_service::SetIamPolicy {
2190 super::builder::featurestore_online_serving_service::SetIamPolicy::new(self.inner.clone())
2191 }
2192
2193 /// Gets the access control policy for a resource. Returns an empty policy
2194 /// if the resource exists and does not have a policy set.
2195 pub fn get_iam_policy(
2196 &self,
2197 ) -> super::builder::featurestore_online_serving_service::GetIamPolicy {
2198 super::builder::featurestore_online_serving_service::GetIamPolicy::new(self.inner.clone())
2199 }
2200
2201 /// Returns permissions that a caller has on the specified resource. If the
2202 /// resource does not exist, this will return an empty set of
2203 /// permissions, not a `NOT_FOUND` error.
2204 ///
2205 /// Note: This operation is designed to be used for building
2206 /// permission-aware UIs and command-line tools, not for authorization
2207 /// checking. This operation may "fail open" without warning.
2208 pub fn test_iam_permissions(
2209 &self,
2210 ) -> super::builder::featurestore_online_serving_service::TestIamPermissions {
2211 super::builder::featurestore_online_serving_service::TestIamPermissions::new(
2212 self.inner.clone(),
2213 )
2214 }
2215
2216 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2217 ///
2218 /// [google.longrunning.Operations]: longrunning::client::Operations
2219 pub fn list_operations(
2220 &self,
2221 ) -> super::builder::featurestore_online_serving_service::ListOperations {
2222 super::builder::featurestore_online_serving_service::ListOperations::new(self.inner.clone())
2223 }
2224
2225 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2226 ///
2227 /// [google.longrunning.Operations]: longrunning::client::Operations
2228 pub fn get_operation(
2229 &self,
2230 ) -> super::builder::featurestore_online_serving_service::GetOperation {
2231 super::builder::featurestore_online_serving_service::GetOperation::new(self.inner.clone())
2232 }
2233
2234 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2235 ///
2236 /// [google.longrunning.Operations]: longrunning::client::Operations
2237 pub fn delete_operation(
2238 &self,
2239 ) -> super::builder::featurestore_online_serving_service::DeleteOperation {
2240 super::builder::featurestore_online_serving_service::DeleteOperation::new(
2241 self.inner.clone(),
2242 )
2243 }
2244
2245 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2246 ///
2247 /// [google.longrunning.Operations]: longrunning::client::Operations
2248 pub fn cancel_operation(
2249 &self,
2250 ) -> super::builder::featurestore_online_serving_service::CancelOperation {
2251 super::builder::featurestore_online_serving_service::CancelOperation::new(
2252 self.inner.clone(),
2253 )
2254 }
2255
2256 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2257 ///
2258 /// [google.longrunning.Operations]: longrunning::client::Operations
2259 pub fn wait_operation(
2260 &self,
2261 ) -> super::builder::featurestore_online_serving_service::WaitOperation {
2262 super::builder::featurestore_online_serving_service::WaitOperation::new(self.inner.clone())
2263 }
2264}
2265
2266/// Implements a client for the Vertex AI API.
2267///
2268/// # Example
2269/// ```
2270/// # tokio_test::block_on(async {
2271/// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
2272/// let client = FeaturestoreService::builder().build().await?;
2273/// // use `client` to make requests to the Vertex AI API.
2274/// # gax::Result::<()>::Ok(()) });
2275/// ```
2276///
2277/// # Service Description
2278///
2279/// The service that handles CRUD and List for resources for Featurestore.
2280///
2281/// # Configuration
2282///
2283/// To configure `FeaturestoreService` use the `with_*` methods in the type returned
2284/// by [builder()][FeaturestoreService::builder]. The default configuration should
2285/// work for most applications. Common configuration changes include
2286///
2287/// * [with_endpoint()]: by default this client uses the global default endpoint
2288/// (`https://aiplatform.googleapis.com`). Applications using regional
2289/// endpoints or running in restricted networks (e.g. a network configured
2290// with [Private Google Access with VPC Service Controls]) may want to
2291/// override this default.
2292/// * [with_credentials()]: by default this client uses
2293/// [Application Default Credentials]. Applications using custom
2294/// authentication may need to override this default.
2295///
2296/// [with_endpoint()]: super::builder::featurestore_service::ClientBuilder::with_endpoint
2297/// [with_credentials()]: super::builder::featurestore_service::ClientBuilder::credentials
2298/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2299/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2300///
2301/// # Pooling and Cloning
2302///
2303/// `FeaturestoreService` holds a connection pool internally, it is advised to
2304/// create one and the reuse it. You do not need to wrap `FeaturestoreService` in
2305/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2306/// already uses an `Arc` internally.
2307#[cfg(feature = "featurestore-service")]
2308#[cfg_attr(docsrs, doc(cfg(feature = "featurestore-service")))]
2309#[derive(Clone, Debug)]
2310pub struct FeaturestoreService {
2311 inner: std::sync::Arc<dyn super::stub::dynamic::FeaturestoreService>,
2312}
2313
2314#[cfg(feature = "featurestore-service")]
2315impl FeaturestoreService {
2316 /// Returns a builder for [FeaturestoreService].
2317 ///
2318 /// ```
2319 /// # tokio_test::block_on(async {
2320 /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
2321 /// let client = FeaturestoreService::builder().build().await?;
2322 /// # gax::Result::<()>::Ok(()) });
2323 /// ```
2324 pub fn builder() -> super::builder::featurestore_service::ClientBuilder {
2325 gax::client_builder::internal::new_builder(
2326 super::builder::featurestore_service::client::Factory,
2327 )
2328 }
2329
2330 /// Creates a new client from the provided stub.
2331 ///
2332 /// The most common case for calling this function is in tests mocking the
2333 /// client's behavior.
2334 pub fn from_stub<T>(stub: T) -> Self
2335 where
2336 T: super::stub::FeaturestoreService + 'static,
2337 {
2338 Self {
2339 inner: std::sync::Arc::new(stub),
2340 }
2341 }
2342
2343 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
2344 let inner = Self::build_inner(config).await?;
2345 Ok(Self { inner })
2346 }
2347
2348 async fn build_inner(
2349 conf: gaxi::options::ClientConfig,
2350 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::FeaturestoreService>> {
2351 if gaxi::options::tracing_enabled(&conf) {
2352 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2353 }
2354 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2355 }
2356
2357 async fn build_transport(
2358 conf: gaxi::options::ClientConfig,
2359 ) -> Result<impl super::stub::FeaturestoreService> {
2360 super::transport::FeaturestoreService::new(conf).await
2361 }
2362
2363 async fn build_with_tracing(
2364 conf: gaxi::options::ClientConfig,
2365 ) -> Result<impl super::stub::FeaturestoreService> {
2366 Self::build_transport(conf)
2367 .await
2368 .map(super::tracing::FeaturestoreService::new)
2369 }
2370
2371 /// Creates a new Featurestore in a given project and location.
2372 ///
2373 /// # Long running operations
2374 ///
2375 /// This method is used to start, and/or poll a [long-running Operation].
2376 /// The [Working with long-running operations] chapter in the [user guide]
2377 /// covers these operations in detail.
2378 ///
2379 /// [long-running operation]: https://google.aip.dev/151
2380 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2381 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2382 pub fn create_featurestore(&self) -> super::builder::featurestore_service::CreateFeaturestore {
2383 super::builder::featurestore_service::CreateFeaturestore::new(self.inner.clone())
2384 }
2385
2386 /// Gets details of a single Featurestore.
2387 pub fn get_featurestore(&self) -> super::builder::featurestore_service::GetFeaturestore {
2388 super::builder::featurestore_service::GetFeaturestore::new(self.inner.clone())
2389 }
2390
2391 /// Lists Featurestores in a given project and location.
2392 pub fn list_featurestores(&self) -> super::builder::featurestore_service::ListFeaturestores {
2393 super::builder::featurestore_service::ListFeaturestores::new(self.inner.clone())
2394 }
2395
2396 /// Updates the parameters of a single Featurestore.
2397 ///
2398 /// # Long running operations
2399 ///
2400 /// This method is used to start, and/or poll a [long-running Operation].
2401 /// The [Working with long-running operations] chapter in the [user guide]
2402 /// covers these operations in detail.
2403 ///
2404 /// [long-running operation]: https://google.aip.dev/151
2405 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2406 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2407 pub fn update_featurestore(&self) -> super::builder::featurestore_service::UpdateFeaturestore {
2408 super::builder::featurestore_service::UpdateFeaturestore::new(self.inner.clone())
2409 }
2410
2411 /// Deletes a single Featurestore. The Featurestore must not contain any
2412 /// EntityTypes or `force` must be set to true for the request to succeed.
2413 ///
2414 /// # Long running operations
2415 ///
2416 /// This method is used to start, and/or poll a [long-running Operation].
2417 /// The [Working with long-running operations] chapter in the [user guide]
2418 /// covers these operations in detail.
2419 ///
2420 /// [long-running operation]: https://google.aip.dev/151
2421 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2422 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2423 pub fn delete_featurestore(&self) -> super::builder::featurestore_service::DeleteFeaturestore {
2424 super::builder::featurestore_service::DeleteFeaturestore::new(self.inner.clone())
2425 }
2426
2427 /// Creates a new EntityType in a given Featurestore.
2428 ///
2429 /// # Long running operations
2430 ///
2431 /// This method is used to start, and/or poll a [long-running Operation].
2432 /// The [Working with long-running operations] chapter in the [user guide]
2433 /// covers these operations in detail.
2434 ///
2435 /// [long-running operation]: https://google.aip.dev/151
2436 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2437 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2438 pub fn create_entity_type(&self) -> super::builder::featurestore_service::CreateEntityType {
2439 super::builder::featurestore_service::CreateEntityType::new(self.inner.clone())
2440 }
2441
2442 /// Gets details of a single EntityType.
2443 pub fn get_entity_type(&self) -> super::builder::featurestore_service::GetEntityType {
2444 super::builder::featurestore_service::GetEntityType::new(self.inner.clone())
2445 }
2446
2447 /// Lists EntityTypes in a given Featurestore.
2448 pub fn list_entity_types(&self) -> super::builder::featurestore_service::ListEntityTypes {
2449 super::builder::featurestore_service::ListEntityTypes::new(self.inner.clone())
2450 }
2451
2452 /// Updates the parameters of a single EntityType.
2453 pub fn update_entity_type(&self) -> super::builder::featurestore_service::UpdateEntityType {
2454 super::builder::featurestore_service::UpdateEntityType::new(self.inner.clone())
2455 }
2456
2457 /// Deletes a single EntityType. The EntityType must not have any Features
2458 /// or `force` must be set to true for the request to succeed.
2459 ///
2460 /// # Long running operations
2461 ///
2462 /// This method is used to start, and/or poll a [long-running Operation].
2463 /// The [Working with long-running operations] chapter in the [user guide]
2464 /// covers these operations in detail.
2465 ///
2466 /// [long-running operation]: https://google.aip.dev/151
2467 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2468 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2469 pub fn delete_entity_type(&self) -> super::builder::featurestore_service::DeleteEntityType {
2470 super::builder::featurestore_service::DeleteEntityType::new(self.inner.clone())
2471 }
2472
2473 /// Creates a new Feature in a given EntityType.
2474 ///
2475 /// # Long running operations
2476 ///
2477 /// This method is used to start, and/or poll a [long-running Operation].
2478 /// The [Working with long-running operations] chapter in the [user guide]
2479 /// covers these operations in detail.
2480 ///
2481 /// [long-running operation]: https://google.aip.dev/151
2482 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2483 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2484 pub fn create_feature(&self) -> super::builder::featurestore_service::CreateFeature {
2485 super::builder::featurestore_service::CreateFeature::new(self.inner.clone())
2486 }
2487
2488 /// Creates a batch of Features in a given EntityType.
2489 ///
2490 /// # Long running operations
2491 ///
2492 /// This method is used to start, and/or poll a [long-running Operation].
2493 /// The [Working with long-running operations] chapter in the [user guide]
2494 /// covers these operations in detail.
2495 ///
2496 /// [long-running operation]: https://google.aip.dev/151
2497 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2498 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2499 pub fn batch_create_features(
2500 &self,
2501 ) -> super::builder::featurestore_service::BatchCreateFeatures {
2502 super::builder::featurestore_service::BatchCreateFeatures::new(self.inner.clone())
2503 }
2504
2505 /// Gets details of a single Feature.
2506 pub fn get_feature(&self) -> super::builder::featurestore_service::GetFeature {
2507 super::builder::featurestore_service::GetFeature::new(self.inner.clone())
2508 }
2509
2510 /// Lists Features in a given EntityType.
2511 pub fn list_features(&self) -> super::builder::featurestore_service::ListFeatures {
2512 super::builder::featurestore_service::ListFeatures::new(self.inner.clone())
2513 }
2514
2515 /// Updates the parameters of a single Feature.
2516 pub fn update_feature(&self) -> super::builder::featurestore_service::UpdateFeature {
2517 super::builder::featurestore_service::UpdateFeature::new(self.inner.clone())
2518 }
2519
2520 /// Deletes a single Feature.
2521 ///
2522 /// # Long running operations
2523 ///
2524 /// This method is used to start, and/or poll a [long-running Operation].
2525 /// The [Working with long-running operations] chapter in the [user guide]
2526 /// covers these operations in detail.
2527 ///
2528 /// [long-running operation]: https://google.aip.dev/151
2529 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2530 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2531 pub fn delete_feature(&self) -> super::builder::featurestore_service::DeleteFeature {
2532 super::builder::featurestore_service::DeleteFeature::new(self.inner.clone())
2533 }
2534
2535 /// Imports Feature values into the Featurestore from a source storage.
2536 ///
2537 /// The progress of the import is tracked by the returned operation. The
2538 /// imported features are guaranteed to be visible to subsequent read
2539 /// operations after the operation is marked as successfully done.
2540 ///
2541 /// If an import operation fails, the Feature values returned from
2542 /// reads and exports may be inconsistent. If consistency is
2543 /// required, the caller must retry the same import request again and wait till
2544 /// the new operation returned is marked as successfully done.
2545 ///
2546 /// There are also scenarios where the caller can cause inconsistency.
2547 ///
2548 /// - Source data for import contains multiple distinct Feature values for
2549 /// the same entity ID and timestamp.
2550 /// - Source is modified during an import. This includes adding, updating, or
2551 /// removing source data and/or metadata. Examples of updating metadata
2552 /// include but are not limited to changing storage location, storage class,
2553 /// or retention policy.
2554 /// - Online serving cluster is under-provisioned.
2555 ///
2556 /// # Long running operations
2557 ///
2558 /// This method is used to start, and/or poll a [long-running Operation].
2559 /// The [Working with long-running operations] chapter in the [user guide]
2560 /// covers these operations in detail.
2561 ///
2562 /// [long-running operation]: https://google.aip.dev/151
2563 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2564 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2565 pub fn import_feature_values(
2566 &self,
2567 ) -> super::builder::featurestore_service::ImportFeatureValues {
2568 super::builder::featurestore_service::ImportFeatureValues::new(self.inner.clone())
2569 }
2570
2571 /// Batch reads Feature values from a Featurestore.
2572 ///
2573 /// This API enables batch reading Feature values, where each read
2574 /// instance in the batch may read Feature values of entities from one or
2575 /// more EntityTypes. Point-in-time correctness is guaranteed for Feature
2576 /// values of each read instance as of each instance's read timestamp.
2577 ///
2578 /// # Long running operations
2579 ///
2580 /// This method is used to start, and/or poll a [long-running Operation].
2581 /// The [Working with long-running operations] chapter in the [user guide]
2582 /// covers these operations in detail.
2583 ///
2584 /// [long-running operation]: https://google.aip.dev/151
2585 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2586 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2587 pub fn batch_read_feature_values(
2588 &self,
2589 ) -> super::builder::featurestore_service::BatchReadFeatureValues {
2590 super::builder::featurestore_service::BatchReadFeatureValues::new(self.inner.clone())
2591 }
2592
2593 /// Exports Feature values from all the entities of a target EntityType.
2594 ///
2595 /// # Long running operations
2596 ///
2597 /// This method is used to start, and/or poll a [long-running Operation].
2598 /// The [Working with long-running operations] chapter in the [user guide]
2599 /// covers these operations in detail.
2600 ///
2601 /// [long-running operation]: https://google.aip.dev/151
2602 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2603 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2604 pub fn export_feature_values(
2605 &self,
2606 ) -> super::builder::featurestore_service::ExportFeatureValues {
2607 super::builder::featurestore_service::ExportFeatureValues::new(self.inner.clone())
2608 }
2609
2610 /// Delete Feature values from Featurestore.
2611 ///
2612 /// The progress of the deletion is tracked by the returned operation. The
2613 /// deleted feature values are guaranteed to be invisible to subsequent read
2614 /// operations after the operation is marked as successfully done.
2615 ///
2616 /// If a delete feature values operation fails, the feature values
2617 /// returned from reads and exports may be inconsistent. If consistency is
2618 /// required, the caller must retry the same delete request again and wait till
2619 /// the new operation returned is marked as successfully done.
2620 ///
2621 /// # Long running operations
2622 ///
2623 /// This method is used to start, and/or poll a [long-running Operation].
2624 /// The [Working with long-running operations] chapter in the [user guide]
2625 /// covers these operations in detail.
2626 ///
2627 /// [long-running operation]: https://google.aip.dev/151
2628 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2629 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2630 pub fn delete_feature_values(
2631 &self,
2632 ) -> super::builder::featurestore_service::DeleteFeatureValues {
2633 super::builder::featurestore_service::DeleteFeatureValues::new(self.inner.clone())
2634 }
2635
2636 /// Searches Features matching a query in a given project.
2637 pub fn search_features(&self) -> super::builder::featurestore_service::SearchFeatures {
2638 super::builder::featurestore_service::SearchFeatures::new(self.inner.clone())
2639 }
2640
2641 /// Lists information about the supported locations for this service.
2642 pub fn list_locations(&self) -> super::builder::featurestore_service::ListLocations {
2643 super::builder::featurestore_service::ListLocations::new(self.inner.clone())
2644 }
2645
2646 /// Gets information about a location.
2647 pub fn get_location(&self) -> super::builder::featurestore_service::GetLocation {
2648 super::builder::featurestore_service::GetLocation::new(self.inner.clone())
2649 }
2650
2651 /// Sets the access control policy on the specified resource. Replaces
2652 /// any existing policy.
2653 ///
2654 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
2655 /// errors.
2656 pub fn set_iam_policy(&self) -> super::builder::featurestore_service::SetIamPolicy {
2657 super::builder::featurestore_service::SetIamPolicy::new(self.inner.clone())
2658 }
2659
2660 /// Gets the access control policy for a resource. Returns an empty policy
2661 /// if the resource exists and does not have a policy set.
2662 pub fn get_iam_policy(&self) -> super::builder::featurestore_service::GetIamPolicy {
2663 super::builder::featurestore_service::GetIamPolicy::new(self.inner.clone())
2664 }
2665
2666 /// Returns permissions that a caller has on the specified resource. If the
2667 /// resource does not exist, this will return an empty set of
2668 /// permissions, not a `NOT_FOUND` error.
2669 ///
2670 /// Note: This operation is designed to be used for building
2671 /// permission-aware UIs and command-line tools, not for authorization
2672 /// checking. This operation may "fail open" without warning.
2673 pub fn test_iam_permissions(&self) -> super::builder::featurestore_service::TestIamPermissions {
2674 super::builder::featurestore_service::TestIamPermissions::new(self.inner.clone())
2675 }
2676
2677 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2678 ///
2679 /// [google.longrunning.Operations]: longrunning::client::Operations
2680 pub fn list_operations(&self) -> super::builder::featurestore_service::ListOperations {
2681 super::builder::featurestore_service::ListOperations::new(self.inner.clone())
2682 }
2683
2684 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2685 ///
2686 /// [google.longrunning.Operations]: longrunning::client::Operations
2687 pub fn get_operation(&self) -> super::builder::featurestore_service::GetOperation {
2688 super::builder::featurestore_service::GetOperation::new(self.inner.clone())
2689 }
2690
2691 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2692 ///
2693 /// [google.longrunning.Operations]: longrunning::client::Operations
2694 pub fn delete_operation(&self) -> super::builder::featurestore_service::DeleteOperation {
2695 super::builder::featurestore_service::DeleteOperation::new(self.inner.clone())
2696 }
2697
2698 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2699 ///
2700 /// [google.longrunning.Operations]: longrunning::client::Operations
2701 pub fn cancel_operation(&self) -> super::builder::featurestore_service::CancelOperation {
2702 super::builder::featurestore_service::CancelOperation::new(self.inner.clone())
2703 }
2704
2705 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2706 ///
2707 /// [google.longrunning.Operations]: longrunning::client::Operations
2708 pub fn wait_operation(&self) -> super::builder::featurestore_service::WaitOperation {
2709 super::builder::featurestore_service::WaitOperation::new(self.inner.clone())
2710 }
2711}
2712
2713/// Implements a client for the Vertex AI API.
2714///
2715/// # Example
2716/// ```
2717/// # tokio_test::block_on(async {
2718/// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
2719/// let client = GenAiCacheService::builder().build().await?;
2720/// // use `client` to make requests to the Vertex AI API.
2721/// # gax::Result::<()>::Ok(()) });
2722/// ```
2723///
2724/// # Service Description
2725///
2726/// Service for managing Vertex AI's CachedContent resource.
2727///
2728/// # Configuration
2729///
2730/// To configure `GenAiCacheService` use the `with_*` methods in the type returned
2731/// by [builder()][GenAiCacheService::builder]. The default configuration should
2732/// work for most applications. Common configuration changes include
2733///
2734/// * [with_endpoint()]: by default this client uses the global default endpoint
2735/// (`https://aiplatform.googleapis.com`). Applications using regional
2736/// endpoints or running in restricted networks (e.g. a network configured
2737// with [Private Google Access with VPC Service Controls]) may want to
2738/// override this default.
2739/// * [with_credentials()]: by default this client uses
2740/// [Application Default Credentials]. Applications using custom
2741/// authentication may need to override this default.
2742///
2743/// [with_endpoint()]: super::builder::gen_ai_cache_service::ClientBuilder::with_endpoint
2744/// [with_credentials()]: super::builder::gen_ai_cache_service::ClientBuilder::credentials
2745/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2746/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2747///
2748/// # Pooling and Cloning
2749///
2750/// `GenAiCacheService` holds a connection pool internally, it is advised to
2751/// create one and the reuse it. You do not need to wrap `GenAiCacheService` in
2752/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2753/// already uses an `Arc` internally.
2754#[cfg(feature = "gen-ai-cache-service")]
2755#[cfg_attr(docsrs, doc(cfg(feature = "gen-ai-cache-service")))]
2756#[derive(Clone, Debug)]
2757pub struct GenAiCacheService {
2758 inner: std::sync::Arc<dyn super::stub::dynamic::GenAiCacheService>,
2759}
2760
2761#[cfg(feature = "gen-ai-cache-service")]
2762impl GenAiCacheService {
2763 /// Returns a builder for [GenAiCacheService].
2764 ///
2765 /// ```
2766 /// # tokio_test::block_on(async {
2767 /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
2768 /// let client = GenAiCacheService::builder().build().await?;
2769 /// # gax::Result::<()>::Ok(()) });
2770 /// ```
2771 pub fn builder() -> super::builder::gen_ai_cache_service::ClientBuilder {
2772 gax::client_builder::internal::new_builder(
2773 super::builder::gen_ai_cache_service::client::Factory,
2774 )
2775 }
2776
2777 /// Creates a new client from the provided stub.
2778 ///
2779 /// The most common case for calling this function is in tests mocking the
2780 /// client's behavior.
2781 pub fn from_stub<T>(stub: T) -> Self
2782 where
2783 T: super::stub::GenAiCacheService + 'static,
2784 {
2785 Self {
2786 inner: std::sync::Arc::new(stub),
2787 }
2788 }
2789
2790 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
2791 let inner = Self::build_inner(config).await?;
2792 Ok(Self { inner })
2793 }
2794
2795 async fn build_inner(
2796 conf: gaxi::options::ClientConfig,
2797 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::GenAiCacheService>> {
2798 if gaxi::options::tracing_enabled(&conf) {
2799 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2800 }
2801 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2802 }
2803
2804 async fn build_transport(
2805 conf: gaxi::options::ClientConfig,
2806 ) -> Result<impl super::stub::GenAiCacheService> {
2807 super::transport::GenAiCacheService::new(conf).await
2808 }
2809
2810 async fn build_with_tracing(
2811 conf: gaxi::options::ClientConfig,
2812 ) -> Result<impl super::stub::GenAiCacheService> {
2813 Self::build_transport(conf)
2814 .await
2815 .map(super::tracing::GenAiCacheService::new)
2816 }
2817
2818 /// Creates cached content, this call will initialize the cached content in the
2819 /// data storage, and users need to pay for the cache data storage.
2820 pub fn create_cached_content(
2821 &self,
2822 ) -> super::builder::gen_ai_cache_service::CreateCachedContent {
2823 super::builder::gen_ai_cache_service::CreateCachedContent::new(self.inner.clone())
2824 }
2825
2826 /// Gets cached content configurations
2827 pub fn get_cached_content(&self) -> super::builder::gen_ai_cache_service::GetCachedContent {
2828 super::builder::gen_ai_cache_service::GetCachedContent::new(self.inner.clone())
2829 }
2830
2831 /// Updates cached content configurations
2832 pub fn update_cached_content(
2833 &self,
2834 ) -> super::builder::gen_ai_cache_service::UpdateCachedContent {
2835 super::builder::gen_ai_cache_service::UpdateCachedContent::new(self.inner.clone())
2836 }
2837
2838 /// Deletes cached content
2839 pub fn delete_cached_content(
2840 &self,
2841 ) -> super::builder::gen_ai_cache_service::DeleteCachedContent {
2842 super::builder::gen_ai_cache_service::DeleteCachedContent::new(self.inner.clone())
2843 }
2844
2845 /// Lists cached contents in a project
2846 pub fn list_cached_contents(&self) -> super::builder::gen_ai_cache_service::ListCachedContents {
2847 super::builder::gen_ai_cache_service::ListCachedContents::new(self.inner.clone())
2848 }
2849
2850 /// Lists information about the supported locations for this service.
2851 pub fn list_locations(&self) -> super::builder::gen_ai_cache_service::ListLocations {
2852 super::builder::gen_ai_cache_service::ListLocations::new(self.inner.clone())
2853 }
2854
2855 /// Gets information about a location.
2856 pub fn get_location(&self) -> super::builder::gen_ai_cache_service::GetLocation {
2857 super::builder::gen_ai_cache_service::GetLocation::new(self.inner.clone())
2858 }
2859
2860 /// Sets the access control policy on the specified resource. Replaces
2861 /// any existing policy.
2862 ///
2863 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
2864 /// errors.
2865 pub fn set_iam_policy(&self) -> super::builder::gen_ai_cache_service::SetIamPolicy {
2866 super::builder::gen_ai_cache_service::SetIamPolicy::new(self.inner.clone())
2867 }
2868
2869 /// Gets the access control policy for a resource. Returns an empty policy
2870 /// if the resource exists and does not have a policy set.
2871 pub fn get_iam_policy(&self) -> super::builder::gen_ai_cache_service::GetIamPolicy {
2872 super::builder::gen_ai_cache_service::GetIamPolicy::new(self.inner.clone())
2873 }
2874
2875 /// Returns permissions that a caller has on the specified resource. If the
2876 /// resource does not exist, this will return an empty set of
2877 /// permissions, not a `NOT_FOUND` error.
2878 ///
2879 /// Note: This operation is designed to be used for building
2880 /// permission-aware UIs and command-line tools, not for authorization
2881 /// checking. This operation may "fail open" without warning.
2882 pub fn test_iam_permissions(&self) -> super::builder::gen_ai_cache_service::TestIamPermissions {
2883 super::builder::gen_ai_cache_service::TestIamPermissions::new(self.inner.clone())
2884 }
2885
2886 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2887 ///
2888 /// [google.longrunning.Operations]: longrunning::client::Operations
2889 pub fn list_operations(&self) -> super::builder::gen_ai_cache_service::ListOperations {
2890 super::builder::gen_ai_cache_service::ListOperations::new(self.inner.clone())
2891 }
2892
2893 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2894 ///
2895 /// [google.longrunning.Operations]: longrunning::client::Operations
2896 pub fn get_operation(&self) -> super::builder::gen_ai_cache_service::GetOperation {
2897 super::builder::gen_ai_cache_service::GetOperation::new(self.inner.clone())
2898 }
2899
2900 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2901 ///
2902 /// [google.longrunning.Operations]: longrunning::client::Operations
2903 pub fn delete_operation(&self) -> super::builder::gen_ai_cache_service::DeleteOperation {
2904 super::builder::gen_ai_cache_service::DeleteOperation::new(self.inner.clone())
2905 }
2906
2907 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2908 ///
2909 /// [google.longrunning.Operations]: longrunning::client::Operations
2910 pub fn cancel_operation(&self) -> super::builder::gen_ai_cache_service::CancelOperation {
2911 super::builder::gen_ai_cache_service::CancelOperation::new(self.inner.clone())
2912 }
2913
2914 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2915 ///
2916 /// [google.longrunning.Operations]: longrunning::client::Operations
2917 pub fn wait_operation(&self) -> super::builder::gen_ai_cache_service::WaitOperation {
2918 super::builder::gen_ai_cache_service::WaitOperation::new(self.inner.clone())
2919 }
2920}
2921
2922/// Implements a client for the Vertex AI API.
2923///
2924/// # Example
2925/// ```
2926/// # tokio_test::block_on(async {
2927/// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
2928/// let client = GenAiTuningService::builder().build().await?;
2929/// // use `client` to make requests to the Vertex AI API.
2930/// # gax::Result::<()>::Ok(()) });
2931/// ```
2932///
2933/// # Service Description
2934///
2935/// A service for creating and managing GenAI Tuning Jobs.
2936///
2937/// # Configuration
2938///
2939/// To configure `GenAiTuningService` use the `with_*` methods in the type returned
2940/// by [builder()][GenAiTuningService::builder]. The default configuration should
2941/// work for most applications. Common configuration changes include
2942///
2943/// * [with_endpoint()]: by default this client uses the global default endpoint
2944/// (`https://aiplatform.googleapis.com`). Applications using regional
2945/// endpoints or running in restricted networks (e.g. a network configured
2946// with [Private Google Access with VPC Service Controls]) may want to
2947/// override this default.
2948/// * [with_credentials()]: by default this client uses
2949/// [Application Default Credentials]. Applications using custom
2950/// authentication may need to override this default.
2951///
2952/// [with_endpoint()]: super::builder::gen_ai_tuning_service::ClientBuilder::with_endpoint
2953/// [with_credentials()]: super::builder::gen_ai_tuning_service::ClientBuilder::credentials
2954/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2955/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2956///
2957/// # Pooling and Cloning
2958///
2959/// `GenAiTuningService` holds a connection pool internally, it is advised to
2960/// create one and the reuse it. You do not need to wrap `GenAiTuningService` in
2961/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2962/// already uses an `Arc` internally.
2963#[cfg(feature = "gen-ai-tuning-service")]
2964#[cfg_attr(docsrs, doc(cfg(feature = "gen-ai-tuning-service")))]
2965#[derive(Clone, Debug)]
2966pub struct GenAiTuningService {
2967 inner: std::sync::Arc<dyn super::stub::dynamic::GenAiTuningService>,
2968}
2969
2970#[cfg(feature = "gen-ai-tuning-service")]
2971impl GenAiTuningService {
2972 /// Returns a builder for [GenAiTuningService].
2973 ///
2974 /// ```
2975 /// # tokio_test::block_on(async {
2976 /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
2977 /// let client = GenAiTuningService::builder().build().await?;
2978 /// # gax::Result::<()>::Ok(()) });
2979 /// ```
2980 pub fn builder() -> super::builder::gen_ai_tuning_service::ClientBuilder {
2981 gax::client_builder::internal::new_builder(
2982 super::builder::gen_ai_tuning_service::client::Factory,
2983 )
2984 }
2985
2986 /// Creates a new client from the provided stub.
2987 ///
2988 /// The most common case for calling this function is in tests mocking the
2989 /// client's behavior.
2990 pub fn from_stub<T>(stub: T) -> Self
2991 where
2992 T: super::stub::GenAiTuningService + 'static,
2993 {
2994 Self {
2995 inner: std::sync::Arc::new(stub),
2996 }
2997 }
2998
2999 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
3000 let inner = Self::build_inner(config).await?;
3001 Ok(Self { inner })
3002 }
3003
3004 async fn build_inner(
3005 conf: gaxi::options::ClientConfig,
3006 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::GenAiTuningService>> {
3007 if gaxi::options::tracing_enabled(&conf) {
3008 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3009 }
3010 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3011 }
3012
3013 async fn build_transport(
3014 conf: gaxi::options::ClientConfig,
3015 ) -> Result<impl super::stub::GenAiTuningService> {
3016 super::transport::GenAiTuningService::new(conf).await
3017 }
3018
3019 async fn build_with_tracing(
3020 conf: gaxi::options::ClientConfig,
3021 ) -> Result<impl super::stub::GenAiTuningService> {
3022 Self::build_transport(conf)
3023 .await
3024 .map(super::tracing::GenAiTuningService::new)
3025 }
3026
3027 /// Creates a TuningJob. A created TuningJob right away will be attempted to
3028 /// be run.
3029 pub fn create_tuning_job(&self) -> super::builder::gen_ai_tuning_service::CreateTuningJob {
3030 super::builder::gen_ai_tuning_service::CreateTuningJob::new(self.inner.clone())
3031 }
3032
3033 /// Gets a TuningJob.
3034 pub fn get_tuning_job(&self) -> super::builder::gen_ai_tuning_service::GetTuningJob {
3035 super::builder::gen_ai_tuning_service::GetTuningJob::new(self.inner.clone())
3036 }
3037
3038 /// Lists TuningJobs in a Location.
3039 pub fn list_tuning_jobs(&self) -> super::builder::gen_ai_tuning_service::ListTuningJobs {
3040 super::builder::gen_ai_tuning_service::ListTuningJobs::new(self.inner.clone())
3041 }
3042
3043 /// Cancels a TuningJob.
3044 /// Starts asynchronous cancellation on the TuningJob. The server makes a best
3045 /// effort to cancel the job, but success is not guaranteed. Clients can use
3046 /// [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob]
3047 /// or other methods to check whether the cancellation succeeded or whether the
3048 /// job completed despite cancellation. On successful cancellation, the
3049 /// TuningJob is not deleted; instead it becomes a job with a
3050 /// [TuningJob.error][google.cloud.aiplatform.v1.TuningJob.error] value with a
3051 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
3052 /// `Code.CANCELLED`, and
3053 /// [TuningJob.state][google.cloud.aiplatform.v1.TuningJob.state] is set to
3054 /// `CANCELLED`.
3055 ///
3056 /// [google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob]: crate::client::GenAiTuningService::get_tuning_job
3057 /// [google.cloud.aiplatform.v1.TuningJob.error]: crate::model::TuningJob::error
3058 /// [google.cloud.aiplatform.v1.TuningJob.state]: crate::model::TuningJob::state
3059 /// [google.rpc.Status.code]: rpc::model::Status::code
3060 pub fn cancel_tuning_job(&self) -> super::builder::gen_ai_tuning_service::CancelTuningJob {
3061 super::builder::gen_ai_tuning_service::CancelTuningJob::new(self.inner.clone())
3062 }
3063
3064 /// Rebase a TunedModel.
3065 ///
3066 /// # Long running operations
3067 ///
3068 /// This method is used to start, and/or poll a [long-running Operation].
3069 /// The [Working with long-running operations] chapter in the [user guide]
3070 /// covers these operations in detail.
3071 ///
3072 /// [long-running operation]: https://google.aip.dev/151
3073 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3074 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3075 pub fn rebase_tuned_model(&self) -> super::builder::gen_ai_tuning_service::RebaseTunedModel {
3076 super::builder::gen_ai_tuning_service::RebaseTunedModel::new(self.inner.clone())
3077 }
3078
3079 /// Lists information about the supported locations for this service.
3080 pub fn list_locations(&self) -> super::builder::gen_ai_tuning_service::ListLocations {
3081 super::builder::gen_ai_tuning_service::ListLocations::new(self.inner.clone())
3082 }
3083
3084 /// Gets information about a location.
3085 pub fn get_location(&self) -> super::builder::gen_ai_tuning_service::GetLocation {
3086 super::builder::gen_ai_tuning_service::GetLocation::new(self.inner.clone())
3087 }
3088
3089 /// Sets the access control policy on the specified resource. Replaces
3090 /// any existing policy.
3091 ///
3092 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
3093 /// errors.
3094 pub fn set_iam_policy(&self) -> super::builder::gen_ai_tuning_service::SetIamPolicy {
3095 super::builder::gen_ai_tuning_service::SetIamPolicy::new(self.inner.clone())
3096 }
3097
3098 /// Gets the access control policy for a resource. Returns an empty policy
3099 /// if the resource exists and does not have a policy set.
3100 pub fn get_iam_policy(&self) -> super::builder::gen_ai_tuning_service::GetIamPolicy {
3101 super::builder::gen_ai_tuning_service::GetIamPolicy::new(self.inner.clone())
3102 }
3103
3104 /// Returns permissions that a caller has on the specified resource. If the
3105 /// resource does not exist, this will return an empty set of
3106 /// permissions, not a `NOT_FOUND` error.
3107 ///
3108 /// Note: This operation is designed to be used for building
3109 /// permission-aware UIs and command-line tools, not for authorization
3110 /// checking. This operation may "fail open" without warning.
3111 pub fn test_iam_permissions(
3112 &self,
3113 ) -> super::builder::gen_ai_tuning_service::TestIamPermissions {
3114 super::builder::gen_ai_tuning_service::TestIamPermissions::new(self.inner.clone())
3115 }
3116
3117 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3118 ///
3119 /// [google.longrunning.Operations]: longrunning::client::Operations
3120 pub fn list_operations(&self) -> super::builder::gen_ai_tuning_service::ListOperations {
3121 super::builder::gen_ai_tuning_service::ListOperations::new(self.inner.clone())
3122 }
3123
3124 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3125 ///
3126 /// [google.longrunning.Operations]: longrunning::client::Operations
3127 pub fn get_operation(&self) -> super::builder::gen_ai_tuning_service::GetOperation {
3128 super::builder::gen_ai_tuning_service::GetOperation::new(self.inner.clone())
3129 }
3130
3131 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3132 ///
3133 /// [google.longrunning.Operations]: longrunning::client::Operations
3134 pub fn delete_operation(&self) -> super::builder::gen_ai_tuning_service::DeleteOperation {
3135 super::builder::gen_ai_tuning_service::DeleteOperation::new(self.inner.clone())
3136 }
3137
3138 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3139 ///
3140 /// [google.longrunning.Operations]: longrunning::client::Operations
3141 pub fn cancel_operation(&self) -> super::builder::gen_ai_tuning_service::CancelOperation {
3142 super::builder::gen_ai_tuning_service::CancelOperation::new(self.inner.clone())
3143 }
3144
3145 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3146 ///
3147 /// [google.longrunning.Operations]: longrunning::client::Operations
3148 pub fn wait_operation(&self) -> super::builder::gen_ai_tuning_service::WaitOperation {
3149 super::builder::gen_ai_tuning_service::WaitOperation::new(self.inner.clone())
3150 }
3151}
3152
3153/// Implements a client for the Vertex AI API.
3154///
3155/// # Example
3156/// ```
3157/// # tokio_test::block_on(async {
3158/// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
3159/// let client = IndexEndpointService::builder().build().await?;
3160/// // use `client` to make requests to the Vertex AI API.
3161/// # gax::Result::<()>::Ok(()) });
3162/// ```
3163///
3164/// # Service Description
3165///
3166/// A service for managing Vertex AI's IndexEndpoints.
3167///
3168/// # Configuration
3169///
3170/// To configure `IndexEndpointService` use the `with_*` methods in the type returned
3171/// by [builder()][IndexEndpointService::builder]. The default configuration should
3172/// work for most applications. Common configuration changes include
3173///
3174/// * [with_endpoint()]: by default this client uses the global default endpoint
3175/// (`https://aiplatform.googleapis.com`). Applications using regional
3176/// endpoints or running in restricted networks (e.g. a network configured
3177// with [Private Google Access with VPC Service Controls]) may want to
3178/// override this default.
3179/// * [with_credentials()]: by default this client uses
3180/// [Application Default Credentials]. Applications using custom
3181/// authentication may need to override this default.
3182///
3183/// [with_endpoint()]: super::builder::index_endpoint_service::ClientBuilder::with_endpoint
3184/// [with_credentials()]: super::builder::index_endpoint_service::ClientBuilder::credentials
3185/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3186/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3187///
3188/// # Pooling and Cloning
3189///
3190/// `IndexEndpointService` holds a connection pool internally, it is advised to
3191/// create one and the reuse it. You do not need to wrap `IndexEndpointService` in
3192/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3193/// already uses an `Arc` internally.
3194#[cfg(feature = "index-endpoint-service")]
3195#[cfg_attr(docsrs, doc(cfg(feature = "index-endpoint-service")))]
3196#[derive(Clone, Debug)]
3197pub struct IndexEndpointService {
3198 inner: std::sync::Arc<dyn super::stub::dynamic::IndexEndpointService>,
3199}
3200
3201#[cfg(feature = "index-endpoint-service")]
3202impl IndexEndpointService {
3203 /// Returns a builder for [IndexEndpointService].
3204 ///
3205 /// ```
3206 /// # tokio_test::block_on(async {
3207 /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
3208 /// let client = IndexEndpointService::builder().build().await?;
3209 /// # gax::Result::<()>::Ok(()) });
3210 /// ```
3211 pub fn builder() -> super::builder::index_endpoint_service::ClientBuilder {
3212 gax::client_builder::internal::new_builder(
3213 super::builder::index_endpoint_service::client::Factory,
3214 )
3215 }
3216
3217 /// Creates a new client from the provided stub.
3218 ///
3219 /// The most common case for calling this function is in tests mocking the
3220 /// client's behavior.
3221 pub fn from_stub<T>(stub: T) -> Self
3222 where
3223 T: super::stub::IndexEndpointService + 'static,
3224 {
3225 Self {
3226 inner: std::sync::Arc::new(stub),
3227 }
3228 }
3229
3230 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
3231 let inner = Self::build_inner(config).await?;
3232 Ok(Self { inner })
3233 }
3234
3235 async fn build_inner(
3236 conf: gaxi::options::ClientConfig,
3237 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::IndexEndpointService>> {
3238 if gaxi::options::tracing_enabled(&conf) {
3239 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3240 }
3241 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3242 }
3243
3244 async fn build_transport(
3245 conf: gaxi::options::ClientConfig,
3246 ) -> Result<impl super::stub::IndexEndpointService> {
3247 super::transport::IndexEndpointService::new(conf).await
3248 }
3249
3250 async fn build_with_tracing(
3251 conf: gaxi::options::ClientConfig,
3252 ) -> Result<impl super::stub::IndexEndpointService> {
3253 Self::build_transport(conf)
3254 .await
3255 .map(super::tracing::IndexEndpointService::new)
3256 }
3257
3258 /// Creates an IndexEndpoint.
3259 ///
3260 /// # Long running operations
3261 ///
3262 /// This method is used to start, and/or poll a [long-running Operation].
3263 /// The [Working with long-running operations] chapter in the [user guide]
3264 /// covers these operations in detail.
3265 ///
3266 /// [long-running operation]: https://google.aip.dev/151
3267 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3268 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3269 pub fn create_index_endpoint(
3270 &self,
3271 ) -> super::builder::index_endpoint_service::CreateIndexEndpoint {
3272 super::builder::index_endpoint_service::CreateIndexEndpoint::new(self.inner.clone())
3273 }
3274
3275 /// Gets an IndexEndpoint.
3276 pub fn get_index_endpoint(&self) -> super::builder::index_endpoint_service::GetIndexEndpoint {
3277 super::builder::index_endpoint_service::GetIndexEndpoint::new(self.inner.clone())
3278 }
3279
3280 /// Lists IndexEndpoints in a Location.
3281 pub fn list_index_endpoints(
3282 &self,
3283 ) -> super::builder::index_endpoint_service::ListIndexEndpoints {
3284 super::builder::index_endpoint_service::ListIndexEndpoints::new(self.inner.clone())
3285 }
3286
3287 /// Updates an IndexEndpoint.
3288 pub fn update_index_endpoint(
3289 &self,
3290 ) -> super::builder::index_endpoint_service::UpdateIndexEndpoint {
3291 super::builder::index_endpoint_service::UpdateIndexEndpoint::new(self.inner.clone())
3292 }
3293
3294 /// Deletes an IndexEndpoint.
3295 ///
3296 /// # Long running operations
3297 ///
3298 /// This method is used to start, and/or poll a [long-running Operation].
3299 /// The [Working with long-running operations] chapter in the [user guide]
3300 /// covers these operations in detail.
3301 ///
3302 /// [long-running operation]: https://google.aip.dev/151
3303 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3304 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3305 pub fn delete_index_endpoint(
3306 &self,
3307 ) -> super::builder::index_endpoint_service::DeleteIndexEndpoint {
3308 super::builder::index_endpoint_service::DeleteIndexEndpoint::new(self.inner.clone())
3309 }
3310
3311 /// Deploys an Index into this IndexEndpoint, creating a DeployedIndex within
3312 /// it.
3313 /// Only non-empty Indexes can be deployed.
3314 ///
3315 /// # Long running operations
3316 ///
3317 /// This method is used to start, and/or poll a [long-running Operation].
3318 /// The [Working with long-running operations] chapter in the [user guide]
3319 /// covers these operations in detail.
3320 ///
3321 /// [long-running operation]: https://google.aip.dev/151
3322 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3323 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3324 pub fn deploy_index(&self) -> super::builder::index_endpoint_service::DeployIndex {
3325 super::builder::index_endpoint_service::DeployIndex::new(self.inner.clone())
3326 }
3327
3328 /// Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it,
3329 /// and freeing all resources it's using.
3330 ///
3331 /// # Long running operations
3332 ///
3333 /// This method is used to start, and/or poll a [long-running Operation].
3334 /// The [Working with long-running operations] chapter in the [user guide]
3335 /// covers these operations in detail.
3336 ///
3337 /// [long-running operation]: https://google.aip.dev/151
3338 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3339 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3340 pub fn undeploy_index(&self) -> super::builder::index_endpoint_service::UndeployIndex {
3341 super::builder::index_endpoint_service::UndeployIndex::new(self.inner.clone())
3342 }
3343
3344 /// Update an existing DeployedIndex under an IndexEndpoint.
3345 ///
3346 /// # Long running operations
3347 ///
3348 /// This method is used to start, and/or poll a [long-running Operation].
3349 /// The [Working with long-running operations] chapter in the [user guide]
3350 /// covers these operations in detail.
3351 ///
3352 /// [long-running operation]: https://google.aip.dev/151
3353 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3354 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3355 pub fn mutate_deployed_index(
3356 &self,
3357 ) -> super::builder::index_endpoint_service::MutateDeployedIndex {
3358 super::builder::index_endpoint_service::MutateDeployedIndex::new(self.inner.clone())
3359 }
3360
3361 /// Lists information about the supported locations for this service.
3362 pub fn list_locations(&self) -> super::builder::index_endpoint_service::ListLocations {
3363 super::builder::index_endpoint_service::ListLocations::new(self.inner.clone())
3364 }
3365
3366 /// Gets information about a location.
3367 pub fn get_location(&self) -> super::builder::index_endpoint_service::GetLocation {
3368 super::builder::index_endpoint_service::GetLocation::new(self.inner.clone())
3369 }
3370
3371 /// Sets the access control policy on the specified resource. Replaces
3372 /// any existing policy.
3373 ///
3374 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
3375 /// errors.
3376 pub fn set_iam_policy(&self) -> super::builder::index_endpoint_service::SetIamPolicy {
3377 super::builder::index_endpoint_service::SetIamPolicy::new(self.inner.clone())
3378 }
3379
3380 /// Gets the access control policy for a resource. Returns an empty policy
3381 /// if the resource exists and does not have a policy set.
3382 pub fn get_iam_policy(&self) -> super::builder::index_endpoint_service::GetIamPolicy {
3383 super::builder::index_endpoint_service::GetIamPolicy::new(self.inner.clone())
3384 }
3385
3386 /// Returns permissions that a caller has on the specified resource. If the
3387 /// resource does not exist, this will return an empty set of
3388 /// permissions, not a `NOT_FOUND` error.
3389 ///
3390 /// Note: This operation is designed to be used for building
3391 /// permission-aware UIs and command-line tools, not for authorization
3392 /// checking. This operation may "fail open" without warning.
3393 pub fn test_iam_permissions(
3394 &self,
3395 ) -> super::builder::index_endpoint_service::TestIamPermissions {
3396 super::builder::index_endpoint_service::TestIamPermissions::new(self.inner.clone())
3397 }
3398
3399 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3400 ///
3401 /// [google.longrunning.Operations]: longrunning::client::Operations
3402 pub fn list_operations(&self) -> super::builder::index_endpoint_service::ListOperations {
3403 super::builder::index_endpoint_service::ListOperations::new(self.inner.clone())
3404 }
3405
3406 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3407 ///
3408 /// [google.longrunning.Operations]: longrunning::client::Operations
3409 pub fn get_operation(&self) -> super::builder::index_endpoint_service::GetOperation {
3410 super::builder::index_endpoint_service::GetOperation::new(self.inner.clone())
3411 }
3412
3413 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3414 ///
3415 /// [google.longrunning.Operations]: longrunning::client::Operations
3416 pub fn delete_operation(&self) -> super::builder::index_endpoint_service::DeleteOperation {
3417 super::builder::index_endpoint_service::DeleteOperation::new(self.inner.clone())
3418 }
3419
3420 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3421 ///
3422 /// [google.longrunning.Operations]: longrunning::client::Operations
3423 pub fn cancel_operation(&self) -> super::builder::index_endpoint_service::CancelOperation {
3424 super::builder::index_endpoint_service::CancelOperation::new(self.inner.clone())
3425 }
3426
3427 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3428 ///
3429 /// [google.longrunning.Operations]: longrunning::client::Operations
3430 pub fn wait_operation(&self) -> super::builder::index_endpoint_service::WaitOperation {
3431 super::builder::index_endpoint_service::WaitOperation::new(self.inner.clone())
3432 }
3433}
3434
3435/// Implements a client for the Vertex AI API.
3436///
3437/// # Example
3438/// ```
3439/// # tokio_test::block_on(async {
3440/// # use google_cloud_aiplatform_v1::client::IndexService;
3441/// let client = IndexService::builder().build().await?;
3442/// // use `client` to make requests to the Vertex AI API.
3443/// # gax::Result::<()>::Ok(()) });
3444/// ```
3445///
3446/// # Service Description
3447///
3448/// A service for creating and managing Vertex AI's Index resources.
3449///
3450/// # Configuration
3451///
3452/// To configure `IndexService` use the `with_*` methods in the type returned
3453/// by [builder()][IndexService::builder]. The default configuration should
3454/// work for most applications. Common configuration changes include
3455///
3456/// * [with_endpoint()]: by default this client uses the global default endpoint
3457/// (`https://aiplatform.googleapis.com`). Applications using regional
3458/// endpoints or running in restricted networks (e.g. a network configured
3459// with [Private Google Access with VPC Service Controls]) may want to
3460/// override this default.
3461/// * [with_credentials()]: by default this client uses
3462/// [Application Default Credentials]. Applications using custom
3463/// authentication may need to override this default.
3464///
3465/// [with_endpoint()]: super::builder::index_service::ClientBuilder::with_endpoint
3466/// [with_credentials()]: super::builder::index_service::ClientBuilder::credentials
3467/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3468/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3469///
3470/// # Pooling and Cloning
3471///
3472/// `IndexService` holds a connection pool internally, it is advised to
3473/// create one and the reuse it. You do not need to wrap `IndexService` in
3474/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3475/// already uses an `Arc` internally.
3476#[cfg(feature = "index-service")]
3477#[cfg_attr(docsrs, doc(cfg(feature = "index-service")))]
3478#[derive(Clone, Debug)]
3479pub struct IndexService {
3480 inner: std::sync::Arc<dyn super::stub::dynamic::IndexService>,
3481}
3482
3483#[cfg(feature = "index-service")]
3484impl IndexService {
3485 /// Returns a builder for [IndexService].
3486 ///
3487 /// ```
3488 /// # tokio_test::block_on(async {
3489 /// # use google_cloud_aiplatform_v1::client::IndexService;
3490 /// let client = IndexService::builder().build().await?;
3491 /// # gax::Result::<()>::Ok(()) });
3492 /// ```
3493 pub fn builder() -> super::builder::index_service::ClientBuilder {
3494 gax::client_builder::internal::new_builder(super::builder::index_service::client::Factory)
3495 }
3496
3497 /// Creates a new client from the provided stub.
3498 ///
3499 /// The most common case for calling this function is in tests mocking the
3500 /// client's behavior.
3501 pub fn from_stub<T>(stub: T) -> Self
3502 where
3503 T: super::stub::IndexService + 'static,
3504 {
3505 Self {
3506 inner: std::sync::Arc::new(stub),
3507 }
3508 }
3509
3510 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
3511 let inner = Self::build_inner(config).await?;
3512 Ok(Self { inner })
3513 }
3514
3515 async fn build_inner(
3516 conf: gaxi::options::ClientConfig,
3517 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::IndexService>> {
3518 if gaxi::options::tracing_enabled(&conf) {
3519 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3520 }
3521 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3522 }
3523
3524 async fn build_transport(
3525 conf: gaxi::options::ClientConfig,
3526 ) -> Result<impl super::stub::IndexService> {
3527 super::transport::IndexService::new(conf).await
3528 }
3529
3530 async fn build_with_tracing(
3531 conf: gaxi::options::ClientConfig,
3532 ) -> Result<impl super::stub::IndexService> {
3533 Self::build_transport(conf)
3534 .await
3535 .map(super::tracing::IndexService::new)
3536 }
3537
3538 /// Creates an Index.
3539 ///
3540 /// # Long running operations
3541 ///
3542 /// This method is used to start, and/or poll a [long-running Operation].
3543 /// The [Working with long-running operations] chapter in the [user guide]
3544 /// covers these operations in detail.
3545 ///
3546 /// [long-running operation]: https://google.aip.dev/151
3547 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3548 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3549 pub fn create_index(&self) -> super::builder::index_service::CreateIndex {
3550 super::builder::index_service::CreateIndex::new(self.inner.clone())
3551 }
3552
3553 /// Gets an Index.
3554 pub fn get_index(&self) -> super::builder::index_service::GetIndex {
3555 super::builder::index_service::GetIndex::new(self.inner.clone())
3556 }
3557
3558 /// Lists Indexes in a Location.
3559 pub fn list_indexes(&self) -> super::builder::index_service::ListIndexes {
3560 super::builder::index_service::ListIndexes::new(self.inner.clone())
3561 }
3562
3563 /// Updates an Index.
3564 ///
3565 /// # Long running operations
3566 ///
3567 /// This method is used to start, and/or poll a [long-running Operation].
3568 /// The [Working with long-running operations] chapter in the [user guide]
3569 /// covers these operations in detail.
3570 ///
3571 /// [long-running operation]: https://google.aip.dev/151
3572 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3573 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3574 pub fn update_index(&self) -> super::builder::index_service::UpdateIndex {
3575 super::builder::index_service::UpdateIndex::new(self.inner.clone())
3576 }
3577
3578 /// Deletes an Index.
3579 /// An Index can only be deleted when all its
3580 /// [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had
3581 /// been undeployed.
3582 ///
3583 /// [google.cloud.aiplatform.v1.Index.deployed_indexes]: crate::model::Index::deployed_indexes
3584 ///
3585 /// # Long running operations
3586 ///
3587 /// This method is used to start, and/or poll a [long-running Operation].
3588 /// The [Working with long-running operations] chapter in the [user guide]
3589 /// covers these operations in detail.
3590 ///
3591 /// [long-running operation]: https://google.aip.dev/151
3592 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3593 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3594 pub fn delete_index(&self) -> super::builder::index_service::DeleteIndex {
3595 super::builder::index_service::DeleteIndex::new(self.inner.clone())
3596 }
3597
3598 /// Add/update Datapoints into an Index.
3599 pub fn upsert_datapoints(&self) -> super::builder::index_service::UpsertDatapoints {
3600 super::builder::index_service::UpsertDatapoints::new(self.inner.clone())
3601 }
3602
3603 /// Remove Datapoints from an Index.
3604 pub fn remove_datapoints(&self) -> super::builder::index_service::RemoveDatapoints {
3605 super::builder::index_service::RemoveDatapoints::new(self.inner.clone())
3606 }
3607
3608 /// Lists information about the supported locations for this service.
3609 pub fn list_locations(&self) -> super::builder::index_service::ListLocations {
3610 super::builder::index_service::ListLocations::new(self.inner.clone())
3611 }
3612
3613 /// Gets information about a location.
3614 pub fn get_location(&self) -> super::builder::index_service::GetLocation {
3615 super::builder::index_service::GetLocation::new(self.inner.clone())
3616 }
3617
3618 /// Sets the access control policy on the specified resource. Replaces
3619 /// any existing policy.
3620 ///
3621 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
3622 /// errors.
3623 pub fn set_iam_policy(&self) -> super::builder::index_service::SetIamPolicy {
3624 super::builder::index_service::SetIamPolicy::new(self.inner.clone())
3625 }
3626
3627 /// Gets the access control policy for a resource. Returns an empty policy
3628 /// if the resource exists and does not have a policy set.
3629 pub fn get_iam_policy(&self) -> super::builder::index_service::GetIamPolicy {
3630 super::builder::index_service::GetIamPolicy::new(self.inner.clone())
3631 }
3632
3633 /// Returns permissions that a caller has on the specified resource. If the
3634 /// resource does not exist, this will return an empty set of
3635 /// permissions, not a `NOT_FOUND` error.
3636 ///
3637 /// Note: This operation is designed to be used for building
3638 /// permission-aware UIs and command-line tools, not for authorization
3639 /// checking. This operation may "fail open" without warning.
3640 pub fn test_iam_permissions(&self) -> super::builder::index_service::TestIamPermissions {
3641 super::builder::index_service::TestIamPermissions::new(self.inner.clone())
3642 }
3643
3644 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3645 ///
3646 /// [google.longrunning.Operations]: longrunning::client::Operations
3647 pub fn list_operations(&self) -> super::builder::index_service::ListOperations {
3648 super::builder::index_service::ListOperations::new(self.inner.clone())
3649 }
3650
3651 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3652 ///
3653 /// [google.longrunning.Operations]: longrunning::client::Operations
3654 pub fn get_operation(&self) -> super::builder::index_service::GetOperation {
3655 super::builder::index_service::GetOperation::new(self.inner.clone())
3656 }
3657
3658 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3659 ///
3660 /// [google.longrunning.Operations]: longrunning::client::Operations
3661 pub fn delete_operation(&self) -> super::builder::index_service::DeleteOperation {
3662 super::builder::index_service::DeleteOperation::new(self.inner.clone())
3663 }
3664
3665 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3666 ///
3667 /// [google.longrunning.Operations]: longrunning::client::Operations
3668 pub fn cancel_operation(&self) -> super::builder::index_service::CancelOperation {
3669 super::builder::index_service::CancelOperation::new(self.inner.clone())
3670 }
3671
3672 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3673 ///
3674 /// [google.longrunning.Operations]: longrunning::client::Operations
3675 pub fn wait_operation(&self) -> super::builder::index_service::WaitOperation {
3676 super::builder::index_service::WaitOperation::new(self.inner.clone())
3677 }
3678}
3679
3680/// Implements a client for the Vertex AI API.
3681///
3682/// # Example
3683/// ```
3684/// # tokio_test::block_on(async {
3685/// # use google_cloud_aiplatform_v1::client::JobService;
3686/// let client = JobService::builder().build().await?;
3687/// // use `client` to make requests to the Vertex AI API.
3688/// # gax::Result::<()>::Ok(()) });
3689/// ```
3690///
3691/// # Service Description
3692///
3693/// A service for creating and managing Vertex AI's jobs.
3694///
3695/// # Configuration
3696///
3697/// To configure `JobService` use the `with_*` methods in the type returned
3698/// by [builder()][JobService::builder]. The default configuration should
3699/// work for most applications. Common configuration changes include
3700///
3701/// * [with_endpoint()]: by default this client uses the global default endpoint
3702/// (`https://aiplatform.googleapis.com`). Applications using regional
3703/// endpoints or running in restricted networks (e.g. a network configured
3704// with [Private Google Access with VPC Service Controls]) may want to
3705/// override this default.
3706/// * [with_credentials()]: by default this client uses
3707/// [Application Default Credentials]. Applications using custom
3708/// authentication may need to override this default.
3709///
3710/// [with_endpoint()]: super::builder::job_service::ClientBuilder::with_endpoint
3711/// [with_credentials()]: super::builder::job_service::ClientBuilder::credentials
3712/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3713/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3714///
3715/// # Pooling and Cloning
3716///
3717/// `JobService` holds a connection pool internally, it is advised to
3718/// create one and the reuse it. You do not need to wrap `JobService` in
3719/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3720/// already uses an `Arc` internally.
3721#[cfg(feature = "job-service")]
3722#[cfg_attr(docsrs, doc(cfg(feature = "job-service")))]
3723#[derive(Clone, Debug)]
3724pub struct JobService {
3725 inner: std::sync::Arc<dyn super::stub::dynamic::JobService>,
3726}
3727
3728#[cfg(feature = "job-service")]
3729impl JobService {
3730 /// Returns a builder for [JobService].
3731 ///
3732 /// ```
3733 /// # tokio_test::block_on(async {
3734 /// # use google_cloud_aiplatform_v1::client::JobService;
3735 /// let client = JobService::builder().build().await?;
3736 /// # gax::Result::<()>::Ok(()) });
3737 /// ```
3738 pub fn builder() -> super::builder::job_service::ClientBuilder {
3739 gax::client_builder::internal::new_builder(super::builder::job_service::client::Factory)
3740 }
3741
3742 /// Creates a new client from the provided stub.
3743 ///
3744 /// The most common case for calling this function is in tests mocking the
3745 /// client's behavior.
3746 pub fn from_stub<T>(stub: T) -> Self
3747 where
3748 T: super::stub::JobService + 'static,
3749 {
3750 Self {
3751 inner: std::sync::Arc::new(stub),
3752 }
3753 }
3754
3755 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
3756 let inner = Self::build_inner(config).await?;
3757 Ok(Self { inner })
3758 }
3759
3760 async fn build_inner(
3761 conf: gaxi::options::ClientConfig,
3762 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::JobService>> {
3763 if gaxi::options::tracing_enabled(&conf) {
3764 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3765 }
3766 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3767 }
3768
3769 async fn build_transport(
3770 conf: gaxi::options::ClientConfig,
3771 ) -> Result<impl super::stub::JobService> {
3772 super::transport::JobService::new(conf).await
3773 }
3774
3775 async fn build_with_tracing(
3776 conf: gaxi::options::ClientConfig,
3777 ) -> Result<impl super::stub::JobService> {
3778 Self::build_transport(conf)
3779 .await
3780 .map(super::tracing::JobService::new)
3781 }
3782
3783 /// Creates a CustomJob. A created CustomJob right away
3784 /// will be attempted to be run.
3785 pub fn create_custom_job(&self) -> super::builder::job_service::CreateCustomJob {
3786 super::builder::job_service::CreateCustomJob::new(self.inner.clone())
3787 }
3788
3789 /// Gets a CustomJob.
3790 pub fn get_custom_job(&self) -> super::builder::job_service::GetCustomJob {
3791 super::builder::job_service::GetCustomJob::new(self.inner.clone())
3792 }
3793
3794 /// Lists CustomJobs in a Location.
3795 pub fn list_custom_jobs(&self) -> super::builder::job_service::ListCustomJobs {
3796 super::builder::job_service::ListCustomJobs::new(self.inner.clone())
3797 }
3798
3799 /// Deletes a CustomJob.
3800 ///
3801 /// # Long running operations
3802 ///
3803 /// This method is used to start, and/or poll a [long-running Operation].
3804 /// The [Working with long-running operations] chapter in the [user guide]
3805 /// covers these operations in detail.
3806 ///
3807 /// [long-running operation]: https://google.aip.dev/151
3808 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3809 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3810 pub fn delete_custom_job(&self) -> super::builder::job_service::DeleteCustomJob {
3811 super::builder::job_service::DeleteCustomJob::new(self.inner.clone())
3812 }
3813
3814 /// Cancels a CustomJob.
3815 /// Starts asynchronous cancellation on the CustomJob. The server
3816 /// makes a best effort to cancel the job, but success is not
3817 /// guaranteed. Clients can use
3818 /// [JobService.GetCustomJob][google.cloud.aiplatform.v1.JobService.GetCustomJob]
3819 /// or other methods to check whether the cancellation succeeded or whether the
3820 /// job completed despite cancellation. On successful cancellation,
3821 /// the CustomJob is not deleted; instead it becomes a job with
3822 /// a [CustomJob.error][google.cloud.aiplatform.v1.CustomJob.error] value with
3823 /// a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
3824 /// `Code.CANCELLED`, and
3825 /// [CustomJob.state][google.cloud.aiplatform.v1.CustomJob.state] is set to
3826 /// `CANCELLED`.
3827 ///
3828 /// [google.cloud.aiplatform.v1.CustomJob.error]: crate::model::CustomJob::error
3829 /// [google.cloud.aiplatform.v1.CustomJob.state]: crate::model::CustomJob::state
3830 /// [google.cloud.aiplatform.v1.JobService.GetCustomJob]: crate::client::JobService::get_custom_job
3831 /// [google.rpc.Status.code]: rpc::model::Status::code
3832 pub fn cancel_custom_job(&self) -> super::builder::job_service::CancelCustomJob {
3833 super::builder::job_service::CancelCustomJob::new(self.inner.clone())
3834 }
3835
3836 /// Creates a DataLabelingJob.
3837 pub fn create_data_labeling_job(&self) -> super::builder::job_service::CreateDataLabelingJob {
3838 super::builder::job_service::CreateDataLabelingJob::new(self.inner.clone())
3839 }
3840
3841 /// Gets a DataLabelingJob.
3842 pub fn get_data_labeling_job(&self) -> super::builder::job_service::GetDataLabelingJob {
3843 super::builder::job_service::GetDataLabelingJob::new(self.inner.clone())
3844 }
3845
3846 /// Lists DataLabelingJobs in a Location.
3847 pub fn list_data_labeling_jobs(&self) -> super::builder::job_service::ListDataLabelingJobs {
3848 super::builder::job_service::ListDataLabelingJobs::new(self.inner.clone())
3849 }
3850
3851 /// Deletes a DataLabelingJob.
3852 ///
3853 /// # Long running operations
3854 ///
3855 /// This method is used to start, and/or poll a [long-running Operation].
3856 /// The [Working with long-running operations] chapter in the [user guide]
3857 /// covers these operations in detail.
3858 ///
3859 /// [long-running operation]: https://google.aip.dev/151
3860 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3861 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3862 pub fn delete_data_labeling_job(&self) -> super::builder::job_service::DeleteDataLabelingJob {
3863 super::builder::job_service::DeleteDataLabelingJob::new(self.inner.clone())
3864 }
3865
3866 /// Cancels a DataLabelingJob. Success of cancellation is not guaranteed.
3867 pub fn cancel_data_labeling_job(&self) -> super::builder::job_service::CancelDataLabelingJob {
3868 super::builder::job_service::CancelDataLabelingJob::new(self.inner.clone())
3869 }
3870
3871 /// Creates a HyperparameterTuningJob
3872 pub fn create_hyperparameter_tuning_job(
3873 &self,
3874 ) -> super::builder::job_service::CreateHyperparameterTuningJob {
3875 super::builder::job_service::CreateHyperparameterTuningJob::new(self.inner.clone())
3876 }
3877
3878 /// Gets a HyperparameterTuningJob
3879 pub fn get_hyperparameter_tuning_job(
3880 &self,
3881 ) -> super::builder::job_service::GetHyperparameterTuningJob {
3882 super::builder::job_service::GetHyperparameterTuningJob::new(self.inner.clone())
3883 }
3884
3885 /// Lists HyperparameterTuningJobs in a Location.
3886 pub fn list_hyperparameter_tuning_jobs(
3887 &self,
3888 ) -> super::builder::job_service::ListHyperparameterTuningJobs {
3889 super::builder::job_service::ListHyperparameterTuningJobs::new(self.inner.clone())
3890 }
3891
3892 /// Deletes a HyperparameterTuningJob.
3893 ///
3894 /// # Long running operations
3895 ///
3896 /// This method is used to start, and/or poll a [long-running Operation].
3897 /// The [Working with long-running operations] chapter in the [user guide]
3898 /// covers these operations in detail.
3899 ///
3900 /// [long-running operation]: https://google.aip.dev/151
3901 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3902 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3903 pub fn delete_hyperparameter_tuning_job(
3904 &self,
3905 ) -> super::builder::job_service::DeleteHyperparameterTuningJob {
3906 super::builder::job_service::DeleteHyperparameterTuningJob::new(self.inner.clone())
3907 }
3908
3909 /// Cancels a HyperparameterTuningJob.
3910 /// Starts asynchronous cancellation on the HyperparameterTuningJob. The server
3911 /// makes a best effort to cancel the job, but success is not
3912 /// guaranteed. Clients can use
3913 /// [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob]
3914 /// or other methods to check whether the cancellation succeeded or whether the
3915 /// job completed despite cancellation. On successful cancellation,
3916 /// the HyperparameterTuningJob is not deleted; instead it becomes a job with
3917 /// a
3918 /// [HyperparameterTuningJob.error][google.cloud.aiplatform.v1.HyperparameterTuningJob.error]
3919 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
3920 /// corresponding to `Code.CANCELLED`, and
3921 /// [HyperparameterTuningJob.state][google.cloud.aiplatform.v1.HyperparameterTuningJob.state]
3922 /// is set to `CANCELLED`.
3923 ///
3924 /// [google.cloud.aiplatform.v1.HyperparameterTuningJob.error]: crate::model::HyperparameterTuningJob::error
3925 /// [google.cloud.aiplatform.v1.HyperparameterTuningJob.state]: crate::model::HyperparameterTuningJob::state
3926 /// [google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob]: crate::client::JobService::get_hyperparameter_tuning_job
3927 /// [google.rpc.Status.code]: rpc::model::Status::code
3928 pub fn cancel_hyperparameter_tuning_job(
3929 &self,
3930 ) -> super::builder::job_service::CancelHyperparameterTuningJob {
3931 super::builder::job_service::CancelHyperparameterTuningJob::new(self.inner.clone())
3932 }
3933
3934 /// Creates a NasJob
3935 pub fn create_nas_job(&self) -> super::builder::job_service::CreateNasJob {
3936 super::builder::job_service::CreateNasJob::new(self.inner.clone())
3937 }
3938
3939 /// Gets a NasJob
3940 pub fn get_nas_job(&self) -> super::builder::job_service::GetNasJob {
3941 super::builder::job_service::GetNasJob::new(self.inner.clone())
3942 }
3943
3944 /// Lists NasJobs in a Location.
3945 pub fn list_nas_jobs(&self) -> super::builder::job_service::ListNasJobs {
3946 super::builder::job_service::ListNasJobs::new(self.inner.clone())
3947 }
3948
3949 /// Deletes a NasJob.
3950 ///
3951 /// # Long running operations
3952 ///
3953 /// This method is used to start, and/or poll a [long-running Operation].
3954 /// The [Working with long-running operations] chapter in the [user guide]
3955 /// covers these operations in detail.
3956 ///
3957 /// [long-running operation]: https://google.aip.dev/151
3958 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3959 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3960 pub fn delete_nas_job(&self) -> super::builder::job_service::DeleteNasJob {
3961 super::builder::job_service::DeleteNasJob::new(self.inner.clone())
3962 }
3963
3964 /// Cancels a NasJob.
3965 /// Starts asynchronous cancellation on the NasJob. The server
3966 /// makes a best effort to cancel the job, but success is not
3967 /// guaranteed. Clients can use
3968 /// [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob] or
3969 /// other methods to check whether the cancellation succeeded or whether the
3970 /// job completed despite cancellation. On successful cancellation,
3971 /// the NasJob is not deleted; instead it becomes a job with
3972 /// a [NasJob.error][google.cloud.aiplatform.v1.NasJob.error] value with a
3973 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
3974 /// `Code.CANCELLED`, and
3975 /// [NasJob.state][google.cloud.aiplatform.v1.NasJob.state] is set to
3976 /// `CANCELLED`.
3977 ///
3978 /// [google.cloud.aiplatform.v1.JobService.GetNasJob]: crate::client::JobService::get_nas_job
3979 /// [google.cloud.aiplatform.v1.NasJob.error]: crate::model::NasJob::error
3980 /// [google.cloud.aiplatform.v1.NasJob.state]: crate::model::NasJob::state
3981 /// [google.rpc.Status.code]: rpc::model::Status::code
3982 pub fn cancel_nas_job(&self) -> super::builder::job_service::CancelNasJob {
3983 super::builder::job_service::CancelNasJob::new(self.inner.clone())
3984 }
3985
3986 /// Gets a NasTrialDetail.
3987 pub fn get_nas_trial_detail(&self) -> super::builder::job_service::GetNasTrialDetail {
3988 super::builder::job_service::GetNasTrialDetail::new(self.inner.clone())
3989 }
3990
3991 /// List top NasTrialDetails of a NasJob.
3992 pub fn list_nas_trial_details(&self) -> super::builder::job_service::ListNasTrialDetails {
3993 super::builder::job_service::ListNasTrialDetails::new(self.inner.clone())
3994 }
3995
3996 /// Creates a BatchPredictionJob. A BatchPredictionJob once created will
3997 /// right away be attempted to start.
3998 pub fn create_batch_prediction_job(
3999 &self,
4000 ) -> super::builder::job_service::CreateBatchPredictionJob {
4001 super::builder::job_service::CreateBatchPredictionJob::new(self.inner.clone())
4002 }
4003
4004 /// Gets a BatchPredictionJob
4005 pub fn get_batch_prediction_job(&self) -> super::builder::job_service::GetBatchPredictionJob {
4006 super::builder::job_service::GetBatchPredictionJob::new(self.inner.clone())
4007 }
4008
4009 /// Lists BatchPredictionJobs in a Location.
4010 pub fn list_batch_prediction_jobs(
4011 &self,
4012 ) -> super::builder::job_service::ListBatchPredictionJobs {
4013 super::builder::job_service::ListBatchPredictionJobs::new(self.inner.clone())
4014 }
4015
4016 /// Deletes a BatchPredictionJob. Can only be called on jobs that already
4017 /// finished.
4018 ///
4019 /// # Long running operations
4020 ///
4021 /// This method is used to start, and/or poll a [long-running Operation].
4022 /// The [Working with long-running operations] chapter in the [user guide]
4023 /// covers these operations in detail.
4024 ///
4025 /// [long-running operation]: https://google.aip.dev/151
4026 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4027 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4028 pub fn delete_batch_prediction_job(
4029 &self,
4030 ) -> super::builder::job_service::DeleteBatchPredictionJob {
4031 super::builder::job_service::DeleteBatchPredictionJob::new(self.inner.clone())
4032 }
4033
4034 /// Cancels a BatchPredictionJob.
4035 ///
4036 /// Starts asynchronous cancellation on the BatchPredictionJob. The server
4037 /// makes the best effort to cancel the job, but success is not
4038 /// guaranteed. Clients can use
4039 /// [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob]
4040 /// or other methods to check whether the cancellation succeeded or whether the
4041 /// job completed despite cancellation. On a successful cancellation,
4042 /// the BatchPredictionJob is not deleted;instead its
4043 /// [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state]
4044 /// is set to `CANCELLED`. Any files already outputted by the job are not
4045 /// deleted.
4046 ///
4047 /// [google.cloud.aiplatform.v1.BatchPredictionJob.state]: crate::model::BatchPredictionJob::state
4048 /// [google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob]: crate::client::JobService::get_batch_prediction_job
4049 pub fn cancel_batch_prediction_job(
4050 &self,
4051 ) -> super::builder::job_service::CancelBatchPredictionJob {
4052 super::builder::job_service::CancelBatchPredictionJob::new(self.inner.clone())
4053 }
4054
4055 /// Creates a ModelDeploymentMonitoringJob. It will run periodically on a
4056 /// configured interval.
4057 pub fn create_model_deployment_monitoring_job(
4058 &self,
4059 ) -> super::builder::job_service::CreateModelDeploymentMonitoringJob {
4060 super::builder::job_service::CreateModelDeploymentMonitoringJob::new(self.inner.clone())
4061 }
4062
4063 /// Searches Model Monitoring Statistics generated within a given time window.
4064 pub fn search_model_deployment_monitoring_stats_anomalies(
4065 &self,
4066 ) -> super::builder::job_service::SearchModelDeploymentMonitoringStatsAnomalies {
4067 super::builder::job_service::SearchModelDeploymentMonitoringStatsAnomalies::new(
4068 self.inner.clone(),
4069 )
4070 }
4071
4072 /// Gets a ModelDeploymentMonitoringJob.
4073 pub fn get_model_deployment_monitoring_job(
4074 &self,
4075 ) -> super::builder::job_service::GetModelDeploymentMonitoringJob {
4076 super::builder::job_service::GetModelDeploymentMonitoringJob::new(self.inner.clone())
4077 }
4078
4079 /// Lists ModelDeploymentMonitoringJobs in a Location.
4080 pub fn list_model_deployment_monitoring_jobs(
4081 &self,
4082 ) -> super::builder::job_service::ListModelDeploymentMonitoringJobs {
4083 super::builder::job_service::ListModelDeploymentMonitoringJobs::new(self.inner.clone())
4084 }
4085
4086 /// Updates a ModelDeploymentMonitoringJob.
4087 ///
4088 /// # Long running operations
4089 ///
4090 /// This method is used to start, and/or poll a [long-running Operation].
4091 /// The [Working with long-running operations] chapter in the [user guide]
4092 /// covers these operations in detail.
4093 ///
4094 /// [long-running operation]: https://google.aip.dev/151
4095 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4096 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4097 pub fn update_model_deployment_monitoring_job(
4098 &self,
4099 ) -> super::builder::job_service::UpdateModelDeploymentMonitoringJob {
4100 super::builder::job_service::UpdateModelDeploymentMonitoringJob::new(self.inner.clone())
4101 }
4102
4103 /// Deletes a ModelDeploymentMonitoringJob.
4104 ///
4105 /// # Long running operations
4106 ///
4107 /// This method is used to start, and/or poll a [long-running Operation].
4108 /// The [Working with long-running operations] chapter in the [user guide]
4109 /// covers these operations in detail.
4110 ///
4111 /// [long-running operation]: https://google.aip.dev/151
4112 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4113 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4114 pub fn delete_model_deployment_monitoring_job(
4115 &self,
4116 ) -> super::builder::job_service::DeleteModelDeploymentMonitoringJob {
4117 super::builder::job_service::DeleteModelDeploymentMonitoringJob::new(self.inner.clone())
4118 }
4119
4120 /// Pauses a ModelDeploymentMonitoringJob. If the job is running, the server
4121 /// makes a best effort to cancel the job. Will mark
4122 /// [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state]
4123 /// to 'PAUSED'.
4124 ///
4125 /// [google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state]: crate::model::ModelDeploymentMonitoringJob::state
4126 pub fn pause_model_deployment_monitoring_job(
4127 &self,
4128 ) -> super::builder::job_service::PauseModelDeploymentMonitoringJob {
4129 super::builder::job_service::PauseModelDeploymentMonitoringJob::new(self.inner.clone())
4130 }
4131
4132 /// Resumes a paused ModelDeploymentMonitoringJob. It will start to run from
4133 /// next scheduled time. A deleted ModelDeploymentMonitoringJob can't be
4134 /// resumed.
4135 pub fn resume_model_deployment_monitoring_job(
4136 &self,
4137 ) -> super::builder::job_service::ResumeModelDeploymentMonitoringJob {
4138 super::builder::job_service::ResumeModelDeploymentMonitoringJob::new(self.inner.clone())
4139 }
4140
4141 /// Lists information about the supported locations for this service.
4142 pub fn list_locations(&self) -> super::builder::job_service::ListLocations {
4143 super::builder::job_service::ListLocations::new(self.inner.clone())
4144 }
4145
4146 /// Gets information about a location.
4147 pub fn get_location(&self) -> super::builder::job_service::GetLocation {
4148 super::builder::job_service::GetLocation::new(self.inner.clone())
4149 }
4150
4151 /// Sets the access control policy on the specified resource. Replaces
4152 /// any existing policy.
4153 ///
4154 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
4155 /// errors.
4156 pub fn set_iam_policy(&self) -> super::builder::job_service::SetIamPolicy {
4157 super::builder::job_service::SetIamPolicy::new(self.inner.clone())
4158 }
4159
4160 /// Gets the access control policy for a resource. Returns an empty policy
4161 /// if the resource exists and does not have a policy set.
4162 pub fn get_iam_policy(&self) -> super::builder::job_service::GetIamPolicy {
4163 super::builder::job_service::GetIamPolicy::new(self.inner.clone())
4164 }
4165
4166 /// Returns permissions that a caller has on the specified resource. If the
4167 /// resource does not exist, this will return an empty set of
4168 /// permissions, not a `NOT_FOUND` error.
4169 ///
4170 /// Note: This operation is designed to be used for building
4171 /// permission-aware UIs and command-line tools, not for authorization
4172 /// checking. This operation may "fail open" without warning.
4173 pub fn test_iam_permissions(&self) -> super::builder::job_service::TestIamPermissions {
4174 super::builder::job_service::TestIamPermissions::new(self.inner.clone())
4175 }
4176
4177 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4178 ///
4179 /// [google.longrunning.Operations]: longrunning::client::Operations
4180 pub fn list_operations(&self) -> super::builder::job_service::ListOperations {
4181 super::builder::job_service::ListOperations::new(self.inner.clone())
4182 }
4183
4184 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4185 ///
4186 /// [google.longrunning.Operations]: longrunning::client::Operations
4187 pub fn get_operation(&self) -> super::builder::job_service::GetOperation {
4188 super::builder::job_service::GetOperation::new(self.inner.clone())
4189 }
4190
4191 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4192 ///
4193 /// [google.longrunning.Operations]: longrunning::client::Operations
4194 pub fn delete_operation(&self) -> super::builder::job_service::DeleteOperation {
4195 super::builder::job_service::DeleteOperation::new(self.inner.clone())
4196 }
4197
4198 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4199 ///
4200 /// [google.longrunning.Operations]: longrunning::client::Operations
4201 pub fn cancel_operation(&self) -> super::builder::job_service::CancelOperation {
4202 super::builder::job_service::CancelOperation::new(self.inner.clone())
4203 }
4204
4205 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4206 ///
4207 /// [google.longrunning.Operations]: longrunning::client::Operations
4208 pub fn wait_operation(&self) -> super::builder::job_service::WaitOperation {
4209 super::builder::job_service::WaitOperation::new(self.inner.clone())
4210 }
4211}
4212
4213/// Implements a client for the Vertex AI API.
4214///
4215/// # Example
4216/// ```
4217/// # tokio_test::block_on(async {
4218/// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
4219/// let client = LlmUtilityService::builder().build().await?;
4220/// // use `client` to make requests to the Vertex AI API.
4221/// # gax::Result::<()>::Ok(()) });
4222/// ```
4223///
4224/// # Service Description
4225///
4226/// Service for LLM related utility functions.
4227///
4228/// # Configuration
4229///
4230/// To configure `LlmUtilityService` use the `with_*` methods in the type returned
4231/// by [builder()][LlmUtilityService::builder]. The default configuration should
4232/// work for most applications. Common configuration changes include
4233///
4234/// * [with_endpoint()]: by default this client uses the global default endpoint
4235/// (`https://aiplatform.googleapis.com`). Applications using regional
4236/// endpoints or running in restricted networks (e.g. a network configured
4237// with [Private Google Access with VPC Service Controls]) may want to
4238/// override this default.
4239/// * [with_credentials()]: by default this client uses
4240/// [Application Default Credentials]. Applications using custom
4241/// authentication may need to override this default.
4242///
4243/// [with_endpoint()]: super::builder::llm_utility_service::ClientBuilder::with_endpoint
4244/// [with_credentials()]: super::builder::llm_utility_service::ClientBuilder::credentials
4245/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4246/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4247///
4248/// # Pooling and Cloning
4249///
4250/// `LlmUtilityService` holds a connection pool internally, it is advised to
4251/// create one and the reuse it. You do not need to wrap `LlmUtilityService` in
4252/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4253/// already uses an `Arc` internally.
4254#[cfg(feature = "llm-utility-service")]
4255#[cfg_attr(docsrs, doc(cfg(feature = "llm-utility-service")))]
4256#[derive(Clone, Debug)]
4257pub struct LlmUtilityService {
4258 inner: std::sync::Arc<dyn super::stub::dynamic::LlmUtilityService>,
4259}
4260
4261#[cfg(feature = "llm-utility-service")]
4262impl LlmUtilityService {
4263 /// Returns a builder for [LlmUtilityService].
4264 ///
4265 /// ```
4266 /// # tokio_test::block_on(async {
4267 /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
4268 /// let client = LlmUtilityService::builder().build().await?;
4269 /// # gax::Result::<()>::Ok(()) });
4270 /// ```
4271 pub fn builder() -> super::builder::llm_utility_service::ClientBuilder {
4272 gax::client_builder::internal::new_builder(
4273 super::builder::llm_utility_service::client::Factory,
4274 )
4275 }
4276
4277 /// Creates a new client from the provided stub.
4278 ///
4279 /// The most common case for calling this function is in tests mocking the
4280 /// client's behavior.
4281 pub fn from_stub<T>(stub: T) -> Self
4282 where
4283 T: super::stub::LlmUtilityService + 'static,
4284 {
4285 Self {
4286 inner: std::sync::Arc::new(stub),
4287 }
4288 }
4289
4290 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
4291 let inner = Self::build_inner(config).await?;
4292 Ok(Self { inner })
4293 }
4294
4295 async fn build_inner(
4296 conf: gaxi::options::ClientConfig,
4297 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::LlmUtilityService>> {
4298 if gaxi::options::tracing_enabled(&conf) {
4299 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4300 }
4301 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4302 }
4303
4304 async fn build_transport(
4305 conf: gaxi::options::ClientConfig,
4306 ) -> Result<impl super::stub::LlmUtilityService> {
4307 super::transport::LlmUtilityService::new(conf).await
4308 }
4309
4310 async fn build_with_tracing(
4311 conf: gaxi::options::ClientConfig,
4312 ) -> Result<impl super::stub::LlmUtilityService> {
4313 Self::build_transport(conf)
4314 .await
4315 .map(super::tracing::LlmUtilityService::new)
4316 }
4317
4318 /// Perform a token counting.
4319 pub fn count_tokens(&self) -> super::builder::llm_utility_service::CountTokens {
4320 super::builder::llm_utility_service::CountTokens::new(self.inner.clone())
4321 }
4322
4323 /// Return a list of tokens based on the input text.
4324 pub fn compute_tokens(&self) -> super::builder::llm_utility_service::ComputeTokens {
4325 super::builder::llm_utility_service::ComputeTokens::new(self.inner.clone())
4326 }
4327
4328 /// Lists information about the supported locations for this service.
4329 pub fn list_locations(&self) -> super::builder::llm_utility_service::ListLocations {
4330 super::builder::llm_utility_service::ListLocations::new(self.inner.clone())
4331 }
4332
4333 /// Gets information about a location.
4334 pub fn get_location(&self) -> super::builder::llm_utility_service::GetLocation {
4335 super::builder::llm_utility_service::GetLocation::new(self.inner.clone())
4336 }
4337
4338 /// Sets the access control policy on the specified resource. Replaces
4339 /// any existing policy.
4340 ///
4341 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
4342 /// errors.
4343 pub fn set_iam_policy(&self) -> super::builder::llm_utility_service::SetIamPolicy {
4344 super::builder::llm_utility_service::SetIamPolicy::new(self.inner.clone())
4345 }
4346
4347 /// Gets the access control policy for a resource. Returns an empty policy
4348 /// if the resource exists and does not have a policy set.
4349 pub fn get_iam_policy(&self) -> super::builder::llm_utility_service::GetIamPolicy {
4350 super::builder::llm_utility_service::GetIamPolicy::new(self.inner.clone())
4351 }
4352
4353 /// Returns permissions that a caller has on the specified resource. If the
4354 /// resource does not exist, this will return an empty set of
4355 /// permissions, not a `NOT_FOUND` error.
4356 ///
4357 /// Note: This operation is designed to be used for building
4358 /// permission-aware UIs and command-line tools, not for authorization
4359 /// checking. This operation may "fail open" without warning.
4360 pub fn test_iam_permissions(&self) -> super::builder::llm_utility_service::TestIamPermissions {
4361 super::builder::llm_utility_service::TestIamPermissions::new(self.inner.clone())
4362 }
4363
4364 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4365 ///
4366 /// [google.longrunning.Operations]: longrunning::client::Operations
4367 pub fn list_operations(&self) -> super::builder::llm_utility_service::ListOperations {
4368 super::builder::llm_utility_service::ListOperations::new(self.inner.clone())
4369 }
4370
4371 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4372 ///
4373 /// [google.longrunning.Operations]: longrunning::client::Operations
4374 pub fn get_operation(&self) -> super::builder::llm_utility_service::GetOperation {
4375 super::builder::llm_utility_service::GetOperation::new(self.inner.clone())
4376 }
4377
4378 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4379 ///
4380 /// [google.longrunning.Operations]: longrunning::client::Operations
4381 pub fn delete_operation(&self) -> super::builder::llm_utility_service::DeleteOperation {
4382 super::builder::llm_utility_service::DeleteOperation::new(self.inner.clone())
4383 }
4384
4385 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4386 ///
4387 /// [google.longrunning.Operations]: longrunning::client::Operations
4388 pub fn cancel_operation(&self) -> super::builder::llm_utility_service::CancelOperation {
4389 super::builder::llm_utility_service::CancelOperation::new(self.inner.clone())
4390 }
4391
4392 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4393 ///
4394 /// [google.longrunning.Operations]: longrunning::client::Operations
4395 pub fn wait_operation(&self) -> super::builder::llm_utility_service::WaitOperation {
4396 super::builder::llm_utility_service::WaitOperation::new(self.inner.clone())
4397 }
4398}
4399
4400/// Implements a client for the Vertex AI API.
4401///
4402/// # Example
4403/// ```
4404/// # tokio_test::block_on(async {
4405/// # use google_cloud_aiplatform_v1::client::MatchService;
4406/// let client = MatchService::builder().build().await?;
4407/// // use `client` to make requests to the Vertex AI API.
4408/// # gax::Result::<()>::Ok(()) });
4409/// ```
4410///
4411/// # Service Description
4412///
4413/// MatchService is a Google managed service for efficient vector similarity
4414/// search at scale.
4415///
4416/// # Configuration
4417///
4418/// To configure `MatchService` use the `with_*` methods in the type returned
4419/// by [builder()][MatchService::builder]. The default configuration should
4420/// work for most applications. Common configuration changes include
4421///
4422/// * [with_endpoint()]: by default this client uses the global default endpoint
4423/// (`https://aiplatform.googleapis.com`). Applications using regional
4424/// endpoints or running in restricted networks (e.g. a network configured
4425// with [Private Google Access with VPC Service Controls]) may want to
4426/// override this default.
4427/// * [with_credentials()]: by default this client uses
4428/// [Application Default Credentials]. Applications using custom
4429/// authentication may need to override this default.
4430///
4431/// [with_endpoint()]: super::builder::match_service::ClientBuilder::with_endpoint
4432/// [with_credentials()]: super::builder::match_service::ClientBuilder::credentials
4433/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4434/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4435///
4436/// # Pooling and Cloning
4437///
4438/// `MatchService` holds a connection pool internally, it is advised to
4439/// create one and the reuse it. You do not need to wrap `MatchService` in
4440/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4441/// already uses an `Arc` internally.
4442#[cfg(feature = "match-service")]
4443#[cfg_attr(docsrs, doc(cfg(feature = "match-service")))]
4444#[derive(Clone, Debug)]
4445pub struct MatchService {
4446 inner: std::sync::Arc<dyn super::stub::dynamic::MatchService>,
4447}
4448
4449#[cfg(feature = "match-service")]
4450impl MatchService {
4451 /// Returns a builder for [MatchService].
4452 ///
4453 /// ```
4454 /// # tokio_test::block_on(async {
4455 /// # use google_cloud_aiplatform_v1::client::MatchService;
4456 /// let client = MatchService::builder().build().await?;
4457 /// # gax::Result::<()>::Ok(()) });
4458 /// ```
4459 pub fn builder() -> super::builder::match_service::ClientBuilder {
4460 gax::client_builder::internal::new_builder(super::builder::match_service::client::Factory)
4461 }
4462
4463 /// Creates a new client from the provided stub.
4464 ///
4465 /// The most common case for calling this function is in tests mocking the
4466 /// client's behavior.
4467 pub fn from_stub<T>(stub: T) -> Self
4468 where
4469 T: super::stub::MatchService + 'static,
4470 {
4471 Self {
4472 inner: std::sync::Arc::new(stub),
4473 }
4474 }
4475
4476 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
4477 let inner = Self::build_inner(config).await?;
4478 Ok(Self { inner })
4479 }
4480
4481 async fn build_inner(
4482 conf: gaxi::options::ClientConfig,
4483 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::MatchService>> {
4484 if gaxi::options::tracing_enabled(&conf) {
4485 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4486 }
4487 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4488 }
4489
4490 async fn build_transport(
4491 conf: gaxi::options::ClientConfig,
4492 ) -> Result<impl super::stub::MatchService> {
4493 super::transport::MatchService::new(conf).await
4494 }
4495
4496 async fn build_with_tracing(
4497 conf: gaxi::options::ClientConfig,
4498 ) -> Result<impl super::stub::MatchService> {
4499 Self::build_transport(conf)
4500 .await
4501 .map(super::tracing::MatchService::new)
4502 }
4503
4504 /// Finds the nearest neighbors of each vector within the request.
4505 pub fn find_neighbors(&self) -> super::builder::match_service::FindNeighbors {
4506 super::builder::match_service::FindNeighbors::new(self.inner.clone())
4507 }
4508
4509 /// Reads the datapoints/vectors of the given IDs.
4510 /// A maximum of 1000 datapoints can be retrieved in a batch.
4511 pub fn read_index_datapoints(&self) -> super::builder::match_service::ReadIndexDatapoints {
4512 super::builder::match_service::ReadIndexDatapoints::new(self.inner.clone())
4513 }
4514
4515 /// Lists information about the supported locations for this service.
4516 pub fn list_locations(&self) -> super::builder::match_service::ListLocations {
4517 super::builder::match_service::ListLocations::new(self.inner.clone())
4518 }
4519
4520 /// Gets information about a location.
4521 pub fn get_location(&self) -> super::builder::match_service::GetLocation {
4522 super::builder::match_service::GetLocation::new(self.inner.clone())
4523 }
4524
4525 /// Sets the access control policy on the specified resource. Replaces
4526 /// any existing policy.
4527 ///
4528 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
4529 /// errors.
4530 pub fn set_iam_policy(&self) -> super::builder::match_service::SetIamPolicy {
4531 super::builder::match_service::SetIamPolicy::new(self.inner.clone())
4532 }
4533
4534 /// Gets the access control policy for a resource. Returns an empty policy
4535 /// if the resource exists and does not have a policy set.
4536 pub fn get_iam_policy(&self) -> super::builder::match_service::GetIamPolicy {
4537 super::builder::match_service::GetIamPolicy::new(self.inner.clone())
4538 }
4539
4540 /// Returns permissions that a caller has on the specified resource. If the
4541 /// resource does not exist, this will return an empty set of
4542 /// permissions, not a `NOT_FOUND` error.
4543 ///
4544 /// Note: This operation is designed to be used for building
4545 /// permission-aware UIs and command-line tools, not for authorization
4546 /// checking. This operation may "fail open" without warning.
4547 pub fn test_iam_permissions(&self) -> super::builder::match_service::TestIamPermissions {
4548 super::builder::match_service::TestIamPermissions::new(self.inner.clone())
4549 }
4550
4551 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4552 ///
4553 /// [google.longrunning.Operations]: longrunning::client::Operations
4554 pub fn list_operations(&self) -> super::builder::match_service::ListOperations {
4555 super::builder::match_service::ListOperations::new(self.inner.clone())
4556 }
4557
4558 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4559 ///
4560 /// [google.longrunning.Operations]: longrunning::client::Operations
4561 pub fn get_operation(&self) -> super::builder::match_service::GetOperation {
4562 super::builder::match_service::GetOperation::new(self.inner.clone())
4563 }
4564
4565 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4566 ///
4567 /// [google.longrunning.Operations]: longrunning::client::Operations
4568 pub fn delete_operation(&self) -> super::builder::match_service::DeleteOperation {
4569 super::builder::match_service::DeleteOperation::new(self.inner.clone())
4570 }
4571
4572 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4573 ///
4574 /// [google.longrunning.Operations]: longrunning::client::Operations
4575 pub fn cancel_operation(&self) -> super::builder::match_service::CancelOperation {
4576 super::builder::match_service::CancelOperation::new(self.inner.clone())
4577 }
4578
4579 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4580 ///
4581 /// [google.longrunning.Operations]: longrunning::client::Operations
4582 pub fn wait_operation(&self) -> super::builder::match_service::WaitOperation {
4583 super::builder::match_service::WaitOperation::new(self.inner.clone())
4584 }
4585}
4586
4587/// Implements a client for the Vertex AI API.
4588///
4589/// # Example
4590/// ```
4591/// # tokio_test::block_on(async {
4592/// # use google_cloud_aiplatform_v1::client::MetadataService;
4593/// let client = MetadataService::builder().build().await?;
4594/// // use `client` to make requests to the Vertex AI API.
4595/// # gax::Result::<()>::Ok(()) });
4596/// ```
4597///
4598/// # Service Description
4599///
4600/// Service for reading and writing metadata entries.
4601///
4602/// # Configuration
4603///
4604/// To configure `MetadataService` use the `with_*` methods in the type returned
4605/// by [builder()][MetadataService::builder]. The default configuration should
4606/// work for most applications. Common configuration changes include
4607///
4608/// * [with_endpoint()]: by default this client uses the global default endpoint
4609/// (`https://aiplatform.googleapis.com`). Applications using regional
4610/// endpoints or running in restricted networks (e.g. a network configured
4611// with [Private Google Access with VPC Service Controls]) may want to
4612/// override this default.
4613/// * [with_credentials()]: by default this client uses
4614/// [Application Default Credentials]. Applications using custom
4615/// authentication may need to override this default.
4616///
4617/// [with_endpoint()]: super::builder::metadata_service::ClientBuilder::with_endpoint
4618/// [with_credentials()]: super::builder::metadata_service::ClientBuilder::credentials
4619/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4620/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4621///
4622/// # Pooling and Cloning
4623///
4624/// `MetadataService` holds a connection pool internally, it is advised to
4625/// create one and the reuse it. You do not need to wrap `MetadataService` in
4626/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4627/// already uses an `Arc` internally.
4628#[cfg(feature = "metadata-service")]
4629#[cfg_attr(docsrs, doc(cfg(feature = "metadata-service")))]
4630#[derive(Clone, Debug)]
4631pub struct MetadataService {
4632 inner: std::sync::Arc<dyn super::stub::dynamic::MetadataService>,
4633}
4634
4635#[cfg(feature = "metadata-service")]
4636impl MetadataService {
4637 /// Returns a builder for [MetadataService].
4638 ///
4639 /// ```
4640 /// # tokio_test::block_on(async {
4641 /// # use google_cloud_aiplatform_v1::client::MetadataService;
4642 /// let client = MetadataService::builder().build().await?;
4643 /// # gax::Result::<()>::Ok(()) });
4644 /// ```
4645 pub fn builder() -> super::builder::metadata_service::ClientBuilder {
4646 gax::client_builder::internal::new_builder(
4647 super::builder::metadata_service::client::Factory,
4648 )
4649 }
4650
4651 /// Creates a new client from the provided stub.
4652 ///
4653 /// The most common case for calling this function is in tests mocking the
4654 /// client's behavior.
4655 pub fn from_stub<T>(stub: T) -> Self
4656 where
4657 T: super::stub::MetadataService + 'static,
4658 {
4659 Self {
4660 inner: std::sync::Arc::new(stub),
4661 }
4662 }
4663
4664 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
4665 let inner = Self::build_inner(config).await?;
4666 Ok(Self { inner })
4667 }
4668
4669 async fn build_inner(
4670 conf: gaxi::options::ClientConfig,
4671 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::MetadataService>> {
4672 if gaxi::options::tracing_enabled(&conf) {
4673 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4674 }
4675 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4676 }
4677
4678 async fn build_transport(
4679 conf: gaxi::options::ClientConfig,
4680 ) -> Result<impl super::stub::MetadataService> {
4681 super::transport::MetadataService::new(conf).await
4682 }
4683
4684 async fn build_with_tracing(
4685 conf: gaxi::options::ClientConfig,
4686 ) -> Result<impl super::stub::MetadataService> {
4687 Self::build_transport(conf)
4688 .await
4689 .map(super::tracing::MetadataService::new)
4690 }
4691
4692 /// Initializes a MetadataStore, including allocation of resources.
4693 ///
4694 /// # Long running operations
4695 ///
4696 /// This method is used to start, and/or poll a [long-running Operation].
4697 /// The [Working with long-running operations] chapter in the [user guide]
4698 /// covers these operations in detail.
4699 ///
4700 /// [long-running operation]: https://google.aip.dev/151
4701 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4702 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4703 pub fn create_metadata_store(&self) -> super::builder::metadata_service::CreateMetadataStore {
4704 super::builder::metadata_service::CreateMetadataStore::new(self.inner.clone())
4705 }
4706
4707 /// Retrieves a specific MetadataStore.
4708 pub fn get_metadata_store(&self) -> super::builder::metadata_service::GetMetadataStore {
4709 super::builder::metadata_service::GetMetadataStore::new(self.inner.clone())
4710 }
4711
4712 /// Lists MetadataStores for a Location.
4713 pub fn list_metadata_stores(&self) -> super::builder::metadata_service::ListMetadataStores {
4714 super::builder::metadata_service::ListMetadataStores::new(self.inner.clone())
4715 }
4716
4717 /// Deletes a single MetadataStore and all its child resources (Artifacts,
4718 /// Executions, and Contexts).
4719 ///
4720 /// # Long running operations
4721 ///
4722 /// This method is used to start, and/or poll a [long-running Operation].
4723 /// The [Working with long-running operations] chapter in the [user guide]
4724 /// covers these operations in detail.
4725 ///
4726 /// [long-running operation]: https://google.aip.dev/151
4727 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4728 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4729 pub fn delete_metadata_store(&self) -> super::builder::metadata_service::DeleteMetadataStore {
4730 super::builder::metadata_service::DeleteMetadataStore::new(self.inner.clone())
4731 }
4732
4733 /// Creates an Artifact associated with a MetadataStore.
4734 pub fn create_artifact(&self) -> super::builder::metadata_service::CreateArtifact {
4735 super::builder::metadata_service::CreateArtifact::new(self.inner.clone())
4736 }
4737
4738 /// Retrieves a specific Artifact.
4739 pub fn get_artifact(&self) -> super::builder::metadata_service::GetArtifact {
4740 super::builder::metadata_service::GetArtifact::new(self.inner.clone())
4741 }
4742
4743 /// Lists Artifacts in the MetadataStore.
4744 pub fn list_artifacts(&self) -> super::builder::metadata_service::ListArtifacts {
4745 super::builder::metadata_service::ListArtifacts::new(self.inner.clone())
4746 }
4747
4748 /// Updates a stored Artifact.
4749 pub fn update_artifact(&self) -> super::builder::metadata_service::UpdateArtifact {
4750 super::builder::metadata_service::UpdateArtifact::new(self.inner.clone())
4751 }
4752
4753 /// Deletes an Artifact.
4754 ///
4755 /// # Long running operations
4756 ///
4757 /// This method is used to start, and/or poll a [long-running Operation].
4758 /// The [Working with long-running operations] chapter in the [user guide]
4759 /// covers these operations in detail.
4760 ///
4761 /// [long-running operation]: https://google.aip.dev/151
4762 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4763 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4764 pub fn delete_artifact(&self) -> super::builder::metadata_service::DeleteArtifact {
4765 super::builder::metadata_service::DeleteArtifact::new(self.inner.clone())
4766 }
4767
4768 /// Purges Artifacts.
4769 ///
4770 /// # Long running operations
4771 ///
4772 /// This method is used to start, and/or poll a [long-running Operation].
4773 /// The [Working with long-running operations] chapter in the [user guide]
4774 /// covers these operations in detail.
4775 ///
4776 /// [long-running operation]: https://google.aip.dev/151
4777 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4778 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4779 pub fn purge_artifacts(&self) -> super::builder::metadata_service::PurgeArtifacts {
4780 super::builder::metadata_service::PurgeArtifacts::new(self.inner.clone())
4781 }
4782
4783 /// Creates a Context associated with a MetadataStore.
4784 pub fn create_context(&self) -> super::builder::metadata_service::CreateContext {
4785 super::builder::metadata_service::CreateContext::new(self.inner.clone())
4786 }
4787
4788 /// Retrieves a specific Context.
4789 pub fn get_context(&self) -> super::builder::metadata_service::GetContext {
4790 super::builder::metadata_service::GetContext::new(self.inner.clone())
4791 }
4792
4793 /// Lists Contexts on the MetadataStore.
4794 pub fn list_contexts(&self) -> super::builder::metadata_service::ListContexts {
4795 super::builder::metadata_service::ListContexts::new(self.inner.clone())
4796 }
4797
4798 /// Updates a stored Context.
4799 pub fn update_context(&self) -> super::builder::metadata_service::UpdateContext {
4800 super::builder::metadata_service::UpdateContext::new(self.inner.clone())
4801 }
4802
4803 /// Deletes a stored Context.
4804 ///
4805 /// # Long running operations
4806 ///
4807 /// This method is used to start, and/or poll a [long-running Operation].
4808 /// The [Working with long-running operations] chapter in the [user guide]
4809 /// covers these operations in detail.
4810 ///
4811 /// [long-running operation]: https://google.aip.dev/151
4812 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4813 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4814 pub fn delete_context(&self) -> super::builder::metadata_service::DeleteContext {
4815 super::builder::metadata_service::DeleteContext::new(self.inner.clone())
4816 }
4817
4818 /// Purges Contexts.
4819 ///
4820 /// # Long running operations
4821 ///
4822 /// This method is used to start, and/or poll a [long-running Operation].
4823 /// The [Working with long-running operations] chapter in the [user guide]
4824 /// covers these operations in detail.
4825 ///
4826 /// [long-running operation]: https://google.aip.dev/151
4827 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4828 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4829 pub fn purge_contexts(&self) -> super::builder::metadata_service::PurgeContexts {
4830 super::builder::metadata_service::PurgeContexts::new(self.inner.clone())
4831 }
4832
4833 /// Adds a set of Artifacts and Executions to a Context. If any of the
4834 /// Artifacts or Executions have already been added to a Context, they are
4835 /// simply skipped.
4836 pub fn add_context_artifacts_and_executions(
4837 &self,
4838 ) -> super::builder::metadata_service::AddContextArtifactsAndExecutions {
4839 super::builder::metadata_service::AddContextArtifactsAndExecutions::new(self.inner.clone())
4840 }
4841
4842 /// Adds a set of Contexts as children to a parent Context. If any of the
4843 /// child Contexts have already been added to the parent Context, they are
4844 /// simply skipped. If this call would create a cycle or cause any Context to
4845 /// have more than 10 parents, the request will fail with an INVALID_ARGUMENT
4846 /// error.
4847 pub fn add_context_children(&self) -> super::builder::metadata_service::AddContextChildren {
4848 super::builder::metadata_service::AddContextChildren::new(self.inner.clone())
4849 }
4850
4851 /// Remove a set of children contexts from a parent Context. If any of the
4852 /// child Contexts were NOT added to the parent Context, they are
4853 /// simply skipped.
4854 pub fn remove_context_children(
4855 &self,
4856 ) -> super::builder::metadata_service::RemoveContextChildren {
4857 super::builder::metadata_service::RemoveContextChildren::new(self.inner.clone())
4858 }
4859
4860 /// Retrieves Artifacts and Executions within the specified Context, connected
4861 /// by Event edges and returned as a LineageSubgraph.
4862 pub fn query_context_lineage_subgraph(
4863 &self,
4864 ) -> super::builder::metadata_service::QueryContextLineageSubgraph {
4865 super::builder::metadata_service::QueryContextLineageSubgraph::new(self.inner.clone())
4866 }
4867
4868 /// Creates an Execution associated with a MetadataStore.
4869 pub fn create_execution(&self) -> super::builder::metadata_service::CreateExecution {
4870 super::builder::metadata_service::CreateExecution::new(self.inner.clone())
4871 }
4872
4873 /// Retrieves a specific Execution.
4874 pub fn get_execution(&self) -> super::builder::metadata_service::GetExecution {
4875 super::builder::metadata_service::GetExecution::new(self.inner.clone())
4876 }
4877
4878 /// Lists Executions in the MetadataStore.
4879 pub fn list_executions(&self) -> super::builder::metadata_service::ListExecutions {
4880 super::builder::metadata_service::ListExecutions::new(self.inner.clone())
4881 }
4882
4883 /// Updates a stored Execution.
4884 pub fn update_execution(&self) -> super::builder::metadata_service::UpdateExecution {
4885 super::builder::metadata_service::UpdateExecution::new(self.inner.clone())
4886 }
4887
4888 /// Deletes an Execution.
4889 ///
4890 /// # Long running operations
4891 ///
4892 /// This method is used to start, and/or poll a [long-running Operation].
4893 /// The [Working with long-running operations] chapter in the [user guide]
4894 /// covers these operations in detail.
4895 ///
4896 /// [long-running operation]: https://google.aip.dev/151
4897 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4898 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4899 pub fn delete_execution(&self) -> super::builder::metadata_service::DeleteExecution {
4900 super::builder::metadata_service::DeleteExecution::new(self.inner.clone())
4901 }
4902
4903 /// Purges Executions.
4904 ///
4905 /// # Long running operations
4906 ///
4907 /// This method is used to start, and/or poll a [long-running Operation].
4908 /// The [Working with long-running operations] chapter in the [user guide]
4909 /// covers these operations in detail.
4910 ///
4911 /// [long-running operation]: https://google.aip.dev/151
4912 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4913 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4914 pub fn purge_executions(&self) -> super::builder::metadata_service::PurgeExecutions {
4915 super::builder::metadata_service::PurgeExecutions::new(self.inner.clone())
4916 }
4917
4918 /// Adds Events to the specified Execution. An Event indicates whether an
4919 /// Artifact was used as an input or output for an Execution. If an Event
4920 /// already exists between the Execution and the Artifact, the Event is
4921 /// skipped.
4922 pub fn add_execution_events(&self) -> super::builder::metadata_service::AddExecutionEvents {
4923 super::builder::metadata_service::AddExecutionEvents::new(self.inner.clone())
4924 }
4925
4926 /// Obtains the set of input and output Artifacts for this Execution, in the
4927 /// form of LineageSubgraph that also contains the Execution and connecting
4928 /// Events.
4929 pub fn query_execution_inputs_and_outputs(
4930 &self,
4931 ) -> super::builder::metadata_service::QueryExecutionInputsAndOutputs {
4932 super::builder::metadata_service::QueryExecutionInputsAndOutputs::new(self.inner.clone())
4933 }
4934
4935 /// Creates a MetadataSchema.
4936 pub fn create_metadata_schema(&self) -> super::builder::metadata_service::CreateMetadataSchema {
4937 super::builder::metadata_service::CreateMetadataSchema::new(self.inner.clone())
4938 }
4939
4940 /// Retrieves a specific MetadataSchema.
4941 pub fn get_metadata_schema(&self) -> super::builder::metadata_service::GetMetadataSchema {
4942 super::builder::metadata_service::GetMetadataSchema::new(self.inner.clone())
4943 }
4944
4945 /// Lists MetadataSchemas.
4946 pub fn list_metadata_schemas(&self) -> super::builder::metadata_service::ListMetadataSchemas {
4947 super::builder::metadata_service::ListMetadataSchemas::new(self.inner.clone())
4948 }
4949
4950 /// Retrieves lineage of an Artifact represented through Artifacts and
4951 /// Executions connected by Event edges and returned as a LineageSubgraph.
4952 pub fn query_artifact_lineage_subgraph(
4953 &self,
4954 ) -> super::builder::metadata_service::QueryArtifactLineageSubgraph {
4955 super::builder::metadata_service::QueryArtifactLineageSubgraph::new(self.inner.clone())
4956 }
4957
4958 /// Lists information about the supported locations for this service.
4959 pub fn list_locations(&self) -> super::builder::metadata_service::ListLocations {
4960 super::builder::metadata_service::ListLocations::new(self.inner.clone())
4961 }
4962
4963 /// Gets information about a location.
4964 pub fn get_location(&self) -> super::builder::metadata_service::GetLocation {
4965 super::builder::metadata_service::GetLocation::new(self.inner.clone())
4966 }
4967
4968 /// Sets the access control policy on the specified resource. Replaces
4969 /// any existing policy.
4970 ///
4971 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
4972 /// errors.
4973 pub fn set_iam_policy(&self) -> super::builder::metadata_service::SetIamPolicy {
4974 super::builder::metadata_service::SetIamPolicy::new(self.inner.clone())
4975 }
4976
4977 /// Gets the access control policy for a resource. Returns an empty policy
4978 /// if the resource exists and does not have a policy set.
4979 pub fn get_iam_policy(&self) -> super::builder::metadata_service::GetIamPolicy {
4980 super::builder::metadata_service::GetIamPolicy::new(self.inner.clone())
4981 }
4982
4983 /// Returns permissions that a caller has on the specified resource. If the
4984 /// resource does not exist, this will return an empty set of
4985 /// permissions, not a `NOT_FOUND` error.
4986 ///
4987 /// Note: This operation is designed to be used for building
4988 /// permission-aware UIs and command-line tools, not for authorization
4989 /// checking. This operation may "fail open" without warning.
4990 pub fn test_iam_permissions(&self) -> super::builder::metadata_service::TestIamPermissions {
4991 super::builder::metadata_service::TestIamPermissions::new(self.inner.clone())
4992 }
4993
4994 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4995 ///
4996 /// [google.longrunning.Operations]: longrunning::client::Operations
4997 pub fn list_operations(&self) -> super::builder::metadata_service::ListOperations {
4998 super::builder::metadata_service::ListOperations::new(self.inner.clone())
4999 }
5000
5001 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5002 ///
5003 /// [google.longrunning.Operations]: longrunning::client::Operations
5004 pub fn get_operation(&self) -> super::builder::metadata_service::GetOperation {
5005 super::builder::metadata_service::GetOperation::new(self.inner.clone())
5006 }
5007
5008 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5009 ///
5010 /// [google.longrunning.Operations]: longrunning::client::Operations
5011 pub fn delete_operation(&self) -> super::builder::metadata_service::DeleteOperation {
5012 super::builder::metadata_service::DeleteOperation::new(self.inner.clone())
5013 }
5014
5015 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5016 ///
5017 /// [google.longrunning.Operations]: longrunning::client::Operations
5018 pub fn cancel_operation(&self) -> super::builder::metadata_service::CancelOperation {
5019 super::builder::metadata_service::CancelOperation::new(self.inner.clone())
5020 }
5021
5022 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5023 ///
5024 /// [google.longrunning.Operations]: longrunning::client::Operations
5025 pub fn wait_operation(&self) -> super::builder::metadata_service::WaitOperation {
5026 super::builder::metadata_service::WaitOperation::new(self.inner.clone())
5027 }
5028}
5029
5030/// Implements a client for the Vertex AI API.
5031///
5032/// # Example
5033/// ```
5034/// # tokio_test::block_on(async {
5035/// # use google_cloud_aiplatform_v1::client::MigrationService;
5036/// let client = MigrationService::builder().build().await?;
5037/// // use `client` to make requests to the Vertex AI API.
5038/// # gax::Result::<()>::Ok(()) });
5039/// ```
5040///
5041/// # Service Description
5042///
5043/// A service that migrates resources from automl.googleapis.com,
5044/// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI.
5045///
5046/// # Configuration
5047///
5048/// To configure `MigrationService` use the `with_*` methods in the type returned
5049/// by [builder()][MigrationService::builder]. The default configuration should
5050/// work for most applications. Common configuration changes include
5051///
5052/// * [with_endpoint()]: by default this client uses the global default endpoint
5053/// (`https://aiplatform.googleapis.com`). Applications using regional
5054/// endpoints or running in restricted networks (e.g. a network configured
5055// with [Private Google Access with VPC Service Controls]) may want to
5056/// override this default.
5057/// * [with_credentials()]: by default this client uses
5058/// [Application Default Credentials]. Applications using custom
5059/// authentication may need to override this default.
5060///
5061/// [with_endpoint()]: super::builder::migration_service::ClientBuilder::with_endpoint
5062/// [with_credentials()]: super::builder::migration_service::ClientBuilder::credentials
5063/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5064/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5065///
5066/// # Pooling and Cloning
5067///
5068/// `MigrationService` holds a connection pool internally, it is advised to
5069/// create one and the reuse it. You do not need to wrap `MigrationService` in
5070/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5071/// already uses an `Arc` internally.
5072#[cfg(feature = "migration-service")]
5073#[cfg_attr(docsrs, doc(cfg(feature = "migration-service")))]
5074#[derive(Clone, Debug)]
5075pub struct MigrationService {
5076 inner: std::sync::Arc<dyn super::stub::dynamic::MigrationService>,
5077}
5078
5079#[cfg(feature = "migration-service")]
5080impl MigrationService {
5081 /// Returns a builder for [MigrationService].
5082 ///
5083 /// ```
5084 /// # tokio_test::block_on(async {
5085 /// # use google_cloud_aiplatform_v1::client::MigrationService;
5086 /// let client = MigrationService::builder().build().await?;
5087 /// # gax::Result::<()>::Ok(()) });
5088 /// ```
5089 pub fn builder() -> super::builder::migration_service::ClientBuilder {
5090 gax::client_builder::internal::new_builder(
5091 super::builder::migration_service::client::Factory,
5092 )
5093 }
5094
5095 /// Creates a new client from the provided stub.
5096 ///
5097 /// The most common case for calling this function is in tests mocking the
5098 /// client's behavior.
5099 pub fn from_stub<T>(stub: T) -> Self
5100 where
5101 T: super::stub::MigrationService + 'static,
5102 {
5103 Self {
5104 inner: std::sync::Arc::new(stub),
5105 }
5106 }
5107
5108 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
5109 let inner = Self::build_inner(config).await?;
5110 Ok(Self { inner })
5111 }
5112
5113 async fn build_inner(
5114 conf: gaxi::options::ClientConfig,
5115 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::MigrationService>> {
5116 if gaxi::options::tracing_enabled(&conf) {
5117 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5118 }
5119 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5120 }
5121
5122 async fn build_transport(
5123 conf: gaxi::options::ClientConfig,
5124 ) -> Result<impl super::stub::MigrationService> {
5125 super::transport::MigrationService::new(conf).await
5126 }
5127
5128 async fn build_with_tracing(
5129 conf: gaxi::options::ClientConfig,
5130 ) -> Result<impl super::stub::MigrationService> {
5131 Self::build_transport(conf)
5132 .await
5133 .map(super::tracing::MigrationService::new)
5134 }
5135
5136 /// Searches all of the resources in automl.googleapis.com,
5137 /// datalabeling.googleapis.com and ml.googleapis.com that can be migrated to
5138 /// Vertex AI's given location.
5139 pub fn search_migratable_resources(
5140 &self,
5141 ) -> super::builder::migration_service::SearchMigratableResources {
5142 super::builder::migration_service::SearchMigratableResources::new(self.inner.clone())
5143 }
5144
5145 /// Batch migrates resources from ml.googleapis.com, automl.googleapis.com,
5146 /// and datalabeling.googleapis.com to Vertex AI.
5147 ///
5148 /// # Long running operations
5149 ///
5150 /// This method is used to start, and/or poll a [long-running Operation].
5151 /// The [Working with long-running operations] chapter in the [user guide]
5152 /// covers these operations in detail.
5153 ///
5154 /// [long-running operation]: https://google.aip.dev/151
5155 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5156 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5157 pub fn batch_migrate_resources(
5158 &self,
5159 ) -> super::builder::migration_service::BatchMigrateResources {
5160 super::builder::migration_service::BatchMigrateResources::new(self.inner.clone())
5161 }
5162
5163 /// Lists information about the supported locations for this service.
5164 pub fn list_locations(&self) -> super::builder::migration_service::ListLocations {
5165 super::builder::migration_service::ListLocations::new(self.inner.clone())
5166 }
5167
5168 /// Gets information about a location.
5169 pub fn get_location(&self) -> super::builder::migration_service::GetLocation {
5170 super::builder::migration_service::GetLocation::new(self.inner.clone())
5171 }
5172
5173 /// Sets the access control policy on the specified resource. Replaces
5174 /// any existing policy.
5175 ///
5176 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
5177 /// errors.
5178 pub fn set_iam_policy(&self) -> super::builder::migration_service::SetIamPolicy {
5179 super::builder::migration_service::SetIamPolicy::new(self.inner.clone())
5180 }
5181
5182 /// Gets the access control policy for a resource. Returns an empty policy
5183 /// if the resource exists and does not have a policy set.
5184 pub fn get_iam_policy(&self) -> super::builder::migration_service::GetIamPolicy {
5185 super::builder::migration_service::GetIamPolicy::new(self.inner.clone())
5186 }
5187
5188 /// Returns permissions that a caller has on the specified resource. If the
5189 /// resource does not exist, this will return an empty set of
5190 /// permissions, not a `NOT_FOUND` error.
5191 ///
5192 /// Note: This operation is designed to be used for building
5193 /// permission-aware UIs and command-line tools, not for authorization
5194 /// checking. This operation may "fail open" without warning.
5195 pub fn test_iam_permissions(&self) -> super::builder::migration_service::TestIamPermissions {
5196 super::builder::migration_service::TestIamPermissions::new(self.inner.clone())
5197 }
5198
5199 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5200 ///
5201 /// [google.longrunning.Operations]: longrunning::client::Operations
5202 pub fn list_operations(&self) -> super::builder::migration_service::ListOperations {
5203 super::builder::migration_service::ListOperations::new(self.inner.clone())
5204 }
5205
5206 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5207 ///
5208 /// [google.longrunning.Operations]: longrunning::client::Operations
5209 pub fn get_operation(&self) -> super::builder::migration_service::GetOperation {
5210 super::builder::migration_service::GetOperation::new(self.inner.clone())
5211 }
5212
5213 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5214 ///
5215 /// [google.longrunning.Operations]: longrunning::client::Operations
5216 pub fn delete_operation(&self) -> super::builder::migration_service::DeleteOperation {
5217 super::builder::migration_service::DeleteOperation::new(self.inner.clone())
5218 }
5219
5220 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5221 ///
5222 /// [google.longrunning.Operations]: longrunning::client::Operations
5223 pub fn cancel_operation(&self) -> super::builder::migration_service::CancelOperation {
5224 super::builder::migration_service::CancelOperation::new(self.inner.clone())
5225 }
5226
5227 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5228 ///
5229 /// [google.longrunning.Operations]: longrunning::client::Operations
5230 pub fn wait_operation(&self) -> super::builder::migration_service::WaitOperation {
5231 super::builder::migration_service::WaitOperation::new(self.inner.clone())
5232 }
5233}
5234
5235/// Implements a client for the Vertex AI API.
5236///
5237/// # Example
5238/// ```
5239/// # tokio_test::block_on(async {
5240/// # use google_cloud_aiplatform_v1::client::ModelGardenService;
5241/// let client = ModelGardenService::builder().build().await?;
5242/// // use `client` to make requests to the Vertex AI API.
5243/// # gax::Result::<()>::Ok(()) });
5244/// ```
5245///
5246/// # Service Description
5247///
5248/// The interface of Model Garden Service.
5249///
5250/// # Configuration
5251///
5252/// To configure `ModelGardenService` use the `with_*` methods in the type returned
5253/// by [builder()][ModelGardenService::builder]. The default configuration should
5254/// work for most applications. Common configuration changes include
5255///
5256/// * [with_endpoint()]: by default this client uses the global default endpoint
5257/// (`https://aiplatform.googleapis.com`). Applications using regional
5258/// endpoints or running in restricted networks (e.g. a network configured
5259// with [Private Google Access with VPC Service Controls]) may want to
5260/// override this default.
5261/// * [with_credentials()]: by default this client uses
5262/// [Application Default Credentials]. Applications using custom
5263/// authentication may need to override this default.
5264///
5265/// [with_endpoint()]: super::builder::model_garden_service::ClientBuilder::with_endpoint
5266/// [with_credentials()]: super::builder::model_garden_service::ClientBuilder::credentials
5267/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5268/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5269///
5270/// # Pooling and Cloning
5271///
5272/// `ModelGardenService` holds a connection pool internally, it is advised to
5273/// create one and the reuse it. You do not need to wrap `ModelGardenService` in
5274/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5275/// already uses an `Arc` internally.
5276#[cfg(feature = "model-garden-service")]
5277#[cfg_attr(docsrs, doc(cfg(feature = "model-garden-service")))]
5278#[derive(Clone, Debug)]
5279pub struct ModelGardenService {
5280 inner: std::sync::Arc<dyn super::stub::dynamic::ModelGardenService>,
5281}
5282
5283#[cfg(feature = "model-garden-service")]
5284impl ModelGardenService {
5285 /// Returns a builder for [ModelGardenService].
5286 ///
5287 /// ```
5288 /// # tokio_test::block_on(async {
5289 /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
5290 /// let client = ModelGardenService::builder().build().await?;
5291 /// # gax::Result::<()>::Ok(()) });
5292 /// ```
5293 pub fn builder() -> super::builder::model_garden_service::ClientBuilder {
5294 gax::client_builder::internal::new_builder(
5295 super::builder::model_garden_service::client::Factory,
5296 )
5297 }
5298
5299 /// Creates a new client from the provided stub.
5300 ///
5301 /// The most common case for calling this function is in tests mocking the
5302 /// client's behavior.
5303 pub fn from_stub<T>(stub: T) -> Self
5304 where
5305 T: super::stub::ModelGardenService + 'static,
5306 {
5307 Self {
5308 inner: std::sync::Arc::new(stub),
5309 }
5310 }
5311
5312 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
5313 let inner = Self::build_inner(config).await?;
5314 Ok(Self { inner })
5315 }
5316
5317 async fn build_inner(
5318 conf: gaxi::options::ClientConfig,
5319 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::ModelGardenService>> {
5320 if gaxi::options::tracing_enabled(&conf) {
5321 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5322 }
5323 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5324 }
5325
5326 async fn build_transport(
5327 conf: gaxi::options::ClientConfig,
5328 ) -> Result<impl super::stub::ModelGardenService> {
5329 super::transport::ModelGardenService::new(conf).await
5330 }
5331
5332 async fn build_with_tracing(
5333 conf: gaxi::options::ClientConfig,
5334 ) -> Result<impl super::stub::ModelGardenService> {
5335 Self::build_transport(conf)
5336 .await
5337 .map(super::tracing::ModelGardenService::new)
5338 }
5339
5340 /// Gets a Model Garden publisher model.
5341 pub fn get_publisher_model(&self) -> super::builder::model_garden_service::GetPublisherModel {
5342 super::builder::model_garden_service::GetPublisherModel::new(self.inner.clone())
5343 }
5344
5345 /// Lists information about the supported locations for this service.
5346 pub fn list_locations(&self) -> super::builder::model_garden_service::ListLocations {
5347 super::builder::model_garden_service::ListLocations::new(self.inner.clone())
5348 }
5349
5350 /// Gets information about a location.
5351 pub fn get_location(&self) -> super::builder::model_garden_service::GetLocation {
5352 super::builder::model_garden_service::GetLocation::new(self.inner.clone())
5353 }
5354
5355 /// Sets the access control policy on the specified resource. Replaces
5356 /// any existing policy.
5357 ///
5358 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
5359 /// errors.
5360 pub fn set_iam_policy(&self) -> super::builder::model_garden_service::SetIamPolicy {
5361 super::builder::model_garden_service::SetIamPolicy::new(self.inner.clone())
5362 }
5363
5364 /// Gets the access control policy for a resource. Returns an empty policy
5365 /// if the resource exists and does not have a policy set.
5366 pub fn get_iam_policy(&self) -> super::builder::model_garden_service::GetIamPolicy {
5367 super::builder::model_garden_service::GetIamPolicy::new(self.inner.clone())
5368 }
5369
5370 /// Returns permissions that a caller has on the specified resource. If the
5371 /// resource does not exist, this will return an empty set of
5372 /// permissions, not a `NOT_FOUND` error.
5373 ///
5374 /// Note: This operation is designed to be used for building
5375 /// permission-aware UIs and command-line tools, not for authorization
5376 /// checking. This operation may "fail open" without warning.
5377 pub fn test_iam_permissions(&self) -> super::builder::model_garden_service::TestIamPermissions {
5378 super::builder::model_garden_service::TestIamPermissions::new(self.inner.clone())
5379 }
5380
5381 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5382 ///
5383 /// [google.longrunning.Operations]: longrunning::client::Operations
5384 pub fn list_operations(&self) -> super::builder::model_garden_service::ListOperations {
5385 super::builder::model_garden_service::ListOperations::new(self.inner.clone())
5386 }
5387
5388 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5389 ///
5390 /// [google.longrunning.Operations]: longrunning::client::Operations
5391 pub fn get_operation(&self) -> super::builder::model_garden_service::GetOperation {
5392 super::builder::model_garden_service::GetOperation::new(self.inner.clone())
5393 }
5394
5395 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5396 ///
5397 /// [google.longrunning.Operations]: longrunning::client::Operations
5398 pub fn delete_operation(&self) -> super::builder::model_garden_service::DeleteOperation {
5399 super::builder::model_garden_service::DeleteOperation::new(self.inner.clone())
5400 }
5401
5402 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5403 ///
5404 /// [google.longrunning.Operations]: longrunning::client::Operations
5405 pub fn cancel_operation(&self) -> super::builder::model_garden_service::CancelOperation {
5406 super::builder::model_garden_service::CancelOperation::new(self.inner.clone())
5407 }
5408
5409 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5410 ///
5411 /// [google.longrunning.Operations]: longrunning::client::Operations
5412 pub fn wait_operation(&self) -> super::builder::model_garden_service::WaitOperation {
5413 super::builder::model_garden_service::WaitOperation::new(self.inner.clone())
5414 }
5415}
5416
5417/// Implements a client for the Vertex AI API.
5418///
5419/// # Example
5420/// ```
5421/// # tokio_test::block_on(async {
5422/// # use google_cloud_aiplatform_v1::client::ModelService;
5423/// let client = ModelService::builder().build().await?;
5424/// // use `client` to make requests to the Vertex AI API.
5425/// # gax::Result::<()>::Ok(()) });
5426/// ```
5427///
5428/// # Service Description
5429///
5430/// A service for managing Vertex AI's machine learning Models.
5431///
5432/// # Configuration
5433///
5434/// To configure `ModelService` use the `with_*` methods in the type returned
5435/// by [builder()][ModelService::builder]. The default configuration should
5436/// work for most applications. Common configuration changes include
5437///
5438/// * [with_endpoint()]: by default this client uses the global default endpoint
5439/// (`https://aiplatform.googleapis.com`). Applications using regional
5440/// endpoints or running in restricted networks (e.g. a network configured
5441// with [Private Google Access with VPC Service Controls]) may want to
5442/// override this default.
5443/// * [with_credentials()]: by default this client uses
5444/// [Application Default Credentials]. Applications using custom
5445/// authentication may need to override this default.
5446///
5447/// [with_endpoint()]: super::builder::model_service::ClientBuilder::with_endpoint
5448/// [with_credentials()]: super::builder::model_service::ClientBuilder::credentials
5449/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5450/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5451///
5452/// # Pooling and Cloning
5453///
5454/// `ModelService` holds a connection pool internally, it is advised to
5455/// create one and the reuse it. You do not need to wrap `ModelService` in
5456/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5457/// already uses an `Arc` internally.
5458#[cfg(feature = "model-service")]
5459#[cfg_attr(docsrs, doc(cfg(feature = "model-service")))]
5460#[derive(Clone, Debug)]
5461pub struct ModelService {
5462 inner: std::sync::Arc<dyn super::stub::dynamic::ModelService>,
5463}
5464
5465#[cfg(feature = "model-service")]
5466impl ModelService {
5467 /// Returns a builder for [ModelService].
5468 ///
5469 /// ```
5470 /// # tokio_test::block_on(async {
5471 /// # use google_cloud_aiplatform_v1::client::ModelService;
5472 /// let client = ModelService::builder().build().await?;
5473 /// # gax::Result::<()>::Ok(()) });
5474 /// ```
5475 pub fn builder() -> super::builder::model_service::ClientBuilder {
5476 gax::client_builder::internal::new_builder(super::builder::model_service::client::Factory)
5477 }
5478
5479 /// Creates a new client from the provided stub.
5480 ///
5481 /// The most common case for calling this function is in tests mocking the
5482 /// client's behavior.
5483 pub fn from_stub<T>(stub: T) -> Self
5484 where
5485 T: super::stub::ModelService + 'static,
5486 {
5487 Self {
5488 inner: std::sync::Arc::new(stub),
5489 }
5490 }
5491
5492 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
5493 let inner = Self::build_inner(config).await?;
5494 Ok(Self { inner })
5495 }
5496
5497 async fn build_inner(
5498 conf: gaxi::options::ClientConfig,
5499 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::ModelService>> {
5500 if gaxi::options::tracing_enabled(&conf) {
5501 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5502 }
5503 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5504 }
5505
5506 async fn build_transport(
5507 conf: gaxi::options::ClientConfig,
5508 ) -> Result<impl super::stub::ModelService> {
5509 super::transport::ModelService::new(conf).await
5510 }
5511
5512 async fn build_with_tracing(
5513 conf: gaxi::options::ClientConfig,
5514 ) -> Result<impl super::stub::ModelService> {
5515 Self::build_transport(conf)
5516 .await
5517 .map(super::tracing::ModelService::new)
5518 }
5519
5520 /// Uploads a Model artifact into Vertex AI.
5521 ///
5522 /// # Long running operations
5523 ///
5524 /// This method is used to start, and/or poll a [long-running Operation].
5525 /// The [Working with long-running operations] chapter in the [user guide]
5526 /// covers these operations in detail.
5527 ///
5528 /// [long-running operation]: https://google.aip.dev/151
5529 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5530 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5531 pub fn upload_model(&self) -> super::builder::model_service::UploadModel {
5532 super::builder::model_service::UploadModel::new(self.inner.clone())
5533 }
5534
5535 /// Gets a Model.
5536 pub fn get_model(&self) -> super::builder::model_service::GetModel {
5537 super::builder::model_service::GetModel::new(self.inner.clone())
5538 }
5539
5540 /// Lists Models in a Location.
5541 pub fn list_models(&self) -> super::builder::model_service::ListModels {
5542 super::builder::model_service::ListModels::new(self.inner.clone())
5543 }
5544
5545 /// Lists versions of the specified model.
5546 pub fn list_model_versions(&self) -> super::builder::model_service::ListModelVersions {
5547 super::builder::model_service::ListModelVersions::new(self.inner.clone())
5548 }
5549
5550 /// Lists checkpoints of the specified model version.
5551 pub fn list_model_version_checkpoints(
5552 &self,
5553 ) -> super::builder::model_service::ListModelVersionCheckpoints {
5554 super::builder::model_service::ListModelVersionCheckpoints::new(self.inner.clone())
5555 }
5556
5557 /// Updates a Model.
5558 pub fn update_model(&self) -> super::builder::model_service::UpdateModel {
5559 super::builder::model_service::UpdateModel::new(self.inner.clone())
5560 }
5561
5562 /// Incrementally update the dataset used for an examples model.
5563 ///
5564 /// # Long running operations
5565 ///
5566 /// This method is used to start, and/or poll a [long-running Operation].
5567 /// The [Working with long-running operations] chapter in the [user guide]
5568 /// covers these operations in detail.
5569 ///
5570 /// [long-running operation]: https://google.aip.dev/151
5571 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5572 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5573 pub fn update_explanation_dataset(
5574 &self,
5575 ) -> super::builder::model_service::UpdateExplanationDataset {
5576 super::builder::model_service::UpdateExplanationDataset::new(self.inner.clone())
5577 }
5578
5579 /// Deletes a Model.
5580 ///
5581 /// A model cannot be deleted if any
5582 /// [Endpoint][google.cloud.aiplatform.v1.Endpoint] resource has a
5583 /// [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] based on the
5584 /// model in its
5585 /// [deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models]
5586 /// field.
5587 ///
5588 /// [google.cloud.aiplatform.v1.DeployedModel]: crate::model::DeployedModel
5589 /// [google.cloud.aiplatform.v1.Endpoint]: crate::model::Endpoint
5590 /// [google.cloud.aiplatform.v1.Endpoint.deployed_models]: crate::model::Endpoint::deployed_models
5591 ///
5592 /// # Long running operations
5593 ///
5594 /// This method is used to start, and/or poll a [long-running Operation].
5595 /// The [Working with long-running operations] chapter in the [user guide]
5596 /// covers these operations in detail.
5597 ///
5598 /// [long-running operation]: https://google.aip.dev/151
5599 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5600 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5601 pub fn delete_model(&self) -> super::builder::model_service::DeleteModel {
5602 super::builder::model_service::DeleteModel::new(self.inner.clone())
5603 }
5604
5605 /// Deletes a Model version.
5606 ///
5607 /// Model version can only be deleted if there are no
5608 /// [DeployedModels][google.cloud.aiplatform.v1.DeployedModel] created from it.
5609 /// Deleting the only version in the Model is not allowed. Use
5610 /// [DeleteModel][google.cloud.aiplatform.v1.ModelService.DeleteModel] for
5611 /// deleting the Model instead.
5612 ///
5613 /// [google.cloud.aiplatform.v1.DeployedModel]: crate::model::DeployedModel
5614 /// [google.cloud.aiplatform.v1.ModelService.DeleteModel]: crate::client::ModelService::delete_model
5615 ///
5616 /// # Long running operations
5617 ///
5618 /// This method is used to start, and/or poll a [long-running Operation].
5619 /// The [Working with long-running operations] chapter in the [user guide]
5620 /// covers these operations in detail.
5621 ///
5622 /// [long-running operation]: https://google.aip.dev/151
5623 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5624 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5625 pub fn delete_model_version(&self) -> super::builder::model_service::DeleteModelVersion {
5626 super::builder::model_service::DeleteModelVersion::new(self.inner.clone())
5627 }
5628
5629 /// Merges a set of aliases for a Model version.
5630 pub fn merge_version_aliases(&self) -> super::builder::model_service::MergeVersionAliases {
5631 super::builder::model_service::MergeVersionAliases::new(self.inner.clone())
5632 }
5633
5634 /// Exports a trained, exportable Model to a location specified by the
5635 /// user. A Model is considered to be exportable if it has at least one
5636 /// [supported export
5637 /// format][google.cloud.aiplatform.v1.Model.supported_export_formats].
5638 ///
5639 /// [google.cloud.aiplatform.v1.Model.supported_export_formats]: crate::model::Model::supported_export_formats
5640 ///
5641 /// # Long running operations
5642 ///
5643 /// This method is used to start, and/or poll a [long-running Operation].
5644 /// The [Working with long-running operations] chapter in the [user guide]
5645 /// covers these operations in detail.
5646 ///
5647 /// [long-running operation]: https://google.aip.dev/151
5648 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5649 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5650 pub fn export_model(&self) -> super::builder::model_service::ExportModel {
5651 super::builder::model_service::ExportModel::new(self.inner.clone())
5652 }
5653
5654 /// Copies an already existing Vertex AI Model into the specified Location.
5655 /// The source Model must exist in the same Project.
5656 /// When copying custom Models, the users themselves are responsible for
5657 /// [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be
5658 /// region-agnostic, as well as making sure that any resources (e.g. files) it
5659 /// depends on remain accessible.
5660 ///
5661 /// [google.cloud.aiplatform.v1.Model.metadata]: crate::model::Model::metadata
5662 ///
5663 /// # Long running operations
5664 ///
5665 /// This method is used to start, and/or poll a [long-running Operation].
5666 /// The [Working with long-running operations] chapter in the [user guide]
5667 /// covers these operations in detail.
5668 ///
5669 /// [long-running operation]: https://google.aip.dev/151
5670 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5671 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5672 pub fn copy_model(&self) -> super::builder::model_service::CopyModel {
5673 super::builder::model_service::CopyModel::new(self.inner.clone())
5674 }
5675
5676 /// Imports an externally generated ModelEvaluation.
5677 pub fn import_model_evaluation(&self) -> super::builder::model_service::ImportModelEvaluation {
5678 super::builder::model_service::ImportModelEvaluation::new(self.inner.clone())
5679 }
5680
5681 /// Imports a list of externally generated ModelEvaluationSlice.
5682 pub fn batch_import_model_evaluation_slices(
5683 &self,
5684 ) -> super::builder::model_service::BatchImportModelEvaluationSlices {
5685 super::builder::model_service::BatchImportModelEvaluationSlices::new(self.inner.clone())
5686 }
5687
5688 /// Imports a list of externally generated EvaluatedAnnotations.
5689 pub fn batch_import_evaluated_annotations(
5690 &self,
5691 ) -> super::builder::model_service::BatchImportEvaluatedAnnotations {
5692 super::builder::model_service::BatchImportEvaluatedAnnotations::new(self.inner.clone())
5693 }
5694
5695 /// Gets a ModelEvaluation.
5696 pub fn get_model_evaluation(&self) -> super::builder::model_service::GetModelEvaluation {
5697 super::builder::model_service::GetModelEvaluation::new(self.inner.clone())
5698 }
5699
5700 /// Lists ModelEvaluations in a Model.
5701 pub fn list_model_evaluations(&self) -> super::builder::model_service::ListModelEvaluations {
5702 super::builder::model_service::ListModelEvaluations::new(self.inner.clone())
5703 }
5704
5705 /// Gets a ModelEvaluationSlice.
5706 pub fn get_model_evaluation_slice(
5707 &self,
5708 ) -> super::builder::model_service::GetModelEvaluationSlice {
5709 super::builder::model_service::GetModelEvaluationSlice::new(self.inner.clone())
5710 }
5711
5712 /// Lists ModelEvaluationSlices in a ModelEvaluation.
5713 pub fn list_model_evaluation_slices(
5714 &self,
5715 ) -> super::builder::model_service::ListModelEvaluationSlices {
5716 super::builder::model_service::ListModelEvaluationSlices::new(self.inner.clone())
5717 }
5718
5719 /// Lists information about the supported locations for this service.
5720 pub fn list_locations(&self) -> super::builder::model_service::ListLocations {
5721 super::builder::model_service::ListLocations::new(self.inner.clone())
5722 }
5723
5724 /// Gets information about a location.
5725 pub fn get_location(&self) -> super::builder::model_service::GetLocation {
5726 super::builder::model_service::GetLocation::new(self.inner.clone())
5727 }
5728
5729 /// Sets the access control policy on the specified resource. Replaces
5730 /// any existing policy.
5731 ///
5732 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
5733 /// errors.
5734 pub fn set_iam_policy(&self) -> super::builder::model_service::SetIamPolicy {
5735 super::builder::model_service::SetIamPolicy::new(self.inner.clone())
5736 }
5737
5738 /// Gets the access control policy for a resource. Returns an empty policy
5739 /// if the resource exists and does not have a policy set.
5740 pub fn get_iam_policy(&self) -> super::builder::model_service::GetIamPolicy {
5741 super::builder::model_service::GetIamPolicy::new(self.inner.clone())
5742 }
5743
5744 /// Returns permissions that a caller has on the specified resource. If the
5745 /// resource does not exist, this will return an empty set of
5746 /// permissions, not a `NOT_FOUND` error.
5747 ///
5748 /// Note: This operation is designed to be used for building
5749 /// permission-aware UIs and command-line tools, not for authorization
5750 /// checking. This operation may "fail open" without warning.
5751 pub fn test_iam_permissions(&self) -> super::builder::model_service::TestIamPermissions {
5752 super::builder::model_service::TestIamPermissions::new(self.inner.clone())
5753 }
5754
5755 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5756 ///
5757 /// [google.longrunning.Operations]: longrunning::client::Operations
5758 pub fn list_operations(&self) -> super::builder::model_service::ListOperations {
5759 super::builder::model_service::ListOperations::new(self.inner.clone())
5760 }
5761
5762 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5763 ///
5764 /// [google.longrunning.Operations]: longrunning::client::Operations
5765 pub fn get_operation(&self) -> super::builder::model_service::GetOperation {
5766 super::builder::model_service::GetOperation::new(self.inner.clone())
5767 }
5768
5769 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5770 ///
5771 /// [google.longrunning.Operations]: longrunning::client::Operations
5772 pub fn delete_operation(&self) -> super::builder::model_service::DeleteOperation {
5773 super::builder::model_service::DeleteOperation::new(self.inner.clone())
5774 }
5775
5776 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5777 ///
5778 /// [google.longrunning.Operations]: longrunning::client::Operations
5779 pub fn cancel_operation(&self) -> super::builder::model_service::CancelOperation {
5780 super::builder::model_service::CancelOperation::new(self.inner.clone())
5781 }
5782
5783 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5784 ///
5785 /// [google.longrunning.Operations]: longrunning::client::Operations
5786 pub fn wait_operation(&self) -> super::builder::model_service::WaitOperation {
5787 super::builder::model_service::WaitOperation::new(self.inner.clone())
5788 }
5789}
5790
5791/// Implements a client for the Vertex AI API.
5792///
5793/// # Example
5794/// ```
5795/// # tokio_test::block_on(async {
5796/// # use google_cloud_aiplatform_v1::client::NotebookService;
5797/// let client = NotebookService::builder().build().await?;
5798/// // use `client` to make requests to the Vertex AI API.
5799/// # gax::Result::<()>::Ok(()) });
5800/// ```
5801///
5802/// # Service Description
5803///
5804/// The interface for Vertex Notebook service (a.k.a. Colab on Workbench).
5805///
5806/// # Configuration
5807///
5808/// To configure `NotebookService` use the `with_*` methods in the type returned
5809/// by [builder()][NotebookService::builder]. The default configuration should
5810/// work for most applications. Common configuration changes include
5811///
5812/// * [with_endpoint()]: by default this client uses the global default endpoint
5813/// (`https://aiplatform.googleapis.com`). Applications using regional
5814/// endpoints or running in restricted networks (e.g. a network configured
5815// with [Private Google Access with VPC Service Controls]) may want to
5816/// override this default.
5817/// * [with_credentials()]: by default this client uses
5818/// [Application Default Credentials]. Applications using custom
5819/// authentication may need to override this default.
5820///
5821/// [with_endpoint()]: super::builder::notebook_service::ClientBuilder::with_endpoint
5822/// [with_credentials()]: super::builder::notebook_service::ClientBuilder::credentials
5823/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5824/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5825///
5826/// # Pooling and Cloning
5827///
5828/// `NotebookService` holds a connection pool internally, it is advised to
5829/// create one and the reuse it. You do not need to wrap `NotebookService` in
5830/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5831/// already uses an `Arc` internally.
5832#[cfg(feature = "notebook-service")]
5833#[cfg_attr(docsrs, doc(cfg(feature = "notebook-service")))]
5834#[derive(Clone, Debug)]
5835pub struct NotebookService {
5836 inner: std::sync::Arc<dyn super::stub::dynamic::NotebookService>,
5837}
5838
5839#[cfg(feature = "notebook-service")]
5840impl NotebookService {
5841 /// Returns a builder for [NotebookService].
5842 ///
5843 /// ```
5844 /// # tokio_test::block_on(async {
5845 /// # use google_cloud_aiplatform_v1::client::NotebookService;
5846 /// let client = NotebookService::builder().build().await?;
5847 /// # gax::Result::<()>::Ok(()) });
5848 /// ```
5849 pub fn builder() -> super::builder::notebook_service::ClientBuilder {
5850 gax::client_builder::internal::new_builder(
5851 super::builder::notebook_service::client::Factory,
5852 )
5853 }
5854
5855 /// Creates a new client from the provided stub.
5856 ///
5857 /// The most common case for calling this function is in tests mocking the
5858 /// client's behavior.
5859 pub fn from_stub<T>(stub: T) -> Self
5860 where
5861 T: super::stub::NotebookService + 'static,
5862 {
5863 Self {
5864 inner: std::sync::Arc::new(stub),
5865 }
5866 }
5867
5868 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
5869 let inner = Self::build_inner(config).await?;
5870 Ok(Self { inner })
5871 }
5872
5873 async fn build_inner(
5874 conf: gaxi::options::ClientConfig,
5875 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::NotebookService>> {
5876 if gaxi::options::tracing_enabled(&conf) {
5877 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5878 }
5879 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5880 }
5881
5882 async fn build_transport(
5883 conf: gaxi::options::ClientConfig,
5884 ) -> Result<impl super::stub::NotebookService> {
5885 super::transport::NotebookService::new(conf).await
5886 }
5887
5888 async fn build_with_tracing(
5889 conf: gaxi::options::ClientConfig,
5890 ) -> Result<impl super::stub::NotebookService> {
5891 Self::build_transport(conf)
5892 .await
5893 .map(super::tracing::NotebookService::new)
5894 }
5895
5896 /// Creates a NotebookRuntimeTemplate.
5897 ///
5898 /// # Long running operations
5899 ///
5900 /// This method is used to start, and/or poll a [long-running Operation].
5901 /// The [Working with long-running operations] chapter in the [user guide]
5902 /// covers these operations in detail.
5903 ///
5904 /// [long-running operation]: https://google.aip.dev/151
5905 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5906 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5907 pub fn create_notebook_runtime_template(
5908 &self,
5909 ) -> super::builder::notebook_service::CreateNotebookRuntimeTemplate {
5910 super::builder::notebook_service::CreateNotebookRuntimeTemplate::new(self.inner.clone())
5911 }
5912
5913 /// Gets a NotebookRuntimeTemplate.
5914 pub fn get_notebook_runtime_template(
5915 &self,
5916 ) -> super::builder::notebook_service::GetNotebookRuntimeTemplate {
5917 super::builder::notebook_service::GetNotebookRuntimeTemplate::new(self.inner.clone())
5918 }
5919
5920 /// Lists NotebookRuntimeTemplates in a Location.
5921 pub fn list_notebook_runtime_templates(
5922 &self,
5923 ) -> super::builder::notebook_service::ListNotebookRuntimeTemplates {
5924 super::builder::notebook_service::ListNotebookRuntimeTemplates::new(self.inner.clone())
5925 }
5926
5927 /// Deletes a NotebookRuntimeTemplate.
5928 ///
5929 /// # Long running operations
5930 ///
5931 /// This method is used to start, and/or poll a [long-running Operation].
5932 /// The [Working with long-running operations] chapter in the [user guide]
5933 /// covers these operations in detail.
5934 ///
5935 /// [long-running operation]: https://google.aip.dev/151
5936 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5937 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5938 pub fn delete_notebook_runtime_template(
5939 &self,
5940 ) -> super::builder::notebook_service::DeleteNotebookRuntimeTemplate {
5941 super::builder::notebook_service::DeleteNotebookRuntimeTemplate::new(self.inner.clone())
5942 }
5943
5944 /// Updates a NotebookRuntimeTemplate.
5945 pub fn update_notebook_runtime_template(
5946 &self,
5947 ) -> super::builder::notebook_service::UpdateNotebookRuntimeTemplate {
5948 super::builder::notebook_service::UpdateNotebookRuntimeTemplate::new(self.inner.clone())
5949 }
5950
5951 /// Assigns a NotebookRuntime to a user for a particular Notebook file. This
5952 /// method will either returns an existing assignment or generates a new one.
5953 ///
5954 /// # Long running operations
5955 ///
5956 /// This method is used to start, and/or poll a [long-running Operation].
5957 /// The [Working with long-running operations] chapter in the [user guide]
5958 /// covers these operations in detail.
5959 ///
5960 /// [long-running operation]: https://google.aip.dev/151
5961 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5962 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5963 pub fn assign_notebook_runtime(
5964 &self,
5965 ) -> super::builder::notebook_service::AssignNotebookRuntime {
5966 super::builder::notebook_service::AssignNotebookRuntime::new(self.inner.clone())
5967 }
5968
5969 /// Gets a NotebookRuntime.
5970 pub fn get_notebook_runtime(&self) -> super::builder::notebook_service::GetNotebookRuntime {
5971 super::builder::notebook_service::GetNotebookRuntime::new(self.inner.clone())
5972 }
5973
5974 /// Lists NotebookRuntimes in a Location.
5975 pub fn list_notebook_runtimes(&self) -> super::builder::notebook_service::ListNotebookRuntimes {
5976 super::builder::notebook_service::ListNotebookRuntimes::new(self.inner.clone())
5977 }
5978
5979 /// Deletes a NotebookRuntime.
5980 ///
5981 /// # Long running operations
5982 ///
5983 /// This method is used to start, and/or poll a [long-running Operation].
5984 /// The [Working with long-running operations] chapter in the [user guide]
5985 /// covers these operations in detail.
5986 ///
5987 /// [long-running operation]: https://google.aip.dev/151
5988 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5989 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5990 pub fn delete_notebook_runtime(
5991 &self,
5992 ) -> super::builder::notebook_service::DeleteNotebookRuntime {
5993 super::builder::notebook_service::DeleteNotebookRuntime::new(self.inner.clone())
5994 }
5995
5996 /// Upgrades a NotebookRuntime.
5997 ///
5998 /// # Long running operations
5999 ///
6000 /// This method is used to start, and/or poll a [long-running Operation].
6001 /// The [Working with long-running operations] chapter in the [user guide]
6002 /// covers these operations in detail.
6003 ///
6004 /// [long-running operation]: https://google.aip.dev/151
6005 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6006 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6007 pub fn upgrade_notebook_runtime(
6008 &self,
6009 ) -> super::builder::notebook_service::UpgradeNotebookRuntime {
6010 super::builder::notebook_service::UpgradeNotebookRuntime::new(self.inner.clone())
6011 }
6012
6013 /// Starts a NotebookRuntime.
6014 ///
6015 /// # Long running operations
6016 ///
6017 /// This method is used to start, and/or poll a [long-running Operation].
6018 /// The [Working with long-running operations] chapter in the [user guide]
6019 /// covers these operations in detail.
6020 ///
6021 /// [long-running operation]: https://google.aip.dev/151
6022 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6023 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6024 pub fn start_notebook_runtime(&self) -> super::builder::notebook_service::StartNotebookRuntime {
6025 super::builder::notebook_service::StartNotebookRuntime::new(self.inner.clone())
6026 }
6027
6028 /// Stops a NotebookRuntime.
6029 ///
6030 /// # Long running operations
6031 ///
6032 /// This method is used to start, and/or poll a [long-running Operation].
6033 /// The [Working with long-running operations] chapter in the [user guide]
6034 /// covers these operations in detail.
6035 ///
6036 /// [long-running operation]: https://google.aip.dev/151
6037 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6038 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6039 pub fn stop_notebook_runtime(&self) -> super::builder::notebook_service::StopNotebookRuntime {
6040 super::builder::notebook_service::StopNotebookRuntime::new(self.inner.clone())
6041 }
6042
6043 /// Creates a NotebookExecutionJob.
6044 ///
6045 /// # Long running operations
6046 ///
6047 /// This method is used to start, and/or poll a [long-running Operation].
6048 /// The [Working with long-running operations] chapter in the [user guide]
6049 /// covers these operations in detail.
6050 ///
6051 /// [long-running operation]: https://google.aip.dev/151
6052 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6053 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6054 pub fn create_notebook_execution_job(
6055 &self,
6056 ) -> super::builder::notebook_service::CreateNotebookExecutionJob {
6057 super::builder::notebook_service::CreateNotebookExecutionJob::new(self.inner.clone())
6058 }
6059
6060 /// Gets a NotebookExecutionJob.
6061 pub fn get_notebook_execution_job(
6062 &self,
6063 ) -> super::builder::notebook_service::GetNotebookExecutionJob {
6064 super::builder::notebook_service::GetNotebookExecutionJob::new(self.inner.clone())
6065 }
6066
6067 /// Lists NotebookExecutionJobs in a Location.
6068 pub fn list_notebook_execution_jobs(
6069 &self,
6070 ) -> super::builder::notebook_service::ListNotebookExecutionJobs {
6071 super::builder::notebook_service::ListNotebookExecutionJobs::new(self.inner.clone())
6072 }
6073
6074 /// Deletes a NotebookExecutionJob.
6075 ///
6076 /// # Long running operations
6077 ///
6078 /// This method is used to start, and/or poll a [long-running Operation].
6079 /// The [Working with long-running operations] chapter in the [user guide]
6080 /// covers these operations in detail.
6081 ///
6082 /// [long-running operation]: https://google.aip.dev/151
6083 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6084 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6085 pub fn delete_notebook_execution_job(
6086 &self,
6087 ) -> super::builder::notebook_service::DeleteNotebookExecutionJob {
6088 super::builder::notebook_service::DeleteNotebookExecutionJob::new(self.inner.clone())
6089 }
6090
6091 /// Lists information about the supported locations for this service.
6092 pub fn list_locations(&self) -> super::builder::notebook_service::ListLocations {
6093 super::builder::notebook_service::ListLocations::new(self.inner.clone())
6094 }
6095
6096 /// Gets information about a location.
6097 pub fn get_location(&self) -> super::builder::notebook_service::GetLocation {
6098 super::builder::notebook_service::GetLocation::new(self.inner.clone())
6099 }
6100
6101 /// Sets the access control policy on the specified resource. Replaces
6102 /// any existing policy.
6103 ///
6104 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
6105 /// errors.
6106 pub fn set_iam_policy(&self) -> super::builder::notebook_service::SetIamPolicy {
6107 super::builder::notebook_service::SetIamPolicy::new(self.inner.clone())
6108 }
6109
6110 /// Gets the access control policy for a resource. Returns an empty policy
6111 /// if the resource exists and does not have a policy set.
6112 pub fn get_iam_policy(&self) -> super::builder::notebook_service::GetIamPolicy {
6113 super::builder::notebook_service::GetIamPolicy::new(self.inner.clone())
6114 }
6115
6116 /// Returns permissions that a caller has on the specified resource. If the
6117 /// resource does not exist, this will return an empty set of
6118 /// permissions, not a `NOT_FOUND` error.
6119 ///
6120 /// Note: This operation is designed to be used for building
6121 /// permission-aware UIs and command-line tools, not for authorization
6122 /// checking. This operation may "fail open" without warning.
6123 pub fn test_iam_permissions(&self) -> super::builder::notebook_service::TestIamPermissions {
6124 super::builder::notebook_service::TestIamPermissions::new(self.inner.clone())
6125 }
6126
6127 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6128 ///
6129 /// [google.longrunning.Operations]: longrunning::client::Operations
6130 pub fn list_operations(&self) -> super::builder::notebook_service::ListOperations {
6131 super::builder::notebook_service::ListOperations::new(self.inner.clone())
6132 }
6133
6134 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6135 ///
6136 /// [google.longrunning.Operations]: longrunning::client::Operations
6137 pub fn get_operation(&self) -> super::builder::notebook_service::GetOperation {
6138 super::builder::notebook_service::GetOperation::new(self.inner.clone())
6139 }
6140
6141 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6142 ///
6143 /// [google.longrunning.Operations]: longrunning::client::Operations
6144 pub fn delete_operation(&self) -> super::builder::notebook_service::DeleteOperation {
6145 super::builder::notebook_service::DeleteOperation::new(self.inner.clone())
6146 }
6147
6148 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6149 ///
6150 /// [google.longrunning.Operations]: longrunning::client::Operations
6151 pub fn cancel_operation(&self) -> super::builder::notebook_service::CancelOperation {
6152 super::builder::notebook_service::CancelOperation::new(self.inner.clone())
6153 }
6154
6155 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6156 ///
6157 /// [google.longrunning.Operations]: longrunning::client::Operations
6158 pub fn wait_operation(&self) -> super::builder::notebook_service::WaitOperation {
6159 super::builder::notebook_service::WaitOperation::new(self.inner.clone())
6160 }
6161}
6162
6163/// Implements a client for the Vertex AI API.
6164///
6165/// # Example
6166/// ```
6167/// # tokio_test::block_on(async {
6168/// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
6169/// let client = PersistentResourceService::builder().build().await?;
6170/// // use `client` to make requests to the Vertex AI API.
6171/// # gax::Result::<()>::Ok(()) });
6172/// ```
6173///
6174/// # Service Description
6175///
6176/// A service for managing Vertex AI's machine learning PersistentResource.
6177///
6178/// # Configuration
6179///
6180/// To configure `PersistentResourceService` use the `with_*` methods in the type returned
6181/// by [builder()][PersistentResourceService::builder]. The default configuration should
6182/// work for most applications. Common configuration changes include
6183///
6184/// * [with_endpoint()]: by default this client uses the global default endpoint
6185/// (`https://aiplatform.googleapis.com`). Applications using regional
6186/// endpoints or running in restricted networks (e.g. a network configured
6187// with [Private Google Access with VPC Service Controls]) may want to
6188/// override this default.
6189/// * [with_credentials()]: by default this client uses
6190/// [Application Default Credentials]. Applications using custom
6191/// authentication may need to override this default.
6192///
6193/// [with_endpoint()]: super::builder::persistent_resource_service::ClientBuilder::with_endpoint
6194/// [with_credentials()]: super::builder::persistent_resource_service::ClientBuilder::credentials
6195/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6196/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6197///
6198/// # Pooling and Cloning
6199///
6200/// `PersistentResourceService` holds a connection pool internally, it is advised to
6201/// create one and the reuse it. You do not need to wrap `PersistentResourceService` in
6202/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6203/// already uses an `Arc` internally.
6204#[cfg(feature = "persistent-resource-service")]
6205#[cfg_attr(docsrs, doc(cfg(feature = "persistent-resource-service")))]
6206#[derive(Clone, Debug)]
6207pub struct PersistentResourceService {
6208 inner: std::sync::Arc<dyn super::stub::dynamic::PersistentResourceService>,
6209}
6210
6211#[cfg(feature = "persistent-resource-service")]
6212impl PersistentResourceService {
6213 /// Returns a builder for [PersistentResourceService].
6214 ///
6215 /// ```
6216 /// # tokio_test::block_on(async {
6217 /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
6218 /// let client = PersistentResourceService::builder().build().await?;
6219 /// # gax::Result::<()>::Ok(()) });
6220 /// ```
6221 pub fn builder() -> super::builder::persistent_resource_service::ClientBuilder {
6222 gax::client_builder::internal::new_builder(
6223 super::builder::persistent_resource_service::client::Factory,
6224 )
6225 }
6226
6227 /// Creates a new client from the provided stub.
6228 ///
6229 /// The most common case for calling this function is in tests mocking the
6230 /// client's behavior.
6231 pub fn from_stub<T>(stub: T) -> Self
6232 where
6233 T: super::stub::PersistentResourceService + 'static,
6234 {
6235 Self {
6236 inner: std::sync::Arc::new(stub),
6237 }
6238 }
6239
6240 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
6241 let inner = Self::build_inner(config).await?;
6242 Ok(Self { inner })
6243 }
6244
6245 async fn build_inner(
6246 conf: gaxi::options::ClientConfig,
6247 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::PersistentResourceService>> {
6248 if gaxi::options::tracing_enabled(&conf) {
6249 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6250 }
6251 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6252 }
6253
6254 async fn build_transport(
6255 conf: gaxi::options::ClientConfig,
6256 ) -> Result<impl super::stub::PersistentResourceService> {
6257 super::transport::PersistentResourceService::new(conf).await
6258 }
6259
6260 async fn build_with_tracing(
6261 conf: gaxi::options::ClientConfig,
6262 ) -> Result<impl super::stub::PersistentResourceService> {
6263 Self::build_transport(conf)
6264 .await
6265 .map(super::tracing::PersistentResourceService::new)
6266 }
6267
6268 /// Creates a PersistentResource.
6269 ///
6270 /// # Long running operations
6271 ///
6272 /// This method is used to start, and/or poll a [long-running Operation].
6273 /// The [Working with long-running operations] chapter in the [user guide]
6274 /// covers these operations in detail.
6275 ///
6276 /// [long-running operation]: https://google.aip.dev/151
6277 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6278 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6279 pub fn create_persistent_resource(
6280 &self,
6281 ) -> super::builder::persistent_resource_service::CreatePersistentResource {
6282 super::builder::persistent_resource_service::CreatePersistentResource::new(
6283 self.inner.clone(),
6284 )
6285 }
6286
6287 /// Gets a PersistentResource.
6288 pub fn get_persistent_resource(
6289 &self,
6290 ) -> super::builder::persistent_resource_service::GetPersistentResource {
6291 super::builder::persistent_resource_service::GetPersistentResource::new(self.inner.clone())
6292 }
6293
6294 /// Lists PersistentResources in a Location.
6295 pub fn list_persistent_resources(
6296 &self,
6297 ) -> super::builder::persistent_resource_service::ListPersistentResources {
6298 super::builder::persistent_resource_service::ListPersistentResources::new(
6299 self.inner.clone(),
6300 )
6301 }
6302
6303 /// Deletes a PersistentResource.
6304 ///
6305 /// # Long running operations
6306 ///
6307 /// This method is used to start, and/or poll a [long-running Operation].
6308 /// The [Working with long-running operations] chapter in the [user guide]
6309 /// covers these operations in detail.
6310 ///
6311 /// [long-running operation]: https://google.aip.dev/151
6312 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6313 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6314 pub fn delete_persistent_resource(
6315 &self,
6316 ) -> super::builder::persistent_resource_service::DeletePersistentResource {
6317 super::builder::persistent_resource_service::DeletePersistentResource::new(
6318 self.inner.clone(),
6319 )
6320 }
6321
6322 /// Updates a PersistentResource.
6323 ///
6324 /// # Long running operations
6325 ///
6326 /// This method is used to start, and/or poll a [long-running Operation].
6327 /// The [Working with long-running operations] chapter in the [user guide]
6328 /// covers these operations in detail.
6329 ///
6330 /// [long-running operation]: https://google.aip.dev/151
6331 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6332 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6333 pub fn update_persistent_resource(
6334 &self,
6335 ) -> super::builder::persistent_resource_service::UpdatePersistentResource {
6336 super::builder::persistent_resource_service::UpdatePersistentResource::new(
6337 self.inner.clone(),
6338 )
6339 }
6340
6341 /// Reboots a PersistentResource.
6342 ///
6343 /// # Long running operations
6344 ///
6345 /// This method is used to start, and/or poll a [long-running Operation].
6346 /// The [Working with long-running operations] chapter in the [user guide]
6347 /// covers these operations in detail.
6348 ///
6349 /// [long-running operation]: https://google.aip.dev/151
6350 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6351 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6352 pub fn reboot_persistent_resource(
6353 &self,
6354 ) -> super::builder::persistent_resource_service::RebootPersistentResource {
6355 super::builder::persistent_resource_service::RebootPersistentResource::new(
6356 self.inner.clone(),
6357 )
6358 }
6359
6360 /// Lists information about the supported locations for this service.
6361 pub fn list_locations(&self) -> super::builder::persistent_resource_service::ListLocations {
6362 super::builder::persistent_resource_service::ListLocations::new(self.inner.clone())
6363 }
6364
6365 /// Gets information about a location.
6366 pub fn get_location(&self) -> super::builder::persistent_resource_service::GetLocation {
6367 super::builder::persistent_resource_service::GetLocation::new(self.inner.clone())
6368 }
6369
6370 /// Sets the access control policy on the specified resource. Replaces
6371 /// any existing policy.
6372 ///
6373 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
6374 /// errors.
6375 pub fn set_iam_policy(&self) -> super::builder::persistent_resource_service::SetIamPolicy {
6376 super::builder::persistent_resource_service::SetIamPolicy::new(self.inner.clone())
6377 }
6378
6379 /// Gets the access control policy for a resource. Returns an empty policy
6380 /// if the resource exists and does not have a policy set.
6381 pub fn get_iam_policy(&self) -> super::builder::persistent_resource_service::GetIamPolicy {
6382 super::builder::persistent_resource_service::GetIamPolicy::new(self.inner.clone())
6383 }
6384
6385 /// Returns permissions that a caller has on the specified resource. If the
6386 /// resource does not exist, this will return an empty set of
6387 /// permissions, not a `NOT_FOUND` error.
6388 ///
6389 /// Note: This operation is designed to be used for building
6390 /// permission-aware UIs and command-line tools, not for authorization
6391 /// checking. This operation may "fail open" without warning.
6392 pub fn test_iam_permissions(
6393 &self,
6394 ) -> super::builder::persistent_resource_service::TestIamPermissions {
6395 super::builder::persistent_resource_service::TestIamPermissions::new(self.inner.clone())
6396 }
6397
6398 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6399 ///
6400 /// [google.longrunning.Operations]: longrunning::client::Operations
6401 pub fn list_operations(&self) -> super::builder::persistent_resource_service::ListOperations {
6402 super::builder::persistent_resource_service::ListOperations::new(self.inner.clone())
6403 }
6404
6405 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6406 ///
6407 /// [google.longrunning.Operations]: longrunning::client::Operations
6408 pub fn get_operation(&self) -> super::builder::persistent_resource_service::GetOperation {
6409 super::builder::persistent_resource_service::GetOperation::new(self.inner.clone())
6410 }
6411
6412 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6413 ///
6414 /// [google.longrunning.Operations]: longrunning::client::Operations
6415 pub fn delete_operation(&self) -> super::builder::persistent_resource_service::DeleteOperation {
6416 super::builder::persistent_resource_service::DeleteOperation::new(self.inner.clone())
6417 }
6418
6419 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6420 ///
6421 /// [google.longrunning.Operations]: longrunning::client::Operations
6422 pub fn cancel_operation(&self) -> super::builder::persistent_resource_service::CancelOperation {
6423 super::builder::persistent_resource_service::CancelOperation::new(self.inner.clone())
6424 }
6425
6426 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6427 ///
6428 /// [google.longrunning.Operations]: longrunning::client::Operations
6429 pub fn wait_operation(&self) -> super::builder::persistent_resource_service::WaitOperation {
6430 super::builder::persistent_resource_service::WaitOperation::new(self.inner.clone())
6431 }
6432}
6433
6434/// Implements a client for the Vertex AI API.
6435///
6436/// # Example
6437/// ```
6438/// # tokio_test::block_on(async {
6439/// # use google_cloud_aiplatform_v1::client::PipelineService;
6440/// let client = PipelineService::builder().build().await?;
6441/// // use `client` to make requests to the Vertex AI API.
6442/// # gax::Result::<()>::Ok(()) });
6443/// ```
6444///
6445/// # Service Description
6446///
6447/// A service for creating and managing Vertex AI's pipelines. This includes both
6448/// `TrainingPipeline` resources (used for AutoML and custom training) and
6449/// `PipelineJob` resources (used for Vertex AI Pipelines).
6450///
6451/// # Configuration
6452///
6453/// To configure `PipelineService` use the `with_*` methods in the type returned
6454/// by [builder()][PipelineService::builder]. The default configuration should
6455/// work for most applications. Common configuration changes include
6456///
6457/// * [with_endpoint()]: by default this client uses the global default endpoint
6458/// (`https://aiplatform.googleapis.com`). Applications using regional
6459/// endpoints or running in restricted networks (e.g. a network configured
6460// with [Private Google Access with VPC Service Controls]) may want to
6461/// override this default.
6462/// * [with_credentials()]: by default this client uses
6463/// [Application Default Credentials]. Applications using custom
6464/// authentication may need to override this default.
6465///
6466/// [with_endpoint()]: super::builder::pipeline_service::ClientBuilder::with_endpoint
6467/// [with_credentials()]: super::builder::pipeline_service::ClientBuilder::credentials
6468/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6469/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6470///
6471/// # Pooling and Cloning
6472///
6473/// `PipelineService` holds a connection pool internally, it is advised to
6474/// create one and the reuse it. You do not need to wrap `PipelineService` in
6475/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6476/// already uses an `Arc` internally.
6477#[cfg(feature = "pipeline-service")]
6478#[cfg_attr(docsrs, doc(cfg(feature = "pipeline-service")))]
6479#[derive(Clone, Debug)]
6480pub struct PipelineService {
6481 inner: std::sync::Arc<dyn super::stub::dynamic::PipelineService>,
6482}
6483
6484#[cfg(feature = "pipeline-service")]
6485impl PipelineService {
6486 /// Returns a builder for [PipelineService].
6487 ///
6488 /// ```
6489 /// # tokio_test::block_on(async {
6490 /// # use google_cloud_aiplatform_v1::client::PipelineService;
6491 /// let client = PipelineService::builder().build().await?;
6492 /// # gax::Result::<()>::Ok(()) });
6493 /// ```
6494 pub fn builder() -> super::builder::pipeline_service::ClientBuilder {
6495 gax::client_builder::internal::new_builder(
6496 super::builder::pipeline_service::client::Factory,
6497 )
6498 }
6499
6500 /// Creates a new client from the provided stub.
6501 ///
6502 /// The most common case for calling this function is in tests mocking the
6503 /// client's behavior.
6504 pub fn from_stub<T>(stub: T) -> Self
6505 where
6506 T: super::stub::PipelineService + 'static,
6507 {
6508 Self {
6509 inner: std::sync::Arc::new(stub),
6510 }
6511 }
6512
6513 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
6514 let inner = Self::build_inner(config).await?;
6515 Ok(Self { inner })
6516 }
6517
6518 async fn build_inner(
6519 conf: gaxi::options::ClientConfig,
6520 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::PipelineService>> {
6521 if gaxi::options::tracing_enabled(&conf) {
6522 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6523 }
6524 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6525 }
6526
6527 async fn build_transport(
6528 conf: gaxi::options::ClientConfig,
6529 ) -> Result<impl super::stub::PipelineService> {
6530 super::transport::PipelineService::new(conf).await
6531 }
6532
6533 async fn build_with_tracing(
6534 conf: gaxi::options::ClientConfig,
6535 ) -> Result<impl super::stub::PipelineService> {
6536 Self::build_transport(conf)
6537 .await
6538 .map(super::tracing::PipelineService::new)
6539 }
6540
6541 /// Creates a TrainingPipeline. A created TrainingPipeline right away will be
6542 /// attempted to be run.
6543 pub fn create_training_pipeline(
6544 &self,
6545 ) -> super::builder::pipeline_service::CreateTrainingPipeline {
6546 super::builder::pipeline_service::CreateTrainingPipeline::new(self.inner.clone())
6547 }
6548
6549 /// Gets a TrainingPipeline.
6550 pub fn get_training_pipeline(&self) -> super::builder::pipeline_service::GetTrainingPipeline {
6551 super::builder::pipeline_service::GetTrainingPipeline::new(self.inner.clone())
6552 }
6553
6554 /// Lists TrainingPipelines in a Location.
6555 pub fn list_training_pipelines(
6556 &self,
6557 ) -> super::builder::pipeline_service::ListTrainingPipelines {
6558 super::builder::pipeline_service::ListTrainingPipelines::new(self.inner.clone())
6559 }
6560
6561 /// Deletes a TrainingPipeline.
6562 ///
6563 /// # Long running operations
6564 ///
6565 /// This method is used to start, and/or poll a [long-running Operation].
6566 /// The [Working with long-running operations] chapter in the [user guide]
6567 /// covers these operations in detail.
6568 ///
6569 /// [long-running operation]: https://google.aip.dev/151
6570 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6571 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6572 pub fn delete_training_pipeline(
6573 &self,
6574 ) -> super::builder::pipeline_service::DeleteTrainingPipeline {
6575 super::builder::pipeline_service::DeleteTrainingPipeline::new(self.inner.clone())
6576 }
6577
6578 /// Cancels a TrainingPipeline.
6579 /// Starts asynchronous cancellation on the TrainingPipeline. The server
6580 /// makes a best effort to cancel the pipeline, but success is not
6581 /// guaranteed. Clients can use
6582 /// [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]
6583 /// or other methods to check whether the cancellation succeeded or whether the
6584 /// pipeline completed despite cancellation. On successful cancellation,
6585 /// the TrainingPipeline is not deleted; instead it becomes a pipeline with
6586 /// a
6587 /// [TrainingPipeline.error][google.cloud.aiplatform.v1.TrainingPipeline.error]
6588 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
6589 /// corresponding to `Code.CANCELLED`, and
6590 /// [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state]
6591 /// is set to `CANCELLED`.
6592 ///
6593 /// [google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]: crate::client::PipelineService::get_training_pipeline
6594 /// [google.cloud.aiplatform.v1.TrainingPipeline.error]: crate::model::TrainingPipeline::error
6595 /// [google.cloud.aiplatform.v1.TrainingPipeline.state]: crate::model::TrainingPipeline::state
6596 /// [google.rpc.Status.code]: rpc::model::Status::code
6597 pub fn cancel_training_pipeline(
6598 &self,
6599 ) -> super::builder::pipeline_service::CancelTrainingPipeline {
6600 super::builder::pipeline_service::CancelTrainingPipeline::new(self.inner.clone())
6601 }
6602
6603 /// Creates a PipelineJob. A PipelineJob will run immediately when created.
6604 pub fn create_pipeline_job(&self) -> super::builder::pipeline_service::CreatePipelineJob {
6605 super::builder::pipeline_service::CreatePipelineJob::new(self.inner.clone())
6606 }
6607
6608 /// Gets a PipelineJob.
6609 pub fn get_pipeline_job(&self) -> super::builder::pipeline_service::GetPipelineJob {
6610 super::builder::pipeline_service::GetPipelineJob::new(self.inner.clone())
6611 }
6612
6613 /// Lists PipelineJobs in a Location.
6614 pub fn list_pipeline_jobs(&self) -> super::builder::pipeline_service::ListPipelineJobs {
6615 super::builder::pipeline_service::ListPipelineJobs::new(self.inner.clone())
6616 }
6617
6618 /// Deletes a PipelineJob.
6619 ///
6620 /// # Long running operations
6621 ///
6622 /// This method is used to start, and/or poll a [long-running Operation].
6623 /// The [Working with long-running operations] chapter in the [user guide]
6624 /// covers these operations in detail.
6625 ///
6626 /// [long-running operation]: https://google.aip.dev/151
6627 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6628 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6629 pub fn delete_pipeline_job(&self) -> super::builder::pipeline_service::DeletePipelineJob {
6630 super::builder::pipeline_service::DeletePipelineJob::new(self.inner.clone())
6631 }
6632
6633 /// Batch deletes PipelineJobs
6634 /// The Operation is atomic. If it fails, none of the PipelineJobs are deleted.
6635 /// If it succeeds, all of the PipelineJobs are deleted.
6636 ///
6637 /// # Long running operations
6638 ///
6639 /// This method is used to start, and/or poll a [long-running Operation].
6640 /// The [Working with long-running operations] chapter in the [user guide]
6641 /// covers these operations in detail.
6642 ///
6643 /// [long-running operation]: https://google.aip.dev/151
6644 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6645 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6646 pub fn batch_delete_pipeline_jobs(
6647 &self,
6648 ) -> super::builder::pipeline_service::BatchDeletePipelineJobs {
6649 super::builder::pipeline_service::BatchDeletePipelineJobs::new(self.inner.clone())
6650 }
6651
6652 /// Cancels a PipelineJob.
6653 /// Starts asynchronous cancellation on the PipelineJob. The server
6654 /// makes a best effort to cancel the pipeline, but success is not
6655 /// guaranteed. Clients can use
6656 /// [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob]
6657 /// or other methods to check whether the cancellation succeeded or whether the
6658 /// pipeline completed despite cancellation. On successful cancellation,
6659 /// the PipelineJob is not deleted; instead it becomes a pipeline with
6660 /// a [PipelineJob.error][google.cloud.aiplatform.v1.PipelineJob.error] value
6661 /// with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding
6662 /// to `Code.CANCELLED`, and
6663 /// [PipelineJob.state][google.cloud.aiplatform.v1.PipelineJob.state] is set to
6664 /// `CANCELLED`.
6665 ///
6666 /// [google.cloud.aiplatform.v1.PipelineJob.error]: crate::model::PipelineJob::error
6667 /// [google.cloud.aiplatform.v1.PipelineJob.state]: crate::model::PipelineJob::state
6668 /// [google.cloud.aiplatform.v1.PipelineService.GetPipelineJob]: crate::client::PipelineService::get_pipeline_job
6669 /// [google.rpc.Status.code]: rpc::model::Status::code
6670 pub fn cancel_pipeline_job(&self) -> super::builder::pipeline_service::CancelPipelineJob {
6671 super::builder::pipeline_service::CancelPipelineJob::new(self.inner.clone())
6672 }
6673
6674 /// Batch cancel PipelineJobs.
6675 /// Firstly the server will check if all the jobs are in non-terminal states,
6676 /// and skip the jobs that are already terminated.
6677 /// If the operation failed, none of the pipeline jobs are cancelled.
6678 /// The server will poll the states of all the pipeline jobs periodically
6679 /// to check the cancellation status.
6680 /// This operation will return an LRO.
6681 ///
6682 /// # Long running operations
6683 ///
6684 /// This method is used to start, and/or poll a [long-running Operation].
6685 /// The [Working with long-running operations] chapter in the [user guide]
6686 /// covers these operations in detail.
6687 ///
6688 /// [long-running operation]: https://google.aip.dev/151
6689 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6690 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6691 pub fn batch_cancel_pipeline_jobs(
6692 &self,
6693 ) -> super::builder::pipeline_service::BatchCancelPipelineJobs {
6694 super::builder::pipeline_service::BatchCancelPipelineJobs::new(self.inner.clone())
6695 }
6696
6697 /// Lists information about the supported locations for this service.
6698 pub fn list_locations(&self) -> super::builder::pipeline_service::ListLocations {
6699 super::builder::pipeline_service::ListLocations::new(self.inner.clone())
6700 }
6701
6702 /// Gets information about a location.
6703 pub fn get_location(&self) -> super::builder::pipeline_service::GetLocation {
6704 super::builder::pipeline_service::GetLocation::new(self.inner.clone())
6705 }
6706
6707 /// Sets the access control policy on the specified resource. Replaces
6708 /// any existing policy.
6709 ///
6710 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
6711 /// errors.
6712 pub fn set_iam_policy(&self) -> super::builder::pipeline_service::SetIamPolicy {
6713 super::builder::pipeline_service::SetIamPolicy::new(self.inner.clone())
6714 }
6715
6716 /// Gets the access control policy for a resource. Returns an empty policy
6717 /// if the resource exists and does not have a policy set.
6718 pub fn get_iam_policy(&self) -> super::builder::pipeline_service::GetIamPolicy {
6719 super::builder::pipeline_service::GetIamPolicy::new(self.inner.clone())
6720 }
6721
6722 /// Returns permissions that a caller has on the specified resource. If the
6723 /// resource does not exist, this will return an empty set of
6724 /// permissions, not a `NOT_FOUND` error.
6725 ///
6726 /// Note: This operation is designed to be used for building
6727 /// permission-aware UIs and command-line tools, not for authorization
6728 /// checking. This operation may "fail open" without warning.
6729 pub fn test_iam_permissions(&self) -> super::builder::pipeline_service::TestIamPermissions {
6730 super::builder::pipeline_service::TestIamPermissions::new(self.inner.clone())
6731 }
6732
6733 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6734 ///
6735 /// [google.longrunning.Operations]: longrunning::client::Operations
6736 pub fn list_operations(&self) -> super::builder::pipeline_service::ListOperations {
6737 super::builder::pipeline_service::ListOperations::new(self.inner.clone())
6738 }
6739
6740 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6741 ///
6742 /// [google.longrunning.Operations]: longrunning::client::Operations
6743 pub fn get_operation(&self) -> super::builder::pipeline_service::GetOperation {
6744 super::builder::pipeline_service::GetOperation::new(self.inner.clone())
6745 }
6746
6747 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6748 ///
6749 /// [google.longrunning.Operations]: longrunning::client::Operations
6750 pub fn delete_operation(&self) -> super::builder::pipeline_service::DeleteOperation {
6751 super::builder::pipeline_service::DeleteOperation::new(self.inner.clone())
6752 }
6753
6754 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6755 ///
6756 /// [google.longrunning.Operations]: longrunning::client::Operations
6757 pub fn cancel_operation(&self) -> super::builder::pipeline_service::CancelOperation {
6758 super::builder::pipeline_service::CancelOperation::new(self.inner.clone())
6759 }
6760
6761 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6762 ///
6763 /// [google.longrunning.Operations]: longrunning::client::Operations
6764 pub fn wait_operation(&self) -> super::builder::pipeline_service::WaitOperation {
6765 super::builder::pipeline_service::WaitOperation::new(self.inner.clone())
6766 }
6767}
6768
6769/// Implements a client for the Vertex AI API.
6770///
6771/// # Example
6772/// ```
6773/// # tokio_test::block_on(async {
6774/// # use google_cloud_aiplatform_v1::client::PredictionService;
6775/// let client = PredictionService::builder().build().await?;
6776/// // use `client` to make requests to the Vertex AI API.
6777/// # gax::Result::<()>::Ok(()) });
6778/// ```
6779///
6780/// # Service Description
6781///
6782/// A service for online predictions and explanations.
6783///
6784/// # Configuration
6785///
6786/// To configure `PredictionService` use the `with_*` methods in the type returned
6787/// by [builder()][PredictionService::builder]. The default configuration should
6788/// work for most applications. Common configuration changes include
6789///
6790/// * [with_endpoint()]: by default this client uses the global default endpoint
6791/// (`https://aiplatform.googleapis.com`). Applications using regional
6792/// endpoints or running in restricted networks (e.g. a network configured
6793// with [Private Google Access with VPC Service Controls]) may want to
6794/// override this default.
6795/// * [with_credentials()]: by default this client uses
6796/// [Application Default Credentials]. Applications using custom
6797/// authentication may need to override this default.
6798///
6799/// [with_endpoint()]: super::builder::prediction_service::ClientBuilder::with_endpoint
6800/// [with_credentials()]: super::builder::prediction_service::ClientBuilder::credentials
6801/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6802/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6803///
6804/// # Pooling and Cloning
6805///
6806/// `PredictionService` holds a connection pool internally, it is advised to
6807/// create one and the reuse it. You do not need to wrap `PredictionService` in
6808/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6809/// already uses an `Arc` internally.
6810#[cfg(feature = "prediction-service")]
6811#[cfg_attr(docsrs, doc(cfg(feature = "prediction-service")))]
6812#[derive(Clone, Debug)]
6813pub struct PredictionService {
6814 inner: std::sync::Arc<dyn super::stub::dynamic::PredictionService>,
6815}
6816
6817#[cfg(feature = "prediction-service")]
6818impl PredictionService {
6819 /// Returns a builder for [PredictionService].
6820 ///
6821 /// ```
6822 /// # tokio_test::block_on(async {
6823 /// # use google_cloud_aiplatform_v1::client::PredictionService;
6824 /// let client = PredictionService::builder().build().await?;
6825 /// # gax::Result::<()>::Ok(()) });
6826 /// ```
6827 pub fn builder() -> super::builder::prediction_service::ClientBuilder {
6828 gax::client_builder::internal::new_builder(
6829 super::builder::prediction_service::client::Factory,
6830 )
6831 }
6832
6833 /// Creates a new client from the provided stub.
6834 ///
6835 /// The most common case for calling this function is in tests mocking the
6836 /// client's behavior.
6837 pub fn from_stub<T>(stub: T) -> Self
6838 where
6839 T: super::stub::PredictionService + 'static,
6840 {
6841 Self {
6842 inner: std::sync::Arc::new(stub),
6843 }
6844 }
6845
6846 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
6847 let inner = Self::build_inner(config).await?;
6848 Ok(Self { inner })
6849 }
6850
6851 async fn build_inner(
6852 conf: gaxi::options::ClientConfig,
6853 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::PredictionService>> {
6854 if gaxi::options::tracing_enabled(&conf) {
6855 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6856 }
6857 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6858 }
6859
6860 async fn build_transport(
6861 conf: gaxi::options::ClientConfig,
6862 ) -> Result<impl super::stub::PredictionService> {
6863 super::transport::PredictionService::new(conf).await
6864 }
6865
6866 async fn build_with_tracing(
6867 conf: gaxi::options::ClientConfig,
6868 ) -> Result<impl super::stub::PredictionService> {
6869 Self::build_transport(conf)
6870 .await
6871 .map(super::tracing::PredictionService::new)
6872 }
6873
6874 /// Perform an online prediction.
6875 pub fn predict(&self) -> super::builder::prediction_service::Predict {
6876 super::builder::prediction_service::Predict::new(self.inner.clone())
6877 }
6878
6879 /// Perform an online prediction with an arbitrary HTTP payload.
6880 ///
6881 /// The response includes the following HTTP headers:
6882 ///
6883 /// * `X-Vertex-AI-Endpoint-Id`: ID of the
6884 /// [Endpoint][google.cloud.aiplatform.v1.Endpoint] that served this
6885 /// prediction.
6886 ///
6887 /// * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's
6888 /// [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] that served this
6889 /// prediction.
6890 ///
6891 ///
6892 /// [google.cloud.aiplatform.v1.DeployedModel]: crate::model::DeployedModel
6893 /// [google.cloud.aiplatform.v1.Endpoint]: crate::model::Endpoint
6894 pub fn raw_predict(&self) -> super::builder::prediction_service::RawPredict {
6895 super::builder::prediction_service::RawPredict::new(self.inner.clone())
6896 }
6897
6898 /// Perform an unary online prediction request to a gRPC model server for
6899 /// Vertex first-party products and frameworks.
6900 pub fn direct_predict(&self) -> super::builder::prediction_service::DirectPredict {
6901 super::builder::prediction_service::DirectPredict::new(self.inner.clone())
6902 }
6903
6904 /// Perform an unary online prediction request to a gRPC model server for
6905 /// custom containers.
6906 pub fn direct_raw_predict(&self) -> super::builder::prediction_service::DirectRawPredict {
6907 super::builder::prediction_service::DirectRawPredict::new(self.inner.clone())
6908 }
6909
6910 /// Perform an online explanation.
6911 ///
6912 /// If
6913 /// [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]
6914 /// is specified, the corresponding DeployModel must have
6915 /// [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec]
6916 /// populated. If
6917 /// [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]
6918 /// is not specified, all DeployedModels must have
6919 /// [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec]
6920 /// populated.
6921 ///
6922 /// [google.cloud.aiplatform.v1.DeployedModel.explanation_spec]: crate::model::DeployedModel::explanation_spec
6923 /// [google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]: crate::model::ExplainRequest::deployed_model_id
6924 pub fn explain(&self) -> super::builder::prediction_service::Explain {
6925 super::builder::prediction_service::Explain::new(self.inner.clone())
6926 }
6927
6928 /// Generate content with multimodal inputs.
6929 pub fn generate_content(&self) -> super::builder::prediction_service::GenerateContent {
6930 super::builder::prediction_service::GenerateContent::new(self.inner.clone())
6931 }
6932
6933 /// Lists information about the supported locations for this service.
6934 pub fn list_locations(&self) -> super::builder::prediction_service::ListLocations {
6935 super::builder::prediction_service::ListLocations::new(self.inner.clone())
6936 }
6937
6938 /// Gets information about a location.
6939 pub fn get_location(&self) -> super::builder::prediction_service::GetLocation {
6940 super::builder::prediction_service::GetLocation::new(self.inner.clone())
6941 }
6942
6943 /// Sets the access control policy on the specified resource. Replaces
6944 /// any existing policy.
6945 ///
6946 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
6947 /// errors.
6948 pub fn set_iam_policy(&self) -> super::builder::prediction_service::SetIamPolicy {
6949 super::builder::prediction_service::SetIamPolicy::new(self.inner.clone())
6950 }
6951
6952 /// Gets the access control policy for a resource. Returns an empty policy
6953 /// if the resource exists and does not have a policy set.
6954 pub fn get_iam_policy(&self) -> super::builder::prediction_service::GetIamPolicy {
6955 super::builder::prediction_service::GetIamPolicy::new(self.inner.clone())
6956 }
6957
6958 /// Returns permissions that a caller has on the specified resource. If the
6959 /// resource does not exist, this will return an empty set of
6960 /// permissions, not a `NOT_FOUND` error.
6961 ///
6962 /// Note: This operation is designed to be used for building
6963 /// permission-aware UIs and command-line tools, not for authorization
6964 /// checking. This operation may "fail open" without warning.
6965 pub fn test_iam_permissions(&self) -> super::builder::prediction_service::TestIamPermissions {
6966 super::builder::prediction_service::TestIamPermissions::new(self.inner.clone())
6967 }
6968
6969 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6970 ///
6971 /// [google.longrunning.Operations]: longrunning::client::Operations
6972 pub fn list_operations(&self) -> super::builder::prediction_service::ListOperations {
6973 super::builder::prediction_service::ListOperations::new(self.inner.clone())
6974 }
6975
6976 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6977 ///
6978 /// [google.longrunning.Operations]: longrunning::client::Operations
6979 pub fn get_operation(&self) -> super::builder::prediction_service::GetOperation {
6980 super::builder::prediction_service::GetOperation::new(self.inner.clone())
6981 }
6982
6983 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6984 ///
6985 /// [google.longrunning.Operations]: longrunning::client::Operations
6986 pub fn delete_operation(&self) -> super::builder::prediction_service::DeleteOperation {
6987 super::builder::prediction_service::DeleteOperation::new(self.inner.clone())
6988 }
6989
6990 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6991 ///
6992 /// [google.longrunning.Operations]: longrunning::client::Operations
6993 pub fn cancel_operation(&self) -> super::builder::prediction_service::CancelOperation {
6994 super::builder::prediction_service::CancelOperation::new(self.inner.clone())
6995 }
6996
6997 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6998 ///
6999 /// [google.longrunning.Operations]: longrunning::client::Operations
7000 pub fn wait_operation(&self) -> super::builder::prediction_service::WaitOperation {
7001 super::builder::prediction_service::WaitOperation::new(self.inner.clone())
7002 }
7003}
7004
7005/// Implements a client for the Vertex AI API.
7006///
7007/// # Example
7008/// ```
7009/// # tokio_test::block_on(async {
7010/// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
7011/// let client = ReasoningEngineExecutionService::builder().build().await?;
7012/// // use `client` to make requests to the Vertex AI API.
7013/// # gax::Result::<()>::Ok(()) });
7014/// ```
7015///
7016/// # Service Description
7017///
7018/// A service for executing queries on Reasoning Engine.
7019///
7020/// # Configuration
7021///
7022/// To configure `ReasoningEngineExecutionService` use the `with_*` methods in the type returned
7023/// by [builder()][ReasoningEngineExecutionService::builder]. The default configuration should
7024/// work for most applications. Common configuration changes include
7025///
7026/// * [with_endpoint()]: by default this client uses the global default endpoint
7027/// (`https://aiplatform.googleapis.com`). Applications using regional
7028/// endpoints or running in restricted networks (e.g. a network configured
7029// with [Private Google Access with VPC Service Controls]) may want to
7030/// override this default.
7031/// * [with_credentials()]: by default this client uses
7032/// [Application Default Credentials]. Applications using custom
7033/// authentication may need to override this default.
7034///
7035/// [with_endpoint()]: super::builder::reasoning_engine_execution_service::ClientBuilder::with_endpoint
7036/// [with_credentials()]: super::builder::reasoning_engine_execution_service::ClientBuilder::credentials
7037/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7038/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7039///
7040/// # Pooling and Cloning
7041///
7042/// `ReasoningEngineExecutionService` holds a connection pool internally, it is advised to
7043/// create one and the reuse it. You do not need to wrap `ReasoningEngineExecutionService` in
7044/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7045/// already uses an `Arc` internally.
7046#[cfg(feature = "reasoning-engine-execution-service")]
7047#[cfg_attr(docsrs, doc(cfg(feature = "reasoning-engine-execution-service")))]
7048#[derive(Clone, Debug)]
7049pub struct ReasoningEngineExecutionService {
7050 inner: std::sync::Arc<dyn super::stub::dynamic::ReasoningEngineExecutionService>,
7051}
7052
7053#[cfg(feature = "reasoning-engine-execution-service")]
7054impl ReasoningEngineExecutionService {
7055 /// Returns a builder for [ReasoningEngineExecutionService].
7056 ///
7057 /// ```
7058 /// # tokio_test::block_on(async {
7059 /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
7060 /// let client = ReasoningEngineExecutionService::builder().build().await?;
7061 /// # gax::Result::<()>::Ok(()) });
7062 /// ```
7063 pub fn builder() -> super::builder::reasoning_engine_execution_service::ClientBuilder {
7064 gax::client_builder::internal::new_builder(
7065 super::builder::reasoning_engine_execution_service::client::Factory,
7066 )
7067 }
7068
7069 /// Creates a new client from the provided stub.
7070 ///
7071 /// The most common case for calling this function is in tests mocking the
7072 /// client's behavior.
7073 pub fn from_stub<T>(stub: T) -> Self
7074 where
7075 T: super::stub::ReasoningEngineExecutionService + 'static,
7076 {
7077 Self {
7078 inner: std::sync::Arc::new(stub),
7079 }
7080 }
7081
7082 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
7083 let inner = Self::build_inner(config).await?;
7084 Ok(Self { inner })
7085 }
7086
7087 async fn build_inner(
7088 conf: gaxi::options::ClientConfig,
7089 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::ReasoningEngineExecutionService>> {
7090 if gaxi::options::tracing_enabled(&conf) {
7091 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7092 }
7093 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7094 }
7095
7096 async fn build_transport(
7097 conf: gaxi::options::ClientConfig,
7098 ) -> Result<impl super::stub::ReasoningEngineExecutionService> {
7099 super::transport::ReasoningEngineExecutionService::new(conf).await
7100 }
7101
7102 async fn build_with_tracing(
7103 conf: gaxi::options::ClientConfig,
7104 ) -> Result<impl super::stub::ReasoningEngineExecutionService> {
7105 Self::build_transport(conf)
7106 .await
7107 .map(super::tracing::ReasoningEngineExecutionService::new)
7108 }
7109
7110 /// Queries using a reasoning engine.
7111 pub fn query_reasoning_engine(
7112 &self,
7113 ) -> super::builder::reasoning_engine_execution_service::QueryReasoningEngine {
7114 super::builder::reasoning_engine_execution_service::QueryReasoningEngine::new(
7115 self.inner.clone(),
7116 )
7117 }
7118
7119 /// Lists information about the supported locations for this service.
7120 pub fn list_locations(
7121 &self,
7122 ) -> super::builder::reasoning_engine_execution_service::ListLocations {
7123 super::builder::reasoning_engine_execution_service::ListLocations::new(self.inner.clone())
7124 }
7125
7126 /// Gets information about a location.
7127 pub fn get_location(&self) -> super::builder::reasoning_engine_execution_service::GetLocation {
7128 super::builder::reasoning_engine_execution_service::GetLocation::new(self.inner.clone())
7129 }
7130
7131 /// Sets the access control policy on the specified resource. Replaces
7132 /// any existing policy.
7133 ///
7134 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
7135 /// errors.
7136 pub fn set_iam_policy(
7137 &self,
7138 ) -> super::builder::reasoning_engine_execution_service::SetIamPolicy {
7139 super::builder::reasoning_engine_execution_service::SetIamPolicy::new(self.inner.clone())
7140 }
7141
7142 /// Gets the access control policy for a resource. Returns an empty policy
7143 /// if the resource exists and does not have a policy set.
7144 pub fn get_iam_policy(
7145 &self,
7146 ) -> super::builder::reasoning_engine_execution_service::GetIamPolicy {
7147 super::builder::reasoning_engine_execution_service::GetIamPolicy::new(self.inner.clone())
7148 }
7149
7150 /// Returns permissions that a caller has on the specified resource. If the
7151 /// resource does not exist, this will return an empty set of
7152 /// permissions, not a `NOT_FOUND` error.
7153 ///
7154 /// Note: This operation is designed to be used for building
7155 /// permission-aware UIs and command-line tools, not for authorization
7156 /// checking. This operation may "fail open" without warning.
7157 pub fn test_iam_permissions(
7158 &self,
7159 ) -> super::builder::reasoning_engine_execution_service::TestIamPermissions {
7160 super::builder::reasoning_engine_execution_service::TestIamPermissions::new(
7161 self.inner.clone(),
7162 )
7163 }
7164
7165 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7166 ///
7167 /// [google.longrunning.Operations]: longrunning::client::Operations
7168 pub fn list_operations(
7169 &self,
7170 ) -> super::builder::reasoning_engine_execution_service::ListOperations {
7171 super::builder::reasoning_engine_execution_service::ListOperations::new(self.inner.clone())
7172 }
7173
7174 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7175 ///
7176 /// [google.longrunning.Operations]: longrunning::client::Operations
7177 pub fn get_operation(
7178 &self,
7179 ) -> super::builder::reasoning_engine_execution_service::GetOperation {
7180 super::builder::reasoning_engine_execution_service::GetOperation::new(self.inner.clone())
7181 }
7182
7183 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7184 ///
7185 /// [google.longrunning.Operations]: longrunning::client::Operations
7186 pub fn delete_operation(
7187 &self,
7188 ) -> super::builder::reasoning_engine_execution_service::DeleteOperation {
7189 super::builder::reasoning_engine_execution_service::DeleteOperation::new(self.inner.clone())
7190 }
7191
7192 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7193 ///
7194 /// [google.longrunning.Operations]: longrunning::client::Operations
7195 pub fn cancel_operation(
7196 &self,
7197 ) -> super::builder::reasoning_engine_execution_service::CancelOperation {
7198 super::builder::reasoning_engine_execution_service::CancelOperation::new(self.inner.clone())
7199 }
7200
7201 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7202 ///
7203 /// [google.longrunning.Operations]: longrunning::client::Operations
7204 pub fn wait_operation(
7205 &self,
7206 ) -> super::builder::reasoning_engine_execution_service::WaitOperation {
7207 super::builder::reasoning_engine_execution_service::WaitOperation::new(self.inner.clone())
7208 }
7209}
7210
7211/// Implements a client for the Vertex AI API.
7212///
7213/// # Example
7214/// ```
7215/// # tokio_test::block_on(async {
7216/// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
7217/// let client = ReasoningEngineService::builder().build().await?;
7218/// // use `client` to make requests to the Vertex AI API.
7219/// # gax::Result::<()>::Ok(()) });
7220/// ```
7221///
7222/// # Service Description
7223///
7224/// A service for managing Vertex AI's Reasoning Engines.
7225///
7226/// # Configuration
7227///
7228/// To configure `ReasoningEngineService` use the `with_*` methods in the type returned
7229/// by [builder()][ReasoningEngineService::builder]. The default configuration should
7230/// work for most applications. Common configuration changes include
7231///
7232/// * [with_endpoint()]: by default this client uses the global default endpoint
7233/// (`https://aiplatform.googleapis.com`). Applications using regional
7234/// endpoints or running in restricted networks (e.g. a network configured
7235// with [Private Google Access with VPC Service Controls]) may want to
7236/// override this default.
7237/// * [with_credentials()]: by default this client uses
7238/// [Application Default Credentials]. Applications using custom
7239/// authentication may need to override this default.
7240///
7241/// [with_endpoint()]: super::builder::reasoning_engine_service::ClientBuilder::with_endpoint
7242/// [with_credentials()]: super::builder::reasoning_engine_service::ClientBuilder::credentials
7243/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7244/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7245///
7246/// # Pooling and Cloning
7247///
7248/// `ReasoningEngineService` holds a connection pool internally, it is advised to
7249/// create one and the reuse it. You do not need to wrap `ReasoningEngineService` in
7250/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7251/// already uses an `Arc` internally.
7252#[cfg(feature = "reasoning-engine-service")]
7253#[cfg_attr(docsrs, doc(cfg(feature = "reasoning-engine-service")))]
7254#[derive(Clone, Debug)]
7255pub struct ReasoningEngineService {
7256 inner: std::sync::Arc<dyn super::stub::dynamic::ReasoningEngineService>,
7257}
7258
7259#[cfg(feature = "reasoning-engine-service")]
7260impl ReasoningEngineService {
7261 /// Returns a builder for [ReasoningEngineService].
7262 ///
7263 /// ```
7264 /// # tokio_test::block_on(async {
7265 /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
7266 /// let client = ReasoningEngineService::builder().build().await?;
7267 /// # gax::Result::<()>::Ok(()) });
7268 /// ```
7269 pub fn builder() -> super::builder::reasoning_engine_service::ClientBuilder {
7270 gax::client_builder::internal::new_builder(
7271 super::builder::reasoning_engine_service::client::Factory,
7272 )
7273 }
7274
7275 /// Creates a new client from the provided stub.
7276 ///
7277 /// The most common case for calling this function is in tests mocking the
7278 /// client's behavior.
7279 pub fn from_stub<T>(stub: T) -> Self
7280 where
7281 T: super::stub::ReasoningEngineService + 'static,
7282 {
7283 Self {
7284 inner: std::sync::Arc::new(stub),
7285 }
7286 }
7287
7288 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
7289 let inner = Self::build_inner(config).await?;
7290 Ok(Self { inner })
7291 }
7292
7293 async fn build_inner(
7294 conf: gaxi::options::ClientConfig,
7295 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::ReasoningEngineService>> {
7296 if gaxi::options::tracing_enabled(&conf) {
7297 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7298 }
7299 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7300 }
7301
7302 async fn build_transport(
7303 conf: gaxi::options::ClientConfig,
7304 ) -> Result<impl super::stub::ReasoningEngineService> {
7305 super::transport::ReasoningEngineService::new(conf).await
7306 }
7307
7308 async fn build_with_tracing(
7309 conf: gaxi::options::ClientConfig,
7310 ) -> Result<impl super::stub::ReasoningEngineService> {
7311 Self::build_transport(conf)
7312 .await
7313 .map(super::tracing::ReasoningEngineService::new)
7314 }
7315
7316 /// Creates a reasoning engine.
7317 ///
7318 /// # Long running operations
7319 ///
7320 /// This method is used to start, and/or poll a [long-running Operation].
7321 /// The [Working with long-running operations] chapter in the [user guide]
7322 /// covers these operations in detail.
7323 ///
7324 /// [long-running operation]: https://google.aip.dev/151
7325 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7326 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7327 pub fn create_reasoning_engine(
7328 &self,
7329 ) -> super::builder::reasoning_engine_service::CreateReasoningEngine {
7330 super::builder::reasoning_engine_service::CreateReasoningEngine::new(self.inner.clone())
7331 }
7332
7333 /// Gets a reasoning engine.
7334 pub fn get_reasoning_engine(
7335 &self,
7336 ) -> super::builder::reasoning_engine_service::GetReasoningEngine {
7337 super::builder::reasoning_engine_service::GetReasoningEngine::new(self.inner.clone())
7338 }
7339
7340 /// Lists reasoning engines in a location.
7341 pub fn list_reasoning_engines(
7342 &self,
7343 ) -> super::builder::reasoning_engine_service::ListReasoningEngines {
7344 super::builder::reasoning_engine_service::ListReasoningEngines::new(self.inner.clone())
7345 }
7346
7347 /// Updates a reasoning engine.
7348 ///
7349 /// # Long running operations
7350 ///
7351 /// This method is used to start, and/or poll a [long-running Operation].
7352 /// The [Working with long-running operations] chapter in the [user guide]
7353 /// covers these operations in detail.
7354 ///
7355 /// [long-running operation]: https://google.aip.dev/151
7356 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7357 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7358 pub fn update_reasoning_engine(
7359 &self,
7360 ) -> super::builder::reasoning_engine_service::UpdateReasoningEngine {
7361 super::builder::reasoning_engine_service::UpdateReasoningEngine::new(self.inner.clone())
7362 }
7363
7364 /// Deletes a reasoning engine.
7365 ///
7366 /// # Long running operations
7367 ///
7368 /// This method is used to start, and/or poll a [long-running Operation].
7369 /// The [Working with long-running operations] chapter in the [user guide]
7370 /// covers these operations in detail.
7371 ///
7372 /// [long-running operation]: https://google.aip.dev/151
7373 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7374 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7375 pub fn delete_reasoning_engine(
7376 &self,
7377 ) -> super::builder::reasoning_engine_service::DeleteReasoningEngine {
7378 super::builder::reasoning_engine_service::DeleteReasoningEngine::new(self.inner.clone())
7379 }
7380
7381 /// Lists information about the supported locations for this service.
7382 pub fn list_locations(&self) -> super::builder::reasoning_engine_service::ListLocations {
7383 super::builder::reasoning_engine_service::ListLocations::new(self.inner.clone())
7384 }
7385
7386 /// Gets information about a location.
7387 pub fn get_location(&self) -> super::builder::reasoning_engine_service::GetLocation {
7388 super::builder::reasoning_engine_service::GetLocation::new(self.inner.clone())
7389 }
7390
7391 /// Sets the access control policy on the specified resource. Replaces
7392 /// any existing policy.
7393 ///
7394 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
7395 /// errors.
7396 pub fn set_iam_policy(&self) -> super::builder::reasoning_engine_service::SetIamPolicy {
7397 super::builder::reasoning_engine_service::SetIamPolicy::new(self.inner.clone())
7398 }
7399
7400 /// Gets the access control policy for a resource. Returns an empty policy
7401 /// if the resource exists and does not have a policy set.
7402 pub fn get_iam_policy(&self) -> super::builder::reasoning_engine_service::GetIamPolicy {
7403 super::builder::reasoning_engine_service::GetIamPolicy::new(self.inner.clone())
7404 }
7405
7406 /// Returns permissions that a caller has on the specified resource. If the
7407 /// resource does not exist, this will return an empty set of
7408 /// permissions, not a `NOT_FOUND` error.
7409 ///
7410 /// Note: This operation is designed to be used for building
7411 /// permission-aware UIs and command-line tools, not for authorization
7412 /// checking. This operation may "fail open" without warning.
7413 pub fn test_iam_permissions(
7414 &self,
7415 ) -> super::builder::reasoning_engine_service::TestIamPermissions {
7416 super::builder::reasoning_engine_service::TestIamPermissions::new(self.inner.clone())
7417 }
7418
7419 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7420 ///
7421 /// [google.longrunning.Operations]: longrunning::client::Operations
7422 pub fn list_operations(&self) -> super::builder::reasoning_engine_service::ListOperations {
7423 super::builder::reasoning_engine_service::ListOperations::new(self.inner.clone())
7424 }
7425
7426 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7427 ///
7428 /// [google.longrunning.Operations]: longrunning::client::Operations
7429 pub fn get_operation(&self) -> super::builder::reasoning_engine_service::GetOperation {
7430 super::builder::reasoning_engine_service::GetOperation::new(self.inner.clone())
7431 }
7432
7433 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7434 ///
7435 /// [google.longrunning.Operations]: longrunning::client::Operations
7436 pub fn delete_operation(&self) -> super::builder::reasoning_engine_service::DeleteOperation {
7437 super::builder::reasoning_engine_service::DeleteOperation::new(self.inner.clone())
7438 }
7439
7440 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7441 ///
7442 /// [google.longrunning.Operations]: longrunning::client::Operations
7443 pub fn cancel_operation(&self) -> super::builder::reasoning_engine_service::CancelOperation {
7444 super::builder::reasoning_engine_service::CancelOperation::new(self.inner.clone())
7445 }
7446
7447 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7448 ///
7449 /// [google.longrunning.Operations]: longrunning::client::Operations
7450 pub fn wait_operation(&self) -> super::builder::reasoning_engine_service::WaitOperation {
7451 super::builder::reasoning_engine_service::WaitOperation::new(self.inner.clone())
7452 }
7453}
7454
7455/// Implements a client for the Vertex AI API.
7456///
7457/// # Example
7458/// ```
7459/// # tokio_test::block_on(async {
7460/// # use google_cloud_aiplatform_v1::client::ScheduleService;
7461/// let client = ScheduleService::builder().build().await?;
7462/// // use `client` to make requests to the Vertex AI API.
7463/// # gax::Result::<()>::Ok(()) });
7464/// ```
7465///
7466/// # Service Description
7467///
7468/// A service for creating and managing Vertex AI's Schedule resources to
7469/// periodically launch shceudled runs to make API calls.
7470///
7471/// # Configuration
7472///
7473/// To configure `ScheduleService` use the `with_*` methods in the type returned
7474/// by [builder()][ScheduleService::builder]. The default configuration should
7475/// work for most applications. Common configuration changes include
7476///
7477/// * [with_endpoint()]: by default this client uses the global default endpoint
7478/// (`https://aiplatform.googleapis.com`). Applications using regional
7479/// endpoints or running in restricted networks (e.g. a network configured
7480// with [Private Google Access with VPC Service Controls]) may want to
7481/// override this default.
7482/// * [with_credentials()]: by default this client uses
7483/// [Application Default Credentials]. Applications using custom
7484/// authentication may need to override this default.
7485///
7486/// [with_endpoint()]: super::builder::schedule_service::ClientBuilder::with_endpoint
7487/// [with_credentials()]: super::builder::schedule_service::ClientBuilder::credentials
7488/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7489/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7490///
7491/// # Pooling and Cloning
7492///
7493/// `ScheduleService` holds a connection pool internally, it is advised to
7494/// create one and the reuse it. You do not need to wrap `ScheduleService` in
7495/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7496/// already uses an `Arc` internally.
7497#[cfg(feature = "schedule-service")]
7498#[cfg_attr(docsrs, doc(cfg(feature = "schedule-service")))]
7499#[derive(Clone, Debug)]
7500pub struct ScheduleService {
7501 inner: std::sync::Arc<dyn super::stub::dynamic::ScheduleService>,
7502}
7503
7504#[cfg(feature = "schedule-service")]
7505impl ScheduleService {
7506 /// Returns a builder for [ScheduleService].
7507 ///
7508 /// ```
7509 /// # tokio_test::block_on(async {
7510 /// # use google_cloud_aiplatform_v1::client::ScheduleService;
7511 /// let client = ScheduleService::builder().build().await?;
7512 /// # gax::Result::<()>::Ok(()) });
7513 /// ```
7514 pub fn builder() -> super::builder::schedule_service::ClientBuilder {
7515 gax::client_builder::internal::new_builder(
7516 super::builder::schedule_service::client::Factory,
7517 )
7518 }
7519
7520 /// Creates a new client from the provided stub.
7521 ///
7522 /// The most common case for calling this function is in tests mocking the
7523 /// client's behavior.
7524 pub fn from_stub<T>(stub: T) -> Self
7525 where
7526 T: super::stub::ScheduleService + 'static,
7527 {
7528 Self {
7529 inner: std::sync::Arc::new(stub),
7530 }
7531 }
7532
7533 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
7534 let inner = Self::build_inner(config).await?;
7535 Ok(Self { inner })
7536 }
7537
7538 async fn build_inner(
7539 conf: gaxi::options::ClientConfig,
7540 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::ScheduleService>> {
7541 if gaxi::options::tracing_enabled(&conf) {
7542 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7543 }
7544 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7545 }
7546
7547 async fn build_transport(
7548 conf: gaxi::options::ClientConfig,
7549 ) -> Result<impl super::stub::ScheduleService> {
7550 super::transport::ScheduleService::new(conf).await
7551 }
7552
7553 async fn build_with_tracing(
7554 conf: gaxi::options::ClientConfig,
7555 ) -> Result<impl super::stub::ScheduleService> {
7556 Self::build_transport(conf)
7557 .await
7558 .map(super::tracing::ScheduleService::new)
7559 }
7560
7561 /// Creates a Schedule.
7562 pub fn create_schedule(&self) -> super::builder::schedule_service::CreateSchedule {
7563 super::builder::schedule_service::CreateSchedule::new(self.inner.clone())
7564 }
7565
7566 /// Deletes a Schedule.
7567 ///
7568 /// # Long running operations
7569 ///
7570 /// This method is used to start, and/or poll a [long-running Operation].
7571 /// The [Working with long-running operations] chapter in the [user guide]
7572 /// covers these operations in detail.
7573 ///
7574 /// [long-running operation]: https://google.aip.dev/151
7575 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7576 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7577 pub fn delete_schedule(&self) -> super::builder::schedule_service::DeleteSchedule {
7578 super::builder::schedule_service::DeleteSchedule::new(self.inner.clone())
7579 }
7580
7581 /// Gets a Schedule.
7582 pub fn get_schedule(&self) -> super::builder::schedule_service::GetSchedule {
7583 super::builder::schedule_service::GetSchedule::new(self.inner.clone())
7584 }
7585
7586 /// Lists Schedules in a Location.
7587 pub fn list_schedules(&self) -> super::builder::schedule_service::ListSchedules {
7588 super::builder::schedule_service::ListSchedules::new(self.inner.clone())
7589 }
7590
7591 /// Pauses a Schedule. Will mark
7592 /// [Schedule.state][google.cloud.aiplatform.v1.Schedule.state] to 'PAUSED'. If
7593 /// the schedule is paused, no new runs will be created. Already created runs
7594 /// will NOT be paused or canceled.
7595 ///
7596 /// [google.cloud.aiplatform.v1.Schedule.state]: crate::model::Schedule::state
7597 pub fn pause_schedule(&self) -> super::builder::schedule_service::PauseSchedule {
7598 super::builder::schedule_service::PauseSchedule::new(self.inner.clone())
7599 }
7600
7601 /// Resumes a paused Schedule to start scheduling new runs. Will mark
7602 /// [Schedule.state][google.cloud.aiplatform.v1.Schedule.state] to 'ACTIVE'.
7603 /// Only paused Schedule can be resumed.
7604 ///
7605 /// When the Schedule is resumed, new runs will be scheduled starting from the
7606 /// next execution time after the current time based on the time_specification
7607 /// in the Schedule. If
7608 /// [Schedule.catch_up][google.cloud.aiplatform.v1.Schedule.catch_up] is set up
7609 /// true, all missed runs will be scheduled for backfill first.
7610 ///
7611 /// [google.cloud.aiplatform.v1.Schedule.catch_up]: crate::model::Schedule::catch_up
7612 /// [google.cloud.aiplatform.v1.Schedule.state]: crate::model::Schedule::state
7613 pub fn resume_schedule(&self) -> super::builder::schedule_service::ResumeSchedule {
7614 super::builder::schedule_service::ResumeSchedule::new(self.inner.clone())
7615 }
7616
7617 /// Updates an active or paused Schedule.
7618 ///
7619 /// When the Schedule is updated, new runs will be scheduled starting from the
7620 /// updated next execution time after the update time based on the
7621 /// time_specification in the updated Schedule. All unstarted runs before the
7622 /// update time will be skipped while already created runs will NOT be paused
7623 /// or canceled.
7624 pub fn update_schedule(&self) -> super::builder::schedule_service::UpdateSchedule {
7625 super::builder::schedule_service::UpdateSchedule::new(self.inner.clone())
7626 }
7627
7628 /// Lists information about the supported locations for this service.
7629 pub fn list_locations(&self) -> super::builder::schedule_service::ListLocations {
7630 super::builder::schedule_service::ListLocations::new(self.inner.clone())
7631 }
7632
7633 /// Gets information about a location.
7634 pub fn get_location(&self) -> super::builder::schedule_service::GetLocation {
7635 super::builder::schedule_service::GetLocation::new(self.inner.clone())
7636 }
7637
7638 /// Sets the access control policy on the specified resource. Replaces
7639 /// any existing policy.
7640 ///
7641 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
7642 /// errors.
7643 pub fn set_iam_policy(&self) -> super::builder::schedule_service::SetIamPolicy {
7644 super::builder::schedule_service::SetIamPolicy::new(self.inner.clone())
7645 }
7646
7647 /// Gets the access control policy for a resource. Returns an empty policy
7648 /// if the resource exists and does not have a policy set.
7649 pub fn get_iam_policy(&self) -> super::builder::schedule_service::GetIamPolicy {
7650 super::builder::schedule_service::GetIamPolicy::new(self.inner.clone())
7651 }
7652
7653 /// Returns permissions that a caller has on the specified resource. If the
7654 /// resource does not exist, this will return an empty set of
7655 /// permissions, not a `NOT_FOUND` error.
7656 ///
7657 /// Note: This operation is designed to be used for building
7658 /// permission-aware UIs and command-line tools, not for authorization
7659 /// checking. This operation may "fail open" without warning.
7660 pub fn test_iam_permissions(&self) -> super::builder::schedule_service::TestIamPermissions {
7661 super::builder::schedule_service::TestIamPermissions::new(self.inner.clone())
7662 }
7663
7664 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7665 ///
7666 /// [google.longrunning.Operations]: longrunning::client::Operations
7667 pub fn list_operations(&self) -> super::builder::schedule_service::ListOperations {
7668 super::builder::schedule_service::ListOperations::new(self.inner.clone())
7669 }
7670
7671 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7672 ///
7673 /// [google.longrunning.Operations]: longrunning::client::Operations
7674 pub fn get_operation(&self) -> super::builder::schedule_service::GetOperation {
7675 super::builder::schedule_service::GetOperation::new(self.inner.clone())
7676 }
7677
7678 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7679 ///
7680 /// [google.longrunning.Operations]: longrunning::client::Operations
7681 pub fn delete_operation(&self) -> super::builder::schedule_service::DeleteOperation {
7682 super::builder::schedule_service::DeleteOperation::new(self.inner.clone())
7683 }
7684
7685 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7686 ///
7687 /// [google.longrunning.Operations]: longrunning::client::Operations
7688 pub fn cancel_operation(&self) -> super::builder::schedule_service::CancelOperation {
7689 super::builder::schedule_service::CancelOperation::new(self.inner.clone())
7690 }
7691
7692 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7693 ///
7694 /// [google.longrunning.Operations]: longrunning::client::Operations
7695 pub fn wait_operation(&self) -> super::builder::schedule_service::WaitOperation {
7696 super::builder::schedule_service::WaitOperation::new(self.inner.clone())
7697 }
7698}
7699
7700/// Implements a client for the Vertex AI API.
7701///
7702/// # Example
7703/// ```
7704/// # tokio_test::block_on(async {
7705/// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
7706/// let client = SpecialistPoolService::builder().build().await?;
7707/// // use `client` to make requests to the Vertex AI API.
7708/// # gax::Result::<()>::Ok(()) });
7709/// ```
7710///
7711/// # Service Description
7712///
7713/// A service for creating and managing Customer SpecialistPools.
7714/// When customers start Data Labeling jobs, they can reuse/create Specialist
7715/// Pools to bring their own Specialists to label the data.
7716/// Customers can add/remove Managers for the Specialist Pool on Cloud console,
7717/// then Managers will get email notifications to manage Specialists and tasks on
7718/// CrowdCompute console.
7719///
7720/// # Configuration
7721///
7722/// To configure `SpecialistPoolService` use the `with_*` methods in the type returned
7723/// by [builder()][SpecialistPoolService::builder]. The default configuration should
7724/// work for most applications. Common configuration changes include
7725///
7726/// * [with_endpoint()]: by default this client uses the global default endpoint
7727/// (`https://aiplatform.googleapis.com`). Applications using regional
7728/// endpoints or running in restricted networks (e.g. a network configured
7729// with [Private Google Access with VPC Service Controls]) may want to
7730/// override this default.
7731/// * [with_credentials()]: by default this client uses
7732/// [Application Default Credentials]. Applications using custom
7733/// authentication may need to override this default.
7734///
7735/// [with_endpoint()]: super::builder::specialist_pool_service::ClientBuilder::with_endpoint
7736/// [with_credentials()]: super::builder::specialist_pool_service::ClientBuilder::credentials
7737/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7738/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7739///
7740/// # Pooling and Cloning
7741///
7742/// `SpecialistPoolService` holds a connection pool internally, it is advised to
7743/// create one and the reuse it. You do not need to wrap `SpecialistPoolService` in
7744/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7745/// already uses an `Arc` internally.
7746#[cfg(feature = "specialist-pool-service")]
7747#[cfg_attr(docsrs, doc(cfg(feature = "specialist-pool-service")))]
7748#[derive(Clone, Debug)]
7749pub struct SpecialistPoolService {
7750 inner: std::sync::Arc<dyn super::stub::dynamic::SpecialistPoolService>,
7751}
7752
7753#[cfg(feature = "specialist-pool-service")]
7754impl SpecialistPoolService {
7755 /// Returns a builder for [SpecialistPoolService].
7756 ///
7757 /// ```
7758 /// # tokio_test::block_on(async {
7759 /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
7760 /// let client = SpecialistPoolService::builder().build().await?;
7761 /// # gax::Result::<()>::Ok(()) });
7762 /// ```
7763 pub fn builder() -> super::builder::specialist_pool_service::ClientBuilder {
7764 gax::client_builder::internal::new_builder(
7765 super::builder::specialist_pool_service::client::Factory,
7766 )
7767 }
7768
7769 /// Creates a new client from the provided stub.
7770 ///
7771 /// The most common case for calling this function is in tests mocking the
7772 /// client's behavior.
7773 pub fn from_stub<T>(stub: T) -> Self
7774 where
7775 T: super::stub::SpecialistPoolService + 'static,
7776 {
7777 Self {
7778 inner: std::sync::Arc::new(stub),
7779 }
7780 }
7781
7782 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
7783 let inner = Self::build_inner(config).await?;
7784 Ok(Self { inner })
7785 }
7786
7787 async fn build_inner(
7788 conf: gaxi::options::ClientConfig,
7789 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::SpecialistPoolService>> {
7790 if gaxi::options::tracing_enabled(&conf) {
7791 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7792 }
7793 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7794 }
7795
7796 async fn build_transport(
7797 conf: gaxi::options::ClientConfig,
7798 ) -> Result<impl super::stub::SpecialistPoolService> {
7799 super::transport::SpecialistPoolService::new(conf).await
7800 }
7801
7802 async fn build_with_tracing(
7803 conf: gaxi::options::ClientConfig,
7804 ) -> Result<impl super::stub::SpecialistPoolService> {
7805 Self::build_transport(conf)
7806 .await
7807 .map(super::tracing::SpecialistPoolService::new)
7808 }
7809
7810 /// Creates a SpecialistPool.
7811 ///
7812 /// # Long running operations
7813 ///
7814 /// This method is used to start, and/or poll a [long-running Operation].
7815 /// The [Working with long-running operations] chapter in the [user guide]
7816 /// covers these operations in detail.
7817 ///
7818 /// [long-running operation]: https://google.aip.dev/151
7819 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7820 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7821 pub fn create_specialist_pool(
7822 &self,
7823 ) -> super::builder::specialist_pool_service::CreateSpecialistPool {
7824 super::builder::specialist_pool_service::CreateSpecialistPool::new(self.inner.clone())
7825 }
7826
7827 /// Gets a SpecialistPool.
7828 pub fn get_specialist_pool(
7829 &self,
7830 ) -> super::builder::specialist_pool_service::GetSpecialistPool {
7831 super::builder::specialist_pool_service::GetSpecialistPool::new(self.inner.clone())
7832 }
7833
7834 /// Lists SpecialistPools in a Location.
7835 pub fn list_specialist_pools(
7836 &self,
7837 ) -> super::builder::specialist_pool_service::ListSpecialistPools {
7838 super::builder::specialist_pool_service::ListSpecialistPools::new(self.inner.clone())
7839 }
7840
7841 /// Deletes a SpecialistPool as well as all Specialists in the pool.
7842 ///
7843 /// # Long running operations
7844 ///
7845 /// This method is used to start, and/or poll a [long-running Operation].
7846 /// The [Working with long-running operations] chapter in the [user guide]
7847 /// covers these operations in detail.
7848 ///
7849 /// [long-running operation]: https://google.aip.dev/151
7850 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7851 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7852 pub fn delete_specialist_pool(
7853 &self,
7854 ) -> super::builder::specialist_pool_service::DeleteSpecialistPool {
7855 super::builder::specialist_pool_service::DeleteSpecialistPool::new(self.inner.clone())
7856 }
7857
7858 /// Updates a SpecialistPool.
7859 ///
7860 /// # Long running operations
7861 ///
7862 /// This method is used to start, and/or poll a [long-running Operation].
7863 /// The [Working with long-running operations] chapter in the [user guide]
7864 /// covers these operations in detail.
7865 ///
7866 /// [long-running operation]: https://google.aip.dev/151
7867 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7868 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7869 pub fn update_specialist_pool(
7870 &self,
7871 ) -> super::builder::specialist_pool_service::UpdateSpecialistPool {
7872 super::builder::specialist_pool_service::UpdateSpecialistPool::new(self.inner.clone())
7873 }
7874
7875 /// Lists information about the supported locations for this service.
7876 pub fn list_locations(&self) -> super::builder::specialist_pool_service::ListLocations {
7877 super::builder::specialist_pool_service::ListLocations::new(self.inner.clone())
7878 }
7879
7880 /// Gets information about a location.
7881 pub fn get_location(&self) -> super::builder::specialist_pool_service::GetLocation {
7882 super::builder::specialist_pool_service::GetLocation::new(self.inner.clone())
7883 }
7884
7885 /// Sets the access control policy on the specified resource. Replaces
7886 /// any existing policy.
7887 ///
7888 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
7889 /// errors.
7890 pub fn set_iam_policy(&self) -> super::builder::specialist_pool_service::SetIamPolicy {
7891 super::builder::specialist_pool_service::SetIamPolicy::new(self.inner.clone())
7892 }
7893
7894 /// Gets the access control policy for a resource. Returns an empty policy
7895 /// if the resource exists and does not have a policy set.
7896 pub fn get_iam_policy(&self) -> super::builder::specialist_pool_service::GetIamPolicy {
7897 super::builder::specialist_pool_service::GetIamPolicy::new(self.inner.clone())
7898 }
7899
7900 /// Returns permissions that a caller has on the specified resource. If the
7901 /// resource does not exist, this will return an empty set of
7902 /// permissions, not a `NOT_FOUND` error.
7903 ///
7904 /// Note: This operation is designed to be used for building
7905 /// permission-aware UIs and command-line tools, not for authorization
7906 /// checking. This operation may "fail open" without warning.
7907 pub fn test_iam_permissions(
7908 &self,
7909 ) -> super::builder::specialist_pool_service::TestIamPermissions {
7910 super::builder::specialist_pool_service::TestIamPermissions::new(self.inner.clone())
7911 }
7912
7913 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7914 ///
7915 /// [google.longrunning.Operations]: longrunning::client::Operations
7916 pub fn list_operations(&self) -> super::builder::specialist_pool_service::ListOperations {
7917 super::builder::specialist_pool_service::ListOperations::new(self.inner.clone())
7918 }
7919
7920 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7921 ///
7922 /// [google.longrunning.Operations]: longrunning::client::Operations
7923 pub fn get_operation(&self) -> super::builder::specialist_pool_service::GetOperation {
7924 super::builder::specialist_pool_service::GetOperation::new(self.inner.clone())
7925 }
7926
7927 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7928 ///
7929 /// [google.longrunning.Operations]: longrunning::client::Operations
7930 pub fn delete_operation(&self) -> super::builder::specialist_pool_service::DeleteOperation {
7931 super::builder::specialist_pool_service::DeleteOperation::new(self.inner.clone())
7932 }
7933
7934 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7935 ///
7936 /// [google.longrunning.Operations]: longrunning::client::Operations
7937 pub fn cancel_operation(&self) -> super::builder::specialist_pool_service::CancelOperation {
7938 super::builder::specialist_pool_service::CancelOperation::new(self.inner.clone())
7939 }
7940
7941 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7942 ///
7943 /// [google.longrunning.Operations]: longrunning::client::Operations
7944 pub fn wait_operation(&self) -> super::builder::specialist_pool_service::WaitOperation {
7945 super::builder::specialist_pool_service::WaitOperation::new(self.inner.clone())
7946 }
7947}
7948
7949/// Implements a client for the Vertex AI API.
7950///
7951/// # Example
7952/// ```
7953/// # tokio_test::block_on(async {
7954/// # use google_cloud_aiplatform_v1::client::TensorboardService;
7955/// let client = TensorboardService::builder().build().await?;
7956/// // use `client` to make requests to the Vertex AI API.
7957/// # gax::Result::<()>::Ok(()) });
7958/// ```
7959///
7960/// # Service Description
7961///
7962/// TensorboardService
7963///
7964/// # Configuration
7965///
7966/// To configure `TensorboardService` use the `with_*` methods in the type returned
7967/// by [builder()][TensorboardService::builder]. The default configuration should
7968/// work for most applications. Common configuration changes include
7969///
7970/// * [with_endpoint()]: by default this client uses the global default endpoint
7971/// (`https://aiplatform.googleapis.com`). Applications using regional
7972/// endpoints or running in restricted networks (e.g. a network configured
7973// with [Private Google Access with VPC Service Controls]) may want to
7974/// override this default.
7975/// * [with_credentials()]: by default this client uses
7976/// [Application Default Credentials]. Applications using custom
7977/// authentication may need to override this default.
7978///
7979/// [with_endpoint()]: super::builder::tensorboard_service::ClientBuilder::with_endpoint
7980/// [with_credentials()]: super::builder::tensorboard_service::ClientBuilder::credentials
7981/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7982/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7983///
7984/// # Pooling and Cloning
7985///
7986/// `TensorboardService` holds a connection pool internally, it is advised to
7987/// create one and the reuse it. You do not need to wrap `TensorboardService` in
7988/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7989/// already uses an `Arc` internally.
7990#[cfg(feature = "tensorboard-service")]
7991#[cfg_attr(docsrs, doc(cfg(feature = "tensorboard-service")))]
7992#[derive(Clone, Debug)]
7993pub struct TensorboardService {
7994 inner: std::sync::Arc<dyn super::stub::dynamic::TensorboardService>,
7995}
7996
7997#[cfg(feature = "tensorboard-service")]
7998impl TensorboardService {
7999 /// Returns a builder for [TensorboardService].
8000 ///
8001 /// ```
8002 /// # tokio_test::block_on(async {
8003 /// # use google_cloud_aiplatform_v1::client::TensorboardService;
8004 /// let client = TensorboardService::builder().build().await?;
8005 /// # gax::Result::<()>::Ok(()) });
8006 /// ```
8007 pub fn builder() -> super::builder::tensorboard_service::ClientBuilder {
8008 gax::client_builder::internal::new_builder(
8009 super::builder::tensorboard_service::client::Factory,
8010 )
8011 }
8012
8013 /// Creates a new client from the provided stub.
8014 ///
8015 /// The most common case for calling this function is in tests mocking the
8016 /// client's behavior.
8017 pub fn from_stub<T>(stub: T) -> Self
8018 where
8019 T: super::stub::TensorboardService + 'static,
8020 {
8021 Self {
8022 inner: std::sync::Arc::new(stub),
8023 }
8024 }
8025
8026 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
8027 let inner = Self::build_inner(config).await?;
8028 Ok(Self { inner })
8029 }
8030
8031 async fn build_inner(
8032 conf: gaxi::options::ClientConfig,
8033 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::TensorboardService>> {
8034 if gaxi::options::tracing_enabled(&conf) {
8035 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8036 }
8037 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8038 }
8039
8040 async fn build_transport(
8041 conf: gaxi::options::ClientConfig,
8042 ) -> Result<impl super::stub::TensorboardService> {
8043 super::transport::TensorboardService::new(conf).await
8044 }
8045
8046 async fn build_with_tracing(
8047 conf: gaxi::options::ClientConfig,
8048 ) -> Result<impl super::stub::TensorboardService> {
8049 Self::build_transport(conf)
8050 .await
8051 .map(super::tracing::TensorboardService::new)
8052 }
8053
8054 /// Creates a Tensorboard.
8055 ///
8056 /// # Long running operations
8057 ///
8058 /// This method is used to start, and/or poll a [long-running Operation].
8059 /// The [Working with long-running operations] chapter in the [user guide]
8060 /// covers these operations in detail.
8061 ///
8062 /// [long-running operation]: https://google.aip.dev/151
8063 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8064 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8065 pub fn create_tensorboard(&self) -> super::builder::tensorboard_service::CreateTensorboard {
8066 super::builder::tensorboard_service::CreateTensorboard::new(self.inner.clone())
8067 }
8068
8069 /// Gets a Tensorboard.
8070 pub fn get_tensorboard(&self) -> super::builder::tensorboard_service::GetTensorboard {
8071 super::builder::tensorboard_service::GetTensorboard::new(self.inner.clone())
8072 }
8073
8074 /// Updates a Tensorboard.
8075 ///
8076 /// # Long running operations
8077 ///
8078 /// This method is used to start, and/or poll a [long-running Operation].
8079 /// The [Working with long-running operations] chapter in the [user guide]
8080 /// covers these operations in detail.
8081 ///
8082 /// [long-running operation]: https://google.aip.dev/151
8083 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8084 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8085 pub fn update_tensorboard(&self) -> super::builder::tensorboard_service::UpdateTensorboard {
8086 super::builder::tensorboard_service::UpdateTensorboard::new(self.inner.clone())
8087 }
8088
8089 /// Lists Tensorboards in a Location.
8090 pub fn list_tensorboards(&self) -> super::builder::tensorboard_service::ListTensorboards {
8091 super::builder::tensorboard_service::ListTensorboards::new(self.inner.clone())
8092 }
8093
8094 /// Deletes a Tensorboard.
8095 ///
8096 /// # Long running operations
8097 ///
8098 /// This method is used to start, and/or poll a [long-running Operation].
8099 /// The [Working with long-running operations] chapter in the [user guide]
8100 /// covers these operations in detail.
8101 ///
8102 /// [long-running operation]: https://google.aip.dev/151
8103 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8104 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8105 pub fn delete_tensorboard(&self) -> super::builder::tensorboard_service::DeleteTensorboard {
8106 super::builder::tensorboard_service::DeleteTensorboard::new(self.inner.clone())
8107 }
8108
8109 /// Returns a list of monthly active users for a given TensorBoard instance.
8110 pub fn read_tensorboard_usage(
8111 &self,
8112 ) -> super::builder::tensorboard_service::ReadTensorboardUsage {
8113 super::builder::tensorboard_service::ReadTensorboardUsage::new(self.inner.clone())
8114 }
8115
8116 /// Returns the storage size for a given TensorBoard instance.
8117 pub fn read_tensorboard_size(
8118 &self,
8119 ) -> super::builder::tensorboard_service::ReadTensorboardSize {
8120 super::builder::tensorboard_service::ReadTensorboardSize::new(self.inner.clone())
8121 }
8122
8123 /// Creates a TensorboardExperiment.
8124 pub fn create_tensorboard_experiment(
8125 &self,
8126 ) -> super::builder::tensorboard_service::CreateTensorboardExperiment {
8127 super::builder::tensorboard_service::CreateTensorboardExperiment::new(self.inner.clone())
8128 }
8129
8130 /// Gets a TensorboardExperiment.
8131 pub fn get_tensorboard_experiment(
8132 &self,
8133 ) -> super::builder::tensorboard_service::GetTensorboardExperiment {
8134 super::builder::tensorboard_service::GetTensorboardExperiment::new(self.inner.clone())
8135 }
8136
8137 /// Updates a TensorboardExperiment.
8138 pub fn update_tensorboard_experiment(
8139 &self,
8140 ) -> super::builder::tensorboard_service::UpdateTensorboardExperiment {
8141 super::builder::tensorboard_service::UpdateTensorboardExperiment::new(self.inner.clone())
8142 }
8143
8144 /// Lists TensorboardExperiments in a Location.
8145 pub fn list_tensorboard_experiments(
8146 &self,
8147 ) -> super::builder::tensorboard_service::ListTensorboardExperiments {
8148 super::builder::tensorboard_service::ListTensorboardExperiments::new(self.inner.clone())
8149 }
8150
8151 /// Deletes a TensorboardExperiment.
8152 ///
8153 /// # Long running operations
8154 ///
8155 /// This method is used to start, and/or poll a [long-running Operation].
8156 /// The [Working with long-running operations] chapter in the [user guide]
8157 /// covers these operations in detail.
8158 ///
8159 /// [long-running operation]: https://google.aip.dev/151
8160 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8161 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8162 pub fn delete_tensorboard_experiment(
8163 &self,
8164 ) -> super::builder::tensorboard_service::DeleteTensorboardExperiment {
8165 super::builder::tensorboard_service::DeleteTensorboardExperiment::new(self.inner.clone())
8166 }
8167
8168 /// Creates a TensorboardRun.
8169 pub fn create_tensorboard_run(
8170 &self,
8171 ) -> super::builder::tensorboard_service::CreateTensorboardRun {
8172 super::builder::tensorboard_service::CreateTensorboardRun::new(self.inner.clone())
8173 }
8174
8175 /// Batch create TensorboardRuns.
8176 pub fn batch_create_tensorboard_runs(
8177 &self,
8178 ) -> super::builder::tensorboard_service::BatchCreateTensorboardRuns {
8179 super::builder::tensorboard_service::BatchCreateTensorboardRuns::new(self.inner.clone())
8180 }
8181
8182 /// Gets a TensorboardRun.
8183 pub fn get_tensorboard_run(&self) -> super::builder::tensorboard_service::GetTensorboardRun {
8184 super::builder::tensorboard_service::GetTensorboardRun::new(self.inner.clone())
8185 }
8186
8187 /// Updates a TensorboardRun.
8188 pub fn update_tensorboard_run(
8189 &self,
8190 ) -> super::builder::tensorboard_service::UpdateTensorboardRun {
8191 super::builder::tensorboard_service::UpdateTensorboardRun::new(self.inner.clone())
8192 }
8193
8194 /// Lists TensorboardRuns in a Location.
8195 pub fn list_tensorboard_runs(
8196 &self,
8197 ) -> super::builder::tensorboard_service::ListTensorboardRuns {
8198 super::builder::tensorboard_service::ListTensorboardRuns::new(self.inner.clone())
8199 }
8200
8201 /// Deletes a TensorboardRun.
8202 ///
8203 /// # Long running operations
8204 ///
8205 /// This method is used to start, and/or poll a [long-running Operation].
8206 /// The [Working with long-running operations] chapter in the [user guide]
8207 /// covers these operations in detail.
8208 ///
8209 /// [long-running operation]: https://google.aip.dev/151
8210 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8211 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8212 pub fn delete_tensorboard_run(
8213 &self,
8214 ) -> super::builder::tensorboard_service::DeleteTensorboardRun {
8215 super::builder::tensorboard_service::DeleteTensorboardRun::new(self.inner.clone())
8216 }
8217
8218 /// Batch create TensorboardTimeSeries that belong to a TensorboardExperiment.
8219 pub fn batch_create_tensorboard_time_series(
8220 &self,
8221 ) -> super::builder::tensorboard_service::BatchCreateTensorboardTimeSeries {
8222 super::builder::tensorboard_service::BatchCreateTensorboardTimeSeries::new(
8223 self.inner.clone(),
8224 )
8225 }
8226
8227 /// Creates a TensorboardTimeSeries.
8228 pub fn create_tensorboard_time_series(
8229 &self,
8230 ) -> super::builder::tensorboard_service::CreateTensorboardTimeSeries {
8231 super::builder::tensorboard_service::CreateTensorboardTimeSeries::new(self.inner.clone())
8232 }
8233
8234 /// Gets a TensorboardTimeSeries.
8235 pub fn get_tensorboard_time_series(
8236 &self,
8237 ) -> super::builder::tensorboard_service::GetTensorboardTimeSeries {
8238 super::builder::tensorboard_service::GetTensorboardTimeSeries::new(self.inner.clone())
8239 }
8240
8241 /// Updates a TensorboardTimeSeries.
8242 pub fn update_tensorboard_time_series(
8243 &self,
8244 ) -> super::builder::tensorboard_service::UpdateTensorboardTimeSeries {
8245 super::builder::tensorboard_service::UpdateTensorboardTimeSeries::new(self.inner.clone())
8246 }
8247
8248 /// Lists TensorboardTimeSeries in a Location.
8249 pub fn list_tensorboard_time_series(
8250 &self,
8251 ) -> super::builder::tensorboard_service::ListTensorboardTimeSeries {
8252 super::builder::tensorboard_service::ListTensorboardTimeSeries::new(self.inner.clone())
8253 }
8254
8255 /// Deletes a TensorboardTimeSeries.
8256 ///
8257 /// # Long running operations
8258 ///
8259 /// This method is used to start, and/or poll a [long-running Operation].
8260 /// The [Working with long-running operations] chapter in the [user guide]
8261 /// covers these operations in detail.
8262 ///
8263 /// [long-running operation]: https://google.aip.dev/151
8264 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8265 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8266 pub fn delete_tensorboard_time_series(
8267 &self,
8268 ) -> super::builder::tensorboard_service::DeleteTensorboardTimeSeries {
8269 super::builder::tensorboard_service::DeleteTensorboardTimeSeries::new(self.inner.clone())
8270 }
8271
8272 /// Reads multiple TensorboardTimeSeries' data. The data point number limit is
8273 /// 1000 for scalars, 100 for tensors and blob references. If the number of
8274 /// data points stored is less than the limit, all data is returned.
8275 /// Otherwise, the number limit of data points is randomly selected from
8276 /// this time series and returned.
8277 pub fn batch_read_tensorboard_time_series_data(
8278 &self,
8279 ) -> super::builder::tensorboard_service::BatchReadTensorboardTimeSeriesData {
8280 super::builder::tensorboard_service::BatchReadTensorboardTimeSeriesData::new(
8281 self.inner.clone(),
8282 )
8283 }
8284
8285 /// Reads a TensorboardTimeSeries' data. By default, if the number of data
8286 /// points stored is less than 1000, all data is returned. Otherwise, 1000
8287 /// data points is randomly selected from this time series and returned.
8288 /// This value can be changed by changing max_data_points, which can't be
8289 /// greater than 10k.
8290 pub fn read_tensorboard_time_series_data(
8291 &self,
8292 ) -> super::builder::tensorboard_service::ReadTensorboardTimeSeriesData {
8293 super::builder::tensorboard_service::ReadTensorboardTimeSeriesData::new(self.inner.clone())
8294 }
8295
8296 /// Write time series data points of multiple TensorboardTimeSeries in multiple
8297 /// TensorboardRun's. If any data fail to be ingested, an error is returned.
8298 pub fn write_tensorboard_experiment_data(
8299 &self,
8300 ) -> super::builder::tensorboard_service::WriteTensorboardExperimentData {
8301 super::builder::tensorboard_service::WriteTensorboardExperimentData::new(self.inner.clone())
8302 }
8303
8304 /// Write time series data points into multiple TensorboardTimeSeries under
8305 /// a TensorboardRun. If any data fail to be ingested, an error is returned.
8306 pub fn write_tensorboard_run_data(
8307 &self,
8308 ) -> super::builder::tensorboard_service::WriteTensorboardRunData {
8309 super::builder::tensorboard_service::WriteTensorboardRunData::new(self.inner.clone())
8310 }
8311
8312 /// Exports a TensorboardTimeSeries' data. Data is returned in paginated
8313 /// responses.
8314 pub fn export_tensorboard_time_series_data(
8315 &self,
8316 ) -> super::builder::tensorboard_service::ExportTensorboardTimeSeriesData {
8317 super::builder::tensorboard_service::ExportTensorboardTimeSeriesData::new(
8318 self.inner.clone(),
8319 )
8320 }
8321
8322 /// Lists information about the supported locations for this service.
8323 pub fn list_locations(&self) -> super::builder::tensorboard_service::ListLocations {
8324 super::builder::tensorboard_service::ListLocations::new(self.inner.clone())
8325 }
8326
8327 /// Gets information about a location.
8328 pub fn get_location(&self) -> super::builder::tensorboard_service::GetLocation {
8329 super::builder::tensorboard_service::GetLocation::new(self.inner.clone())
8330 }
8331
8332 /// Sets the access control policy on the specified resource. Replaces
8333 /// any existing policy.
8334 ///
8335 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
8336 /// errors.
8337 pub fn set_iam_policy(&self) -> super::builder::tensorboard_service::SetIamPolicy {
8338 super::builder::tensorboard_service::SetIamPolicy::new(self.inner.clone())
8339 }
8340
8341 /// Gets the access control policy for a resource. Returns an empty policy
8342 /// if the resource exists and does not have a policy set.
8343 pub fn get_iam_policy(&self) -> super::builder::tensorboard_service::GetIamPolicy {
8344 super::builder::tensorboard_service::GetIamPolicy::new(self.inner.clone())
8345 }
8346
8347 /// Returns permissions that a caller has on the specified resource. If the
8348 /// resource does not exist, this will return an empty set of
8349 /// permissions, not a `NOT_FOUND` error.
8350 ///
8351 /// Note: This operation is designed to be used for building
8352 /// permission-aware UIs and command-line tools, not for authorization
8353 /// checking. This operation may "fail open" without warning.
8354 pub fn test_iam_permissions(&self) -> super::builder::tensorboard_service::TestIamPermissions {
8355 super::builder::tensorboard_service::TestIamPermissions::new(self.inner.clone())
8356 }
8357
8358 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8359 ///
8360 /// [google.longrunning.Operations]: longrunning::client::Operations
8361 pub fn list_operations(&self) -> super::builder::tensorboard_service::ListOperations {
8362 super::builder::tensorboard_service::ListOperations::new(self.inner.clone())
8363 }
8364
8365 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8366 ///
8367 /// [google.longrunning.Operations]: longrunning::client::Operations
8368 pub fn get_operation(&self) -> super::builder::tensorboard_service::GetOperation {
8369 super::builder::tensorboard_service::GetOperation::new(self.inner.clone())
8370 }
8371
8372 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8373 ///
8374 /// [google.longrunning.Operations]: longrunning::client::Operations
8375 pub fn delete_operation(&self) -> super::builder::tensorboard_service::DeleteOperation {
8376 super::builder::tensorboard_service::DeleteOperation::new(self.inner.clone())
8377 }
8378
8379 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8380 ///
8381 /// [google.longrunning.Operations]: longrunning::client::Operations
8382 pub fn cancel_operation(&self) -> super::builder::tensorboard_service::CancelOperation {
8383 super::builder::tensorboard_service::CancelOperation::new(self.inner.clone())
8384 }
8385
8386 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8387 ///
8388 /// [google.longrunning.Operations]: longrunning::client::Operations
8389 pub fn wait_operation(&self) -> super::builder::tensorboard_service::WaitOperation {
8390 super::builder::tensorboard_service::WaitOperation::new(self.inner.clone())
8391 }
8392}
8393
8394/// Implements a client for the Vertex AI API.
8395///
8396/// # Example
8397/// ```
8398/// # tokio_test::block_on(async {
8399/// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
8400/// let client = VertexRagDataService::builder().build().await?;
8401/// // use `client` to make requests to the Vertex AI API.
8402/// # gax::Result::<()>::Ok(()) });
8403/// ```
8404///
8405/// # Service Description
8406///
8407/// A service for managing user data for RAG.
8408///
8409/// # Configuration
8410///
8411/// To configure `VertexRagDataService` use the `with_*` methods in the type returned
8412/// by [builder()][VertexRagDataService::builder]. The default configuration should
8413/// work for most applications. Common configuration changes include
8414///
8415/// * [with_endpoint()]: by default this client uses the global default endpoint
8416/// (`https://aiplatform.googleapis.com`). Applications using regional
8417/// endpoints or running in restricted networks (e.g. a network configured
8418// with [Private Google Access with VPC Service Controls]) may want to
8419/// override this default.
8420/// * [with_credentials()]: by default this client uses
8421/// [Application Default Credentials]. Applications using custom
8422/// authentication may need to override this default.
8423///
8424/// [with_endpoint()]: super::builder::vertex_rag_data_service::ClientBuilder::with_endpoint
8425/// [with_credentials()]: super::builder::vertex_rag_data_service::ClientBuilder::credentials
8426/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8427/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8428///
8429/// # Pooling and Cloning
8430///
8431/// `VertexRagDataService` holds a connection pool internally, it is advised to
8432/// create one and the reuse it. You do not need to wrap `VertexRagDataService` in
8433/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8434/// already uses an `Arc` internally.
8435#[cfg(feature = "vertex-rag-data-service")]
8436#[cfg_attr(docsrs, doc(cfg(feature = "vertex-rag-data-service")))]
8437#[derive(Clone, Debug)]
8438pub struct VertexRagDataService {
8439 inner: std::sync::Arc<dyn super::stub::dynamic::VertexRagDataService>,
8440}
8441
8442#[cfg(feature = "vertex-rag-data-service")]
8443impl VertexRagDataService {
8444 /// Returns a builder for [VertexRagDataService].
8445 ///
8446 /// ```
8447 /// # tokio_test::block_on(async {
8448 /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
8449 /// let client = VertexRagDataService::builder().build().await?;
8450 /// # gax::Result::<()>::Ok(()) });
8451 /// ```
8452 pub fn builder() -> super::builder::vertex_rag_data_service::ClientBuilder {
8453 gax::client_builder::internal::new_builder(
8454 super::builder::vertex_rag_data_service::client::Factory,
8455 )
8456 }
8457
8458 /// Creates a new client from the provided stub.
8459 ///
8460 /// The most common case for calling this function is in tests mocking the
8461 /// client's behavior.
8462 pub fn from_stub<T>(stub: T) -> Self
8463 where
8464 T: super::stub::VertexRagDataService + 'static,
8465 {
8466 Self {
8467 inner: std::sync::Arc::new(stub),
8468 }
8469 }
8470
8471 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
8472 let inner = Self::build_inner(config).await?;
8473 Ok(Self { inner })
8474 }
8475
8476 async fn build_inner(
8477 conf: gaxi::options::ClientConfig,
8478 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::VertexRagDataService>> {
8479 if gaxi::options::tracing_enabled(&conf) {
8480 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8481 }
8482 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8483 }
8484
8485 async fn build_transport(
8486 conf: gaxi::options::ClientConfig,
8487 ) -> Result<impl super::stub::VertexRagDataService> {
8488 super::transport::VertexRagDataService::new(conf).await
8489 }
8490
8491 async fn build_with_tracing(
8492 conf: gaxi::options::ClientConfig,
8493 ) -> Result<impl super::stub::VertexRagDataService> {
8494 Self::build_transport(conf)
8495 .await
8496 .map(super::tracing::VertexRagDataService::new)
8497 }
8498
8499 /// Creates a RagCorpus.
8500 ///
8501 /// # Long running operations
8502 ///
8503 /// This method is used to start, and/or poll a [long-running Operation].
8504 /// The [Working with long-running operations] chapter in the [user guide]
8505 /// covers these operations in detail.
8506 ///
8507 /// [long-running operation]: https://google.aip.dev/151
8508 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8509 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8510 pub fn create_rag_corpus(&self) -> super::builder::vertex_rag_data_service::CreateRagCorpus {
8511 super::builder::vertex_rag_data_service::CreateRagCorpus::new(self.inner.clone())
8512 }
8513
8514 /// Updates a RagCorpus.
8515 ///
8516 /// # Long running operations
8517 ///
8518 /// This method is used to start, and/or poll a [long-running Operation].
8519 /// The [Working with long-running operations] chapter in the [user guide]
8520 /// covers these operations in detail.
8521 ///
8522 /// [long-running operation]: https://google.aip.dev/151
8523 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8524 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8525 pub fn update_rag_corpus(&self) -> super::builder::vertex_rag_data_service::UpdateRagCorpus {
8526 super::builder::vertex_rag_data_service::UpdateRagCorpus::new(self.inner.clone())
8527 }
8528
8529 /// Gets a RagCorpus.
8530 pub fn get_rag_corpus(&self) -> super::builder::vertex_rag_data_service::GetRagCorpus {
8531 super::builder::vertex_rag_data_service::GetRagCorpus::new(self.inner.clone())
8532 }
8533
8534 /// Lists RagCorpora in a Location.
8535 pub fn list_rag_corpora(&self) -> super::builder::vertex_rag_data_service::ListRagCorpora {
8536 super::builder::vertex_rag_data_service::ListRagCorpora::new(self.inner.clone())
8537 }
8538
8539 /// Deletes a RagCorpus.
8540 ///
8541 /// # Long running operations
8542 ///
8543 /// This method is used to start, and/or poll a [long-running Operation].
8544 /// The [Working with long-running operations] chapter in the [user guide]
8545 /// covers these operations in detail.
8546 ///
8547 /// [long-running operation]: https://google.aip.dev/151
8548 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8549 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8550 pub fn delete_rag_corpus(&self) -> super::builder::vertex_rag_data_service::DeleteRagCorpus {
8551 super::builder::vertex_rag_data_service::DeleteRagCorpus::new(self.inner.clone())
8552 }
8553
8554 /// Upload a file into a RagCorpus.
8555 pub fn upload_rag_file(&self) -> super::builder::vertex_rag_data_service::UploadRagFile {
8556 super::builder::vertex_rag_data_service::UploadRagFile::new(self.inner.clone())
8557 }
8558
8559 /// Import files from Google Cloud Storage or Google Drive into a RagCorpus.
8560 ///
8561 /// # Long running operations
8562 ///
8563 /// This method is used to start, and/or poll a [long-running Operation].
8564 /// The [Working with long-running operations] chapter in the [user guide]
8565 /// covers these operations in detail.
8566 ///
8567 /// [long-running operation]: https://google.aip.dev/151
8568 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8569 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8570 pub fn import_rag_files(&self) -> super::builder::vertex_rag_data_service::ImportRagFiles {
8571 super::builder::vertex_rag_data_service::ImportRagFiles::new(self.inner.clone())
8572 }
8573
8574 /// Gets a RagFile.
8575 pub fn get_rag_file(&self) -> super::builder::vertex_rag_data_service::GetRagFile {
8576 super::builder::vertex_rag_data_service::GetRagFile::new(self.inner.clone())
8577 }
8578
8579 /// Lists RagFiles in a RagCorpus.
8580 pub fn list_rag_files(&self) -> super::builder::vertex_rag_data_service::ListRagFiles {
8581 super::builder::vertex_rag_data_service::ListRagFiles::new(self.inner.clone())
8582 }
8583
8584 /// Deletes a RagFile.
8585 ///
8586 /// # Long running operations
8587 ///
8588 /// This method is used to start, and/or poll a [long-running Operation].
8589 /// The [Working with long-running operations] chapter in the [user guide]
8590 /// covers these operations in detail.
8591 ///
8592 /// [long-running operation]: https://google.aip.dev/151
8593 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8594 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8595 pub fn delete_rag_file(&self) -> super::builder::vertex_rag_data_service::DeleteRagFile {
8596 super::builder::vertex_rag_data_service::DeleteRagFile::new(self.inner.clone())
8597 }
8598
8599 /// Lists information about the supported locations for this service.
8600 pub fn list_locations(&self) -> super::builder::vertex_rag_data_service::ListLocations {
8601 super::builder::vertex_rag_data_service::ListLocations::new(self.inner.clone())
8602 }
8603
8604 /// Gets information about a location.
8605 pub fn get_location(&self) -> super::builder::vertex_rag_data_service::GetLocation {
8606 super::builder::vertex_rag_data_service::GetLocation::new(self.inner.clone())
8607 }
8608
8609 /// Sets the access control policy on the specified resource. Replaces
8610 /// any existing policy.
8611 ///
8612 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
8613 /// errors.
8614 pub fn set_iam_policy(&self) -> super::builder::vertex_rag_data_service::SetIamPolicy {
8615 super::builder::vertex_rag_data_service::SetIamPolicy::new(self.inner.clone())
8616 }
8617
8618 /// Gets the access control policy for a resource. Returns an empty policy
8619 /// if the resource exists and does not have a policy set.
8620 pub fn get_iam_policy(&self) -> super::builder::vertex_rag_data_service::GetIamPolicy {
8621 super::builder::vertex_rag_data_service::GetIamPolicy::new(self.inner.clone())
8622 }
8623
8624 /// Returns permissions that a caller has on the specified resource. If the
8625 /// resource does not exist, this will return an empty set of
8626 /// permissions, not a `NOT_FOUND` error.
8627 ///
8628 /// Note: This operation is designed to be used for building
8629 /// permission-aware UIs and command-line tools, not for authorization
8630 /// checking. This operation may "fail open" without warning.
8631 pub fn test_iam_permissions(
8632 &self,
8633 ) -> super::builder::vertex_rag_data_service::TestIamPermissions {
8634 super::builder::vertex_rag_data_service::TestIamPermissions::new(self.inner.clone())
8635 }
8636
8637 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8638 ///
8639 /// [google.longrunning.Operations]: longrunning::client::Operations
8640 pub fn list_operations(&self) -> super::builder::vertex_rag_data_service::ListOperations {
8641 super::builder::vertex_rag_data_service::ListOperations::new(self.inner.clone())
8642 }
8643
8644 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8645 ///
8646 /// [google.longrunning.Operations]: longrunning::client::Operations
8647 pub fn get_operation(&self) -> super::builder::vertex_rag_data_service::GetOperation {
8648 super::builder::vertex_rag_data_service::GetOperation::new(self.inner.clone())
8649 }
8650
8651 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8652 ///
8653 /// [google.longrunning.Operations]: longrunning::client::Operations
8654 pub fn delete_operation(&self) -> super::builder::vertex_rag_data_service::DeleteOperation {
8655 super::builder::vertex_rag_data_service::DeleteOperation::new(self.inner.clone())
8656 }
8657
8658 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8659 ///
8660 /// [google.longrunning.Operations]: longrunning::client::Operations
8661 pub fn cancel_operation(&self) -> super::builder::vertex_rag_data_service::CancelOperation {
8662 super::builder::vertex_rag_data_service::CancelOperation::new(self.inner.clone())
8663 }
8664
8665 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8666 ///
8667 /// [google.longrunning.Operations]: longrunning::client::Operations
8668 pub fn wait_operation(&self) -> super::builder::vertex_rag_data_service::WaitOperation {
8669 super::builder::vertex_rag_data_service::WaitOperation::new(self.inner.clone())
8670 }
8671}
8672
8673/// Implements a client for the Vertex AI API.
8674///
8675/// # Example
8676/// ```
8677/// # tokio_test::block_on(async {
8678/// # use google_cloud_aiplatform_v1::client::VertexRagService;
8679/// let client = VertexRagService::builder().build().await?;
8680/// // use `client` to make requests to the Vertex AI API.
8681/// # gax::Result::<()>::Ok(()) });
8682/// ```
8683///
8684/// # Service Description
8685///
8686/// A service for retrieving relevant contexts.
8687///
8688/// # Configuration
8689///
8690/// To configure `VertexRagService` use the `with_*` methods in the type returned
8691/// by [builder()][VertexRagService::builder]. The default configuration should
8692/// work for most applications. Common configuration changes include
8693///
8694/// * [with_endpoint()]: by default this client uses the global default endpoint
8695/// (`https://aiplatform.googleapis.com`). Applications using regional
8696/// endpoints or running in restricted networks (e.g. a network configured
8697// with [Private Google Access with VPC Service Controls]) may want to
8698/// override this default.
8699/// * [with_credentials()]: by default this client uses
8700/// [Application Default Credentials]. Applications using custom
8701/// authentication may need to override this default.
8702///
8703/// [with_endpoint()]: super::builder::vertex_rag_service::ClientBuilder::with_endpoint
8704/// [with_credentials()]: super::builder::vertex_rag_service::ClientBuilder::credentials
8705/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8706/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8707///
8708/// # Pooling and Cloning
8709///
8710/// `VertexRagService` holds a connection pool internally, it is advised to
8711/// create one and the reuse it. You do not need to wrap `VertexRagService` in
8712/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8713/// already uses an `Arc` internally.
8714#[cfg(feature = "vertex-rag-service")]
8715#[cfg_attr(docsrs, doc(cfg(feature = "vertex-rag-service")))]
8716#[derive(Clone, Debug)]
8717pub struct VertexRagService {
8718 inner: std::sync::Arc<dyn super::stub::dynamic::VertexRagService>,
8719}
8720
8721#[cfg(feature = "vertex-rag-service")]
8722impl VertexRagService {
8723 /// Returns a builder for [VertexRagService].
8724 ///
8725 /// ```
8726 /// # tokio_test::block_on(async {
8727 /// # use google_cloud_aiplatform_v1::client::VertexRagService;
8728 /// let client = VertexRagService::builder().build().await?;
8729 /// # gax::Result::<()>::Ok(()) });
8730 /// ```
8731 pub fn builder() -> super::builder::vertex_rag_service::ClientBuilder {
8732 gax::client_builder::internal::new_builder(
8733 super::builder::vertex_rag_service::client::Factory,
8734 )
8735 }
8736
8737 /// Creates a new client from the provided stub.
8738 ///
8739 /// The most common case for calling this function is in tests mocking the
8740 /// client's behavior.
8741 pub fn from_stub<T>(stub: T) -> Self
8742 where
8743 T: super::stub::VertexRagService + 'static,
8744 {
8745 Self {
8746 inner: std::sync::Arc::new(stub),
8747 }
8748 }
8749
8750 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
8751 let inner = Self::build_inner(config).await?;
8752 Ok(Self { inner })
8753 }
8754
8755 async fn build_inner(
8756 conf: gaxi::options::ClientConfig,
8757 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::VertexRagService>> {
8758 if gaxi::options::tracing_enabled(&conf) {
8759 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8760 }
8761 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8762 }
8763
8764 async fn build_transport(
8765 conf: gaxi::options::ClientConfig,
8766 ) -> Result<impl super::stub::VertexRagService> {
8767 super::transport::VertexRagService::new(conf).await
8768 }
8769
8770 async fn build_with_tracing(
8771 conf: gaxi::options::ClientConfig,
8772 ) -> Result<impl super::stub::VertexRagService> {
8773 Self::build_transport(conf)
8774 .await
8775 .map(super::tracing::VertexRagService::new)
8776 }
8777
8778 /// Retrieves relevant contexts for a query.
8779 pub fn retrieve_contexts(&self) -> super::builder::vertex_rag_service::RetrieveContexts {
8780 super::builder::vertex_rag_service::RetrieveContexts::new(self.inner.clone())
8781 }
8782
8783 /// Given an input prompt, it returns augmented prompt from vertex rag store
8784 /// to guide LLM towards generating grounded responses.
8785 pub fn augment_prompt(&self) -> super::builder::vertex_rag_service::AugmentPrompt {
8786 super::builder::vertex_rag_service::AugmentPrompt::new(self.inner.clone())
8787 }
8788
8789 /// Given an input text, it returns a score that evaluates the factuality of
8790 /// the text. It also extracts and returns claims from the text and provides
8791 /// supporting facts.
8792 pub fn corroborate_content(&self) -> super::builder::vertex_rag_service::CorroborateContent {
8793 super::builder::vertex_rag_service::CorroborateContent::new(self.inner.clone())
8794 }
8795
8796 /// Lists information about the supported locations for this service.
8797 pub fn list_locations(&self) -> super::builder::vertex_rag_service::ListLocations {
8798 super::builder::vertex_rag_service::ListLocations::new(self.inner.clone())
8799 }
8800
8801 /// Gets information about a location.
8802 pub fn get_location(&self) -> super::builder::vertex_rag_service::GetLocation {
8803 super::builder::vertex_rag_service::GetLocation::new(self.inner.clone())
8804 }
8805
8806 /// Sets the access control policy on the specified resource. Replaces
8807 /// any existing policy.
8808 ///
8809 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
8810 /// errors.
8811 pub fn set_iam_policy(&self) -> super::builder::vertex_rag_service::SetIamPolicy {
8812 super::builder::vertex_rag_service::SetIamPolicy::new(self.inner.clone())
8813 }
8814
8815 /// Gets the access control policy for a resource. Returns an empty policy
8816 /// if the resource exists and does not have a policy set.
8817 pub fn get_iam_policy(&self) -> super::builder::vertex_rag_service::GetIamPolicy {
8818 super::builder::vertex_rag_service::GetIamPolicy::new(self.inner.clone())
8819 }
8820
8821 /// Returns permissions that a caller has on the specified resource. If the
8822 /// resource does not exist, this will return an empty set of
8823 /// permissions, not a `NOT_FOUND` error.
8824 ///
8825 /// Note: This operation is designed to be used for building
8826 /// permission-aware UIs and command-line tools, not for authorization
8827 /// checking. This operation may "fail open" without warning.
8828 pub fn test_iam_permissions(&self) -> super::builder::vertex_rag_service::TestIamPermissions {
8829 super::builder::vertex_rag_service::TestIamPermissions::new(self.inner.clone())
8830 }
8831
8832 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8833 ///
8834 /// [google.longrunning.Operations]: longrunning::client::Operations
8835 pub fn list_operations(&self) -> super::builder::vertex_rag_service::ListOperations {
8836 super::builder::vertex_rag_service::ListOperations::new(self.inner.clone())
8837 }
8838
8839 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8840 ///
8841 /// [google.longrunning.Operations]: longrunning::client::Operations
8842 pub fn get_operation(&self) -> super::builder::vertex_rag_service::GetOperation {
8843 super::builder::vertex_rag_service::GetOperation::new(self.inner.clone())
8844 }
8845
8846 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8847 ///
8848 /// [google.longrunning.Operations]: longrunning::client::Operations
8849 pub fn delete_operation(&self) -> super::builder::vertex_rag_service::DeleteOperation {
8850 super::builder::vertex_rag_service::DeleteOperation::new(self.inner.clone())
8851 }
8852
8853 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8854 ///
8855 /// [google.longrunning.Operations]: longrunning::client::Operations
8856 pub fn cancel_operation(&self) -> super::builder::vertex_rag_service::CancelOperation {
8857 super::builder::vertex_rag_service::CancelOperation::new(self.inner.clone())
8858 }
8859
8860 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
8861 ///
8862 /// [google.longrunning.Operations]: longrunning::client::Operations
8863 pub fn wait_operation(&self) -> super::builder::vertex_rag_service::WaitOperation {
8864 super::builder::vertex_rag_service::WaitOperation::new(self.inner.clone())
8865 }
8866}
8867
8868/// Implements a client for the Vertex AI API.
8869///
8870/// # Example
8871/// ```
8872/// # tokio_test::block_on(async {
8873/// # use google_cloud_aiplatform_v1::client::VizierService;
8874/// let client = VizierService::builder().build().await?;
8875/// // use `client` to make requests to the Vertex AI API.
8876/// # gax::Result::<()>::Ok(()) });
8877/// ```
8878///
8879/// # Service Description
8880///
8881/// Vertex AI Vizier API.
8882///
8883/// Vertex AI Vizier is a service to solve blackbox optimization problems,
8884/// such as tuning machine learning hyperparameters and searching over deep
8885/// learning architectures.
8886///
8887/// # Configuration
8888///
8889/// To configure `VizierService` use the `with_*` methods in the type returned
8890/// by [builder()][VizierService::builder]. The default configuration should
8891/// work for most applications. Common configuration changes include
8892///
8893/// * [with_endpoint()]: by default this client uses the global default endpoint
8894/// (`https://aiplatform.googleapis.com`). Applications using regional
8895/// endpoints or running in restricted networks (e.g. a network configured
8896// with [Private Google Access with VPC Service Controls]) may want to
8897/// override this default.
8898/// * [with_credentials()]: by default this client uses
8899/// [Application Default Credentials]. Applications using custom
8900/// authentication may need to override this default.
8901///
8902/// [with_endpoint()]: super::builder::vizier_service::ClientBuilder::with_endpoint
8903/// [with_credentials()]: super::builder::vizier_service::ClientBuilder::credentials
8904/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8905/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8906///
8907/// # Pooling and Cloning
8908///
8909/// `VizierService` holds a connection pool internally, it is advised to
8910/// create one and the reuse it. You do not need to wrap `VizierService` in
8911/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8912/// already uses an `Arc` internally.
8913#[cfg(feature = "vizier-service")]
8914#[cfg_attr(docsrs, doc(cfg(feature = "vizier-service")))]
8915#[derive(Clone, Debug)]
8916pub struct VizierService {
8917 inner: std::sync::Arc<dyn super::stub::dynamic::VizierService>,
8918}
8919
8920#[cfg(feature = "vizier-service")]
8921impl VizierService {
8922 /// Returns a builder for [VizierService].
8923 ///
8924 /// ```
8925 /// # tokio_test::block_on(async {
8926 /// # use google_cloud_aiplatform_v1::client::VizierService;
8927 /// let client = VizierService::builder().build().await?;
8928 /// # gax::Result::<()>::Ok(()) });
8929 /// ```
8930 pub fn builder() -> super::builder::vizier_service::ClientBuilder {
8931 gax::client_builder::internal::new_builder(super::builder::vizier_service::client::Factory)
8932 }
8933
8934 /// Creates a new client from the provided stub.
8935 ///
8936 /// The most common case for calling this function is in tests mocking the
8937 /// client's behavior.
8938 pub fn from_stub<T>(stub: T) -> Self
8939 where
8940 T: super::stub::VizierService + 'static,
8941 {
8942 Self {
8943 inner: std::sync::Arc::new(stub),
8944 }
8945 }
8946
8947 pub(crate) async fn new(config: gaxi::options::ClientConfig) -> Result<Self> {
8948 let inner = Self::build_inner(config).await?;
8949 Ok(Self { inner })
8950 }
8951
8952 async fn build_inner(
8953 conf: gaxi::options::ClientConfig,
8954 ) -> Result<std::sync::Arc<dyn super::stub::dynamic::VizierService>> {
8955 if gaxi::options::tracing_enabled(&conf) {
8956 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8957 }
8958 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8959 }
8960
8961 async fn build_transport(
8962 conf: gaxi::options::ClientConfig,
8963 ) -> Result<impl super::stub::VizierService> {
8964 super::transport::VizierService::new(conf).await
8965 }
8966
8967 async fn build_with_tracing(
8968 conf: gaxi::options::ClientConfig,
8969 ) -> Result<impl super::stub::VizierService> {
8970 Self::build_transport(conf)
8971 .await
8972 .map(super::tracing::VizierService::new)
8973 }
8974
8975 /// Creates a Study. A resource name will be generated after creation of the
8976 /// Study.
8977 pub fn create_study(&self) -> super::builder::vizier_service::CreateStudy {
8978 super::builder::vizier_service::CreateStudy::new(self.inner.clone())
8979 }
8980
8981 /// Gets a Study by name.
8982 pub fn get_study(&self) -> super::builder::vizier_service::GetStudy {
8983 super::builder::vizier_service::GetStudy::new(self.inner.clone())
8984 }
8985
8986 /// Lists all the studies in a region for an associated project.
8987 pub fn list_studies(&self) -> super::builder::vizier_service::ListStudies {
8988 super::builder::vizier_service::ListStudies::new(self.inner.clone())
8989 }
8990
8991 /// Deletes a Study.
8992 pub fn delete_study(&self) -> super::builder::vizier_service::DeleteStudy {
8993 super::builder::vizier_service::DeleteStudy::new(self.inner.clone())
8994 }
8995
8996 /// Looks a study up using the user-defined display_name field instead of the
8997 /// fully qualified resource name.
8998 pub fn lookup_study(&self) -> super::builder::vizier_service::LookupStudy {
8999 super::builder::vizier_service::LookupStudy::new(self.inner.clone())
9000 }
9001
9002 /// Adds one or more Trials to a Study, with parameter values
9003 /// suggested by Vertex AI Vizier. Returns a long-running
9004 /// operation associated with the generation of Trial suggestions.
9005 /// When this long-running operation succeeds, it will contain
9006 /// a
9007 /// [SuggestTrialsResponse][google.cloud.aiplatform.v1.SuggestTrialsResponse].
9008 ///
9009 /// [google.cloud.aiplatform.v1.SuggestTrialsResponse]: crate::model::SuggestTrialsResponse
9010 ///
9011 /// # Long running operations
9012 ///
9013 /// This method is used to start, and/or poll a [long-running Operation].
9014 /// The [Working with long-running operations] chapter in the [user guide]
9015 /// covers these operations in detail.
9016 ///
9017 /// [long-running operation]: https://google.aip.dev/151
9018 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
9019 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
9020 pub fn suggest_trials(&self) -> super::builder::vizier_service::SuggestTrials {
9021 super::builder::vizier_service::SuggestTrials::new(self.inner.clone())
9022 }
9023
9024 /// Adds a user provided Trial to a Study.
9025 pub fn create_trial(&self) -> super::builder::vizier_service::CreateTrial {
9026 super::builder::vizier_service::CreateTrial::new(self.inner.clone())
9027 }
9028
9029 /// Gets a Trial.
9030 pub fn get_trial(&self) -> super::builder::vizier_service::GetTrial {
9031 super::builder::vizier_service::GetTrial::new(self.inner.clone())
9032 }
9033
9034 /// Lists the Trials associated with a Study.
9035 pub fn list_trials(&self) -> super::builder::vizier_service::ListTrials {
9036 super::builder::vizier_service::ListTrials::new(self.inner.clone())
9037 }
9038
9039 /// Adds a measurement of the objective metrics to a Trial. This measurement
9040 /// is assumed to have been taken before the Trial is complete.
9041 pub fn add_trial_measurement(&self) -> super::builder::vizier_service::AddTrialMeasurement {
9042 super::builder::vizier_service::AddTrialMeasurement::new(self.inner.clone())
9043 }
9044
9045 /// Marks a Trial as complete.
9046 pub fn complete_trial(&self) -> super::builder::vizier_service::CompleteTrial {
9047 super::builder::vizier_service::CompleteTrial::new(self.inner.clone())
9048 }
9049
9050 /// Deletes a Trial.
9051 pub fn delete_trial(&self) -> super::builder::vizier_service::DeleteTrial {
9052 super::builder::vizier_service::DeleteTrial::new(self.inner.clone())
9053 }
9054
9055 /// Checks whether a Trial should stop or not. Returns a
9056 /// long-running operation. When the operation is successful,
9057 /// it will contain a
9058 /// [CheckTrialEarlyStoppingStateResponse][google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateResponse].
9059 ///
9060 /// [google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateResponse]: crate::model::CheckTrialEarlyStoppingStateResponse
9061 ///
9062 /// # Long running operations
9063 ///
9064 /// This method is used to start, and/or poll a [long-running Operation].
9065 /// The [Working with long-running operations] chapter in the [user guide]
9066 /// covers these operations in detail.
9067 ///
9068 /// [long-running operation]: https://google.aip.dev/151
9069 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
9070 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
9071 pub fn check_trial_early_stopping_state(
9072 &self,
9073 ) -> super::builder::vizier_service::CheckTrialEarlyStoppingState {
9074 super::builder::vizier_service::CheckTrialEarlyStoppingState::new(self.inner.clone())
9075 }
9076
9077 /// Stops a Trial.
9078 pub fn stop_trial(&self) -> super::builder::vizier_service::StopTrial {
9079 super::builder::vizier_service::StopTrial::new(self.inner.clone())
9080 }
9081
9082 /// Lists the pareto-optimal Trials for multi-objective Study or the
9083 /// optimal Trials for single-objective Study. The definition of
9084 /// pareto-optimal can be checked in wiki page.
9085 /// <https://en.wikipedia.org/wiki/Pareto_efficiency>
9086 pub fn list_optimal_trials(&self) -> super::builder::vizier_service::ListOptimalTrials {
9087 super::builder::vizier_service::ListOptimalTrials::new(self.inner.clone())
9088 }
9089
9090 /// Lists information about the supported locations for this service.
9091 pub fn list_locations(&self) -> super::builder::vizier_service::ListLocations {
9092 super::builder::vizier_service::ListLocations::new(self.inner.clone())
9093 }
9094
9095 /// Gets information about a location.
9096 pub fn get_location(&self) -> super::builder::vizier_service::GetLocation {
9097 super::builder::vizier_service::GetLocation::new(self.inner.clone())
9098 }
9099
9100 /// Sets the access control policy on the specified resource. Replaces
9101 /// any existing policy.
9102 ///
9103 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
9104 /// errors.
9105 pub fn set_iam_policy(&self) -> super::builder::vizier_service::SetIamPolicy {
9106 super::builder::vizier_service::SetIamPolicy::new(self.inner.clone())
9107 }
9108
9109 /// Gets the access control policy for a resource. Returns an empty policy
9110 /// if the resource exists and does not have a policy set.
9111 pub fn get_iam_policy(&self) -> super::builder::vizier_service::GetIamPolicy {
9112 super::builder::vizier_service::GetIamPolicy::new(self.inner.clone())
9113 }
9114
9115 /// Returns permissions that a caller has on the specified resource. If the
9116 /// resource does not exist, this will return an empty set of
9117 /// permissions, not a `NOT_FOUND` error.
9118 ///
9119 /// Note: This operation is designed to be used for building
9120 /// permission-aware UIs and command-line tools, not for authorization
9121 /// checking. This operation may "fail open" without warning.
9122 pub fn test_iam_permissions(&self) -> super::builder::vizier_service::TestIamPermissions {
9123 super::builder::vizier_service::TestIamPermissions::new(self.inner.clone())
9124 }
9125
9126 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9127 ///
9128 /// [google.longrunning.Operations]: longrunning::client::Operations
9129 pub fn list_operations(&self) -> super::builder::vizier_service::ListOperations {
9130 super::builder::vizier_service::ListOperations::new(self.inner.clone())
9131 }
9132
9133 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9134 ///
9135 /// [google.longrunning.Operations]: longrunning::client::Operations
9136 pub fn get_operation(&self) -> super::builder::vizier_service::GetOperation {
9137 super::builder::vizier_service::GetOperation::new(self.inner.clone())
9138 }
9139
9140 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9141 ///
9142 /// [google.longrunning.Operations]: longrunning::client::Operations
9143 pub fn delete_operation(&self) -> super::builder::vizier_service::DeleteOperation {
9144 super::builder::vizier_service::DeleteOperation::new(self.inner.clone())
9145 }
9146
9147 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9148 ///
9149 /// [google.longrunning.Operations]: longrunning::client::Operations
9150 pub fn cancel_operation(&self) -> super::builder::vizier_service::CancelOperation {
9151 super::builder::vizier_service::CancelOperation::new(self.inner.clone())
9152 }
9153
9154 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9155 ///
9156 /// [google.longrunning.Operations]: longrunning::client::Operations
9157 pub fn wait_operation(&self) -> super::builder::vizier_service::WaitOperation {
9158 super::builder::vizier_service::WaitOperation::new(self.inner.clone())
9159 }
9160}