Skip to main content

google_cloud_aiplatform_v1/
client.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::redundant_explicit_links)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::invalid_html_tags)]
19
20/// Implements a client for the Vertex AI API.
21///
22/// # Example
23/// ```
24/// # use google_cloud_aiplatform_v1::client::DataFoundryService;
25/// async fn sample(
26/// ) -> anyhow::Result<()> {
27///     let client = DataFoundryService::builder().build().await?;
28///     let response = client.generate_synthetic_data()
29///         /* set fields */
30///         .send().await?;
31///     println!("response {:?}", response);
32///     Ok(())
33/// }
34/// ```
35///
36/// # Service Description
37///
38/// Service for generating and preparing datasets for Gen AI evaluation.
39///
40/// # Configuration
41///
42/// To configure `DataFoundryService` use the `with_*` methods in the type returned
43/// by [builder()][DataFoundryService::builder]. The default configuration should
44/// work for most applications. Common configuration changes include
45///
46/// * [with_endpoint()]: by default this client uses the global default endpoint
47///   (`https://aiplatform.googleapis.com`). Applications using regional
48///   endpoints or running in restricted networks (e.g. a network configured
49///   with [Private Google Access with VPC Service Controls]) may want to
50///   override this default.
51/// * [with_credentials()]: by default this client uses
52///   [Application Default Credentials]. Applications using custom
53///   authentication may need to override this default.
54///
55/// [with_endpoint()]: super::builder::data_foundry_service::ClientBuilder::with_endpoint
56/// [with_credentials()]: super::builder::data_foundry_service::ClientBuilder::with_credentials
57/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
58/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
59///
60/// # Pooling and Cloning
61///
62/// `DataFoundryService` holds a connection pool internally, it is advised to
63/// create one and reuse it. You do not need to wrap `DataFoundryService` in
64/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
65/// already uses an `Arc` internally.
66#[cfg(feature = "data-foundry-service")]
67#[cfg_attr(docsrs, doc(cfg(feature = "data-foundry-service")))]
68#[derive(Clone, Debug)]
69pub struct DataFoundryService {
70    inner: std::sync::Arc<dyn super::stub::dynamic::DataFoundryService>,
71}
72
73#[cfg(feature = "data-foundry-service")]
74impl DataFoundryService {
75    /// Returns a builder for [DataFoundryService].
76    ///
77    /// ```
78    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
79    /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
80    /// let client = DataFoundryService::builder().build().await?;
81    /// # Ok(()) }
82    /// ```
83    pub fn builder() -> super::builder::data_foundry_service::ClientBuilder {
84        crate::new_client_builder(super::builder::data_foundry_service::client::Factory)
85    }
86
87    /// Creates a new client from the provided stub.
88    ///
89    /// The most common case for calling this function is in tests mocking the
90    /// client's behavior.
91    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
92    where
93        T: super::stub::DataFoundryService + 'static,
94    {
95        Self { inner: stub.into() }
96    }
97
98    pub(crate) async fn new(
99        config: gaxi::options::ClientConfig,
100    ) -> crate::ClientBuilderResult<Self> {
101        let inner = Self::build_inner(config).await?;
102        Ok(Self { inner })
103    }
104
105    async fn build_inner(
106        conf: gaxi::options::ClientConfig,
107    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DataFoundryService>>
108    {
109        if gaxi::options::tracing_enabled(&conf) {
110            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
111        }
112        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
113    }
114
115    async fn build_transport(
116        conf: gaxi::options::ClientConfig,
117    ) -> crate::ClientBuilderResult<impl super::stub::DataFoundryService> {
118        super::transport::DataFoundryService::new(conf).await
119    }
120
121    async fn build_with_tracing(
122        conf: gaxi::options::ClientConfig,
123    ) -> crate::ClientBuilderResult<impl super::stub::DataFoundryService> {
124        Self::build_transport(conf)
125            .await
126            .map(super::tracing::DataFoundryService::new)
127    }
128
129    /// Generates synthetic data based on the provided configuration.
130    ///
131    /// # Example
132    /// ```
133    /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
134    /// use google_cloud_aiplatform_v1::Result;
135    /// async fn sample(
136    ///    client: &DataFoundryService
137    /// ) -> Result<()> {
138    ///     let response = client.generate_synthetic_data()
139    ///         /* set fields */
140    ///         .send().await?;
141    ///     println!("response {:?}", response);
142    ///     Ok(())
143    /// }
144    /// ```
145    pub fn generate_synthetic_data(
146        &self,
147    ) -> super::builder::data_foundry_service::GenerateSyntheticData {
148        super::builder::data_foundry_service::GenerateSyntheticData::new(self.inner.clone())
149    }
150
151    /// Lists information about the supported locations for this service.
152    ///
153    /// # Example
154    /// ```
155    /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
156    /// use google_cloud_gax::paginator::ItemPaginator as _;
157    /// use google_cloud_aiplatform_v1::Result;
158    /// async fn sample(
159    ///    client: &DataFoundryService
160    /// ) -> Result<()> {
161    ///     let mut list = client.list_locations()
162    ///         /* set fields */
163    ///         .by_item();
164    ///     while let Some(item) = list.next().await.transpose()? {
165    ///         println!("{:?}", item);
166    ///     }
167    ///     Ok(())
168    /// }
169    /// ```
170    pub fn list_locations(&self) -> super::builder::data_foundry_service::ListLocations {
171        super::builder::data_foundry_service::ListLocations::new(self.inner.clone())
172    }
173
174    /// Gets information about a location.
175    ///
176    /// # Example
177    /// ```
178    /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
179    /// use google_cloud_aiplatform_v1::Result;
180    /// async fn sample(
181    ///    client: &DataFoundryService
182    /// ) -> Result<()> {
183    ///     let response = client.get_location()
184    ///         /* set fields */
185    ///         .send().await?;
186    ///     println!("response {:?}", response);
187    ///     Ok(())
188    /// }
189    /// ```
190    pub fn get_location(&self) -> super::builder::data_foundry_service::GetLocation {
191        super::builder::data_foundry_service::GetLocation::new(self.inner.clone())
192    }
193
194    /// Sets the access control policy on the specified resource. Replaces
195    /// any existing policy.
196    ///
197    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
198    /// errors.
199    ///
200    /// # Example
201    /// ```
202    /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
203    /// use google_cloud_aiplatform_v1::Result;
204    /// async fn sample(
205    ///    client: &DataFoundryService
206    /// ) -> Result<()> {
207    ///     let response = client.set_iam_policy()
208    ///         /* set fields */
209    ///         .send().await?;
210    ///     println!("response {:?}", response);
211    ///     Ok(())
212    /// }
213    /// ```
214    pub fn set_iam_policy(&self) -> super::builder::data_foundry_service::SetIamPolicy {
215        super::builder::data_foundry_service::SetIamPolicy::new(self.inner.clone())
216    }
217
218    /// Gets the access control policy for a resource. Returns an empty policy
219    /// if the resource exists and does not have a policy set.
220    ///
221    /// # Example
222    /// ```
223    /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
224    /// use google_cloud_aiplatform_v1::Result;
225    /// async fn sample(
226    ///    client: &DataFoundryService
227    /// ) -> Result<()> {
228    ///     let response = client.get_iam_policy()
229    ///         /* set fields */
230    ///         .send().await?;
231    ///     println!("response {:?}", response);
232    ///     Ok(())
233    /// }
234    /// ```
235    pub fn get_iam_policy(&self) -> super::builder::data_foundry_service::GetIamPolicy {
236        super::builder::data_foundry_service::GetIamPolicy::new(self.inner.clone())
237    }
238
239    /// Returns permissions that a caller has on the specified resource. If the
240    /// resource does not exist, this will return an empty set of
241    /// permissions, not a `NOT_FOUND` error.
242    ///
243    /// Note: This operation is designed to be used for building
244    /// permission-aware UIs and command-line tools, not for authorization
245    /// checking. This operation may "fail open" without warning.
246    ///
247    /// # Example
248    /// ```
249    /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
250    /// use google_cloud_aiplatform_v1::Result;
251    /// async fn sample(
252    ///    client: &DataFoundryService
253    /// ) -> Result<()> {
254    ///     let response = client.test_iam_permissions()
255    ///         /* set fields */
256    ///         .send().await?;
257    ///     println!("response {:?}", response);
258    ///     Ok(())
259    /// }
260    /// ```
261    pub fn test_iam_permissions(&self) -> super::builder::data_foundry_service::TestIamPermissions {
262        super::builder::data_foundry_service::TestIamPermissions::new(self.inner.clone())
263    }
264
265    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
266    ///
267    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
268    ///
269    /// # Example
270    /// ```
271    /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
272    /// use google_cloud_gax::paginator::ItemPaginator as _;
273    /// use google_cloud_aiplatform_v1::Result;
274    /// async fn sample(
275    ///    client: &DataFoundryService
276    /// ) -> Result<()> {
277    ///     let mut list = client.list_operations()
278    ///         /* set fields */
279    ///         .by_item();
280    ///     while let Some(item) = list.next().await.transpose()? {
281    ///         println!("{:?}", item);
282    ///     }
283    ///     Ok(())
284    /// }
285    /// ```
286    pub fn list_operations(&self) -> super::builder::data_foundry_service::ListOperations {
287        super::builder::data_foundry_service::ListOperations::new(self.inner.clone())
288    }
289
290    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
291    ///
292    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
293    ///
294    /// # Example
295    /// ```
296    /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
297    /// use google_cloud_aiplatform_v1::Result;
298    /// async fn sample(
299    ///    client: &DataFoundryService
300    /// ) -> Result<()> {
301    ///     let response = client.get_operation()
302    ///         /* set fields */
303    ///         .send().await?;
304    ///     println!("response {:?}", response);
305    ///     Ok(())
306    /// }
307    /// ```
308    pub fn get_operation(&self) -> super::builder::data_foundry_service::GetOperation {
309        super::builder::data_foundry_service::GetOperation::new(self.inner.clone())
310    }
311
312    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
313    ///
314    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
315    ///
316    /// # Example
317    /// ```
318    /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
319    /// use google_cloud_aiplatform_v1::Result;
320    /// async fn sample(
321    ///    client: &DataFoundryService
322    /// ) -> Result<()> {
323    ///     client.delete_operation()
324    ///         /* set fields */
325    ///         .send().await?;
326    ///     Ok(())
327    /// }
328    /// ```
329    pub fn delete_operation(&self) -> super::builder::data_foundry_service::DeleteOperation {
330        super::builder::data_foundry_service::DeleteOperation::new(self.inner.clone())
331    }
332
333    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
334    ///
335    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
336    ///
337    /// # Example
338    /// ```
339    /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
340    /// use google_cloud_aiplatform_v1::Result;
341    /// async fn sample(
342    ///    client: &DataFoundryService
343    /// ) -> Result<()> {
344    ///     client.cancel_operation()
345    ///         /* set fields */
346    ///         .send().await?;
347    ///     Ok(())
348    /// }
349    /// ```
350    pub fn cancel_operation(&self) -> super::builder::data_foundry_service::CancelOperation {
351        super::builder::data_foundry_service::CancelOperation::new(self.inner.clone())
352    }
353
354    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
355    ///
356    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
357    ///
358    /// # Example
359    /// ```
360    /// # use google_cloud_aiplatform_v1::client::DataFoundryService;
361    /// use google_cloud_aiplatform_v1::Result;
362    /// async fn sample(
363    ///    client: &DataFoundryService
364    /// ) -> Result<()> {
365    ///     let response = client.wait_operation()
366    ///         /* set fields */
367    ///         .send().await?;
368    ///     println!("response {:?}", response);
369    ///     Ok(())
370    /// }
371    /// ```
372    pub fn wait_operation(&self) -> super::builder::data_foundry_service::WaitOperation {
373        super::builder::data_foundry_service::WaitOperation::new(self.inner.clone())
374    }
375}
376
377/// Implements a client for the Vertex AI API.
378///
379/// # Example
380/// ```
381/// # use google_cloud_aiplatform_v1::client::DatasetService;
382/// use google_cloud_gax::paginator::ItemPaginator as _;
383/// async fn sample(
384///    parent: &str,
385/// ) -> anyhow::Result<()> {
386///     let client = DatasetService::builder().build().await?;
387///     let mut list = client.list_datasets()
388///         .set_parent(parent)
389///         .by_item();
390///     while let Some(item) = list.next().await.transpose()? {
391///         println!("{:?}", item);
392///     }
393///     Ok(())
394/// }
395/// ```
396///
397/// # Service Description
398///
399/// The service that manages Vertex AI Dataset and its child resources.
400///
401/// # Configuration
402///
403/// To configure `DatasetService` use the `with_*` methods in the type returned
404/// by [builder()][DatasetService::builder]. The default configuration should
405/// work for most applications. Common configuration changes include
406///
407/// * [with_endpoint()]: by default this client uses the global default endpoint
408///   (`https://aiplatform.googleapis.com`). Applications using regional
409///   endpoints or running in restricted networks (e.g. a network configured
410///   with [Private Google Access with VPC Service Controls]) may want to
411///   override this default.
412/// * [with_credentials()]: by default this client uses
413///   [Application Default Credentials]. Applications using custom
414///   authentication may need to override this default.
415///
416/// [with_endpoint()]: super::builder::dataset_service::ClientBuilder::with_endpoint
417/// [with_credentials()]: super::builder::dataset_service::ClientBuilder::with_credentials
418/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
419/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
420///
421/// # Pooling and Cloning
422///
423/// `DatasetService` holds a connection pool internally, it is advised to
424/// create one and reuse it. You do not need to wrap `DatasetService` in
425/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
426/// already uses an `Arc` internally.
427#[cfg(feature = "dataset-service")]
428#[cfg_attr(docsrs, doc(cfg(feature = "dataset-service")))]
429#[derive(Clone, Debug)]
430pub struct DatasetService {
431    inner: std::sync::Arc<dyn super::stub::dynamic::DatasetService>,
432}
433
434#[cfg(feature = "dataset-service")]
435impl DatasetService {
436    /// Returns a builder for [DatasetService].
437    ///
438    /// ```
439    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
440    /// # use google_cloud_aiplatform_v1::client::DatasetService;
441    /// let client = DatasetService::builder().build().await?;
442    /// # Ok(()) }
443    /// ```
444    pub fn builder() -> super::builder::dataset_service::ClientBuilder {
445        crate::new_client_builder(super::builder::dataset_service::client::Factory)
446    }
447
448    /// Creates a new client from the provided stub.
449    ///
450    /// The most common case for calling this function is in tests mocking the
451    /// client's behavior.
452    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
453    where
454        T: super::stub::DatasetService + 'static,
455    {
456        Self { inner: stub.into() }
457    }
458
459    pub(crate) async fn new(
460        config: gaxi::options::ClientConfig,
461    ) -> crate::ClientBuilderResult<Self> {
462        let inner = Self::build_inner(config).await?;
463        Ok(Self { inner })
464    }
465
466    async fn build_inner(
467        conf: gaxi::options::ClientConfig,
468    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DatasetService>> {
469        if gaxi::options::tracing_enabled(&conf) {
470            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
471        }
472        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
473    }
474
475    async fn build_transport(
476        conf: gaxi::options::ClientConfig,
477    ) -> crate::ClientBuilderResult<impl super::stub::DatasetService> {
478        super::transport::DatasetService::new(conf).await
479    }
480
481    async fn build_with_tracing(
482        conf: gaxi::options::ClientConfig,
483    ) -> crate::ClientBuilderResult<impl super::stub::DatasetService> {
484        Self::build_transport(conf)
485            .await
486            .map(super::tracing::DatasetService::new)
487    }
488
489    /// Creates a Dataset.
490    ///
491    /// # Long running operations
492    ///
493    /// This method is used to start, and/or poll a [long-running Operation].
494    /// The [Working with long-running operations] chapter in the [user guide]
495    /// covers these operations in detail.
496    ///
497    /// [long-running operation]: https://google.aip.dev/151
498    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
499    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
500    ///
501    /// # Example
502    /// ```
503    /// # use google_cloud_aiplatform_v1::client::DatasetService;
504    /// use google_cloud_lro::Poller;
505    /// use google_cloud_aiplatform_v1::model::Dataset;
506    /// use google_cloud_aiplatform_v1::Result;
507    /// async fn sample(
508    ///    client: &DatasetService, parent: &str
509    /// ) -> Result<()> {
510    ///     let response = client.create_dataset()
511    ///         .set_parent(parent)
512    ///         .set_dataset(
513    ///             Dataset::new()/* set fields */
514    ///         )
515    ///         .poller().until_done().await?;
516    ///     println!("response {:?}", response);
517    ///     Ok(())
518    /// }
519    /// ```
520    pub fn create_dataset(&self) -> super::builder::dataset_service::CreateDataset {
521        super::builder::dataset_service::CreateDataset::new(self.inner.clone())
522    }
523
524    /// Gets a Dataset.
525    ///
526    /// # Example
527    /// ```
528    /// # use google_cloud_aiplatform_v1::client::DatasetService;
529    /// use google_cloud_aiplatform_v1::Result;
530    /// async fn sample(
531    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str
532    /// ) -> Result<()> {
533    ///     let response = client.get_dataset()
534    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}"))
535    ///         .send().await?;
536    ///     println!("response {:?}", response);
537    ///     Ok(())
538    /// }
539    /// ```
540    pub fn get_dataset(&self) -> super::builder::dataset_service::GetDataset {
541        super::builder::dataset_service::GetDataset::new(self.inner.clone())
542    }
543
544    /// Updates a Dataset.
545    ///
546    /// # Example
547    /// ```
548    /// # use google_cloud_aiplatform_v1::client::DatasetService;
549    /// # extern crate wkt as google_cloud_wkt;
550    /// use google_cloud_wkt::FieldMask;
551    /// use google_cloud_aiplatform_v1::model::Dataset;
552    /// use google_cloud_aiplatform_v1::Result;
553    /// async fn sample(
554    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str
555    /// ) -> Result<()> {
556    ///     let response = client.update_dataset()
557    ///         .set_dataset(
558    ///             Dataset::new().set_name(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}"))/* set fields */
559    ///         )
560    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
561    ///         .send().await?;
562    ///     println!("response {:?}", response);
563    ///     Ok(())
564    /// }
565    /// ```
566    pub fn update_dataset(&self) -> super::builder::dataset_service::UpdateDataset {
567        super::builder::dataset_service::UpdateDataset::new(self.inner.clone())
568    }
569
570    /// Lists Datasets in a Location.
571    ///
572    /// # Example
573    /// ```
574    /// # use google_cloud_aiplatform_v1::client::DatasetService;
575    /// use google_cloud_gax::paginator::ItemPaginator as _;
576    /// use google_cloud_aiplatform_v1::Result;
577    /// async fn sample(
578    ///    client: &DatasetService, parent: &str
579    /// ) -> Result<()> {
580    ///     let mut list = client.list_datasets()
581    ///         .set_parent(parent)
582    ///         .by_item();
583    ///     while let Some(item) = list.next().await.transpose()? {
584    ///         println!("{:?}", item);
585    ///     }
586    ///     Ok(())
587    /// }
588    /// ```
589    pub fn list_datasets(&self) -> super::builder::dataset_service::ListDatasets {
590        super::builder::dataset_service::ListDatasets::new(self.inner.clone())
591    }
592
593    /// Deletes a Dataset.
594    ///
595    /// # Long running operations
596    ///
597    /// This method is used to start, and/or poll a [long-running Operation].
598    /// The [Working with long-running operations] chapter in the [user guide]
599    /// covers these operations in detail.
600    ///
601    /// [long-running operation]: https://google.aip.dev/151
602    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
603    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
604    ///
605    /// # Example
606    /// ```
607    /// # use google_cloud_aiplatform_v1::client::DatasetService;
608    /// use google_cloud_lro::Poller;
609    /// use google_cloud_aiplatform_v1::Result;
610    /// async fn sample(
611    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str
612    /// ) -> Result<()> {
613    ///     client.delete_dataset()
614    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}"))
615    ///         .poller().until_done().await?;
616    ///     Ok(())
617    /// }
618    /// ```
619    pub fn delete_dataset(&self) -> super::builder::dataset_service::DeleteDataset {
620        super::builder::dataset_service::DeleteDataset::new(self.inner.clone())
621    }
622
623    /// Imports data into a Dataset.
624    ///
625    /// # Long running operations
626    ///
627    /// This method is used to start, and/or poll a [long-running Operation].
628    /// The [Working with long-running operations] chapter in the [user guide]
629    /// covers these operations in detail.
630    ///
631    /// [long-running operation]: https://google.aip.dev/151
632    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
633    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
634    ///
635    /// # Example
636    /// ```
637    /// # use google_cloud_aiplatform_v1::client::DatasetService;
638    /// use google_cloud_lro::Poller;
639    /// use google_cloud_aiplatform_v1::Result;
640    /// async fn sample(
641    ///    client: &DatasetService
642    /// ) -> Result<()> {
643    ///     let response = client.import_data()
644    ///         /* set fields */
645    ///         .poller().until_done().await?;
646    ///     println!("response {:?}", response);
647    ///     Ok(())
648    /// }
649    /// ```
650    pub fn import_data(&self) -> super::builder::dataset_service::ImportData {
651        super::builder::dataset_service::ImportData::new(self.inner.clone())
652    }
653
654    /// Exports data from a Dataset.
655    ///
656    /// # Long running operations
657    ///
658    /// This method is used to start, and/or poll a [long-running Operation].
659    /// The [Working with long-running operations] chapter in the [user guide]
660    /// covers these operations in detail.
661    ///
662    /// [long-running operation]: https://google.aip.dev/151
663    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
664    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
665    ///
666    /// # Example
667    /// ```
668    /// # use google_cloud_aiplatform_v1::client::DatasetService;
669    /// use google_cloud_lro::Poller;
670    /// use google_cloud_aiplatform_v1::Result;
671    /// async fn sample(
672    ///    client: &DatasetService
673    /// ) -> Result<()> {
674    ///     let response = client.export_data()
675    ///         /* set fields */
676    ///         .poller().until_done().await?;
677    ///     println!("response {:?}", response);
678    ///     Ok(())
679    /// }
680    /// ```
681    pub fn export_data(&self) -> super::builder::dataset_service::ExportData {
682        super::builder::dataset_service::ExportData::new(self.inner.clone())
683    }
684
685    /// Create a version from a Dataset.
686    ///
687    /// # Long running operations
688    ///
689    /// This method is used to start, and/or poll a [long-running Operation].
690    /// The [Working with long-running operations] chapter in the [user guide]
691    /// covers these operations in detail.
692    ///
693    /// [long-running operation]: https://google.aip.dev/151
694    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
695    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
696    ///
697    /// # Example
698    /// ```
699    /// # use google_cloud_aiplatform_v1::client::DatasetService;
700    /// use google_cloud_lro::Poller;
701    /// use google_cloud_aiplatform_v1::model::DatasetVersion;
702    /// use google_cloud_aiplatform_v1::Result;
703    /// async fn sample(
704    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str
705    /// ) -> Result<()> {
706    ///     let response = client.create_dataset_version()
707    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}"))
708    ///         .set_dataset_version(
709    ///             DatasetVersion::new()/* set fields */
710    ///         )
711    ///         .poller().until_done().await?;
712    ///     println!("response {:?}", response);
713    ///     Ok(())
714    /// }
715    /// ```
716    pub fn create_dataset_version(&self) -> super::builder::dataset_service::CreateDatasetVersion {
717        super::builder::dataset_service::CreateDatasetVersion::new(self.inner.clone())
718    }
719
720    /// Updates a DatasetVersion.
721    ///
722    /// # Example
723    /// ```
724    /// # use google_cloud_aiplatform_v1::client::DatasetService;
725    /// # extern crate wkt as google_cloud_wkt;
726    /// use google_cloud_wkt::FieldMask;
727    /// use google_cloud_aiplatform_v1::model::DatasetVersion;
728    /// use google_cloud_aiplatform_v1::Result;
729    /// async fn sample(
730    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str, dataset_version_id: &str
731    /// ) -> Result<()> {
732    ///     let response = client.update_dataset_version()
733    ///         .set_dataset_version(
734    ///             DatasetVersion::new().set_name(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/datasetVersions/{dataset_version_id}"))/* set fields */
735    ///         )
736    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
737    ///         .send().await?;
738    ///     println!("response {:?}", response);
739    ///     Ok(())
740    /// }
741    /// ```
742    pub fn update_dataset_version(&self) -> super::builder::dataset_service::UpdateDatasetVersion {
743        super::builder::dataset_service::UpdateDatasetVersion::new(self.inner.clone())
744    }
745
746    /// Deletes a Dataset version.
747    ///
748    /// # Long running operations
749    ///
750    /// This method is used to start, and/or poll a [long-running Operation].
751    /// The [Working with long-running operations] chapter in the [user guide]
752    /// covers these operations in detail.
753    ///
754    /// [long-running operation]: https://google.aip.dev/151
755    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
756    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
757    ///
758    /// # Example
759    /// ```
760    /// # use google_cloud_aiplatform_v1::client::DatasetService;
761    /// use google_cloud_lro::Poller;
762    /// use google_cloud_aiplatform_v1::Result;
763    /// async fn sample(
764    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str, dataset_version_id: &str
765    /// ) -> Result<()> {
766    ///     client.delete_dataset_version()
767    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/datasetVersions/{dataset_version_id}"))
768    ///         .poller().until_done().await?;
769    ///     Ok(())
770    /// }
771    /// ```
772    pub fn delete_dataset_version(&self) -> super::builder::dataset_service::DeleteDatasetVersion {
773        super::builder::dataset_service::DeleteDatasetVersion::new(self.inner.clone())
774    }
775
776    /// Gets a Dataset version.
777    ///
778    /// # Example
779    /// ```
780    /// # use google_cloud_aiplatform_v1::client::DatasetService;
781    /// use google_cloud_aiplatform_v1::Result;
782    /// async fn sample(
783    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str, dataset_version_id: &str
784    /// ) -> Result<()> {
785    ///     let response = client.get_dataset_version()
786    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/datasetVersions/{dataset_version_id}"))
787    ///         .send().await?;
788    ///     println!("response {:?}", response);
789    ///     Ok(())
790    /// }
791    /// ```
792    pub fn get_dataset_version(&self) -> super::builder::dataset_service::GetDatasetVersion {
793        super::builder::dataset_service::GetDatasetVersion::new(self.inner.clone())
794    }
795
796    /// Lists DatasetVersions in a Dataset.
797    ///
798    /// # Example
799    /// ```
800    /// # use google_cloud_aiplatform_v1::client::DatasetService;
801    /// use google_cloud_gax::paginator::ItemPaginator as _;
802    /// use google_cloud_aiplatform_v1::Result;
803    /// async fn sample(
804    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str
805    /// ) -> Result<()> {
806    ///     let mut list = client.list_dataset_versions()
807    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}"))
808    ///         .by_item();
809    ///     while let Some(item) = list.next().await.transpose()? {
810    ///         println!("{:?}", item);
811    ///     }
812    ///     Ok(())
813    /// }
814    /// ```
815    pub fn list_dataset_versions(&self) -> super::builder::dataset_service::ListDatasetVersions {
816        super::builder::dataset_service::ListDatasetVersions::new(self.inner.clone())
817    }
818
819    /// Restores a dataset version.
820    ///
821    /// # Long running operations
822    ///
823    /// This method is used to start, and/or poll a [long-running Operation].
824    /// The [Working with long-running operations] chapter in the [user guide]
825    /// covers these operations in detail.
826    ///
827    /// [long-running operation]: https://google.aip.dev/151
828    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
829    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
830    ///
831    /// # Example
832    /// ```
833    /// # use google_cloud_aiplatform_v1::client::DatasetService;
834    /// use google_cloud_lro::Poller;
835    /// use google_cloud_aiplatform_v1::Result;
836    /// async fn sample(
837    ///    client: &DatasetService
838    /// ) -> Result<()> {
839    ///     let response = client.restore_dataset_version()
840    ///         /* set fields */
841    ///         .poller().until_done().await?;
842    ///     println!("response {:?}", response);
843    ///     Ok(())
844    /// }
845    /// ```
846    pub fn restore_dataset_version(
847        &self,
848    ) -> super::builder::dataset_service::RestoreDatasetVersion {
849        super::builder::dataset_service::RestoreDatasetVersion::new(self.inner.clone())
850    }
851
852    /// Lists DataItems in a Dataset.
853    ///
854    /// # Example
855    /// ```
856    /// # use google_cloud_aiplatform_v1::client::DatasetService;
857    /// use google_cloud_gax::paginator::ItemPaginator as _;
858    /// use google_cloud_aiplatform_v1::Result;
859    /// async fn sample(
860    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str
861    /// ) -> Result<()> {
862    ///     let mut list = client.list_data_items()
863    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}"))
864    ///         .by_item();
865    ///     while let Some(item) = list.next().await.transpose()? {
866    ///         println!("{:?}", item);
867    ///     }
868    ///     Ok(())
869    /// }
870    /// ```
871    pub fn list_data_items(&self) -> super::builder::dataset_service::ListDataItems {
872        super::builder::dataset_service::ListDataItems::new(self.inner.clone())
873    }
874
875    /// Searches DataItems in a Dataset.
876    ///
877    /// # Example
878    /// ```
879    /// # use google_cloud_aiplatform_v1::client::DatasetService;
880    /// use google_cloud_gax::paginator::ItemPaginator as _;
881    /// use google_cloud_aiplatform_v1::Result;
882    /// async fn sample(
883    ///    client: &DatasetService
884    /// ) -> Result<()> {
885    ///     let mut list = client.search_data_items()
886    ///         /* set fields */
887    ///         .by_item();
888    ///     while let Some(item) = list.next().await.transpose()? {
889    ///         println!("{:?}", item);
890    ///     }
891    ///     Ok(())
892    /// }
893    /// ```
894    pub fn search_data_items(&self) -> super::builder::dataset_service::SearchDataItems {
895        super::builder::dataset_service::SearchDataItems::new(self.inner.clone())
896    }
897
898    /// Lists SavedQueries in a Dataset.
899    ///
900    /// # Example
901    /// ```
902    /// # use google_cloud_aiplatform_v1::client::DatasetService;
903    /// use google_cloud_gax::paginator::ItemPaginator as _;
904    /// use google_cloud_aiplatform_v1::Result;
905    /// async fn sample(
906    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str
907    /// ) -> Result<()> {
908    ///     let mut list = client.list_saved_queries()
909    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}"))
910    ///         .by_item();
911    ///     while let Some(item) = list.next().await.transpose()? {
912    ///         println!("{:?}", item);
913    ///     }
914    ///     Ok(())
915    /// }
916    /// ```
917    pub fn list_saved_queries(&self) -> super::builder::dataset_service::ListSavedQueries {
918        super::builder::dataset_service::ListSavedQueries::new(self.inner.clone())
919    }
920
921    /// Deletes a SavedQuery.
922    ///
923    /// # Long running operations
924    ///
925    /// This method is used to start, and/or poll a [long-running Operation].
926    /// The [Working with long-running operations] chapter in the [user guide]
927    /// covers these operations in detail.
928    ///
929    /// [long-running operation]: https://google.aip.dev/151
930    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
931    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
932    ///
933    /// # Example
934    /// ```
935    /// # use google_cloud_aiplatform_v1::client::DatasetService;
936    /// use google_cloud_lro::Poller;
937    /// use google_cloud_aiplatform_v1::Result;
938    /// async fn sample(
939    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str, saved_query_id: &str
940    /// ) -> Result<()> {
941    ///     client.delete_saved_query()
942    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/savedQueries/{saved_query_id}"))
943    ///         .poller().until_done().await?;
944    ///     Ok(())
945    /// }
946    /// ```
947    pub fn delete_saved_query(&self) -> super::builder::dataset_service::DeleteSavedQuery {
948        super::builder::dataset_service::DeleteSavedQuery::new(self.inner.clone())
949    }
950
951    /// Gets an AnnotationSpec.
952    ///
953    /// # Example
954    /// ```
955    /// # use google_cloud_aiplatform_v1::client::DatasetService;
956    /// use google_cloud_aiplatform_v1::Result;
957    /// async fn sample(
958    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str, annotation_spec_id: &str
959    /// ) -> Result<()> {
960    ///     let response = client.get_annotation_spec()
961    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}"))
962    ///         .send().await?;
963    ///     println!("response {:?}", response);
964    ///     Ok(())
965    /// }
966    /// ```
967    pub fn get_annotation_spec(&self) -> super::builder::dataset_service::GetAnnotationSpec {
968        super::builder::dataset_service::GetAnnotationSpec::new(self.inner.clone())
969    }
970
971    /// Lists Annotations belongs to a dataitem.
972    ///
973    /// # Example
974    /// ```
975    /// # use google_cloud_aiplatform_v1::client::DatasetService;
976    /// use google_cloud_gax::paginator::ItemPaginator as _;
977    /// use google_cloud_aiplatform_v1::Result;
978    /// async fn sample(
979    ///    client: &DatasetService, project_id: &str, location_id: &str, dataset_id: &str, data_item_id: &str
980    /// ) -> Result<()> {
981    ///     let mut list = client.list_annotations()
982    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/dataItems/{data_item_id}"))
983    ///         .by_item();
984    ///     while let Some(item) = list.next().await.transpose()? {
985    ///         println!("{:?}", item);
986    ///     }
987    ///     Ok(())
988    /// }
989    /// ```
990    pub fn list_annotations(&self) -> super::builder::dataset_service::ListAnnotations {
991        super::builder::dataset_service::ListAnnotations::new(self.inner.clone())
992    }
993
994    /// Lists information about the supported locations for this service.
995    ///
996    /// # Example
997    /// ```
998    /// # use google_cloud_aiplatform_v1::client::DatasetService;
999    /// use google_cloud_gax::paginator::ItemPaginator as _;
1000    /// use google_cloud_aiplatform_v1::Result;
1001    /// async fn sample(
1002    ///    client: &DatasetService
1003    /// ) -> Result<()> {
1004    ///     let mut list = client.list_locations()
1005    ///         /* set fields */
1006    ///         .by_item();
1007    ///     while let Some(item) = list.next().await.transpose()? {
1008    ///         println!("{:?}", item);
1009    ///     }
1010    ///     Ok(())
1011    /// }
1012    /// ```
1013    pub fn list_locations(&self) -> super::builder::dataset_service::ListLocations {
1014        super::builder::dataset_service::ListLocations::new(self.inner.clone())
1015    }
1016
1017    /// Gets information about a location.
1018    ///
1019    /// # Example
1020    /// ```
1021    /// # use google_cloud_aiplatform_v1::client::DatasetService;
1022    /// use google_cloud_aiplatform_v1::Result;
1023    /// async fn sample(
1024    ///    client: &DatasetService
1025    /// ) -> Result<()> {
1026    ///     let response = client.get_location()
1027    ///         /* set fields */
1028    ///         .send().await?;
1029    ///     println!("response {:?}", response);
1030    ///     Ok(())
1031    /// }
1032    /// ```
1033    pub fn get_location(&self) -> super::builder::dataset_service::GetLocation {
1034        super::builder::dataset_service::GetLocation::new(self.inner.clone())
1035    }
1036
1037    /// Sets the access control policy on the specified resource. Replaces
1038    /// any existing policy.
1039    ///
1040    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1041    /// errors.
1042    ///
1043    /// # Example
1044    /// ```
1045    /// # use google_cloud_aiplatform_v1::client::DatasetService;
1046    /// use google_cloud_aiplatform_v1::Result;
1047    /// async fn sample(
1048    ///    client: &DatasetService
1049    /// ) -> Result<()> {
1050    ///     let response = client.set_iam_policy()
1051    ///         /* set fields */
1052    ///         .send().await?;
1053    ///     println!("response {:?}", response);
1054    ///     Ok(())
1055    /// }
1056    /// ```
1057    pub fn set_iam_policy(&self) -> super::builder::dataset_service::SetIamPolicy {
1058        super::builder::dataset_service::SetIamPolicy::new(self.inner.clone())
1059    }
1060
1061    /// Gets the access control policy for a resource. Returns an empty policy
1062    /// if the resource exists and does not have a policy set.
1063    ///
1064    /// # Example
1065    /// ```
1066    /// # use google_cloud_aiplatform_v1::client::DatasetService;
1067    /// use google_cloud_aiplatform_v1::Result;
1068    /// async fn sample(
1069    ///    client: &DatasetService
1070    /// ) -> Result<()> {
1071    ///     let response = client.get_iam_policy()
1072    ///         /* set fields */
1073    ///         .send().await?;
1074    ///     println!("response {:?}", response);
1075    ///     Ok(())
1076    /// }
1077    /// ```
1078    pub fn get_iam_policy(&self) -> super::builder::dataset_service::GetIamPolicy {
1079        super::builder::dataset_service::GetIamPolicy::new(self.inner.clone())
1080    }
1081
1082    /// Returns permissions that a caller has on the specified resource. If the
1083    /// resource does not exist, this will return an empty set of
1084    /// permissions, not a `NOT_FOUND` error.
1085    ///
1086    /// Note: This operation is designed to be used for building
1087    /// permission-aware UIs and command-line tools, not for authorization
1088    /// checking. This operation may "fail open" without warning.
1089    ///
1090    /// # Example
1091    /// ```
1092    /// # use google_cloud_aiplatform_v1::client::DatasetService;
1093    /// use google_cloud_aiplatform_v1::Result;
1094    /// async fn sample(
1095    ///    client: &DatasetService
1096    /// ) -> Result<()> {
1097    ///     let response = client.test_iam_permissions()
1098    ///         /* set fields */
1099    ///         .send().await?;
1100    ///     println!("response {:?}", response);
1101    ///     Ok(())
1102    /// }
1103    /// ```
1104    pub fn test_iam_permissions(&self) -> super::builder::dataset_service::TestIamPermissions {
1105        super::builder::dataset_service::TestIamPermissions::new(self.inner.clone())
1106    }
1107
1108    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1109    ///
1110    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1111    ///
1112    /// # Example
1113    /// ```
1114    /// # use google_cloud_aiplatform_v1::client::DatasetService;
1115    /// use google_cloud_gax::paginator::ItemPaginator as _;
1116    /// use google_cloud_aiplatform_v1::Result;
1117    /// async fn sample(
1118    ///    client: &DatasetService
1119    /// ) -> Result<()> {
1120    ///     let mut list = client.list_operations()
1121    ///         /* set fields */
1122    ///         .by_item();
1123    ///     while let Some(item) = list.next().await.transpose()? {
1124    ///         println!("{:?}", item);
1125    ///     }
1126    ///     Ok(())
1127    /// }
1128    /// ```
1129    pub fn list_operations(&self) -> super::builder::dataset_service::ListOperations {
1130        super::builder::dataset_service::ListOperations::new(self.inner.clone())
1131    }
1132
1133    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1134    ///
1135    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1136    ///
1137    /// # Example
1138    /// ```
1139    /// # use google_cloud_aiplatform_v1::client::DatasetService;
1140    /// use google_cloud_aiplatform_v1::Result;
1141    /// async fn sample(
1142    ///    client: &DatasetService
1143    /// ) -> Result<()> {
1144    ///     let response = client.get_operation()
1145    ///         /* set fields */
1146    ///         .send().await?;
1147    ///     println!("response {:?}", response);
1148    ///     Ok(())
1149    /// }
1150    /// ```
1151    pub fn get_operation(&self) -> super::builder::dataset_service::GetOperation {
1152        super::builder::dataset_service::GetOperation::new(self.inner.clone())
1153    }
1154
1155    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1156    ///
1157    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1158    ///
1159    /// # Example
1160    /// ```
1161    /// # use google_cloud_aiplatform_v1::client::DatasetService;
1162    /// use google_cloud_aiplatform_v1::Result;
1163    /// async fn sample(
1164    ///    client: &DatasetService
1165    /// ) -> Result<()> {
1166    ///     client.delete_operation()
1167    ///         /* set fields */
1168    ///         .send().await?;
1169    ///     Ok(())
1170    /// }
1171    /// ```
1172    pub fn delete_operation(&self) -> super::builder::dataset_service::DeleteOperation {
1173        super::builder::dataset_service::DeleteOperation::new(self.inner.clone())
1174    }
1175
1176    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1177    ///
1178    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1179    ///
1180    /// # Example
1181    /// ```
1182    /// # use google_cloud_aiplatform_v1::client::DatasetService;
1183    /// use google_cloud_aiplatform_v1::Result;
1184    /// async fn sample(
1185    ///    client: &DatasetService
1186    /// ) -> Result<()> {
1187    ///     client.cancel_operation()
1188    ///         /* set fields */
1189    ///         .send().await?;
1190    ///     Ok(())
1191    /// }
1192    /// ```
1193    pub fn cancel_operation(&self) -> super::builder::dataset_service::CancelOperation {
1194        super::builder::dataset_service::CancelOperation::new(self.inner.clone())
1195    }
1196
1197    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1198    ///
1199    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1200    ///
1201    /// # Example
1202    /// ```
1203    /// # use google_cloud_aiplatform_v1::client::DatasetService;
1204    /// use google_cloud_aiplatform_v1::Result;
1205    /// async fn sample(
1206    ///    client: &DatasetService
1207    /// ) -> Result<()> {
1208    ///     let response = client.wait_operation()
1209    ///         /* set fields */
1210    ///         .send().await?;
1211    ///     println!("response {:?}", response);
1212    ///     Ok(())
1213    /// }
1214    /// ```
1215    pub fn wait_operation(&self) -> super::builder::dataset_service::WaitOperation {
1216        super::builder::dataset_service::WaitOperation::new(self.inner.clone())
1217    }
1218}
1219
1220/// Implements a client for the Vertex AI API.
1221///
1222/// # Example
1223/// ```
1224/// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1225/// use google_cloud_gax::paginator::ItemPaginator as _;
1226/// async fn sample(
1227///    parent: &str,
1228/// ) -> anyhow::Result<()> {
1229///     let client = DeploymentResourcePoolService::builder().build().await?;
1230///     let mut list = client.list_deployment_resource_pools()
1231///         .set_parent(parent)
1232///         .by_item();
1233///     while let Some(item) = list.next().await.transpose()? {
1234///         println!("{:?}", item);
1235///     }
1236///     Ok(())
1237/// }
1238/// ```
1239///
1240/// # Service Description
1241///
1242/// A service that manages the DeploymentResourcePool resource.
1243///
1244/// # Configuration
1245///
1246/// To configure `DeploymentResourcePoolService` use the `with_*` methods in the type returned
1247/// by [builder()][DeploymentResourcePoolService::builder]. The default configuration should
1248/// work for most applications. Common configuration changes include
1249///
1250/// * [with_endpoint()]: by default this client uses the global default endpoint
1251///   (`https://aiplatform.googleapis.com`). Applications using regional
1252///   endpoints or running in restricted networks (e.g. a network configured
1253///   with [Private Google Access with VPC Service Controls]) may want to
1254///   override this default.
1255/// * [with_credentials()]: by default this client uses
1256///   [Application Default Credentials]. Applications using custom
1257///   authentication may need to override this default.
1258///
1259/// [with_endpoint()]: super::builder::deployment_resource_pool_service::ClientBuilder::with_endpoint
1260/// [with_credentials()]: super::builder::deployment_resource_pool_service::ClientBuilder::with_credentials
1261/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1262/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1263///
1264/// # Pooling and Cloning
1265///
1266/// `DeploymentResourcePoolService` holds a connection pool internally, it is advised to
1267/// create one and reuse it. You do not need to wrap `DeploymentResourcePoolService` in
1268/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1269/// already uses an `Arc` internally.
1270#[cfg(feature = "deployment-resource-pool-service")]
1271#[cfg_attr(docsrs, doc(cfg(feature = "deployment-resource-pool-service")))]
1272#[derive(Clone, Debug)]
1273pub struct DeploymentResourcePoolService {
1274    inner: std::sync::Arc<dyn super::stub::dynamic::DeploymentResourcePoolService>,
1275}
1276
1277#[cfg(feature = "deployment-resource-pool-service")]
1278impl DeploymentResourcePoolService {
1279    /// Returns a builder for [DeploymentResourcePoolService].
1280    ///
1281    /// ```
1282    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1283    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1284    /// let client = DeploymentResourcePoolService::builder().build().await?;
1285    /// # Ok(()) }
1286    /// ```
1287    pub fn builder() -> super::builder::deployment_resource_pool_service::ClientBuilder {
1288        crate::new_client_builder(super::builder::deployment_resource_pool_service::client::Factory)
1289    }
1290
1291    /// Creates a new client from the provided stub.
1292    ///
1293    /// The most common case for calling this function is in tests mocking the
1294    /// client's behavior.
1295    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1296    where
1297        T: super::stub::DeploymentResourcePoolService + 'static,
1298    {
1299        Self { inner: stub.into() }
1300    }
1301
1302    pub(crate) async fn new(
1303        config: gaxi::options::ClientConfig,
1304    ) -> crate::ClientBuilderResult<Self> {
1305        let inner = Self::build_inner(config).await?;
1306        Ok(Self { inner })
1307    }
1308
1309    async fn build_inner(
1310        conf: gaxi::options::ClientConfig,
1311    ) -> crate::ClientBuilderResult<
1312        std::sync::Arc<dyn super::stub::dynamic::DeploymentResourcePoolService>,
1313    > {
1314        if gaxi::options::tracing_enabled(&conf) {
1315            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1316        }
1317        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1318    }
1319
1320    async fn build_transport(
1321        conf: gaxi::options::ClientConfig,
1322    ) -> crate::ClientBuilderResult<impl super::stub::DeploymentResourcePoolService> {
1323        super::transport::DeploymentResourcePoolService::new(conf).await
1324    }
1325
1326    async fn build_with_tracing(
1327        conf: gaxi::options::ClientConfig,
1328    ) -> crate::ClientBuilderResult<impl super::stub::DeploymentResourcePoolService> {
1329        Self::build_transport(conf)
1330            .await
1331            .map(super::tracing::DeploymentResourcePoolService::new)
1332    }
1333
1334    /// Create a DeploymentResourcePool.
1335    ///
1336    /// # Long running operations
1337    ///
1338    /// This method is used to start, and/or poll a [long-running Operation].
1339    /// The [Working with long-running operations] chapter in the [user guide]
1340    /// covers these operations in detail.
1341    ///
1342    /// [long-running operation]: https://google.aip.dev/151
1343    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1344    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1345    ///
1346    /// # Example
1347    /// ```
1348    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1349    /// use google_cloud_lro::Poller;
1350    /// use google_cloud_aiplatform_v1::Result;
1351    /// async fn sample(
1352    ///    client: &DeploymentResourcePoolService
1353    /// ) -> Result<()> {
1354    ///     let response = client.create_deployment_resource_pool()
1355    ///         /* set fields */
1356    ///         .poller().until_done().await?;
1357    ///     println!("response {:?}", response);
1358    ///     Ok(())
1359    /// }
1360    /// ```
1361    pub fn create_deployment_resource_pool(
1362        &self,
1363    ) -> super::builder::deployment_resource_pool_service::CreateDeploymentResourcePool {
1364        super::builder::deployment_resource_pool_service::CreateDeploymentResourcePool::new(
1365            self.inner.clone(),
1366        )
1367    }
1368
1369    /// Get a DeploymentResourcePool.
1370    ///
1371    /// # Example
1372    /// ```
1373    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1374    /// use google_cloud_aiplatform_v1::Result;
1375    /// async fn sample(
1376    ///    client: &DeploymentResourcePoolService, project_id: &str, location_id: &str, deployment_resource_pool_id: &str
1377    /// ) -> Result<()> {
1378    ///     let response = client.get_deployment_resource_pool()
1379    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/deploymentResourcePools/{deployment_resource_pool_id}"))
1380    ///         .send().await?;
1381    ///     println!("response {:?}", response);
1382    ///     Ok(())
1383    /// }
1384    /// ```
1385    pub fn get_deployment_resource_pool(
1386        &self,
1387    ) -> super::builder::deployment_resource_pool_service::GetDeploymentResourcePool {
1388        super::builder::deployment_resource_pool_service::GetDeploymentResourcePool::new(
1389            self.inner.clone(),
1390        )
1391    }
1392
1393    /// List DeploymentResourcePools in a location.
1394    ///
1395    /// # Example
1396    /// ```
1397    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1398    /// use google_cloud_gax::paginator::ItemPaginator as _;
1399    /// use google_cloud_aiplatform_v1::Result;
1400    /// async fn sample(
1401    ///    client: &DeploymentResourcePoolService, parent: &str
1402    /// ) -> Result<()> {
1403    ///     let mut list = client.list_deployment_resource_pools()
1404    ///         .set_parent(parent)
1405    ///         .by_item();
1406    ///     while let Some(item) = list.next().await.transpose()? {
1407    ///         println!("{:?}", item);
1408    ///     }
1409    ///     Ok(())
1410    /// }
1411    /// ```
1412    pub fn list_deployment_resource_pools(
1413        &self,
1414    ) -> super::builder::deployment_resource_pool_service::ListDeploymentResourcePools {
1415        super::builder::deployment_resource_pool_service::ListDeploymentResourcePools::new(
1416            self.inner.clone(),
1417        )
1418    }
1419
1420    /// Update a DeploymentResourcePool.
1421    ///
1422    /// # Long running operations
1423    ///
1424    /// This method is used to start, and/or poll a [long-running Operation].
1425    /// The [Working with long-running operations] chapter in the [user guide]
1426    /// covers these operations in detail.
1427    ///
1428    /// [long-running operation]: https://google.aip.dev/151
1429    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1430    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1431    ///
1432    /// # Example
1433    /// ```
1434    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1435    /// use google_cloud_lro::Poller;
1436    /// # extern crate wkt as google_cloud_wkt;
1437    /// use google_cloud_wkt::FieldMask;
1438    /// use google_cloud_aiplatform_v1::model::DeploymentResourcePool;
1439    /// use google_cloud_aiplatform_v1::Result;
1440    /// async fn sample(
1441    ///    client: &DeploymentResourcePoolService, project_id: &str, location_id: &str, deployment_resource_pool_id: &str
1442    /// ) -> Result<()> {
1443    ///     let response = client.update_deployment_resource_pool()
1444    ///         .set_deployment_resource_pool(
1445    ///             DeploymentResourcePool::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentResourcePools/{deployment_resource_pool_id}"))/* set fields */
1446    ///         )
1447    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1448    ///         .poller().until_done().await?;
1449    ///     println!("response {:?}", response);
1450    ///     Ok(())
1451    /// }
1452    /// ```
1453    pub fn update_deployment_resource_pool(
1454        &self,
1455    ) -> super::builder::deployment_resource_pool_service::UpdateDeploymentResourcePool {
1456        super::builder::deployment_resource_pool_service::UpdateDeploymentResourcePool::new(
1457            self.inner.clone(),
1458        )
1459    }
1460
1461    /// Delete a DeploymentResourcePool.
1462    ///
1463    /// # Long running operations
1464    ///
1465    /// This method is used to start, and/or poll a [long-running Operation].
1466    /// The [Working with long-running operations] chapter in the [user guide]
1467    /// covers these operations in detail.
1468    ///
1469    /// [long-running operation]: https://google.aip.dev/151
1470    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1471    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1472    ///
1473    /// # Example
1474    /// ```
1475    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1476    /// use google_cloud_lro::Poller;
1477    /// use google_cloud_aiplatform_v1::Result;
1478    /// async fn sample(
1479    ///    client: &DeploymentResourcePoolService, project_id: &str, location_id: &str, deployment_resource_pool_id: &str
1480    /// ) -> Result<()> {
1481    ///     client.delete_deployment_resource_pool()
1482    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/deploymentResourcePools/{deployment_resource_pool_id}"))
1483    ///         .poller().until_done().await?;
1484    ///     Ok(())
1485    /// }
1486    /// ```
1487    pub fn delete_deployment_resource_pool(
1488        &self,
1489    ) -> super::builder::deployment_resource_pool_service::DeleteDeploymentResourcePool {
1490        super::builder::deployment_resource_pool_service::DeleteDeploymentResourcePool::new(
1491            self.inner.clone(),
1492        )
1493    }
1494
1495    /// List DeployedModels that have been deployed on this DeploymentResourcePool.
1496    ///
1497    /// # Example
1498    /// ```
1499    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1500    /// use google_cloud_gax::paginator::ItemPaginator as _;
1501    /// use google_cloud_aiplatform_v1::Result;
1502    /// async fn sample(
1503    ///    client: &DeploymentResourcePoolService
1504    /// ) -> Result<()> {
1505    ///     let mut list = client.query_deployed_models()
1506    ///         /* set fields */
1507    ///         .by_item();
1508    ///     while let Some(item) = list.next().await.transpose()? {
1509    ///         println!("{:?}", item);
1510    ///     }
1511    ///     Ok(())
1512    /// }
1513    /// ```
1514    pub fn query_deployed_models(
1515        &self,
1516    ) -> super::builder::deployment_resource_pool_service::QueryDeployedModels {
1517        super::builder::deployment_resource_pool_service::QueryDeployedModels::new(
1518            self.inner.clone(),
1519        )
1520    }
1521
1522    /// Lists information about the supported locations for this service.
1523    ///
1524    /// # Example
1525    /// ```
1526    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1527    /// use google_cloud_gax::paginator::ItemPaginator as _;
1528    /// use google_cloud_aiplatform_v1::Result;
1529    /// async fn sample(
1530    ///    client: &DeploymentResourcePoolService
1531    /// ) -> Result<()> {
1532    ///     let mut list = client.list_locations()
1533    ///         /* set fields */
1534    ///         .by_item();
1535    ///     while let Some(item) = list.next().await.transpose()? {
1536    ///         println!("{:?}", item);
1537    ///     }
1538    ///     Ok(())
1539    /// }
1540    /// ```
1541    pub fn list_locations(
1542        &self,
1543    ) -> super::builder::deployment_resource_pool_service::ListLocations {
1544        super::builder::deployment_resource_pool_service::ListLocations::new(self.inner.clone())
1545    }
1546
1547    /// Gets information about a location.
1548    ///
1549    /// # Example
1550    /// ```
1551    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1552    /// use google_cloud_aiplatform_v1::Result;
1553    /// async fn sample(
1554    ///    client: &DeploymentResourcePoolService
1555    /// ) -> Result<()> {
1556    ///     let response = client.get_location()
1557    ///         /* set fields */
1558    ///         .send().await?;
1559    ///     println!("response {:?}", response);
1560    ///     Ok(())
1561    /// }
1562    /// ```
1563    pub fn get_location(&self) -> super::builder::deployment_resource_pool_service::GetLocation {
1564        super::builder::deployment_resource_pool_service::GetLocation::new(self.inner.clone())
1565    }
1566
1567    /// Sets the access control policy on the specified resource. Replaces
1568    /// any existing policy.
1569    ///
1570    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1571    /// errors.
1572    ///
1573    /// # Example
1574    /// ```
1575    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1576    /// use google_cloud_aiplatform_v1::Result;
1577    /// async fn sample(
1578    ///    client: &DeploymentResourcePoolService
1579    /// ) -> Result<()> {
1580    ///     let response = client.set_iam_policy()
1581    ///         /* set fields */
1582    ///         .send().await?;
1583    ///     println!("response {:?}", response);
1584    ///     Ok(())
1585    /// }
1586    /// ```
1587    pub fn set_iam_policy(&self) -> super::builder::deployment_resource_pool_service::SetIamPolicy {
1588        super::builder::deployment_resource_pool_service::SetIamPolicy::new(self.inner.clone())
1589    }
1590
1591    /// Gets the access control policy for a resource. Returns an empty policy
1592    /// if the resource exists and does not have a policy set.
1593    ///
1594    /// # Example
1595    /// ```
1596    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1597    /// use google_cloud_aiplatform_v1::Result;
1598    /// async fn sample(
1599    ///    client: &DeploymentResourcePoolService
1600    /// ) -> Result<()> {
1601    ///     let response = client.get_iam_policy()
1602    ///         /* set fields */
1603    ///         .send().await?;
1604    ///     println!("response {:?}", response);
1605    ///     Ok(())
1606    /// }
1607    /// ```
1608    pub fn get_iam_policy(&self) -> super::builder::deployment_resource_pool_service::GetIamPolicy {
1609        super::builder::deployment_resource_pool_service::GetIamPolicy::new(self.inner.clone())
1610    }
1611
1612    /// Returns permissions that a caller has on the specified resource. If the
1613    /// resource does not exist, this will return an empty set of
1614    /// permissions, not a `NOT_FOUND` error.
1615    ///
1616    /// Note: This operation is designed to be used for building
1617    /// permission-aware UIs and command-line tools, not for authorization
1618    /// checking. This operation may "fail open" without warning.
1619    ///
1620    /// # Example
1621    /// ```
1622    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1623    /// use google_cloud_aiplatform_v1::Result;
1624    /// async fn sample(
1625    ///    client: &DeploymentResourcePoolService
1626    /// ) -> Result<()> {
1627    ///     let response = client.test_iam_permissions()
1628    ///         /* set fields */
1629    ///         .send().await?;
1630    ///     println!("response {:?}", response);
1631    ///     Ok(())
1632    /// }
1633    /// ```
1634    pub fn test_iam_permissions(
1635        &self,
1636    ) -> super::builder::deployment_resource_pool_service::TestIamPermissions {
1637        super::builder::deployment_resource_pool_service::TestIamPermissions::new(
1638            self.inner.clone(),
1639        )
1640    }
1641
1642    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1643    ///
1644    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1645    ///
1646    /// # Example
1647    /// ```
1648    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1649    /// use google_cloud_gax::paginator::ItemPaginator as _;
1650    /// use google_cloud_aiplatform_v1::Result;
1651    /// async fn sample(
1652    ///    client: &DeploymentResourcePoolService
1653    /// ) -> Result<()> {
1654    ///     let mut list = client.list_operations()
1655    ///         /* set fields */
1656    ///         .by_item();
1657    ///     while let Some(item) = list.next().await.transpose()? {
1658    ///         println!("{:?}", item);
1659    ///     }
1660    ///     Ok(())
1661    /// }
1662    /// ```
1663    pub fn list_operations(
1664        &self,
1665    ) -> super::builder::deployment_resource_pool_service::ListOperations {
1666        super::builder::deployment_resource_pool_service::ListOperations::new(self.inner.clone())
1667    }
1668
1669    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1670    ///
1671    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1672    ///
1673    /// # Example
1674    /// ```
1675    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1676    /// use google_cloud_aiplatform_v1::Result;
1677    /// async fn sample(
1678    ///    client: &DeploymentResourcePoolService
1679    /// ) -> Result<()> {
1680    ///     let response = client.get_operation()
1681    ///         /* set fields */
1682    ///         .send().await?;
1683    ///     println!("response {:?}", response);
1684    ///     Ok(())
1685    /// }
1686    /// ```
1687    pub fn get_operation(&self) -> super::builder::deployment_resource_pool_service::GetOperation {
1688        super::builder::deployment_resource_pool_service::GetOperation::new(self.inner.clone())
1689    }
1690
1691    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1692    ///
1693    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1694    ///
1695    /// # Example
1696    /// ```
1697    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1698    /// use google_cloud_aiplatform_v1::Result;
1699    /// async fn sample(
1700    ///    client: &DeploymentResourcePoolService
1701    /// ) -> Result<()> {
1702    ///     client.delete_operation()
1703    ///         /* set fields */
1704    ///         .send().await?;
1705    ///     Ok(())
1706    /// }
1707    /// ```
1708    pub fn delete_operation(
1709        &self,
1710    ) -> super::builder::deployment_resource_pool_service::DeleteOperation {
1711        super::builder::deployment_resource_pool_service::DeleteOperation::new(self.inner.clone())
1712    }
1713
1714    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1715    ///
1716    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1717    ///
1718    /// # Example
1719    /// ```
1720    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1721    /// use google_cloud_aiplatform_v1::Result;
1722    /// async fn sample(
1723    ///    client: &DeploymentResourcePoolService
1724    /// ) -> Result<()> {
1725    ///     client.cancel_operation()
1726    ///         /* set fields */
1727    ///         .send().await?;
1728    ///     Ok(())
1729    /// }
1730    /// ```
1731    pub fn cancel_operation(
1732        &self,
1733    ) -> super::builder::deployment_resource_pool_service::CancelOperation {
1734        super::builder::deployment_resource_pool_service::CancelOperation::new(self.inner.clone())
1735    }
1736
1737    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1738    ///
1739    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1740    ///
1741    /// # Example
1742    /// ```
1743    /// # use google_cloud_aiplatform_v1::client::DeploymentResourcePoolService;
1744    /// use google_cloud_aiplatform_v1::Result;
1745    /// async fn sample(
1746    ///    client: &DeploymentResourcePoolService
1747    /// ) -> Result<()> {
1748    ///     let response = client.wait_operation()
1749    ///         /* set fields */
1750    ///         .send().await?;
1751    ///     println!("response {:?}", response);
1752    ///     Ok(())
1753    /// }
1754    /// ```
1755    pub fn wait_operation(
1756        &self,
1757    ) -> super::builder::deployment_resource_pool_service::WaitOperation {
1758        super::builder::deployment_resource_pool_service::WaitOperation::new(self.inner.clone())
1759    }
1760}
1761
1762/// Implements a client for the Vertex AI API.
1763///
1764/// # Example
1765/// ```
1766/// # use google_cloud_aiplatform_v1::client::EndpointService;
1767/// use google_cloud_gax::paginator::ItemPaginator as _;
1768/// async fn sample(
1769///    parent: &str,
1770/// ) -> anyhow::Result<()> {
1771///     let client = EndpointService::builder().build().await?;
1772///     let mut list = client.list_endpoints()
1773///         .set_parent(parent)
1774///         .by_item();
1775///     while let Some(item) = list.next().await.transpose()? {
1776///         println!("{:?}", item);
1777///     }
1778///     Ok(())
1779/// }
1780/// ```
1781///
1782/// # Service Description
1783///
1784/// A service for managing Vertex AI's Endpoints.
1785///
1786/// # Configuration
1787///
1788/// To configure `EndpointService` use the `with_*` methods in the type returned
1789/// by [builder()][EndpointService::builder]. The default configuration should
1790/// work for most applications. Common configuration changes include
1791///
1792/// * [with_endpoint()]: by default this client uses the global default endpoint
1793///   (`https://aiplatform.googleapis.com`). Applications using regional
1794///   endpoints or running in restricted networks (e.g. a network configured
1795///   with [Private Google Access with VPC Service Controls]) may want to
1796///   override this default.
1797/// * [with_credentials()]: by default this client uses
1798///   [Application Default Credentials]. Applications using custom
1799///   authentication may need to override this default.
1800///
1801/// [with_endpoint()]: super::builder::endpoint_service::ClientBuilder::with_endpoint
1802/// [with_credentials()]: super::builder::endpoint_service::ClientBuilder::with_credentials
1803/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1804/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1805///
1806/// # Pooling and Cloning
1807///
1808/// `EndpointService` holds a connection pool internally, it is advised to
1809/// create one and reuse it. You do not need to wrap `EndpointService` in
1810/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1811/// already uses an `Arc` internally.
1812#[cfg(feature = "endpoint-service")]
1813#[cfg_attr(docsrs, doc(cfg(feature = "endpoint-service")))]
1814#[derive(Clone, Debug)]
1815pub struct EndpointService {
1816    inner: std::sync::Arc<dyn super::stub::dynamic::EndpointService>,
1817}
1818
1819#[cfg(feature = "endpoint-service")]
1820impl EndpointService {
1821    /// Returns a builder for [EndpointService].
1822    ///
1823    /// ```
1824    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1825    /// # use google_cloud_aiplatform_v1::client::EndpointService;
1826    /// let client = EndpointService::builder().build().await?;
1827    /// # Ok(()) }
1828    /// ```
1829    pub fn builder() -> super::builder::endpoint_service::ClientBuilder {
1830        crate::new_client_builder(super::builder::endpoint_service::client::Factory)
1831    }
1832
1833    /// Creates a new client from the provided stub.
1834    ///
1835    /// The most common case for calling this function is in tests mocking the
1836    /// client's behavior.
1837    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1838    where
1839        T: super::stub::EndpointService + 'static,
1840    {
1841        Self { inner: stub.into() }
1842    }
1843
1844    pub(crate) async fn new(
1845        config: gaxi::options::ClientConfig,
1846    ) -> crate::ClientBuilderResult<Self> {
1847        let inner = Self::build_inner(config).await?;
1848        Ok(Self { inner })
1849    }
1850
1851    async fn build_inner(
1852        conf: gaxi::options::ClientConfig,
1853    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::EndpointService>> {
1854        if gaxi::options::tracing_enabled(&conf) {
1855            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1856        }
1857        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1858    }
1859
1860    async fn build_transport(
1861        conf: gaxi::options::ClientConfig,
1862    ) -> crate::ClientBuilderResult<impl super::stub::EndpointService> {
1863        super::transport::EndpointService::new(conf).await
1864    }
1865
1866    async fn build_with_tracing(
1867        conf: gaxi::options::ClientConfig,
1868    ) -> crate::ClientBuilderResult<impl super::stub::EndpointService> {
1869        Self::build_transport(conf)
1870            .await
1871            .map(super::tracing::EndpointService::new)
1872    }
1873
1874    /// Creates an Endpoint.
1875    ///
1876    /// # Long running operations
1877    ///
1878    /// This method is used to start, and/or poll a [long-running Operation].
1879    /// The [Working with long-running operations] chapter in the [user guide]
1880    /// covers these operations in detail.
1881    ///
1882    /// [long-running operation]: https://google.aip.dev/151
1883    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1884    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1885    ///
1886    /// # Example
1887    /// ```
1888    /// # use google_cloud_aiplatform_v1::client::EndpointService;
1889    /// use google_cloud_lro::Poller;
1890    /// use google_cloud_aiplatform_v1::model::Endpoint;
1891    /// use google_cloud_aiplatform_v1::Result;
1892    /// async fn sample(
1893    ///    client: &EndpointService, parent: &str
1894    /// ) -> Result<()> {
1895    ///     let response = client.create_endpoint()
1896    ///         .set_parent(parent)
1897    ///         .set_endpoint_id("endpoint_id_value")
1898    ///         .set_endpoint(
1899    ///             Endpoint::new()/* set fields */
1900    ///         )
1901    ///         .poller().until_done().await?;
1902    ///     println!("response {:?}", response);
1903    ///     Ok(())
1904    /// }
1905    /// ```
1906    pub fn create_endpoint(&self) -> super::builder::endpoint_service::CreateEndpoint {
1907        super::builder::endpoint_service::CreateEndpoint::new(self.inner.clone())
1908    }
1909
1910    /// Gets an Endpoint.
1911    ///
1912    /// # Example
1913    /// ```
1914    /// # use google_cloud_aiplatform_v1::client::EndpointService;
1915    /// use google_cloud_aiplatform_v1::Result;
1916    /// async fn sample(
1917    ///    client: &EndpointService, project_id: &str, location_id: &str, endpoint_id: &str
1918    /// ) -> Result<()> {
1919    ///     let response = client.get_endpoint()
1920    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/endpoints/{endpoint_id}"))
1921    ///         .send().await?;
1922    ///     println!("response {:?}", response);
1923    ///     Ok(())
1924    /// }
1925    /// ```
1926    pub fn get_endpoint(&self) -> super::builder::endpoint_service::GetEndpoint {
1927        super::builder::endpoint_service::GetEndpoint::new(self.inner.clone())
1928    }
1929
1930    /// Lists Endpoints in a Location.
1931    ///
1932    /// # Example
1933    /// ```
1934    /// # use google_cloud_aiplatform_v1::client::EndpointService;
1935    /// use google_cloud_gax::paginator::ItemPaginator as _;
1936    /// use google_cloud_aiplatform_v1::Result;
1937    /// async fn sample(
1938    ///    client: &EndpointService, parent: &str
1939    /// ) -> Result<()> {
1940    ///     let mut list = client.list_endpoints()
1941    ///         .set_parent(parent)
1942    ///         .by_item();
1943    ///     while let Some(item) = list.next().await.transpose()? {
1944    ///         println!("{:?}", item);
1945    ///     }
1946    ///     Ok(())
1947    /// }
1948    /// ```
1949    pub fn list_endpoints(&self) -> super::builder::endpoint_service::ListEndpoints {
1950        super::builder::endpoint_service::ListEndpoints::new(self.inner.clone())
1951    }
1952
1953    /// Updates an Endpoint.
1954    ///
1955    /// # Example
1956    /// ```
1957    /// # use google_cloud_aiplatform_v1::client::EndpointService;
1958    /// # extern crate wkt as google_cloud_wkt;
1959    /// use google_cloud_wkt::FieldMask;
1960    /// use google_cloud_aiplatform_v1::model::Endpoint;
1961    /// use google_cloud_aiplatform_v1::Result;
1962    /// async fn sample(
1963    ///    client: &EndpointService, project_id: &str, location_id: &str, endpoint_id: &str
1964    /// ) -> Result<()> {
1965    ///     let response = client.update_endpoint()
1966    ///         .set_endpoint(
1967    ///             Endpoint::new().set_name(format!("projects/{project_id}/locations/{location_id}/endpoints/{endpoint_id}"))/* set fields */
1968    ///         )
1969    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1970    ///         .send().await?;
1971    ///     println!("response {:?}", response);
1972    ///     Ok(())
1973    /// }
1974    /// ```
1975    pub fn update_endpoint(&self) -> super::builder::endpoint_service::UpdateEndpoint {
1976        super::builder::endpoint_service::UpdateEndpoint::new(self.inner.clone())
1977    }
1978
1979    /// Updates an Endpoint with a long running operation.
1980    ///
1981    /// # Long running operations
1982    ///
1983    /// This method is used to start, and/or poll a [long-running Operation].
1984    /// The [Working with long-running operations] chapter in the [user guide]
1985    /// covers these operations in detail.
1986    ///
1987    /// [long-running operation]: https://google.aip.dev/151
1988    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1989    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1990    ///
1991    /// # Example
1992    /// ```
1993    /// # use google_cloud_aiplatform_v1::client::EndpointService;
1994    /// use google_cloud_lro::Poller;
1995    /// use google_cloud_aiplatform_v1::Result;
1996    /// async fn sample(
1997    ///    client: &EndpointService
1998    /// ) -> Result<()> {
1999    ///     let response = client.update_endpoint_long_running()
2000    ///         /* set fields */
2001    ///         .poller().until_done().await?;
2002    ///     println!("response {:?}", response);
2003    ///     Ok(())
2004    /// }
2005    /// ```
2006    pub fn update_endpoint_long_running(
2007        &self,
2008    ) -> super::builder::endpoint_service::UpdateEndpointLongRunning {
2009        super::builder::endpoint_service::UpdateEndpointLongRunning::new(self.inner.clone())
2010    }
2011
2012    /// Deletes an Endpoint.
2013    ///
2014    /// # Long running operations
2015    ///
2016    /// This method is used to start, and/or poll a [long-running Operation].
2017    /// The [Working with long-running operations] chapter in the [user guide]
2018    /// covers these operations in detail.
2019    ///
2020    /// [long-running operation]: https://google.aip.dev/151
2021    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2022    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2023    ///
2024    /// # Example
2025    /// ```
2026    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2027    /// use google_cloud_lro::Poller;
2028    /// use google_cloud_aiplatform_v1::Result;
2029    /// async fn sample(
2030    ///    client: &EndpointService, project_id: &str, location_id: &str, endpoint_id: &str
2031    /// ) -> Result<()> {
2032    ///     client.delete_endpoint()
2033    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/endpoints/{endpoint_id}"))
2034    ///         .poller().until_done().await?;
2035    ///     Ok(())
2036    /// }
2037    /// ```
2038    pub fn delete_endpoint(&self) -> super::builder::endpoint_service::DeleteEndpoint {
2039        super::builder::endpoint_service::DeleteEndpoint::new(self.inner.clone())
2040    }
2041
2042    /// Deploys a Model into this Endpoint, creating a DeployedModel within it.
2043    ///
2044    /// # Long running operations
2045    ///
2046    /// This method is used to start, and/or poll a [long-running Operation].
2047    /// The [Working with long-running operations] chapter in the [user guide]
2048    /// covers these operations in detail.
2049    ///
2050    /// [long-running operation]: https://google.aip.dev/151
2051    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2052    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2053    ///
2054    /// # Example
2055    /// ```
2056    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2057    /// use google_cloud_lro::Poller;
2058    /// use google_cloud_aiplatform_v1::Result;
2059    /// async fn sample(
2060    ///    client: &EndpointService
2061    /// ) -> Result<()> {
2062    ///     let response = client.deploy_model()
2063    ///         /* set fields */
2064    ///         .poller().until_done().await?;
2065    ///     println!("response {:?}", response);
2066    ///     Ok(())
2067    /// }
2068    /// ```
2069    pub fn deploy_model(&self) -> super::builder::endpoint_service::DeployModel {
2070        super::builder::endpoint_service::DeployModel::new(self.inner.clone())
2071    }
2072
2073    /// Undeploys a Model from an Endpoint, removing a DeployedModel from it, and
2074    /// freeing all resources it's using.
2075    ///
2076    /// # Long running operations
2077    ///
2078    /// This method is used to start, and/or poll a [long-running Operation].
2079    /// The [Working with long-running operations] chapter in the [user guide]
2080    /// covers these operations in detail.
2081    ///
2082    /// [long-running operation]: https://google.aip.dev/151
2083    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2084    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2085    ///
2086    /// # Example
2087    /// ```
2088    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2089    /// use google_cloud_lro::Poller;
2090    /// use google_cloud_aiplatform_v1::Result;
2091    /// async fn sample(
2092    ///    client: &EndpointService
2093    /// ) -> Result<()> {
2094    ///     let response = client.undeploy_model()
2095    ///         /* set fields */
2096    ///         .poller().until_done().await?;
2097    ///     println!("response {:?}", response);
2098    ///     Ok(())
2099    /// }
2100    /// ```
2101    pub fn undeploy_model(&self) -> super::builder::endpoint_service::UndeployModel {
2102        super::builder::endpoint_service::UndeployModel::new(self.inner.clone())
2103    }
2104
2105    /// Updates an existing deployed model. Updatable fields include
2106    /// `min_replica_count`, `max_replica_count`, `required_replica_count`,
2107    /// `autoscaling_metric_specs`, `disable_container_logging` (v1 only), and
2108    /// `enable_container_logging` (v1beta1 only).
2109    ///
2110    /// # Long running operations
2111    ///
2112    /// This method is used to start, and/or poll a [long-running Operation].
2113    /// The [Working with long-running operations] chapter in the [user guide]
2114    /// covers these operations in detail.
2115    ///
2116    /// [long-running operation]: https://google.aip.dev/151
2117    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2118    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2119    ///
2120    /// # Example
2121    /// ```
2122    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2123    /// use google_cloud_lro::Poller;
2124    /// use google_cloud_aiplatform_v1::Result;
2125    /// async fn sample(
2126    ///    client: &EndpointService
2127    /// ) -> Result<()> {
2128    ///     let response = client.mutate_deployed_model()
2129    ///         /* set fields */
2130    ///         .poller().until_done().await?;
2131    ///     println!("response {:?}", response);
2132    ///     Ok(())
2133    /// }
2134    /// ```
2135    pub fn mutate_deployed_model(&self) -> super::builder::endpoint_service::MutateDeployedModel {
2136        super::builder::endpoint_service::MutateDeployedModel::new(self.inner.clone())
2137    }
2138
2139    /// Lists information about the supported locations for this service.
2140    ///
2141    /// # Example
2142    /// ```
2143    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2144    /// use google_cloud_gax::paginator::ItemPaginator as _;
2145    /// use google_cloud_aiplatform_v1::Result;
2146    /// async fn sample(
2147    ///    client: &EndpointService
2148    /// ) -> Result<()> {
2149    ///     let mut list = client.list_locations()
2150    ///         /* set fields */
2151    ///         .by_item();
2152    ///     while let Some(item) = list.next().await.transpose()? {
2153    ///         println!("{:?}", item);
2154    ///     }
2155    ///     Ok(())
2156    /// }
2157    /// ```
2158    pub fn list_locations(&self) -> super::builder::endpoint_service::ListLocations {
2159        super::builder::endpoint_service::ListLocations::new(self.inner.clone())
2160    }
2161
2162    /// Gets information about a location.
2163    ///
2164    /// # Example
2165    /// ```
2166    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2167    /// use google_cloud_aiplatform_v1::Result;
2168    /// async fn sample(
2169    ///    client: &EndpointService
2170    /// ) -> Result<()> {
2171    ///     let response = client.get_location()
2172    ///         /* set fields */
2173    ///         .send().await?;
2174    ///     println!("response {:?}", response);
2175    ///     Ok(())
2176    /// }
2177    /// ```
2178    pub fn get_location(&self) -> super::builder::endpoint_service::GetLocation {
2179        super::builder::endpoint_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    ///
2188    /// # Example
2189    /// ```
2190    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2191    /// use google_cloud_aiplatform_v1::Result;
2192    /// async fn sample(
2193    ///    client: &EndpointService
2194    /// ) -> Result<()> {
2195    ///     let response = client.set_iam_policy()
2196    ///         /* set fields */
2197    ///         .send().await?;
2198    ///     println!("response {:?}", response);
2199    ///     Ok(())
2200    /// }
2201    /// ```
2202    pub fn set_iam_policy(&self) -> super::builder::endpoint_service::SetIamPolicy {
2203        super::builder::endpoint_service::SetIamPolicy::new(self.inner.clone())
2204    }
2205
2206    /// Gets the access control policy for a resource. Returns an empty policy
2207    /// if the resource exists and does not have a policy set.
2208    ///
2209    /// # Example
2210    /// ```
2211    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2212    /// use google_cloud_aiplatform_v1::Result;
2213    /// async fn sample(
2214    ///    client: &EndpointService
2215    /// ) -> Result<()> {
2216    ///     let response = client.get_iam_policy()
2217    ///         /* set fields */
2218    ///         .send().await?;
2219    ///     println!("response {:?}", response);
2220    ///     Ok(())
2221    /// }
2222    /// ```
2223    pub fn get_iam_policy(&self) -> super::builder::endpoint_service::GetIamPolicy {
2224        super::builder::endpoint_service::GetIamPolicy::new(self.inner.clone())
2225    }
2226
2227    /// Returns permissions that a caller has on the specified resource. If the
2228    /// resource does not exist, this will return an empty set of
2229    /// permissions, not a `NOT_FOUND` error.
2230    ///
2231    /// Note: This operation is designed to be used for building
2232    /// permission-aware UIs and command-line tools, not for authorization
2233    /// checking. This operation may "fail open" without warning.
2234    ///
2235    /// # Example
2236    /// ```
2237    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2238    /// use google_cloud_aiplatform_v1::Result;
2239    /// async fn sample(
2240    ///    client: &EndpointService
2241    /// ) -> Result<()> {
2242    ///     let response = client.test_iam_permissions()
2243    ///         /* set fields */
2244    ///         .send().await?;
2245    ///     println!("response {:?}", response);
2246    ///     Ok(())
2247    /// }
2248    /// ```
2249    pub fn test_iam_permissions(&self) -> super::builder::endpoint_service::TestIamPermissions {
2250        super::builder::endpoint_service::TestIamPermissions::new(self.inner.clone())
2251    }
2252
2253    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2254    ///
2255    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2256    ///
2257    /// # Example
2258    /// ```
2259    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2260    /// use google_cloud_gax::paginator::ItemPaginator as _;
2261    /// use google_cloud_aiplatform_v1::Result;
2262    /// async fn sample(
2263    ///    client: &EndpointService
2264    /// ) -> Result<()> {
2265    ///     let mut list = client.list_operations()
2266    ///         /* set fields */
2267    ///         .by_item();
2268    ///     while let Some(item) = list.next().await.transpose()? {
2269    ///         println!("{:?}", item);
2270    ///     }
2271    ///     Ok(())
2272    /// }
2273    /// ```
2274    pub fn list_operations(&self) -> super::builder::endpoint_service::ListOperations {
2275        super::builder::endpoint_service::ListOperations::new(self.inner.clone())
2276    }
2277
2278    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2279    ///
2280    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2281    ///
2282    /// # Example
2283    /// ```
2284    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2285    /// use google_cloud_aiplatform_v1::Result;
2286    /// async fn sample(
2287    ///    client: &EndpointService
2288    /// ) -> Result<()> {
2289    ///     let response = client.get_operation()
2290    ///         /* set fields */
2291    ///         .send().await?;
2292    ///     println!("response {:?}", response);
2293    ///     Ok(())
2294    /// }
2295    /// ```
2296    pub fn get_operation(&self) -> super::builder::endpoint_service::GetOperation {
2297        super::builder::endpoint_service::GetOperation::new(self.inner.clone())
2298    }
2299
2300    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2301    ///
2302    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2303    ///
2304    /// # Example
2305    /// ```
2306    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2307    /// use google_cloud_aiplatform_v1::Result;
2308    /// async fn sample(
2309    ///    client: &EndpointService
2310    /// ) -> Result<()> {
2311    ///     client.delete_operation()
2312    ///         /* set fields */
2313    ///         .send().await?;
2314    ///     Ok(())
2315    /// }
2316    /// ```
2317    pub fn delete_operation(&self) -> super::builder::endpoint_service::DeleteOperation {
2318        super::builder::endpoint_service::DeleteOperation::new(self.inner.clone())
2319    }
2320
2321    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2322    ///
2323    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2324    ///
2325    /// # Example
2326    /// ```
2327    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2328    /// use google_cloud_aiplatform_v1::Result;
2329    /// async fn sample(
2330    ///    client: &EndpointService
2331    /// ) -> Result<()> {
2332    ///     client.cancel_operation()
2333    ///         /* set fields */
2334    ///         .send().await?;
2335    ///     Ok(())
2336    /// }
2337    /// ```
2338    pub fn cancel_operation(&self) -> super::builder::endpoint_service::CancelOperation {
2339        super::builder::endpoint_service::CancelOperation::new(self.inner.clone())
2340    }
2341
2342    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2343    ///
2344    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2345    ///
2346    /// # Example
2347    /// ```
2348    /// # use google_cloud_aiplatform_v1::client::EndpointService;
2349    /// use google_cloud_aiplatform_v1::Result;
2350    /// async fn sample(
2351    ///    client: &EndpointService
2352    /// ) -> Result<()> {
2353    ///     let response = client.wait_operation()
2354    ///         /* set fields */
2355    ///         .send().await?;
2356    ///     println!("response {:?}", response);
2357    ///     Ok(())
2358    /// }
2359    /// ```
2360    pub fn wait_operation(&self) -> super::builder::endpoint_service::WaitOperation {
2361        super::builder::endpoint_service::WaitOperation::new(self.inner.clone())
2362    }
2363}
2364
2365/// Implements a client for the Vertex AI API.
2366///
2367/// # Example
2368/// ```
2369/// # use google_cloud_aiplatform_v1::client::EvaluationService;
2370/// async fn sample(
2371/// ) -> anyhow::Result<()> {
2372///     let client = EvaluationService::builder().build().await?;
2373///     let response = client.evaluate_instances()
2374///         /* set fields */
2375///         .send().await?;
2376///     println!("response {:?}", response);
2377///     Ok(())
2378/// }
2379/// ```
2380///
2381/// # Service Description
2382///
2383/// Vertex AI Online Evaluation Service.
2384///
2385/// # Configuration
2386///
2387/// To configure `EvaluationService` use the `with_*` methods in the type returned
2388/// by [builder()][EvaluationService::builder]. The default configuration should
2389/// work for most applications. Common configuration changes include
2390///
2391/// * [with_endpoint()]: by default this client uses the global default endpoint
2392///   (`https://aiplatform.googleapis.com`). Applications using regional
2393///   endpoints or running in restricted networks (e.g. a network configured
2394///   with [Private Google Access with VPC Service Controls]) may want to
2395///   override this default.
2396/// * [with_credentials()]: by default this client uses
2397///   [Application Default Credentials]. Applications using custom
2398///   authentication may need to override this default.
2399///
2400/// [with_endpoint()]: super::builder::evaluation_service::ClientBuilder::with_endpoint
2401/// [with_credentials()]: super::builder::evaluation_service::ClientBuilder::with_credentials
2402/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2403/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2404///
2405/// # Pooling and Cloning
2406///
2407/// `EvaluationService` holds a connection pool internally, it is advised to
2408/// create one and reuse it. You do not need to wrap `EvaluationService` in
2409/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2410/// already uses an `Arc` internally.
2411#[cfg(feature = "evaluation-service")]
2412#[cfg_attr(docsrs, doc(cfg(feature = "evaluation-service")))]
2413#[derive(Clone, Debug)]
2414pub struct EvaluationService {
2415    inner: std::sync::Arc<dyn super::stub::dynamic::EvaluationService>,
2416}
2417
2418#[cfg(feature = "evaluation-service")]
2419impl EvaluationService {
2420    /// Returns a builder for [EvaluationService].
2421    ///
2422    /// ```
2423    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2424    /// # use google_cloud_aiplatform_v1::client::EvaluationService;
2425    /// let client = EvaluationService::builder().build().await?;
2426    /// # Ok(()) }
2427    /// ```
2428    pub fn builder() -> super::builder::evaluation_service::ClientBuilder {
2429        crate::new_client_builder(super::builder::evaluation_service::client::Factory)
2430    }
2431
2432    /// Creates a new client from the provided stub.
2433    ///
2434    /// The most common case for calling this function is in tests mocking the
2435    /// client's behavior.
2436    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2437    where
2438        T: super::stub::EvaluationService + 'static,
2439    {
2440        Self { inner: stub.into() }
2441    }
2442
2443    pub(crate) async fn new(
2444        config: gaxi::options::ClientConfig,
2445    ) -> crate::ClientBuilderResult<Self> {
2446        let inner = Self::build_inner(config).await?;
2447        Ok(Self { inner })
2448    }
2449
2450    async fn build_inner(
2451        conf: gaxi::options::ClientConfig,
2452    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::EvaluationService>>
2453    {
2454        if gaxi::options::tracing_enabled(&conf) {
2455            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2456        }
2457        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2458    }
2459
2460    async fn build_transport(
2461        conf: gaxi::options::ClientConfig,
2462    ) -> crate::ClientBuilderResult<impl super::stub::EvaluationService> {
2463        super::transport::EvaluationService::new(conf).await
2464    }
2465
2466    async fn build_with_tracing(
2467        conf: gaxi::options::ClientConfig,
2468    ) -> crate::ClientBuilderResult<impl super::stub::EvaluationService> {
2469        Self::build_transport(conf)
2470            .await
2471            .map(super::tracing::EvaluationService::new)
2472    }
2473
2474    /// Evaluates instances based on a given metric.
2475    ///
2476    /// # Example
2477    /// ```
2478    /// # use google_cloud_aiplatform_v1::client::EvaluationService;
2479    /// use google_cloud_aiplatform_v1::Result;
2480    /// async fn sample(
2481    ///    client: &EvaluationService
2482    /// ) -> Result<()> {
2483    ///     let response = client.evaluate_instances()
2484    ///         /* set fields */
2485    ///         .send().await?;
2486    ///     println!("response {:?}", response);
2487    ///     Ok(())
2488    /// }
2489    /// ```
2490    pub fn evaluate_instances(&self) -> super::builder::evaluation_service::EvaluateInstances {
2491        super::builder::evaluation_service::EvaluateInstances::new(self.inner.clone())
2492    }
2493
2494    /// Lists information about the supported locations for this service.
2495    ///
2496    /// # Example
2497    /// ```
2498    /// # use google_cloud_aiplatform_v1::client::EvaluationService;
2499    /// use google_cloud_gax::paginator::ItemPaginator as _;
2500    /// use google_cloud_aiplatform_v1::Result;
2501    /// async fn sample(
2502    ///    client: &EvaluationService
2503    /// ) -> Result<()> {
2504    ///     let mut list = client.list_locations()
2505    ///         /* set fields */
2506    ///         .by_item();
2507    ///     while let Some(item) = list.next().await.transpose()? {
2508    ///         println!("{:?}", item);
2509    ///     }
2510    ///     Ok(())
2511    /// }
2512    /// ```
2513    pub fn list_locations(&self) -> super::builder::evaluation_service::ListLocations {
2514        super::builder::evaluation_service::ListLocations::new(self.inner.clone())
2515    }
2516
2517    /// Gets information about a location.
2518    ///
2519    /// # Example
2520    /// ```
2521    /// # use google_cloud_aiplatform_v1::client::EvaluationService;
2522    /// use google_cloud_aiplatform_v1::Result;
2523    /// async fn sample(
2524    ///    client: &EvaluationService
2525    /// ) -> Result<()> {
2526    ///     let response = client.get_location()
2527    ///         /* set fields */
2528    ///         .send().await?;
2529    ///     println!("response {:?}", response);
2530    ///     Ok(())
2531    /// }
2532    /// ```
2533    pub fn get_location(&self) -> super::builder::evaluation_service::GetLocation {
2534        super::builder::evaluation_service::GetLocation::new(self.inner.clone())
2535    }
2536
2537    /// Sets the access control policy on the specified resource. Replaces
2538    /// any existing policy.
2539    ///
2540    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
2541    /// errors.
2542    ///
2543    /// # Example
2544    /// ```
2545    /// # use google_cloud_aiplatform_v1::client::EvaluationService;
2546    /// use google_cloud_aiplatform_v1::Result;
2547    /// async fn sample(
2548    ///    client: &EvaluationService
2549    /// ) -> Result<()> {
2550    ///     let response = client.set_iam_policy()
2551    ///         /* set fields */
2552    ///         .send().await?;
2553    ///     println!("response {:?}", response);
2554    ///     Ok(())
2555    /// }
2556    /// ```
2557    pub fn set_iam_policy(&self) -> super::builder::evaluation_service::SetIamPolicy {
2558        super::builder::evaluation_service::SetIamPolicy::new(self.inner.clone())
2559    }
2560
2561    /// Gets the access control policy for a resource. Returns an empty policy
2562    /// if the resource exists and does not have a policy set.
2563    ///
2564    /// # Example
2565    /// ```
2566    /// # use google_cloud_aiplatform_v1::client::EvaluationService;
2567    /// use google_cloud_aiplatform_v1::Result;
2568    /// async fn sample(
2569    ///    client: &EvaluationService
2570    /// ) -> Result<()> {
2571    ///     let response = client.get_iam_policy()
2572    ///         /* set fields */
2573    ///         .send().await?;
2574    ///     println!("response {:?}", response);
2575    ///     Ok(())
2576    /// }
2577    /// ```
2578    pub fn get_iam_policy(&self) -> super::builder::evaluation_service::GetIamPolicy {
2579        super::builder::evaluation_service::GetIamPolicy::new(self.inner.clone())
2580    }
2581
2582    /// Returns permissions that a caller has on the specified resource. If the
2583    /// resource does not exist, this will return an empty set of
2584    /// permissions, not a `NOT_FOUND` error.
2585    ///
2586    /// Note: This operation is designed to be used for building
2587    /// permission-aware UIs and command-line tools, not for authorization
2588    /// checking. This operation may "fail open" without warning.
2589    ///
2590    /// # Example
2591    /// ```
2592    /// # use google_cloud_aiplatform_v1::client::EvaluationService;
2593    /// use google_cloud_aiplatform_v1::Result;
2594    /// async fn sample(
2595    ///    client: &EvaluationService
2596    /// ) -> Result<()> {
2597    ///     let response = client.test_iam_permissions()
2598    ///         /* set fields */
2599    ///         .send().await?;
2600    ///     println!("response {:?}", response);
2601    ///     Ok(())
2602    /// }
2603    /// ```
2604    pub fn test_iam_permissions(&self) -> super::builder::evaluation_service::TestIamPermissions {
2605        super::builder::evaluation_service::TestIamPermissions::new(self.inner.clone())
2606    }
2607
2608    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2609    ///
2610    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2611    ///
2612    /// # Example
2613    /// ```
2614    /// # use google_cloud_aiplatform_v1::client::EvaluationService;
2615    /// use google_cloud_gax::paginator::ItemPaginator as _;
2616    /// use google_cloud_aiplatform_v1::Result;
2617    /// async fn sample(
2618    ///    client: &EvaluationService
2619    /// ) -> Result<()> {
2620    ///     let mut list = client.list_operations()
2621    ///         /* set fields */
2622    ///         .by_item();
2623    ///     while let Some(item) = list.next().await.transpose()? {
2624    ///         println!("{:?}", item);
2625    ///     }
2626    ///     Ok(())
2627    /// }
2628    /// ```
2629    pub fn list_operations(&self) -> super::builder::evaluation_service::ListOperations {
2630        super::builder::evaluation_service::ListOperations::new(self.inner.clone())
2631    }
2632
2633    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2634    ///
2635    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2636    ///
2637    /// # Example
2638    /// ```
2639    /// # use google_cloud_aiplatform_v1::client::EvaluationService;
2640    /// use google_cloud_aiplatform_v1::Result;
2641    /// async fn sample(
2642    ///    client: &EvaluationService
2643    /// ) -> Result<()> {
2644    ///     let response = client.get_operation()
2645    ///         /* set fields */
2646    ///         .send().await?;
2647    ///     println!("response {:?}", response);
2648    ///     Ok(())
2649    /// }
2650    /// ```
2651    pub fn get_operation(&self) -> super::builder::evaluation_service::GetOperation {
2652        super::builder::evaluation_service::GetOperation::new(self.inner.clone())
2653    }
2654
2655    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2656    ///
2657    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2658    ///
2659    /// # Example
2660    /// ```
2661    /// # use google_cloud_aiplatform_v1::client::EvaluationService;
2662    /// use google_cloud_aiplatform_v1::Result;
2663    /// async fn sample(
2664    ///    client: &EvaluationService
2665    /// ) -> Result<()> {
2666    ///     client.delete_operation()
2667    ///         /* set fields */
2668    ///         .send().await?;
2669    ///     Ok(())
2670    /// }
2671    /// ```
2672    pub fn delete_operation(&self) -> super::builder::evaluation_service::DeleteOperation {
2673        super::builder::evaluation_service::DeleteOperation::new(self.inner.clone())
2674    }
2675
2676    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2677    ///
2678    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2679    ///
2680    /// # Example
2681    /// ```
2682    /// # use google_cloud_aiplatform_v1::client::EvaluationService;
2683    /// use google_cloud_aiplatform_v1::Result;
2684    /// async fn sample(
2685    ///    client: &EvaluationService
2686    /// ) -> Result<()> {
2687    ///     client.cancel_operation()
2688    ///         /* set fields */
2689    ///         .send().await?;
2690    ///     Ok(())
2691    /// }
2692    /// ```
2693    pub fn cancel_operation(&self) -> super::builder::evaluation_service::CancelOperation {
2694        super::builder::evaluation_service::CancelOperation::new(self.inner.clone())
2695    }
2696
2697    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2698    ///
2699    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2700    ///
2701    /// # Example
2702    /// ```
2703    /// # use google_cloud_aiplatform_v1::client::EvaluationService;
2704    /// use google_cloud_aiplatform_v1::Result;
2705    /// async fn sample(
2706    ///    client: &EvaluationService
2707    /// ) -> Result<()> {
2708    ///     let response = client.wait_operation()
2709    ///         /* set fields */
2710    ///         .send().await?;
2711    ///     println!("response {:?}", response);
2712    ///     Ok(())
2713    /// }
2714    /// ```
2715    pub fn wait_operation(&self) -> super::builder::evaluation_service::WaitOperation {
2716        super::builder::evaluation_service::WaitOperation::new(self.inner.clone())
2717    }
2718}
2719
2720/// Implements a client for the Vertex AI API.
2721///
2722/// # Example
2723/// ```
2724/// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
2725/// use google_cloud_gax::paginator::ItemPaginator as _;
2726/// async fn sample(
2727///    project_id: &str,
2728///    location_id: &str,
2729/// ) -> anyhow::Result<()> {
2730///     let client = FeatureOnlineStoreAdminService::builder().build().await?;
2731///     let mut list = client.list_feature_online_stores()
2732///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
2733///         .by_item();
2734///     while let Some(item) = list.next().await.transpose()? {
2735///         println!("{:?}", item);
2736///     }
2737///     Ok(())
2738/// }
2739/// ```
2740///
2741/// # Service Description
2742///
2743/// The service that handles CRUD and List for resources for
2744/// FeatureOnlineStore.
2745///
2746/// # Configuration
2747///
2748/// To configure `FeatureOnlineStoreAdminService` use the `with_*` methods in the type returned
2749/// by [builder()][FeatureOnlineStoreAdminService::builder]. The default configuration should
2750/// work for most applications. Common configuration changes include
2751///
2752/// * [with_endpoint()]: by default this client uses the global default endpoint
2753///   (`https://aiplatform.googleapis.com`). Applications using regional
2754///   endpoints or running in restricted networks (e.g. a network configured
2755///   with [Private Google Access with VPC Service Controls]) may want to
2756///   override this default.
2757/// * [with_credentials()]: by default this client uses
2758///   [Application Default Credentials]. Applications using custom
2759///   authentication may need to override this default.
2760///
2761/// [with_endpoint()]: super::builder::feature_online_store_admin_service::ClientBuilder::with_endpoint
2762/// [with_credentials()]: super::builder::feature_online_store_admin_service::ClientBuilder::with_credentials
2763/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2764/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2765///
2766/// # Pooling and Cloning
2767///
2768/// `FeatureOnlineStoreAdminService` holds a connection pool internally, it is advised to
2769/// create one and reuse it. You do not need to wrap `FeatureOnlineStoreAdminService` in
2770/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2771/// already uses an `Arc` internally.
2772#[cfg(feature = "feature-online-store-admin-service")]
2773#[cfg_attr(docsrs, doc(cfg(feature = "feature-online-store-admin-service")))]
2774#[derive(Clone, Debug)]
2775pub struct FeatureOnlineStoreAdminService {
2776    inner: std::sync::Arc<dyn super::stub::dynamic::FeatureOnlineStoreAdminService>,
2777}
2778
2779#[cfg(feature = "feature-online-store-admin-service")]
2780impl FeatureOnlineStoreAdminService {
2781    /// Returns a builder for [FeatureOnlineStoreAdminService].
2782    ///
2783    /// ```
2784    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2785    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
2786    /// let client = FeatureOnlineStoreAdminService::builder().build().await?;
2787    /// # Ok(()) }
2788    /// ```
2789    pub fn builder() -> super::builder::feature_online_store_admin_service::ClientBuilder {
2790        crate::new_client_builder(
2791            super::builder::feature_online_store_admin_service::client::Factory,
2792        )
2793    }
2794
2795    /// Creates a new client from the provided stub.
2796    ///
2797    /// The most common case for calling this function is in tests mocking the
2798    /// client's behavior.
2799    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2800    where
2801        T: super::stub::FeatureOnlineStoreAdminService + 'static,
2802    {
2803        Self { inner: stub.into() }
2804    }
2805
2806    pub(crate) async fn new(
2807        config: gaxi::options::ClientConfig,
2808    ) -> crate::ClientBuilderResult<Self> {
2809        let inner = Self::build_inner(config).await?;
2810        Ok(Self { inner })
2811    }
2812
2813    async fn build_inner(
2814        conf: gaxi::options::ClientConfig,
2815    ) -> crate::ClientBuilderResult<
2816        std::sync::Arc<dyn super::stub::dynamic::FeatureOnlineStoreAdminService>,
2817    > {
2818        if gaxi::options::tracing_enabled(&conf) {
2819            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2820        }
2821        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2822    }
2823
2824    async fn build_transport(
2825        conf: gaxi::options::ClientConfig,
2826    ) -> crate::ClientBuilderResult<impl super::stub::FeatureOnlineStoreAdminService> {
2827        super::transport::FeatureOnlineStoreAdminService::new(conf).await
2828    }
2829
2830    async fn build_with_tracing(
2831        conf: gaxi::options::ClientConfig,
2832    ) -> crate::ClientBuilderResult<impl super::stub::FeatureOnlineStoreAdminService> {
2833        Self::build_transport(conf)
2834            .await
2835            .map(super::tracing::FeatureOnlineStoreAdminService::new)
2836    }
2837
2838    /// Creates a new FeatureOnlineStore in a given project and location.
2839    ///
2840    /// # Long running operations
2841    ///
2842    /// This method is used to start, and/or poll a [long-running Operation].
2843    /// The [Working with long-running operations] chapter in the [user guide]
2844    /// covers these operations in detail.
2845    ///
2846    /// [long-running operation]: https://google.aip.dev/151
2847    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2848    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2849    ///
2850    /// # Example
2851    /// ```
2852    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
2853    /// use google_cloud_lro::Poller;
2854    /// use google_cloud_aiplatform_v1::model::FeatureOnlineStore;
2855    /// use google_cloud_aiplatform_v1::Result;
2856    /// async fn sample(
2857    ///    client: &FeatureOnlineStoreAdminService, project_id: &str, location_id: &str
2858    /// ) -> Result<()> {
2859    ///     let response = client.create_feature_online_store()
2860    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
2861    ///         .set_feature_online_store(
2862    ///             FeatureOnlineStore::new()/* set fields */
2863    ///         )
2864    ///         .poller().until_done().await?;
2865    ///     println!("response {:?}", response);
2866    ///     Ok(())
2867    /// }
2868    /// ```
2869    pub fn create_feature_online_store(
2870        &self,
2871    ) -> super::builder::feature_online_store_admin_service::CreateFeatureOnlineStore {
2872        super::builder::feature_online_store_admin_service::CreateFeatureOnlineStore::new(
2873            self.inner.clone(),
2874        )
2875    }
2876
2877    /// Gets details of a single FeatureOnlineStore.
2878    ///
2879    /// # Example
2880    /// ```
2881    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
2882    /// use google_cloud_aiplatform_v1::Result;
2883    /// async fn sample(
2884    ///    client: &FeatureOnlineStoreAdminService, project_id: &str, location_id: &str, feature_online_store_id: &str
2885    /// ) -> Result<()> {
2886    ///     let response = client.get_feature_online_store()
2887    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featureOnlineStores/{feature_online_store_id}"))
2888    ///         .send().await?;
2889    ///     println!("response {:?}", response);
2890    ///     Ok(())
2891    /// }
2892    /// ```
2893    pub fn get_feature_online_store(
2894        &self,
2895    ) -> super::builder::feature_online_store_admin_service::GetFeatureOnlineStore {
2896        super::builder::feature_online_store_admin_service::GetFeatureOnlineStore::new(
2897            self.inner.clone(),
2898        )
2899    }
2900
2901    /// Lists FeatureOnlineStores in a given project and location.
2902    ///
2903    /// # Example
2904    /// ```
2905    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
2906    /// use google_cloud_gax::paginator::ItemPaginator as _;
2907    /// use google_cloud_aiplatform_v1::Result;
2908    /// async fn sample(
2909    ///    client: &FeatureOnlineStoreAdminService, project_id: &str, location_id: &str
2910    /// ) -> Result<()> {
2911    ///     let mut list = client.list_feature_online_stores()
2912    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
2913    ///         .by_item();
2914    ///     while let Some(item) = list.next().await.transpose()? {
2915    ///         println!("{:?}", item);
2916    ///     }
2917    ///     Ok(())
2918    /// }
2919    /// ```
2920    pub fn list_feature_online_stores(
2921        &self,
2922    ) -> super::builder::feature_online_store_admin_service::ListFeatureOnlineStores {
2923        super::builder::feature_online_store_admin_service::ListFeatureOnlineStores::new(
2924            self.inner.clone(),
2925        )
2926    }
2927
2928    /// Updates the parameters of a single FeatureOnlineStore.
2929    ///
2930    /// # Long running operations
2931    ///
2932    /// This method is used to start, and/or poll a [long-running Operation].
2933    /// The [Working with long-running operations] chapter in the [user guide]
2934    /// covers these operations in detail.
2935    ///
2936    /// [long-running operation]: https://google.aip.dev/151
2937    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2938    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2939    ///
2940    /// # Example
2941    /// ```
2942    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
2943    /// use google_cloud_lro::Poller;
2944    /// # extern crate wkt as google_cloud_wkt;
2945    /// use google_cloud_wkt::FieldMask;
2946    /// use google_cloud_aiplatform_v1::model::FeatureOnlineStore;
2947    /// use google_cloud_aiplatform_v1::Result;
2948    /// async fn sample(
2949    ///    client: &FeatureOnlineStoreAdminService, project_id: &str, location_id: &str, feature_online_store_id: &str
2950    /// ) -> Result<()> {
2951    ///     let response = client.update_feature_online_store()
2952    ///         .set_feature_online_store(
2953    ///             FeatureOnlineStore::new().set_name(format!("projects/{project_id}/locations/{location_id}/featureOnlineStores/{feature_online_store_id}"))/* set fields */
2954    ///         )
2955    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
2956    ///         .poller().until_done().await?;
2957    ///     println!("response {:?}", response);
2958    ///     Ok(())
2959    /// }
2960    /// ```
2961    pub fn update_feature_online_store(
2962        &self,
2963    ) -> super::builder::feature_online_store_admin_service::UpdateFeatureOnlineStore {
2964        super::builder::feature_online_store_admin_service::UpdateFeatureOnlineStore::new(
2965            self.inner.clone(),
2966        )
2967    }
2968
2969    /// Deletes a single FeatureOnlineStore. The FeatureOnlineStore must not
2970    /// contain any FeatureViews.
2971    ///
2972    /// # Long running operations
2973    ///
2974    /// This method is used to start, and/or poll a [long-running Operation].
2975    /// The [Working with long-running operations] chapter in the [user guide]
2976    /// covers these operations in detail.
2977    ///
2978    /// [long-running operation]: https://google.aip.dev/151
2979    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2980    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2981    ///
2982    /// # Example
2983    /// ```
2984    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
2985    /// use google_cloud_lro::Poller;
2986    /// use google_cloud_aiplatform_v1::Result;
2987    /// async fn sample(
2988    ///    client: &FeatureOnlineStoreAdminService, project_id: &str, location_id: &str, feature_online_store_id: &str
2989    /// ) -> Result<()> {
2990    ///     client.delete_feature_online_store()
2991    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featureOnlineStores/{feature_online_store_id}"))
2992    ///         .poller().until_done().await?;
2993    ///     Ok(())
2994    /// }
2995    /// ```
2996    pub fn delete_feature_online_store(
2997        &self,
2998    ) -> super::builder::feature_online_store_admin_service::DeleteFeatureOnlineStore {
2999        super::builder::feature_online_store_admin_service::DeleteFeatureOnlineStore::new(
3000            self.inner.clone(),
3001        )
3002    }
3003
3004    /// Creates a new FeatureView in a given FeatureOnlineStore.
3005    ///
3006    /// # Long running operations
3007    ///
3008    /// This method is used to start, and/or poll a [long-running Operation].
3009    /// The [Working with long-running operations] chapter in the [user guide]
3010    /// covers these operations in detail.
3011    ///
3012    /// [long-running operation]: https://google.aip.dev/151
3013    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3014    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3015    ///
3016    /// # Example
3017    /// ```
3018    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3019    /// use google_cloud_lro::Poller;
3020    /// use google_cloud_aiplatform_v1::model::FeatureView;
3021    /// use google_cloud_aiplatform_v1::Result;
3022    /// async fn sample(
3023    ///    client: &FeatureOnlineStoreAdminService, project_id: &str, location_id: &str, feature_online_store_id: &str
3024    /// ) -> Result<()> {
3025    ///     let response = client.create_feature_view()
3026    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/featureOnlineStores/{feature_online_store_id}"))
3027    ///         .set_feature_view(
3028    ///             FeatureView::new()/* set fields */
3029    ///         )
3030    ///         .poller().until_done().await?;
3031    ///     println!("response {:?}", response);
3032    ///     Ok(())
3033    /// }
3034    /// ```
3035    pub fn create_feature_view(
3036        &self,
3037    ) -> super::builder::feature_online_store_admin_service::CreateFeatureView {
3038        super::builder::feature_online_store_admin_service::CreateFeatureView::new(
3039            self.inner.clone(),
3040        )
3041    }
3042
3043    /// Gets details of a single FeatureView.
3044    ///
3045    /// # Example
3046    /// ```
3047    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3048    /// use google_cloud_aiplatform_v1::Result;
3049    /// async fn sample(
3050    ///    client: &FeatureOnlineStoreAdminService, project_id: &str, location_id: &str, feature_online_store_id: &str, feature_view_id: &str
3051    /// ) -> Result<()> {
3052    ///     let response = client.get_feature_view()
3053    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featureOnlineStores/{feature_online_store_id}/featureViews/{feature_view_id}"))
3054    ///         .send().await?;
3055    ///     println!("response {:?}", response);
3056    ///     Ok(())
3057    /// }
3058    /// ```
3059    pub fn get_feature_view(
3060        &self,
3061    ) -> super::builder::feature_online_store_admin_service::GetFeatureView {
3062        super::builder::feature_online_store_admin_service::GetFeatureView::new(self.inner.clone())
3063    }
3064
3065    /// Lists FeatureViews in a given FeatureOnlineStore.
3066    ///
3067    /// # Example
3068    /// ```
3069    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3070    /// use google_cloud_gax::paginator::ItemPaginator as _;
3071    /// use google_cloud_aiplatform_v1::Result;
3072    /// async fn sample(
3073    ///    client: &FeatureOnlineStoreAdminService, project_id: &str, location_id: &str, feature_online_store_id: &str
3074    /// ) -> Result<()> {
3075    ///     let mut list = client.list_feature_views()
3076    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/featureOnlineStores/{feature_online_store_id}"))
3077    ///         .by_item();
3078    ///     while let Some(item) = list.next().await.transpose()? {
3079    ///         println!("{:?}", item);
3080    ///     }
3081    ///     Ok(())
3082    /// }
3083    /// ```
3084    pub fn list_feature_views(
3085        &self,
3086    ) -> super::builder::feature_online_store_admin_service::ListFeatureViews {
3087        super::builder::feature_online_store_admin_service::ListFeatureViews::new(
3088            self.inner.clone(),
3089        )
3090    }
3091
3092    /// Updates the parameters of a single FeatureView.
3093    ///
3094    /// # Long running operations
3095    ///
3096    /// This method is used to start, and/or poll a [long-running Operation].
3097    /// The [Working with long-running operations] chapter in the [user guide]
3098    /// covers these operations in detail.
3099    ///
3100    /// [long-running operation]: https://google.aip.dev/151
3101    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3102    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3103    ///
3104    /// # Example
3105    /// ```
3106    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3107    /// use google_cloud_lro::Poller;
3108    /// # extern crate wkt as google_cloud_wkt;
3109    /// use google_cloud_wkt::FieldMask;
3110    /// use google_cloud_aiplatform_v1::model::FeatureView;
3111    /// use google_cloud_aiplatform_v1::Result;
3112    /// async fn sample(
3113    ///    client: &FeatureOnlineStoreAdminService, project_id: &str, location_id: &str, feature_online_store_id: &str, feature_view_id: &str
3114    /// ) -> Result<()> {
3115    ///     let response = client.update_feature_view()
3116    ///         .set_feature_view(
3117    ///             FeatureView::new().set_name(format!("projects/{project_id}/locations/{location_id}/featureOnlineStores/{feature_online_store_id}/featureViews/{feature_view_id}"))/* set fields */
3118    ///         )
3119    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
3120    ///         .poller().until_done().await?;
3121    ///     println!("response {:?}", response);
3122    ///     Ok(())
3123    /// }
3124    /// ```
3125    pub fn update_feature_view(
3126        &self,
3127    ) -> super::builder::feature_online_store_admin_service::UpdateFeatureView {
3128        super::builder::feature_online_store_admin_service::UpdateFeatureView::new(
3129            self.inner.clone(),
3130        )
3131    }
3132
3133    /// Deletes a single FeatureView.
3134    ///
3135    /// # Long running operations
3136    ///
3137    /// This method is used to start, and/or poll a [long-running Operation].
3138    /// The [Working with long-running operations] chapter in the [user guide]
3139    /// covers these operations in detail.
3140    ///
3141    /// [long-running operation]: https://google.aip.dev/151
3142    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
3143    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
3144    ///
3145    /// # Example
3146    /// ```
3147    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3148    /// use google_cloud_lro::Poller;
3149    /// use google_cloud_aiplatform_v1::Result;
3150    /// async fn sample(
3151    ///    client: &FeatureOnlineStoreAdminService, project_id: &str, location_id: &str, feature_online_store_id: &str, feature_view_id: &str
3152    /// ) -> Result<()> {
3153    ///     client.delete_feature_view()
3154    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featureOnlineStores/{feature_online_store_id}/featureViews/{feature_view_id}"))
3155    ///         .poller().until_done().await?;
3156    ///     Ok(())
3157    /// }
3158    /// ```
3159    pub fn delete_feature_view(
3160        &self,
3161    ) -> super::builder::feature_online_store_admin_service::DeleteFeatureView {
3162        super::builder::feature_online_store_admin_service::DeleteFeatureView::new(
3163            self.inner.clone(),
3164        )
3165    }
3166
3167    /// Triggers on-demand sync for the FeatureView.
3168    ///
3169    /// # Example
3170    /// ```
3171    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3172    /// use google_cloud_aiplatform_v1::Result;
3173    /// async fn sample(
3174    ///    client: &FeatureOnlineStoreAdminService
3175    /// ) -> Result<()> {
3176    ///     let response = client.sync_feature_view()
3177    ///         /* set fields */
3178    ///         .send().await?;
3179    ///     println!("response {:?}", response);
3180    ///     Ok(())
3181    /// }
3182    /// ```
3183    pub fn sync_feature_view(
3184        &self,
3185    ) -> super::builder::feature_online_store_admin_service::SyncFeatureView {
3186        super::builder::feature_online_store_admin_service::SyncFeatureView::new(self.inner.clone())
3187    }
3188
3189    /// Gets details of a single FeatureViewSync.
3190    ///
3191    /// # Example
3192    /// ```
3193    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3194    /// use google_cloud_aiplatform_v1::Result;
3195    /// async fn sample(
3196    ///    client: &FeatureOnlineStoreAdminService, project_id: &str, location_id: &str, feature_online_store_id: &str, feature_view_id: &str
3197    /// ) -> Result<()> {
3198    ///     let response = client.get_feature_view_sync()
3199    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featureOnlineStores/{feature_online_store_id}/featureViews/{feature_view_id}/featureViewSyncs/feature_view_sync"))
3200    ///         .send().await?;
3201    ///     println!("response {:?}", response);
3202    ///     Ok(())
3203    /// }
3204    /// ```
3205    pub fn get_feature_view_sync(
3206        &self,
3207    ) -> super::builder::feature_online_store_admin_service::GetFeatureViewSync {
3208        super::builder::feature_online_store_admin_service::GetFeatureViewSync::new(
3209            self.inner.clone(),
3210        )
3211    }
3212
3213    /// Lists FeatureViewSyncs in a given FeatureView.
3214    ///
3215    /// # Example
3216    /// ```
3217    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3218    /// use google_cloud_gax::paginator::ItemPaginator as _;
3219    /// use google_cloud_aiplatform_v1::Result;
3220    /// async fn sample(
3221    ///    client: &FeatureOnlineStoreAdminService, project_id: &str, location_id: &str, feature_online_store_id: &str, feature_view_id: &str
3222    /// ) -> Result<()> {
3223    ///     let mut list = client.list_feature_view_syncs()
3224    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/featureOnlineStores/{feature_online_store_id}/featureViews/{feature_view_id}"))
3225    ///         .by_item();
3226    ///     while let Some(item) = list.next().await.transpose()? {
3227    ///         println!("{:?}", item);
3228    ///     }
3229    ///     Ok(())
3230    /// }
3231    /// ```
3232    pub fn list_feature_view_syncs(
3233        &self,
3234    ) -> super::builder::feature_online_store_admin_service::ListFeatureViewSyncs {
3235        super::builder::feature_online_store_admin_service::ListFeatureViewSyncs::new(
3236            self.inner.clone(),
3237        )
3238    }
3239
3240    /// Lists information about the supported locations for this service.
3241    ///
3242    /// # Example
3243    /// ```
3244    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3245    /// use google_cloud_gax::paginator::ItemPaginator as _;
3246    /// use google_cloud_aiplatform_v1::Result;
3247    /// async fn sample(
3248    ///    client: &FeatureOnlineStoreAdminService
3249    /// ) -> Result<()> {
3250    ///     let mut list = client.list_locations()
3251    ///         /* set fields */
3252    ///         .by_item();
3253    ///     while let Some(item) = list.next().await.transpose()? {
3254    ///         println!("{:?}", item);
3255    ///     }
3256    ///     Ok(())
3257    /// }
3258    /// ```
3259    pub fn list_locations(
3260        &self,
3261    ) -> super::builder::feature_online_store_admin_service::ListLocations {
3262        super::builder::feature_online_store_admin_service::ListLocations::new(self.inner.clone())
3263    }
3264
3265    /// Gets information about a location.
3266    ///
3267    /// # Example
3268    /// ```
3269    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3270    /// use google_cloud_aiplatform_v1::Result;
3271    /// async fn sample(
3272    ///    client: &FeatureOnlineStoreAdminService
3273    /// ) -> Result<()> {
3274    ///     let response = client.get_location()
3275    ///         /* set fields */
3276    ///         .send().await?;
3277    ///     println!("response {:?}", response);
3278    ///     Ok(())
3279    /// }
3280    /// ```
3281    pub fn get_location(&self) -> super::builder::feature_online_store_admin_service::GetLocation {
3282        super::builder::feature_online_store_admin_service::GetLocation::new(self.inner.clone())
3283    }
3284
3285    /// Sets the access control policy on the specified resource. Replaces
3286    /// any existing policy.
3287    ///
3288    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
3289    /// errors.
3290    ///
3291    /// # Example
3292    /// ```
3293    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3294    /// use google_cloud_aiplatform_v1::Result;
3295    /// async fn sample(
3296    ///    client: &FeatureOnlineStoreAdminService
3297    /// ) -> Result<()> {
3298    ///     let response = client.set_iam_policy()
3299    ///         /* set fields */
3300    ///         .send().await?;
3301    ///     println!("response {:?}", response);
3302    ///     Ok(())
3303    /// }
3304    /// ```
3305    pub fn set_iam_policy(
3306        &self,
3307    ) -> super::builder::feature_online_store_admin_service::SetIamPolicy {
3308        super::builder::feature_online_store_admin_service::SetIamPolicy::new(self.inner.clone())
3309    }
3310
3311    /// Gets the access control policy for a resource. Returns an empty policy
3312    /// if the resource exists and does not have a policy set.
3313    ///
3314    /// # Example
3315    /// ```
3316    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3317    /// use google_cloud_aiplatform_v1::Result;
3318    /// async fn sample(
3319    ///    client: &FeatureOnlineStoreAdminService
3320    /// ) -> Result<()> {
3321    ///     let response = client.get_iam_policy()
3322    ///         /* set fields */
3323    ///         .send().await?;
3324    ///     println!("response {:?}", response);
3325    ///     Ok(())
3326    /// }
3327    /// ```
3328    pub fn get_iam_policy(
3329        &self,
3330    ) -> super::builder::feature_online_store_admin_service::GetIamPolicy {
3331        super::builder::feature_online_store_admin_service::GetIamPolicy::new(self.inner.clone())
3332    }
3333
3334    /// Returns permissions that a caller has on the specified resource. If the
3335    /// resource does not exist, this will return an empty set of
3336    /// permissions, not a `NOT_FOUND` error.
3337    ///
3338    /// Note: This operation is designed to be used for building
3339    /// permission-aware UIs and command-line tools, not for authorization
3340    /// checking. This operation may "fail open" without warning.
3341    ///
3342    /// # Example
3343    /// ```
3344    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3345    /// use google_cloud_aiplatform_v1::Result;
3346    /// async fn sample(
3347    ///    client: &FeatureOnlineStoreAdminService
3348    /// ) -> Result<()> {
3349    ///     let response = client.test_iam_permissions()
3350    ///         /* set fields */
3351    ///         .send().await?;
3352    ///     println!("response {:?}", response);
3353    ///     Ok(())
3354    /// }
3355    /// ```
3356    pub fn test_iam_permissions(
3357        &self,
3358    ) -> super::builder::feature_online_store_admin_service::TestIamPermissions {
3359        super::builder::feature_online_store_admin_service::TestIamPermissions::new(
3360            self.inner.clone(),
3361        )
3362    }
3363
3364    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3365    ///
3366    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3367    ///
3368    /// # Example
3369    /// ```
3370    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3371    /// use google_cloud_gax::paginator::ItemPaginator as _;
3372    /// use google_cloud_aiplatform_v1::Result;
3373    /// async fn sample(
3374    ///    client: &FeatureOnlineStoreAdminService
3375    /// ) -> Result<()> {
3376    ///     let mut list = client.list_operations()
3377    ///         /* set fields */
3378    ///         .by_item();
3379    ///     while let Some(item) = list.next().await.transpose()? {
3380    ///         println!("{:?}", item);
3381    ///     }
3382    ///     Ok(())
3383    /// }
3384    /// ```
3385    pub fn list_operations(
3386        &self,
3387    ) -> super::builder::feature_online_store_admin_service::ListOperations {
3388        super::builder::feature_online_store_admin_service::ListOperations::new(self.inner.clone())
3389    }
3390
3391    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3392    ///
3393    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3394    ///
3395    /// # Example
3396    /// ```
3397    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3398    /// use google_cloud_aiplatform_v1::Result;
3399    /// async fn sample(
3400    ///    client: &FeatureOnlineStoreAdminService
3401    /// ) -> Result<()> {
3402    ///     let response = client.get_operation()
3403    ///         /* set fields */
3404    ///         .send().await?;
3405    ///     println!("response {:?}", response);
3406    ///     Ok(())
3407    /// }
3408    /// ```
3409    pub fn get_operation(
3410        &self,
3411    ) -> super::builder::feature_online_store_admin_service::GetOperation {
3412        super::builder::feature_online_store_admin_service::GetOperation::new(self.inner.clone())
3413    }
3414
3415    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3416    ///
3417    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3418    ///
3419    /// # Example
3420    /// ```
3421    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3422    /// use google_cloud_aiplatform_v1::Result;
3423    /// async fn sample(
3424    ///    client: &FeatureOnlineStoreAdminService
3425    /// ) -> Result<()> {
3426    ///     client.delete_operation()
3427    ///         /* set fields */
3428    ///         .send().await?;
3429    ///     Ok(())
3430    /// }
3431    /// ```
3432    pub fn delete_operation(
3433        &self,
3434    ) -> super::builder::feature_online_store_admin_service::DeleteOperation {
3435        super::builder::feature_online_store_admin_service::DeleteOperation::new(self.inner.clone())
3436    }
3437
3438    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3439    ///
3440    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3441    ///
3442    /// # Example
3443    /// ```
3444    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3445    /// use google_cloud_aiplatform_v1::Result;
3446    /// async fn sample(
3447    ///    client: &FeatureOnlineStoreAdminService
3448    /// ) -> Result<()> {
3449    ///     client.cancel_operation()
3450    ///         /* set fields */
3451    ///         .send().await?;
3452    ///     Ok(())
3453    /// }
3454    /// ```
3455    pub fn cancel_operation(
3456        &self,
3457    ) -> super::builder::feature_online_store_admin_service::CancelOperation {
3458        super::builder::feature_online_store_admin_service::CancelOperation::new(self.inner.clone())
3459    }
3460
3461    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3462    ///
3463    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3464    ///
3465    /// # Example
3466    /// ```
3467    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreAdminService;
3468    /// use google_cloud_aiplatform_v1::Result;
3469    /// async fn sample(
3470    ///    client: &FeatureOnlineStoreAdminService
3471    /// ) -> Result<()> {
3472    ///     let response = client.wait_operation()
3473    ///         /* set fields */
3474    ///         .send().await?;
3475    ///     println!("response {:?}", response);
3476    ///     Ok(())
3477    /// }
3478    /// ```
3479    pub fn wait_operation(
3480        &self,
3481    ) -> super::builder::feature_online_store_admin_service::WaitOperation {
3482        super::builder::feature_online_store_admin_service::WaitOperation::new(self.inner.clone())
3483    }
3484}
3485
3486/// Implements a client for the Vertex AI API.
3487///
3488/// # Example
3489/// ```
3490/// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3491/// async fn sample(
3492/// ) -> anyhow::Result<()> {
3493///     let client = FeatureOnlineStoreService::builder().build().await?;
3494///     let response = client.fetch_feature_values()
3495///         /* set fields */
3496///         .send().await?;
3497///     println!("response {:?}", response);
3498///     Ok(())
3499/// }
3500/// ```
3501///
3502/// # Service Description
3503///
3504/// A service for fetching feature values from the online store.
3505///
3506/// # Configuration
3507///
3508/// To configure `FeatureOnlineStoreService` use the `with_*` methods in the type returned
3509/// by [builder()][FeatureOnlineStoreService::builder]. The default configuration should
3510/// work for most applications. Common configuration changes include
3511///
3512/// * [with_endpoint()]: by default this client uses the global default endpoint
3513///   (`https://aiplatform.googleapis.com`). Applications using regional
3514///   endpoints or running in restricted networks (e.g. a network configured
3515///   with [Private Google Access with VPC Service Controls]) may want to
3516///   override this default.
3517/// * [with_credentials()]: by default this client uses
3518///   [Application Default Credentials]. Applications using custom
3519///   authentication may need to override this default.
3520///
3521/// [with_endpoint()]: super::builder::feature_online_store_service::ClientBuilder::with_endpoint
3522/// [with_credentials()]: super::builder::feature_online_store_service::ClientBuilder::with_credentials
3523/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3524/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3525///
3526/// # Pooling and Cloning
3527///
3528/// `FeatureOnlineStoreService` holds a connection pool internally, it is advised to
3529/// create one and reuse it. You do not need to wrap `FeatureOnlineStoreService` in
3530/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3531/// already uses an `Arc` internally.
3532#[cfg(feature = "feature-online-store-service")]
3533#[cfg_attr(docsrs, doc(cfg(feature = "feature-online-store-service")))]
3534#[derive(Clone, Debug)]
3535pub struct FeatureOnlineStoreService {
3536    inner: std::sync::Arc<dyn super::stub::dynamic::FeatureOnlineStoreService>,
3537}
3538
3539#[cfg(feature = "feature-online-store-service")]
3540impl FeatureOnlineStoreService {
3541    /// Returns a builder for [FeatureOnlineStoreService].
3542    ///
3543    /// ```
3544    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3545    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3546    /// let client = FeatureOnlineStoreService::builder().build().await?;
3547    /// # Ok(()) }
3548    /// ```
3549    pub fn builder() -> super::builder::feature_online_store_service::ClientBuilder {
3550        crate::new_client_builder(super::builder::feature_online_store_service::client::Factory)
3551    }
3552
3553    /// Creates a new client from the provided stub.
3554    ///
3555    /// The most common case for calling this function is in tests mocking the
3556    /// client's behavior.
3557    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3558    where
3559        T: super::stub::FeatureOnlineStoreService + 'static,
3560    {
3561        Self { inner: stub.into() }
3562    }
3563
3564    pub(crate) async fn new(
3565        config: gaxi::options::ClientConfig,
3566    ) -> crate::ClientBuilderResult<Self> {
3567        let inner = Self::build_inner(config).await?;
3568        Ok(Self { inner })
3569    }
3570
3571    async fn build_inner(
3572        conf: gaxi::options::ClientConfig,
3573    ) -> crate::ClientBuilderResult<
3574        std::sync::Arc<dyn super::stub::dynamic::FeatureOnlineStoreService>,
3575    > {
3576        if gaxi::options::tracing_enabled(&conf) {
3577            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3578        }
3579        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3580    }
3581
3582    async fn build_transport(
3583        conf: gaxi::options::ClientConfig,
3584    ) -> crate::ClientBuilderResult<impl super::stub::FeatureOnlineStoreService> {
3585        super::transport::FeatureOnlineStoreService::new(conf).await
3586    }
3587
3588    async fn build_with_tracing(
3589        conf: gaxi::options::ClientConfig,
3590    ) -> crate::ClientBuilderResult<impl super::stub::FeatureOnlineStoreService> {
3591        Self::build_transport(conf)
3592            .await
3593            .map(super::tracing::FeatureOnlineStoreService::new)
3594    }
3595
3596    /// Fetch feature values under a FeatureView.
3597    ///
3598    /// # Example
3599    /// ```
3600    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3601    /// use google_cloud_aiplatform_v1::Result;
3602    /// async fn sample(
3603    ///    client: &FeatureOnlineStoreService
3604    /// ) -> Result<()> {
3605    ///     let response = client.fetch_feature_values()
3606    ///         /* set fields */
3607    ///         .send().await?;
3608    ///     println!("response {:?}", response);
3609    ///     Ok(())
3610    /// }
3611    /// ```
3612    pub fn fetch_feature_values(
3613        &self,
3614    ) -> super::builder::feature_online_store_service::FetchFeatureValues {
3615        super::builder::feature_online_store_service::FetchFeatureValues::new(self.inner.clone())
3616    }
3617
3618    /// Search the nearest entities under a FeatureView.
3619    /// Search only works for indexable feature view; if a feature view isn't
3620    /// indexable, returns Invalid argument response.
3621    ///
3622    /// # Example
3623    /// ```
3624    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3625    /// use google_cloud_aiplatform_v1::Result;
3626    /// async fn sample(
3627    ///    client: &FeatureOnlineStoreService
3628    /// ) -> Result<()> {
3629    ///     let response = client.search_nearest_entities()
3630    ///         /* set fields */
3631    ///         .send().await?;
3632    ///     println!("response {:?}", response);
3633    ///     Ok(())
3634    /// }
3635    /// ```
3636    pub fn search_nearest_entities(
3637        &self,
3638    ) -> super::builder::feature_online_store_service::SearchNearestEntities {
3639        super::builder::feature_online_store_service::SearchNearestEntities::new(self.inner.clone())
3640    }
3641
3642    /// RPC to generate an access token for the given feature view. FeatureViews
3643    /// under the same FeatureOnlineStore share the same access token.
3644    ///
3645    /// # Example
3646    /// ```
3647    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3648    /// use google_cloud_aiplatform_v1::Result;
3649    /// async fn sample(
3650    ///    client: &FeatureOnlineStoreService
3651    /// ) -> Result<()> {
3652    ///     let response = client.generate_fetch_access_token()
3653    ///         /* set fields */
3654    ///         .send().await?;
3655    ///     println!("response {:?}", response);
3656    ///     Ok(())
3657    /// }
3658    /// ```
3659    pub fn generate_fetch_access_token(
3660        &self,
3661    ) -> super::builder::feature_online_store_service::GenerateFetchAccessToken {
3662        super::builder::feature_online_store_service::GenerateFetchAccessToken::new(
3663            self.inner.clone(),
3664        )
3665    }
3666
3667    /// Lists information about the supported locations for this service.
3668    ///
3669    /// # Example
3670    /// ```
3671    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3672    /// use google_cloud_gax::paginator::ItemPaginator as _;
3673    /// use google_cloud_aiplatform_v1::Result;
3674    /// async fn sample(
3675    ///    client: &FeatureOnlineStoreService
3676    /// ) -> Result<()> {
3677    ///     let mut list = client.list_locations()
3678    ///         /* set fields */
3679    ///         .by_item();
3680    ///     while let Some(item) = list.next().await.transpose()? {
3681    ///         println!("{:?}", item);
3682    ///     }
3683    ///     Ok(())
3684    /// }
3685    /// ```
3686    pub fn list_locations(&self) -> super::builder::feature_online_store_service::ListLocations {
3687        super::builder::feature_online_store_service::ListLocations::new(self.inner.clone())
3688    }
3689
3690    /// Gets information about a location.
3691    ///
3692    /// # Example
3693    /// ```
3694    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3695    /// use google_cloud_aiplatform_v1::Result;
3696    /// async fn sample(
3697    ///    client: &FeatureOnlineStoreService
3698    /// ) -> Result<()> {
3699    ///     let response = client.get_location()
3700    ///         /* set fields */
3701    ///         .send().await?;
3702    ///     println!("response {:?}", response);
3703    ///     Ok(())
3704    /// }
3705    /// ```
3706    pub fn get_location(&self) -> super::builder::feature_online_store_service::GetLocation {
3707        super::builder::feature_online_store_service::GetLocation::new(self.inner.clone())
3708    }
3709
3710    /// Sets the access control policy on the specified resource. Replaces
3711    /// any existing policy.
3712    ///
3713    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
3714    /// errors.
3715    ///
3716    /// # Example
3717    /// ```
3718    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3719    /// use google_cloud_aiplatform_v1::Result;
3720    /// async fn sample(
3721    ///    client: &FeatureOnlineStoreService
3722    /// ) -> Result<()> {
3723    ///     let response = client.set_iam_policy()
3724    ///         /* set fields */
3725    ///         .send().await?;
3726    ///     println!("response {:?}", response);
3727    ///     Ok(())
3728    /// }
3729    /// ```
3730    pub fn set_iam_policy(&self) -> super::builder::feature_online_store_service::SetIamPolicy {
3731        super::builder::feature_online_store_service::SetIamPolicy::new(self.inner.clone())
3732    }
3733
3734    /// Gets the access control policy for a resource. Returns an empty policy
3735    /// if the resource exists and does not have a policy set.
3736    ///
3737    /// # Example
3738    /// ```
3739    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3740    /// use google_cloud_aiplatform_v1::Result;
3741    /// async fn sample(
3742    ///    client: &FeatureOnlineStoreService
3743    /// ) -> Result<()> {
3744    ///     let response = client.get_iam_policy()
3745    ///         /* set fields */
3746    ///         .send().await?;
3747    ///     println!("response {:?}", response);
3748    ///     Ok(())
3749    /// }
3750    /// ```
3751    pub fn get_iam_policy(&self) -> super::builder::feature_online_store_service::GetIamPolicy {
3752        super::builder::feature_online_store_service::GetIamPolicy::new(self.inner.clone())
3753    }
3754
3755    /// Returns permissions that a caller has on the specified resource. If the
3756    /// resource does not exist, this will return an empty set of
3757    /// permissions, not a `NOT_FOUND` error.
3758    ///
3759    /// Note: This operation is designed to be used for building
3760    /// permission-aware UIs and command-line tools, not for authorization
3761    /// checking. This operation may "fail open" without warning.
3762    ///
3763    /// # Example
3764    /// ```
3765    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3766    /// use google_cloud_aiplatform_v1::Result;
3767    /// async fn sample(
3768    ///    client: &FeatureOnlineStoreService
3769    /// ) -> Result<()> {
3770    ///     let response = client.test_iam_permissions()
3771    ///         /* set fields */
3772    ///         .send().await?;
3773    ///     println!("response {:?}", response);
3774    ///     Ok(())
3775    /// }
3776    /// ```
3777    pub fn test_iam_permissions(
3778        &self,
3779    ) -> super::builder::feature_online_store_service::TestIamPermissions {
3780        super::builder::feature_online_store_service::TestIamPermissions::new(self.inner.clone())
3781    }
3782
3783    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3784    ///
3785    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3786    ///
3787    /// # Example
3788    /// ```
3789    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3790    /// use google_cloud_gax::paginator::ItemPaginator as _;
3791    /// use google_cloud_aiplatform_v1::Result;
3792    /// async fn sample(
3793    ///    client: &FeatureOnlineStoreService
3794    /// ) -> Result<()> {
3795    ///     let mut list = client.list_operations()
3796    ///         /* set fields */
3797    ///         .by_item();
3798    ///     while let Some(item) = list.next().await.transpose()? {
3799    ///         println!("{:?}", item);
3800    ///     }
3801    ///     Ok(())
3802    /// }
3803    /// ```
3804    pub fn list_operations(&self) -> super::builder::feature_online_store_service::ListOperations {
3805        super::builder::feature_online_store_service::ListOperations::new(self.inner.clone())
3806    }
3807
3808    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3809    ///
3810    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3811    ///
3812    /// # Example
3813    /// ```
3814    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3815    /// use google_cloud_aiplatform_v1::Result;
3816    /// async fn sample(
3817    ///    client: &FeatureOnlineStoreService
3818    /// ) -> Result<()> {
3819    ///     let response = client.get_operation()
3820    ///         /* set fields */
3821    ///         .send().await?;
3822    ///     println!("response {:?}", response);
3823    ///     Ok(())
3824    /// }
3825    /// ```
3826    pub fn get_operation(&self) -> super::builder::feature_online_store_service::GetOperation {
3827        super::builder::feature_online_store_service::GetOperation::new(self.inner.clone())
3828    }
3829
3830    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3831    ///
3832    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3833    ///
3834    /// # Example
3835    /// ```
3836    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3837    /// use google_cloud_aiplatform_v1::Result;
3838    /// async fn sample(
3839    ///    client: &FeatureOnlineStoreService
3840    /// ) -> Result<()> {
3841    ///     client.delete_operation()
3842    ///         /* set fields */
3843    ///         .send().await?;
3844    ///     Ok(())
3845    /// }
3846    /// ```
3847    pub fn delete_operation(
3848        &self,
3849    ) -> super::builder::feature_online_store_service::DeleteOperation {
3850        super::builder::feature_online_store_service::DeleteOperation::new(self.inner.clone())
3851    }
3852
3853    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3854    ///
3855    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3856    ///
3857    /// # Example
3858    /// ```
3859    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3860    /// use google_cloud_aiplatform_v1::Result;
3861    /// async fn sample(
3862    ///    client: &FeatureOnlineStoreService
3863    /// ) -> Result<()> {
3864    ///     client.cancel_operation()
3865    ///         /* set fields */
3866    ///         .send().await?;
3867    ///     Ok(())
3868    /// }
3869    /// ```
3870    pub fn cancel_operation(
3871        &self,
3872    ) -> super::builder::feature_online_store_service::CancelOperation {
3873        super::builder::feature_online_store_service::CancelOperation::new(self.inner.clone())
3874    }
3875
3876    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
3877    ///
3878    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
3879    ///
3880    /// # Example
3881    /// ```
3882    /// # use google_cloud_aiplatform_v1::client::FeatureOnlineStoreService;
3883    /// use google_cloud_aiplatform_v1::Result;
3884    /// async fn sample(
3885    ///    client: &FeatureOnlineStoreService
3886    /// ) -> Result<()> {
3887    ///     let response = client.wait_operation()
3888    ///         /* set fields */
3889    ///         .send().await?;
3890    ///     println!("response {:?}", response);
3891    ///     Ok(())
3892    /// }
3893    /// ```
3894    pub fn wait_operation(&self) -> super::builder::feature_online_store_service::WaitOperation {
3895        super::builder::feature_online_store_service::WaitOperation::new(self.inner.clone())
3896    }
3897}
3898
3899/// Implements a client for the Vertex AI API.
3900///
3901/// # Example
3902/// ```
3903/// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
3904/// use google_cloud_gax::paginator::ItemPaginator as _;
3905/// async fn sample(
3906///    project_id: &str,
3907///    location_id: &str,
3908/// ) -> anyhow::Result<()> {
3909///     let client = FeatureRegistryService::builder().build().await?;
3910///     let mut list = client.list_feature_groups()
3911///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
3912///         .by_item();
3913///     while let Some(item) = list.next().await.transpose()? {
3914///         println!("{:?}", item);
3915///     }
3916///     Ok(())
3917/// }
3918/// ```
3919///
3920/// # Service Description
3921///
3922/// The service that handles CRUD and List for resources for
3923/// FeatureRegistry.
3924///
3925/// # Configuration
3926///
3927/// To configure `FeatureRegistryService` use the `with_*` methods in the type returned
3928/// by [builder()][FeatureRegistryService::builder]. The default configuration should
3929/// work for most applications. Common configuration changes include
3930///
3931/// * [with_endpoint()]: by default this client uses the global default endpoint
3932///   (`https://aiplatform.googleapis.com`). Applications using regional
3933///   endpoints or running in restricted networks (e.g. a network configured
3934///   with [Private Google Access with VPC Service Controls]) may want to
3935///   override this default.
3936/// * [with_credentials()]: by default this client uses
3937///   [Application Default Credentials]. Applications using custom
3938///   authentication may need to override this default.
3939///
3940/// [with_endpoint()]: super::builder::feature_registry_service::ClientBuilder::with_endpoint
3941/// [with_credentials()]: super::builder::feature_registry_service::ClientBuilder::with_credentials
3942/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3943/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3944///
3945/// # Pooling and Cloning
3946///
3947/// `FeatureRegistryService` holds a connection pool internally, it is advised to
3948/// create one and reuse it. You do not need to wrap `FeatureRegistryService` in
3949/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3950/// already uses an `Arc` internally.
3951#[cfg(feature = "feature-registry-service")]
3952#[cfg_attr(docsrs, doc(cfg(feature = "feature-registry-service")))]
3953#[derive(Clone, Debug)]
3954pub struct FeatureRegistryService {
3955    inner: std::sync::Arc<dyn super::stub::dynamic::FeatureRegistryService>,
3956}
3957
3958#[cfg(feature = "feature-registry-service")]
3959impl FeatureRegistryService {
3960    /// Returns a builder for [FeatureRegistryService].
3961    ///
3962    /// ```
3963    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3964    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
3965    /// let client = FeatureRegistryService::builder().build().await?;
3966    /// # Ok(()) }
3967    /// ```
3968    pub fn builder() -> super::builder::feature_registry_service::ClientBuilder {
3969        crate::new_client_builder(super::builder::feature_registry_service::client::Factory)
3970    }
3971
3972    /// Creates a new client from the provided stub.
3973    ///
3974    /// The most common case for calling this function is in tests mocking the
3975    /// client's behavior.
3976    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3977    where
3978        T: super::stub::FeatureRegistryService + 'static,
3979    {
3980        Self { inner: stub.into() }
3981    }
3982
3983    pub(crate) async fn new(
3984        config: gaxi::options::ClientConfig,
3985    ) -> crate::ClientBuilderResult<Self> {
3986        let inner = Self::build_inner(config).await?;
3987        Ok(Self { inner })
3988    }
3989
3990    async fn build_inner(
3991        conf: gaxi::options::ClientConfig,
3992    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FeatureRegistryService>>
3993    {
3994        if gaxi::options::tracing_enabled(&conf) {
3995            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3996        }
3997        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3998    }
3999
4000    async fn build_transport(
4001        conf: gaxi::options::ClientConfig,
4002    ) -> crate::ClientBuilderResult<impl super::stub::FeatureRegistryService> {
4003        super::transport::FeatureRegistryService::new(conf).await
4004    }
4005
4006    async fn build_with_tracing(
4007        conf: gaxi::options::ClientConfig,
4008    ) -> crate::ClientBuilderResult<impl super::stub::FeatureRegistryService> {
4009        Self::build_transport(conf)
4010            .await
4011            .map(super::tracing::FeatureRegistryService::new)
4012    }
4013
4014    /// Creates a new FeatureGroup in a given project and location.
4015    ///
4016    /// # Long running operations
4017    ///
4018    /// This method is used to start, and/or poll a [long-running Operation].
4019    /// The [Working with long-running operations] chapter in the [user guide]
4020    /// covers these operations in detail.
4021    ///
4022    /// [long-running operation]: https://google.aip.dev/151
4023    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4024    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4025    ///
4026    /// # Example
4027    /// ```
4028    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4029    /// use google_cloud_lro::Poller;
4030    /// use google_cloud_aiplatform_v1::model::FeatureGroup;
4031    /// use google_cloud_aiplatform_v1::Result;
4032    /// async fn sample(
4033    ///    client: &FeatureRegistryService, project_id: &str, location_id: &str
4034    /// ) -> Result<()> {
4035    ///     let response = client.create_feature_group()
4036    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
4037    ///         .set_feature_group(
4038    ///             FeatureGroup::new()/* set fields */
4039    ///         )
4040    ///         .poller().until_done().await?;
4041    ///     println!("response {:?}", response);
4042    ///     Ok(())
4043    /// }
4044    /// ```
4045    pub fn create_feature_group(
4046        &self,
4047    ) -> super::builder::feature_registry_service::CreateFeatureGroup {
4048        super::builder::feature_registry_service::CreateFeatureGroup::new(self.inner.clone())
4049    }
4050
4051    /// Gets details of a single FeatureGroup.
4052    ///
4053    /// # Example
4054    /// ```
4055    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4056    /// use google_cloud_aiplatform_v1::Result;
4057    /// async fn sample(
4058    ///    client: &FeatureRegistryService, project_id: &str, location_id: &str, feature_group_id: &str
4059    /// ) -> Result<()> {
4060    ///     let response = client.get_feature_group()
4061    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featureGroups/{feature_group_id}"))
4062    ///         .send().await?;
4063    ///     println!("response {:?}", response);
4064    ///     Ok(())
4065    /// }
4066    /// ```
4067    pub fn get_feature_group(&self) -> super::builder::feature_registry_service::GetFeatureGroup {
4068        super::builder::feature_registry_service::GetFeatureGroup::new(self.inner.clone())
4069    }
4070
4071    /// Lists FeatureGroups in a given project and location.
4072    ///
4073    /// # Example
4074    /// ```
4075    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4076    /// use google_cloud_gax::paginator::ItemPaginator as _;
4077    /// use google_cloud_aiplatform_v1::Result;
4078    /// async fn sample(
4079    ///    client: &FeatureRegistryService, project_id: &str, location_id: &str
4080    /// ) -> Result<()> {
4081    ///     let mut list = client.list_feature_groups()
4082    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
4083    ///         .by_item();
4084    ///     while let Some(item) = list.next().await.transpose()? {
4085    ///         println!("{:?}", item);
4086    ///     }
4087    ///     Ok(())
4088    /// }
4089    /// ```
4090    pub fn list_feature_groups(
4091        &self,
4092    ) -> super::builder::feature_registry_service::ListFeatureGroups {
4093        super::builder::feature_registry_service::ListFeatureGroups::new(self.inner.clone())
4094    }
4095
4096    /// Updates the parameters of a single FeatureGroup.
4097    ///
4098    /// # Long running operations
4099    ///
4100    /// This method is used to start, and/or poll a [long-running Operation].
4101    /// The [Working with long-running operations] chapter in the [user guide]
4102    /// covers these operations in detail.
4103    ///
4104    /// [long-running operation]: https://google.aip.dev/151
4105    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4106    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4107    ///
4108    /// # Example
4109    /// ```
4110    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4111    /// use google_cloud_lro::Poller;
4112    /// # extern crate wkt as google_cloud_wkt;
4113    /// use google_cloud_wkt::FieldMask;
4114    /// use google_cloud_aiplatform_v1::model::FeatureGroup;
4115    /// use google_cloud_aiplatform_v1::Result;
4116    /// async fn sample(
4117    ///    client: &FeatureRegistryService, project_id: &str, location_id: &str, feature_group_id: &str
4118    /// ) -> Result<()> {
4119    ///     let response = client.update_feature_group()
4120    ///         .set_feature_group(
4121    ///             FeatureGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/featureGroups/{feature_group_id}"))/* set fields */
4122    ///         )
4123    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
4124    ///         .poller().until_done().await?;
4125    ///     println!("response {:?}", response);
4126    ///     Ok(())
4127    /// }
4128    /// ```
4129    pub fn update_feature_group(
4130        &self,
4131    ) -> super::builder::feature_registry_service::UpdateFeatureGroup {
4132        super::builder::feature_registry_service::UpdateFeatureGroup::new(self.inner.clone())
4133    }
4134
4135    /// Deletes a single FeatureGroup.
4136    ///
4137    /// # Long running operations
4138    ///
4139    /// This method is used to start, and/or poll a [long-running Operation].
4140    /// The [Working with long-running operations] chapter in the [user guide]
4141    /// covers these operations in detail.
4142    ///
4143    /// [long-running operation]: https://google.aip.dev/151
4144    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4145    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4146    ///
4147    /// # Example
4148    /// ```
4149    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4150    /// use google_cloud_lro::Poller;
4151    /// use google_cloud_aiplatform_v1::Result;
4152    /// async fn sample(
4153    ///    client: &FeatureRegistryService, project_id: &str, location_id: &str, feature_group_id: &str
4154    /// ) -> Result<()> {
4155    ///     client.delete_feature_group()
4156    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featureGroups/{feature_group_id}"))
4157    ///         .poller().until_done().await?;
4158    ///     Ok(())
4159    /// }
4160    /// ```
4161    pub fn delete_feature_group(
4162        &self,
4163    ) -> super::builder::feature_registry_service::DeleteFeatureGroup {
4164        super::builder::feature_registry_service::DeleteFeatureGroup::new(self.inner.clone())
4165    }
4166
4167    /// Creates a new Feature in a given FeatureGroup.
4168    ///
4169    /// # Long running operations
4170    ///
4171    /// This method is used to start, and/or poll a [long-running Operation].
4172    /// The [Working with long-running operations] chapter in the [user guide]
4173    /// covers these operations in detail.
4174    ///
4175    /// [long-running operation]: https://google.aip.dev/151
4176    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4177    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4178    ///
4179    /// # Example
4180    /// ```
4181    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4182    /// use google_cloud_lro::Poller;
4183    /// use google_cloud_aiplatform_v1::model::Feature;
4184    /// use google_cloud_aiplatform_v1::Result;
4185    /// async fn sample(
4186    ///    client: &FeatureRegistryService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str
4187    /// ) -> Result<()> {
4188    ///     let response = client.create_feature()
4189    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}"))
4190    ///         .set_feature_id("feature_id_value")
4191    ///         .set_feature(
4192    ///             Feature::new()/* set fields */
4193    ///         )
4194    ///         .poller().until_done().await?;
4195    ///     println!("response {:?}", response);
4196    ///     Ok(())
4197    /// }
4198    /// ```
4199    pub fn create_feature(&self) -> super::builder::feature_registry_service::CreateFeature {
4200        super::builder::feature_registry_service::CreateFeature::new(self.inner.clone())
4201    }
4202
4203    /// Creates a batch of Features in a given FeatureGroup.
4204    ///
4205    /// # Long running operations
4206    ///
4207    /// This method is used to start, and/or poll a [long-running Operation].
4208    /// The [Working with long-running operations] chapter in the [user guide]
4209    /// covers these operations in detail.
4210    ///
4211    /// [long-running operation]: https://google.aip.dev/151
4212    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4213    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4214    ///
4215    /// # Example
4216    /// ```
4217    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4218    /// use google_cloud_lro::Poller;
4219    /// use google_cloud_aiplatform_v1::Result;
4220    /// async fn sample(
4221    ///    client: &FeatureRegistryService
4222    /// ) -> Result<()> {
4223    ///     let response = client.batch_create_features()
4224    ///         /* set fields */
4225    ///         .poller().until_done().await?;
4226    ///     println!("response {:?}", response);
4227    ///     Ok(())
4228    /// }
4229    /// ```
4230    pub fn batch_create_features(
4231        &self,
4232    ) -> super::builder::feature_registry_service::BatchCreateFeatures {
4233        super::builder::feature_registry_service::BatchCreateFeatures::new(self.inner.clone())
4234    }
4235
4236    /// Gets details of a single Feature.
4237    ///
4238    /// # Example
4239    /// ```
4240    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4241    /// use google_cloud_aiplatform_v1::Result;
4242    /// async fn sample(
4243    ///    client: &FeatureRegistryService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str, feature_id: &str
4244    /// ) -> Result<()> {
4245    ///     let response = client.get_feature()
4246    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}/features/{feature_id}"))
4247    ///         .send().await?;
4248    ///     println!("response {:?}", response);
4249    ///     Ok(())
4250    /// }
4251    /// ```
4252    pub fn get_feature(&self) -> super::builder::feature_registry_service::GetFeature {
4253        super::builder::feature_registry_service::GetFeature::new(self.inner.clone())
4254    }
4255
4256    /// Lists Features in a given FeatureGroup.
4257    ///
4258    /// # Example
4259    /// ```
4260    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4261    /// use google_cloud_gax::paginator::ItemPaginator as _;
4262    /// use google_cloud_aiplatform_v1::Result;
4263    /// async fn sample(
4264    ///    client: &FeatureRegistryService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str
4265    /// ) -> Result<()> {
4266    ///     let mut list = client.list_features()
4267    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}"))
4268    ///         .by_item();
4269    ///     while let Some(item) = list.next().await.transpose()? {
4270    ///         println!("{:?}", item);
4271    ///     }
4272    ///     Ok(())
4273    /// }
4274    /// ```
4275    pub fn list_features(&self) -> super::builder::feature_registry_service::ListFeatures {
4276        super::builder::feature_registry_service::ListFeatures::new(self.inner.clone())
4277    }
4278
4279    /// Updates the parameters of a single Feature.
4280    ///
4281    /// # Long running operations
4282    ///
4283    /// This method is used to start, and/or poll a [long-running Operation].
4284    /// The [Working with long-running operations] chapter in the [user guide]
4285    /// covers these operations in detail.
4286    ///
4287    /// [long-running operation]: https://google.aip.dev/151
4288    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4289    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4290    ///
4291    /// # Example
4292    /// ```
4293    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4294    /// use google_cloud_lro::Poller;
4295    /// # extern crate wkt as google_cloud_wkt;
4296    /// use google_cloud_wkt::FieldMask;
4297    /// use google_cloud_aiplatform_v1::model::Feature;
4298    /// use google_cloud_aiplatform_v1::Result;
4299    /// async fn sample(
4300    ///    client: &FeatureRegistryService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str, feature_id: &str
4301    /// ) -> Result<()> {
4302    ///     let response = client.update_feature()
4303    ///         .set_feature(
4304    ///             Feature::new().set_name(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}/features/{feature_id}"))/* set fields */
4305    ///         )
4306    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
4307    ///         .poller().until_done().await?;
4308    ///     println!("response {:?}", response);
4309    ///     Ok(())
4310    /// }
4311    /// ```
4312    pub fn update_feature(&self) -> super::builder::feature_registry_service::UpdateFeature {
4313        super::builder::feature_registry_service::UpdateFeature::new(self.inner.clone())
4314    }
4315
4316    /// Deletes a single Feature.
4317    ///
4318    /// # Long running operations
4319    ///
4320    /// This method is used to start, and/or poll a [long-running Operation].
4321    /// The [Working with long-running operations] chapter in the [user guide]
4322    /// covers these operations in detail.
4323    ///
4324    /// [long-running operation]: https://google.aip.dev/151
4325    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
4326    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
4327    ///
4328    /// # Example
4329    /// ```
4330    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4331    /// use google_cloud_lro::Poller;
4332    /// use google_cloud_aiplatform_v1::Result;
4333    /// async fn sample(
4334    ///    client: &FeatureRegistryService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str, feature_id: &str
4335    /// ) -> Result<()> {
4336    ///     client.delete_feature()
4337    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}/features/{feature_id}"))
4338    ///         .poller().until_done().await?;
4339    ///     Ok(())
4340    /// }
4341    /// ```
4342    pub fn delete_feature(&self) -> super::builder::feature_registry_service::DeleteFeature {
4343        super::builder::feature_registry_service::DeleteFeature::new(self.inner.clone())
4344    }
4345
4346    /// Lists information about the supported locations for this service.
4347    ///
4348    /// # Example
4349    /// ```
4350    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4351    /// use google_cloud_gax::paginator::ItemPaginator as _;
4352    /// use google_cloud_aiplatform_v1::Result;
4353    /// async fn sample(
4354    ///    client: &FeatureRegistryService
4355    /// ) -> Result<()> {
4356    ///     let mut list = client.list_locations()
4357    ///         /* set fields */
4358    ///         .by_item();
4359    ///     while let Some(item) = list.next().await.transpose()? {
4360    ///         println!("{:?}", item);
4361    ///     }
4362    ///     Ok(())
4363    /// }
4364    /// ```
4365    pub fn list_locations(&self) -> super::builder::feature_registry_service::ListLocations {
4366        super::builder::feature_registry_service::ListLocations::new(self.inner.clone())
4367    }
4368
4369    /// Gets information about a location.
4370    ///
4371    /// # Example
4372    /// ```
4373    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4374    /// use google_cloud_aiplatform_v1::Result;
4375    /// async fn sample(
4376    ///    client: &FeatureRegistryService
4377    /// ) -> Result<()> {
4378    ///     let response = client.get_location()
4379    ///         /* set fields */
4380    ///         .send().await?;
4381    ///     println!("response {:?}", response);
4382    ///     Ok(())
4383    /// }
4384    /// ```
4385    pub fn get_location(&self) -> super::builder::feature_registry_service::GetLocation {
4386        super::builder::feature_registry_service::GetLocation::new(self.inner.clone())
4387    }
4388
4389    /// Sets the access control policy on the specified resource. Replaces
4390    /// any existing policy.
4391    ///
4392    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
4393    /// errors.
4394    ///
4395    /// # Example
4396    /// ```
4397    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4398    /// use google_cloud_aiplatform_v1::Result;
4399    /// async fn sample(
4400    ///    client: &FeatureRegistryService
4401    /// ) -> Result<()> {
4402    ///     let response = client.set_iam_policy()
4403    ///         /* set fields */
4404    ///         .send().await?;
4405    ///     println!("response {:?}", response);
4406    ///     Ok(())
4407    /// }
4408    /// ```
4409    pub fn set_iam_policy(&self) -> super::builder::feature_registry_service::SetIamPolicy {
4410        super::builder::feature_registry_service::SetIamPolicy::new(self.inner.clone())
4411    }
4412
4413    /// Gets the access control policy for a resource. Returns an empty policy
4414    /// if the resource exists and does not have a policy set.
4415    ///
4416    /// # Example
4417    /// ```
4418    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4419    /// use google_cloud_aiplatform_v1::Result;
4420    /// async fn sample(
4421    ///    client: &FeatureRegistryService
4422    /// ) -> Result<()> {
4423    ///     let response = client.get_iam_policy()
4424    ///         /* set fields */
4425    ///         .send().await?;
4426    ///     println!("response {:?}", response);
4427    ///     Ok(())
4428    /// }
4429    /// ```
4430    pub fn get_iam_policy(&self) -> super::builder::feature_registry_service::GetIamPolicy {
4431        super::builder::feature_registry_service::GetIamPolicy::new(self.inner.clone())
4432    }
4433
4434    /// Returns permissions that a caller has on the specified resource. If the
4435    /// resource does not exist, this will return an empty set of
4436    /// permissions, not a `NOT_FOUND` error.
4437    ///
4438    /// Note: This operation is designed to be used for building
4439    /// permission-aware UIs and command-line tools, not for authorization
4440    /// checking. This operation may "fail open" without warning.
4441    ///
4442    /// # Example
4443    /// ```
4444    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4445    /// use google_cloud_aiplatform_v1::Result;
4446    /// async fn sample(
4447    ///    client: &FeatureRegistryService
4448    /// ) -> Result<()> {
4449    ///     let response = client.test_iam_permissions()
4450    ///         /* set fields */
4451    ///         .send().await?;
4452    ///     println!("response {:?}", response);
4453    ///     Ok(())
4454    /// }
4455    /// ```
4456    pub fn test_iam_permissions(
4457        &self,
4458    ) -> super::builder::feature_registry_service::TestIamPermissions {
4459        super::builder::feature_registry_service::TestIamPermissions::new(self.inner.clone())
4460    }
4461
4462    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4463    ///
4464    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4465    ///
4466    /// # Example
4467    /// ```
4468    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4469    /// use google_cloud_gax::paginator::ItemPaginator as _;
4470    /// use google_cloud_aiplatform_v1::Result;
4471    /// async fn sample(
4472    ///    client: &FeatureRegistryService
4473    /// ) -> Result<()> {
4474    ///     let mut list = client.list_operations()
4475    ///         /* set fields */
4476    ///         .by_item();
4477    ///     while let Some(item) = list.next().await.transpose()? {
4478    ///         println!("{:?}", item);
4479    ///     }
4480    ///     Ok(())
4481    /// }
4482    /// ```
4483    pub fn list_operations(&self) -> super::builder::feature_registry_service::ListOperations {
4484        super::builder::feature_registry_service::ListOperations::new(self.inner.clone())
4485    }
4486
4487    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4488    ///
4489    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4490    ///
4491    /// # Example
4492    /// ```
4493    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4494    /// use google_cloud_aiplatform_v1::Result;
4495    /// async fn sample(
4496    ///    client: &FeatureRegistryService
4497    /// ) -> Result<()> {
4498    ///     let response = client.get_operation()
4499    ///         /* set fields */
4500    ///         .send().await?;
4501    ///     println!("response {:?}", response);
4502    ///     Ok(())
4503    /// }
4504    /// ```
4505    pub fn get_operation(&self) -> super::builder::feature_registry_service::GetOperation {
4506        super::builder::feature_registry_service::GetOperation::new(self.inner.clone())
4507    }
4508
4509    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4510    ///
4511    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4512    ///
4513    /// # Example
4514    /// ```
4515    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4516    /// use google_cloud_aiplatform_v1::Result;
4517    /// async fn sample(
4518    ///    client: &FeatureRegistryService
4519    /// ) -> Result<()> {
4520    ///     client.delete_operation()
4521    ///         /* set fields */
4522    ///         .send().await?;
4523    ///     Ok(())
4524    /// }
4525    /// ```
4526    pub fn delete_operation(&self) -> super::builder::feature_registry_service::DeleteOperation {
4527        super::builder::feature_registry_service::DeleteOperation::new(self.inner.clone())
4528    }
4529
4530    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4531    ///
4532    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4533    ///
4534    /// # Example
4535    /// ```
4536    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4537    /// use google_cloud_aiplatform_v1::Result;
4538    /// async fn sample(
4539    ///    client: &FeatureRegistryService
4540    /// ) -> Result<()> {
4541    ///     client.cancel_operation()
4542    ///         /* set fields */
4543    ///         .send().await?;
4544    ///     Ok(())
4545    /// }
4546    /// ```
4547    pub fn cancel_operation(&self) -> super::builder::feature_registry_service::CancelOperation {
4548        super::builder::feature_registry_service::CancelOperation::new(self.inner.clone())
4549    }
4550
4551    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4552    ///
4553    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4554    ///
4555    /// # Example
4556    /// ```
4557    /// # use google_cloud_aiplatform_v1::client::FeatureRegistryService;
4558    /// use google_cloud_aiplatform_v1::Result;
4559    /// async fn sample(
4560    ///    client: &FeatureRegistryService
4561    /// ) -> Result<()> {
4562    ///     let response = client.wait_operation()
4563    ///         /* set fields */
4564    ///         .send().await?;
4565    ///     println!("response {:?}", response);
4566    ///     Ok(())
4567    /// }
4568    /// ```
4569    pub fn wait_operation(&self) -> super::builder::feature_registry_service::WaitOperation {
4570        super::builder::feature_registry_service::WaitOperation::new(self.inner.clone())
4571    }
4572}
4573
4574/// Implements a client for the Vertex AI API.
4575///
4576/// # Example
4577/// ```
4578/// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4579/// async fn sample(
4580/// ) -> anyhow::Result<()> {
4581///     let client = FeaturestoreOnlineServingService::builder().build().await?;
4582///     let response = client.read_feature_values()
4583///         /* set fields */
4584///         .send().await?;
4585///     println!("response {:?}", response);
4586///     Ok(())
4587/// }
4588/// ```
4589///
4590/// # Service Description
4591///
4592/// A service for serving online feature values.
4593///
4594/// # Configuration
4595///
4596/// To configure `FeaturestoreOnlineServingService` use the `with_*` methods in the type returned
4597/// by [builder()][FeaturestoreOnlineServingService::builder]. The default configuration should
4598/// work for most applications. Common configuration changes include
4599///
4600/// * [with_endpoint()]: by default this client uses the global default endpoint
4601///   (`https://aiplatform.googleapis.com`). Applications using regional
4602///   endpoints or running in restricted networks (e.g. a network configured
4603///   with [Private Google Access with VPC Service Controls]) may want to
4604///   override this default.
4605/// * [with_credentials()]: by default this client uses
4606///   [Application Default Credentials]. Applications using custom
4607///   authentication may need to override this default.
4608///
4609/// [with_endpoint()]: super::builder::featurestore_online_serving_service::ClientBuilder::with_endpoint
4610/// [with_credentials()]: super::builder::featurestore_online_serving_service::ClientBuilder::with_credentials
4611/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4612/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4613///
4614/// # Pooling and Cloning
4615///
4616/// `FeaturestoreOnlineServingService` holds a connection pool internally, it is advised to
4617/// create one and reuse it. You do not need to wrap `FeaturestoreOnlineServingService` in
4618/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4619/// already uses an `Arc` internally.
4620#[cfg(feature = "featurestore-online-serving-service")]
4621#[cfg_attr(docsrs, doc(cfg(feature = "featurestore-online-serving-service")))]
4622#[derive(Clone, Debug)]
4623pub struct FeaturestoreOnlineServingService {
4624    inner: std::sync::Arc<dyn super::stub::dynamic::FeaturestoreOnlineServingService>,
4625}
4626
4627#[cfg(feature = "featurestore-online-serving-service")]
4628impl FeaturestoreOnlineServingService {
4629    /// Returns a builder for [FeaturestoreOnlineServingService].
4630    ///
4631    /// ```
4632    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4633    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4634    /// let client = FeaturestoreOnlineServingService::builder().build().await?;
4635    /// # Ok(()) }
4636    /// ```
4637    pub fn builder() -> super::builder::featurestore_online_serving_service::ClientBuilder {
4638        crate::new_client_builder(
4639            super::builder::featurestore_online_serving_service::client::Factory,
4640        )
4641    }
4642
4643    /// Creates a new client from the provided stub.
4644    ///
4645    /// The most common case for calling this function is in tests mocking the
4646    /// client's behavior.
4647    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4648    where
4649        T: super::stub::FeaturestoreOnlineServingService + 'static,
4650    {
4651        Self { inner: stub.into() }
4652    }
4653
4654    pub(crate) async fn new(
4655        config: gaxi::options::ClientConfig,
4656    ) -> crate::ClientBuilderResult<Self> {
4657        let inner = Self::build_inner(config).await?;
4658        Ok(Self { inner })
4659    }
4660
4661    async fn build_inner(
4662        conf: gaxi::options::ClientConfig,
4663    ) -> crate::ClientBuilderResult<
4664        std::sync::Arc<dyn super::stub::dynamic::FeaturestoreOnlineServingService>,
4665    > {
4666        if gaxi::options::tracing_enabled(&conf) {
4667            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4668        }
4669        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4670    }
4671
4672    async fn build_transport(
4673        conf: gaxi::options::ClientConfig,
4674    ) -> crate::ClientBuilderResult<impl super::stub::FeaturestoreOnlineServingService> {
4675        super::transport::FeaturestoreOnlineServingService::new(conf).await
4676    }
4677
4678    async fn build_with_tracing(
4679        conf: gaxi::options::ClientConfig,
4680    ) -> crate::ClientBuilderResult<impl super::stub::FeaturestoreOnlineServingService> {
4681        Self::build_transport(conf)
4682            .await
4683            .map(super::tracing::FeaturestoreOnlineServingService::new)
4684    }
4685
4686    /// Reads Feature values of a specific entity of an EntityType. For reading
4687    /// feature values of multiple entities of an EntityType, please use
4688    /// StreamingReadFeatureValues.
4689    ///
4690    /// # Example
4691    /// ```
4692    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4693    /// use google_cloud_aiplatform_v1::Result;
4694    /// async fn sample(
4695    ///    client: &FeaturestoreOnlineServingService
4696    /// ) -> Result<()> {
4697    ///     let response = client.read_feature_values()
4698    ///         /* set fields */
4699    ///         .send().await?;
4700    ///     println!("response {:?}", response);
4701    ///     Ok(())
4702    /// }
4703    /// ```
4704    pub fn read_feature_values(
4705        &self,
4706    ) -> super::builder::featurestore_online_serving_service::ReadFeatureValues {
4707        super::builder::featurestore_online_serving_service::ReadFeatureValues::new(
4708            self.inner.clone(),
4709        )
4710    }
4711
4712    /// Writes Feature values of one or more entities of an EntityType.
4713    ///
4714    /// The Feature values are merged into existing entities if any. The Feature
4715    /// values to be written must have timestamp within the online storage
4716    /// retention.
4717    ///
4718    /// # Example
4719    /// ```
4720    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4721    /// use google_cloud_aiplatform_v1::Result;
4722    /// async fn sample(
4723    ///    client: &FeaturestoreOnlineServingService
4724    /// ) -> Result<()> {
4725    ///     let response = client.write_feature_values()
4726    ///         /* set fields */
4727    ///         .send().await?;
4728    ///     println!("response {:?}", response);
4729    ///     Ok(())
4730    /// }
4731    /// ```
4732    pub fn write_feature_values(
4733        &self,
4734    ) -> super::builder::featurestore_online_serving_service::WriteFeatureValues {
4735        super::builder::featurestore_online_serving_service::WriteFeatureValues::new(
4736            self.inner.clone(),
4737        )
4738    }
4739
4740    /// Lists information about the supported locations for this service.
4741    ///
4742    /// # Example
4743    /// ```
4744    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4745    /// use google_cloud_gax::paginator::ItemPaginator as _;
4746    /// use google_cloud_aiplatform_v1::Result;
4747    /// async fn sample(
4748    ///    client: &FeaturestoreOnlineServingService
4749    /// ) -> Result<()> {
4750    ///     let mut list = client.list_locations()
4751    ///         /* set fields */
4752    ///         .by_item();
4753    ///     while let Some(item) = list.next().await.transpose()? {
4754    ///         println!("{:?}", item);
4755    ///     }
4756    ///     Ok(())
4757    /// }
4758    /// ```
4759    pub fn list_locations(
4760        &self,
4761    ) -> super::builder::featurestore_online_serving_service::ListLocations {
4762        super::builder::featurestore_online_serving_service::ListLocations::new(self.inner.clone())
4763    }
4764
4765    /// Gets information about a location.
4766    ///
4767    /// # Example
4768    /// ```
4769    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4770    /// use google_cloud_aiplatform_v1::Result;
4771    /// async fn sample(
4772    ///    client: &FeaturestoreOnlineServingService
4773    /// ) -> Result<()> {
4774    ///     let response = client.get_location()
4775    ///         /* set fields */
4776    ///         .send().await?;
4777    ///     println!("response {:?}", response);
4778    ///     Ok(())
4779    /// }
4780    /// ```
4781    pub fn get_location(&self) -> super::builder::featurestore_online_serving_service::GetLocation {
4782        super::builder::featurestore_online_serving_service::GetLocation::new(self.inner.clone())
4783    }
4784
4785    /// Sets the access control policy on the specified resource. Replaces
4786    /// any existing policy.
4787    ///
4788    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
4789    /// errors.
4790    ///
4791    /// # Example
4792    /// ```
4793    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4794    /// use google_cloud_aiplatform_v1::Result;
4795    /// async fn sample(
4796    ///    client: &FeaturestoreOnlineServingService
4797    /// ) -> Result<()> {
4798    ///     let response = client.set_iam_policy()
4799    ///         /* set fields */
4800    ///         .send().await?;
4801    ///     println!("response {:?}", response);
4802    ///     Ok(())
4803    /// }
4804    /// ```
4805    pub fn set_iam_policy(
4806        &self,
4807    ) -> super::builder::featurestore_online_serving_service::SetIamPolicy {
4808        super::builder::featurestore_online_serving_service::SetIamPolicy::new(self.inner.clone())
4809    }
4810
4811    /// Gets the access control policy for a resource. Returns an empty policy
4812    /// if the resource exists and does not have a policy set.
4813    ///
4814    /// # Example
4815    /// ```
4816    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4817    /// use google_cloud_aiplatform_v1::Result;
4818    /// async fn sample(
4819    ///    client: &FeaturestoreOnlineServingService
4820    /// ) -> Result<()> {
4821    ///     let response = client.get_iam_policy()
4822    ///         /* set fields */
4823    ///         .send().await?;
4824    ///     println!("response {:?}", response);
4825    ///     Ok(())
4826    /// }
4827    /// ```
4828    pub fn get_iam_policy(
4829        &self,
4830    ) -> super::builder::featurestore_online_serving_service::GetIamPolicy {
4831        super::builder::featurestore_online_serving_service::GetIamPolicy::new(self.inner.clone())
4832    }
4833
4834    /// Returns permissions that a caller has on the specified resource. If the
4835    /// resource does not exist, this will return an empty set of
4836    /// permissions, not a `NOT_FOUND` error.
4837    ///
4838    /// Note: This operation is designed to be used for building
4839    /// permission-aware UIs and command-line tools, not for authorization
4840    /// checking. This operation may "fail open" without warning.
4841    ///
4842    /// # Example
4843    /// ```
4844    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4845    /// use google_cloud_aiplatform_v1::Result;
4846    /// async fn sample(
4847    ///    client: &FeaturestoreOnlineServingService
4848    /// ) -> Result<()> {
4849    ///     let response = client.test_iam_permissions()
4850    ///         /* set fields */
4851    ///         .send().await?;
4852    ///     println!("response {:?}", response);
4853    ///     Ok(())
4854    /// }
4855    /// ```
4856    pub fn test_iam_permissions(
4857        &self,
4858    ) -> super::builder::featurestore_online_serving_service::TestIamPermissions {
4859        super::builder::featurestore_online_serving_service::TestIamPermissions::new(
4860            self.inner.clone(),
4861        )
4862    }
4863
4864    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4865    ///
4866    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4867    ///
4868    /// # Example
4869    /// ```
4870    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4871    /// use google_cloud_gax::paginator::ItemPaginator as _;
4872    /// use google_cloud_aiplatform_v1::Result;
4873    /// async fn sample(
4874    ///    client: &FeaturestoreOnlineServingService
4875    /// ) -> Result<()> {
4876    ///     let mut list = client.list_operations()
4877    ///         /* set fields */
4878    ///         .by_item();
4879    ///     while let Some(item) = list.next().await.transpose()? {
4880    ///         println!("{:?}", item);
4881    ///     }
4882    ///     Ok(())
4883    /// }
4884    /// ```
4885    pub fn list_operations(
4886        &self,
4887    ) -> super::builder::featurestore_online_serving_service::ListOperations {
4888        super::builder::featurestore_online_serving_service::ListOperations::new(self.inner.clone())
4889    }
4890
4891    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4892    ///
4893    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4894    ///
4895    /// # Example
4896    /// ```
4897    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4898    /// use google_cloud_aiplatform_v1::Result;
4899    /// async fn sample(
4900    ///    client: &FeaturestoreOnlineServingService
4901    /// ) -> Result<()> {
4902    ///     let response = client.get_operation()
4903    ///         /* set fields */
4904    ///         .send().await?;
4905    ///     println!("response {:?}", response);
4906    ///     Ok(())
4907    /// }
4908    /// ```
4909    pub fn get_operation(
4910        &self,
4911    ) -> super::builder::featurestore_online_serving_service::GetOperation {
4912        super::builder::featurestore_online_serving_service::GetOperation::new(self.inner.clone())
4913    }
4914
4915    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4916    ///
4917    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4918    ///
4919    /// # Example
4920    /// ```
4921    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4922    /// use google_cloud_aiplatform_v1::Result;
4923    /// async fn sample(
4924    ///    client: &FeaturestoreOnlineServingService
4925    /// ) -> Result<()> {
4926    ///     client.delete_operation()
4927    ///         /* set fields */
4928    ///         .send().await?;
4929    ///     Ok(())
4930    /// }
4931    /// ```
4932    pub fn delete_operation(
4933        &self,
4934    ) -> super::builder::featurestore_online_serving_service::DeleteOperation {
4935        super::builder::featurestore_online_serving_service::DeleteOperation::new(
4936            self.inner.clone(),
4937        )
4938    }
4939
4940    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4941    ///
4942    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4943    ///
4944    /// # Example
4945    /// ```
4946    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4947    /// use google_cloud_aiplatform_v1::Result;
4948    /// async fn sample(
4949    ///    client: &FeaturestoreOnlineServingService
4950    /// ) -> Result<()> {
4951    ///     client.cancel_operation()
4952    ///         /* set fields */
4953    ///         .send().await?;
4954    ///     Ok(())
4955    /// }
4956    /// ```
4957    pub fn cancel_operation(
4958        &self,
4959    ) -> super::builder::featurestore_online_serving_service::CancelOperation {
4960        super::builder::featurestore_online_serving_service::CancelOperation::new(
4961            self.inner.clone(),
4962        )
4963    }
4964
4965    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
4966    ///
4967    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
4968    ///
4969    /// # Example
4970    /// ```
4971    /// # use google_cloud_aiplatform_v1::client::FeaturestoreOnlineServingService;
4972    /// use google_cloud_aiplatform_v1::Result;
4973    /// async fn sample(
4974    ///    client: &FeaturestoreOnlineServingService
4975    /// ) -> Result<()> {
4976    ///     let response = client.wait_operation()
4977    ///         /* set fields */
4978    ///         .send().await?;
4979    ///     println!("response {:?}", response);
4980    ///     Ok(())
4981    /// }
4982    /// ```
4983    pub fn wait_operation(
4984        &self,
4985    ) -> super::builder::featurestore_online_serving_service::WaitOperation {
4986        super::builder::featurestore_online_serving_service::WaitOperation::new(self.inner.clone())
4987    }
4988}
4989
4990/// Implements a client for the Vertex AI API.
4991///
4992/// # Example
4993/// ```
4994/// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
4995/// use google_cloud_gax::paginator::ItemPaginator as _;
4996/// async fn sample(
4997///    project_id: &str,
4998///    location_id: &str,
4999/// ) -> anyhow::Result<()> {
5000///     let client = FeaturestoreService::builder().build().await?;
5001///     let mut list = client.list_featurestores()
5002///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
5003///         .by_item();
5004///     while let Some(item) = list.next().await.transpose()? {
5005///         println!("{:?}", item);
5006///     }
5007///     Ok(())
5008/// }
5009/// ```
5010///
5011/// # Service Description
5012///
5013/// The service that handles CRUD and List for resources for Featurestore.
5014///
5015/// # Configuration
5016///
5017/// To configure `FeaturestoreService` use the `with_*` methods in the type returned
5018/// by [builder()][FeaturestoreService::builder]. The default configuration should
5019/// work for most applications. Common configuration changes include
5020///
5021/// * [with_endpoint()]: by default this client uses the global default endpoint
5022///   (`https://aiplatform.googleapis.com`). Applications using regional
5023///   endpoints or running in restricted networks (e.g. a network configured
5024///   with [Private Google Access with VPC Service Controls]) may want to
5025///   override this default.
5026/// * [with_credentials()]: by default this client uses
5027///   [Application Default Credentials]. Applications using custom
5028///   authentication may need to override this default.
5029///
5030/// [with_endpoint()]: super::builder::featurestore_service::ClientBuilder::with_endpoint
5031/// [with_credentials()]: super::builder::featurestore_service::ClientBuilder::with_credentials
5032/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5033/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5034///
5035/// # Pooling and Cloning
5036///
5037/// `FeaturestoreService` holds a connection pool internally, it is advised to
5038/// create one and reuse it. You do not need to wrap `FeaturestoreService` in
5039/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5040/// already uses an `Arc` internally.
5041#[cfg(feature = "featurestore-service")]
5042#[cfg_attr(docsrs, doc(cfg(feature = "featurestore-service")))]
5043#[derive(Clone, Debug)]
5044pub struct FeaturestoreService {
5045    inner: std::sync::Arc<dyn super::stub::dynamic::FeaturestoreService>,
5046}
5047
5048#[cfg(feature = "featurestore-service")]
5049impl FeaturestoreService {
5050    /// Returns a builder for [FeaturestoreService].
5051    ///
5052    /// ```
5053    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5054    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5055    /// let client = FeaturestoreService::builder().build().await?;
5056    /// # Ok(()) }
5057    /// ```
5058    pub fn builder() -> super::builder::featurestore_service::ClientBuilder {
5059        crate::new_client_builder(super::builder::featurestore_service::client::Factory)
5060    }
5061
5062    /// Creates a new client from the provided stub.
5063    ///
5064    /// The most common case for calling this function is in tests mocking the
5065    /// client's behavior.
5066    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5067    where
5068        T: super::stub::FeaturestoreService + 'static,
5069    {
5070        Self { inner: stub.into() }
5071    }
5072
5073    pub(crate) async fn new(
5074        config: gaxi::options::ClientConfig,
5075    ) -> crate::ClientBuilderResult<Self> {
5076        let inner = Self::build_inner(config).await?;
5077        Ok(Self { inner })
5078    }
5079
5080    async fn build_inner(
5081        conf: gaxi::options::ClientConfig,
5082    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FeaturestoreService>>
5083    {
5084        if gaxi::options::tracing_enabled(&conf) {
5085            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5086        }
5087        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5088    }
5089
5090    async fn build_transport(
5091        conf: gaxi::options::ClientConfig,
5092    ) -> crate::ClientBuilderResult<impl super::stub::FeaturestoreService> {
5093        super::transport::FeaturestoreService::new(conf).await
5094    }
5095
5096    async fn build_with_tracing(
5097        conf: gaxi::options::ClientConfig,
5098    ) -> crate::ClientBuilderResult<impl super::stub::FeaturestoreService> {
5099        Self::build_transport(conf)
5100            .await
5101            .map(super::tracing::FeaturestoreService::new)
5102    }
5103
5104    /// Creates a new Featurestore in a given project and location.
5105    ///
5106    /// # Long running operations
5107    ///
5108    /// This method is used to start, and/or poll a [long-running Operation].
5109    /// The [Working with long-running operations] chapter in the [user guide]
5110    /// covers these operations in detail.
5111    ///
5112    /// [long-running operation]: https://google.aip.dev/151
5113    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5114    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5115    ///
5116    /// # Example
5117    /// ```
5118    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5119    /// use google_cloud_lro::Poller;
5120    /// use google_cloud_aiplatform_v1::model::Featurestore;
5121    /// use google_cloud_aiplatform_v1::Result;
5122    /// async fn sample(
5123    ///    client: &FeaturestoreService, project_id: &str, location_id: &str
5124    /// ) -> Result<()> {
5125    ///     let response = client.create_featurestore()
5126    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
5127    ///         .set_featurestore_id("featurestore_id_value")
5128    ///         .set_featurestore(
5129    ///             Featurestore::new()/* set fields */
5130    ///         )
5131    ///         .poller().until_done().await?;
5132    ///     println!("response {:?}", response);
5133    ///     Ok(())
5134    /// }
5135    /// ```
5136    pub fn create_featurestore(&self) -> super::builder::featurestore_service::CreateFeaturestore {
5137        super::builder::featurestore_service::CreateFeaturestore::new(self.inner.clone())
5138    }
5139
5140    /// Gets details of a single Featurestore.
5141    ///
5142    /// # Example
5143    /// ```
5144    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5145    /// use google_cloud_aiplatform_v1::Result;
5146    /// async fn sample(
5147    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str
5148    /// ) -> Result<()> {
5149    ///     let response = client.get_featurestore()
5150    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}"))
5151    ///         .send().await?;
5152    ///     println!("response {:?}", response);
5153    ///     Ok(())
5154    /// }
5155    /// ```
5156    pub fn get_featurestore(&self) -> super::builder::featurestore_service::GetFeaturestore {
5157        super::builder::featurestore_service::GetFeaturestore::new(self.inner.clone())
5158    }
5159
5160    /// Lists Featurestores in a given project and location.
5161    ///
5162    /// # Example
5163    /// ```
5164    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5165    /// use google_cloud_gax::paginator::ItemPaginator as _;
5166    /// use google_cloud_aiplatform_v1::Result;
5167    /// async fn sample(
5168    ///    client: &FeaturestoreService, project_id: &str, location_id: &str
5169    /// ) -> Result<()> {
5170    ///     let mut list = client.list_featurestores()
5171    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
5172    ///         .by_item();
5173    ///     while let Some(item) = list.next().await.transpose()? {
5174    ///         println!("{:?}", item);
5175    ///     }
5176    ///     Ok(())
5177    /// }
5178    /// ```
5179    pub fn list_featurestores(&self) -> super::builder::featurestore_service::ListFeaturestores {
5180        super::builder::featurestore_service::ListFeaturestores::new(self.inner.clone())
5181    }
5182
5183    /// Updates the parameters of a single Featurestore.
5184    ///
5185    /// # Long running operations
5186    ///
5187    /// This method is used to start, and/or poll a [long-running Operation].
5188    /// The [Working with long-running operations] chapter in the [user guide]
5189    /// covers these operations in detail.
5190    ///
5191    /// [long-running operation]: https://google.aip.dev/151
5192    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5193    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5194    ///
5195    /// # Example
5196    /// ```
5197    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5198    /// use google_cloud_lro::Poller;
5199    /// # extern crate wkt as google_cloud_wkt;
5200    /// use google_cloud_wkt::FieldMask;
5201    /// use google_cloud_aiplatform_v1::model::Featurestore;
5202    /// use google_cloud_aiplatform_v1::Result;
5203    /// async fn sample(
5204    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str
5205    /// ) -> Result<()> {
5206    ///     let response = client.update_featurestore()
5207    ///         .set_featurestore(
5208    ///             Featurestore::new().set_name(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}"))/* set fields */
5209    ///         )
5210    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
5211    ///         .poller().until_done().await?;
5212    ///     println!("response {:?}", response);
5213    ///     Ok(())
5214    /// }
5215    /// ```
5216    pub fn update_featurestore(&self) -> super::builder::featurestore_service::UpdateFeaturestore {
5217        super::builder::featurestore_service::UpdateFeaturestore::new(self.inner.clone())
5218    }
5219
5220    /// Deletes a single Featurestore. The Featurestore must not contain any
5221    /// EntityTypes or `force` must be set to true for the request to succeed.
5222    ///
5223    /// # Long running operations
5224    ///
5225    /// This method is used to start, and/or poll a [long-running Operation].
5226    /// The [Working with long-running operations] chapter in the [user guide]
5227    /// covers these operations in detail.
5228    ///
5229    /// [long-running operation]: https://google.aip.dev/151
5230    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5231    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5232    ///
5233    /// # Example
5234    /// ```
5235    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5236    /// use google_cloud_lro::Poller;
5237    /// use google_cloud_aiplatform_v1::Result;
5238    /// async fn sample(
5239    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str
5240    /// ) -> Result<()> {
5241    ///     client.delete_featurestore()
5242    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}"))
5243    ///         .poller().until_done().await?;
5244    ///     Ok(())
5245    /// }
5246    /// ```
5247    pub fn delete_featurestore(&self) -> super::builder::featurestore_service::DeleteFeaturestore {
5248        super::builder::featurestore_service::DeleteFeaturestore::new(self.inner.clone())
5249    }
5250
5251    /// Creates a new EntityType in a given Featurestore.
5252    ///
5253    /// # Long running operations
5254    ///
5255    /// This method is used to start, and/or poll a [long-running Operation].
5256    /// The [Working with long-running operations] chapter in the [user guide]
5257    /// covers these operations in detail.
5258    ///
5259    /// [long-running operation]: https://google.aip.dev/151
5260    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5261    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5262    ///
5263    /// # Example
5264    /// ```
5265    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5266    /// use google_cloud_lro::Poller;
5267    /// use google_cloud_aiplatform_v1::model::EntityType;
5268    /// use google_cloud_aiplatform_v1::Result;
5269    /// async fn sample(
5270    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str
5271    /// ) -> Result<()> {
5272    ///     let response = client.create_entity_type()
5273    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}"))
5274    ///         .set_entity_type(
5275    ///             EntityType::new()/* set fields */
5276    ///         )
5277    ///         .poller().until_done().await?;
5278    ///     println!("response {:?}", response);
5279    ///     Ok(())
5280    /// }
5281    /// ```
5282    pub fn create_entity_type(&self) -> super::builder::featurestore_service::CreateEntityType {
5283        super::builder::featurestore_service::CreateEntityType::new(self.inner.clone())
5284    }
5285
5286    /// Gets details of a single EntityType.
5287    ///
5288    /// # Example
5289    /// ```
5290    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5291    /// use google_cloud_aiplatform_v1::Result;
5292    /// async fn sample(
5293    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str
5294    /// ) -> Result<()> {
5295    ///     let response = client.get_entity_type()
5296    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}"))
5297    ///         .send().await?;
5298    ///     println!("response {:?}", response);
5299    ///     Ok(())
5300    /// }
5301    /// ```
5302    pub fn get_entity_type(&self) -> super::builder::featurestore_service::GetEntityType {
5303        super::builder::featurestore_service::GetEntityType::new(self.inner.clone())
5304    }
5305
5306    /// Lists EntityTypes in a given Featurestore.
5307    ///
5308    /// # Example
5309    /// ```
5310    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5311    /// use google_cloud_gax::paginator::ItemPaginator as _;
5312    /// use google_cloud_aiplatform_v1::Result;
5313    /// async fn sample(
5314    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str
5315    /// ) -> Result<()> {
5316    ///     let mut list = client.list_entity_types()
5317    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}"))
5318    ///         .by_item();
5319    ///     while let Some(item) = list.next().await.transpose()? {
5320    ///         println!("{:?}", item);
5321    ///     }
5322    ///     Ok(())
5323    /// }
5324    /// ```
5325    pub fn list_entity_types(&self) -> super::builder::featurestore_service::ListEntityTypes {
5326        super::builder::featurestore_service::ListEntityTypes::new(self.inner.clone())
5327    }
5328
5329    /// Updates the parameters of a single EntityType.
5330    ///
5331    /// # Example
5332    /// ```
5333    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5334    /// # extern crate wkt as google_cloud_wkt;
5335    /// use google_cloud_wkt::FieldMask;
5336    /// use google_cloud_aiplatform_v1::model::EntityType;
5337    /// use google_cloud_aiplatform_v1::Result;
5338    /// async fn sample(
5339    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str
5340    /// ) -> Result<()> {
5341    ///     let response = client.update_entity_type()
5342    ///         .set_entity_type(
5343    ///             EntityType::new().set_name(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}"))/* set fields */
5344    ///         )
5345    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
5346    ///         .send().await?;
5347    ///     println!("response {:?}", response);
5348    ///     Ok(())
5349    /// }
5350    /// ```
5351    pub fn update_entity_type(&self) -> super::builder::featurestore_service::UpdateEntityType {
5352        super::builder::featurestore_service::UpdateEntityType::new(self.inner.clone())
5353    }
5354
5355    /// Deletes a single EntityType. The EntityType must not have any Features
5356    /// or `force` must be set to true for the request to succeed.
5357    ///
5358    /// # Long running operations
5359    ///
5360    /// This method is used to start, and/or poll a [long-running Operation].
5361    /// The [Working with long-running operations] chapter in the [user guide]
5362    /// covers these operations in detail.
5363    ///
5364    /// [long-running operation]: https://google.aip.dev/151
5365    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5366    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5367    ///
5368    /// # Example
5369    /// ```
5370    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5371    /// use google_cloud_lro::Poller;
5372    /// use google_cloud_aiplatform_v1::Result;
5373    /// async fn sample(
5374    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str
5375    /// ) -> Result<()> {
5376    ///     client.delete_entity_type()
5377    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}"))
5378    ///         .poller().until_done().await?;
5379    ///     Ok(())
5380    /// }
5381    /// ```
5382    pub fn delete_entity_type(&self) -> super::builder::featurestore_service::DeleteEntityType {
5383        super::builder::featurestore_service::DeleteEntityType::new(self.inner.clone())
5384    }
5385
5386    /// Creates a new Feature in a given EntityType.
5387    ///
5388    /// # Long running operations
5389    ///
5390    /// This method is used to start, and/or poll a [long-running Operation].
5391    /// The [Working with long-running operations] chapter in the [user guide]
5392    /// covers these operations in detail.
5393    ///
5394    /// [long-running operation]: https://google.aip.dev/151
5395    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5396    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5397    ///
5398    /// # Example
5399    /// ```
5400    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5401    /// use google_cloud_lro::Poller;
5402    /// use google_cloud_aiplatform_v1::model::Feature;
5403    /// use google_cloud_aiplatform_v1::Result;
5404    /// async fn sample(
5405    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str
5406    /// ) -> Result<()> {
5407    ///     let response = client.create_feature()
5408    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}"))
5409    ///         .set_feature_id("feature_id_value")
5410    ///         .set_feature(
5411    ///             Feature::new()/* set fields */
5412    ///         )
5413    ///         .poller().until_done().await?;
5414    ///     println!("response {:?}", response);
5415    ///     Ok(())
5416    /// }
5417    /// ```
5418    pub fn create_feature(&self) -> super::builder::featurestore_service::CreateFeature {
5419        super::builder::featurestore_service::CreateFeature::new(self.inner.clone())
5420    }
5421
5422    /// Creates a batch of Features in a given EntityType.
5423    ///
5424    /// # Long running operations
5425    ///
5426    /// This method is used to start, and/or poll a [long-running Operation].
5427    /// The [Working with long-running operations] chapter in the [user guide]
5428    /// covers these operations in detail.
5429    ///
5430    /// [long-running operation]: https://google.aip.dev/151
5431    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5432    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5433    ///
5434    /// # Example
5435    /// ```
5436    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5437    /// use google_cloud_lro::Poller;
5438    /// use google_cloud_aiplatform_v1::Result;
5439    /// async fn sample(
5440    ///    client: &FeaturestoreService
5441    /// ) -> Result<()> {
5442    ///     let response = client.batch_create_features()
5443    ///         /* set fields */
5444    ///         .poller().until_done().await?;
5445    ///     println!("response {:?}", response);
5446    ///     Ok(())
5447    /// }
5448    /// ```
5449    pub fn batch_create_features(
5450        &self,
5451    ) -> super::builder::featurestore_service::BatchCreateFeatures {
5452        super::builder::featurestore_service::BatchCreateFeatures::new(self.inner.clone())
5453    }
5454
5455    /// Gets details of a single Feature.
5456    ///
5457    /// # Example
5458    /// ```
5459    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5460    /// use google_cloud_aiplatform_v1::Result;
5461    /// async fn sample(
5462    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str, feature_id: &str
5463    /// ) -> Result<()> {
5464    ///     let response = client.get_feature()
5465    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}/features/{feature_id}"))
5466    ///         .send().await?;
5467    ///     println!("response {:?}", response);
5468    ///     Ok(())
5469    /// }
5470    /// ```
5471    pub fn get_feature(&self) -> super::builder::featurestore_service::GetFeature {
5472        super::builder::featurestore_service::GetFeature::new(self.inner.clone())
5473    }
5474
5475    /// Lists Features in a given EntityType.
5476    ///
5477    /// # Example
5478    /// ```
5479    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5480    /// use google_cloud_gax::paginator::ItemPaginator as _;
5481    /// use google_cloud_aiplatform_v1::Result;
5482    /// async fn sample(
5483    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str
5484    /// ) -> Result<()> {
5485    ///     let mut list = client.list_features()
5486    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}"))
5487    ///         .by_item();
5488    ///     while let Some(item) = list.next().await.transpose()? {
5489    ///         println!("{:?}", item);
5490    ///     }
5491    ///     Ok(())
5492    /// }
5493    /// ```
5494    pub fn list_features(&self) -> super::builder::featurestore_service::ListFeatures {
5495        super::builder::featurestore_service::ListFeatures::new(self.inner.clone())
5496    }
5497
5498    /// Updates the parameters of a single Feature.
5499    ///
5500    /// # Example
5501    /// ```
5502    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5503    /// # extern crate wkt as google_cloud_wkt;
5504    /// use google_cloud_wkt::FieldMask;
5505    /// use google_cloud_aiplatform_v1::model::Feature;
5506    /// use google_cloud_aiplatform_v1::Result;
5507    /// async fn sample(
5508    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str, feature_id: &str
5509    /// ) -> Result<()> {
5510    ///     let response = client.update_feature()
5511    ///         .set_feature(
5512    ///             Feature::new().set_name(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}/features/{feature_id}"))/* set fields */
5513    ///         )
5514    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
5515    ///         .send().await?;
5516    ///     println!("response {:?}", response);
5517    ///     Ok(())
5518    /// }
5519    /// ```
5520    pub fn update_feature(&self) -> super::builder::featurestore_service::UpdateFeature {
5521        super::builder::featurestore_service::UpdateFeature::new(self.inner.clone())
5522    }
5523
5524    /// Deletes a single Feature.
5525    ///
5526    /// # Long running operations
5527    ///
5528    /// This method is used to start, and/or poll a [long-running Operation].
5529    /// The [Working with long-running operations] chapter in the [user guide]
5530    /// covers these operations in detail.
5531    ///
5532    /// [long-running operation]: https://google.aip.dev/151
5533    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5534    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5535    ///
5536    /// # Example
5537    /// ```
5538    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5539    /// use google_cloud_lro::Poller;
5540    /// use google_cloud_aiplatform_v1::Result;
5541    /// async fn sample(
5542    ///    client: &FeaturestoreService, project_id: &str, location_id: &str, featurestore_id: &str, entity_type_id: &str, feature_id: &str
5543    /// ) -> Result<()> {
5544    ///     client.delete_feature()
5545    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/featurestores/{featurestore_id}/entityTypes/{entity_type_id}/features/{feature_id}"))
5546    ///         .poller().until_done().await?;
5547    ///     Ok(())
5548    /// }
5549    /// ```
5550    pub fn delete_feature(&self) -> super::builder::featurestore_service::DeleteFeature {
5551        super::builder::featurestore_service::DeleteFeature::new(self.inner.clone())
5552    }
5553
5554    /// Imports Feature values into the Featurestore from a source storage.
5555    ///
5556    /// The progress of the import is tracked by the returned operation. The
5557    /// imported features are guaranteed to be visible to subsequent read
5558    /// operations after the operation is marked as successfully done.
5559    ///
5560    /// If an import operation fails, the Feature values returned from
5561    /// reads and exports may be inconsistent. If consistency is
5562    /// required, the caller must retry the same import request again and wait till
5563    /// the new operation returned is marked as successfully done.
5564    ///
5565    /// There are also scenarios where the caller can cause inconsistency.
5566    ///
5567    /// - Source data for import contains multiple distinct Feature values for
5568    ///   the same entity ID and timestamp.
5569    /// - Source is modified during an import. This includes adding, updating, or
5570    ///   removing source data and/or metadata. Examples of updating metadata
5571    ///   include but are not limited to changing storage location, storage class,
5572    ///   or retention policy.
5573    /// - Online serving cluster is under-provisioned.
5574    ///
5575    /// # Long running operations
5576    ///
5577    /// This method is used to start, and/or poll a [long-running Operation].
5578    /// The [Working with long-running operations] chapter in the [user guide]
5579    /// covers these operations in detail.
5580    ///
5581    /// [long-running operation]: https://google.aip.dev/151
5582    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5583    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5584    ///
5585    /// # Example
5586    /// ```
5587    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5588    /// use google_cloud_lro::Poller;
5589    /// use google_cloud_aiplatform_v1::Result;
5590    /// async fn sample(
5591    ///    client: &FeaturestoreService
5592    /// ) -> Result<()> {
5593    ///     let response = client.import_feature_values()
5594    ///         /* set fields */
5595    ///         .poller().until_done().await?;
5596    ///     println!("response {:?}", response);
5597    ///     Ok(())
5598    /// }
5599    /// ```
5600    pub fn import_feature_values(
5601        &self,
5602    ) -> super::builder::featurestore_service::ImportFeatureValues {
5603        super::builder::featurestore_service::ImportFeatureValues::new(self.inner.clone())
5604    }
5605
5606    /// Batch reads Feature values from a Featurestore.
5607    ///
5608    /// This API enables batch reading Feature values, where each read
5609    /// instance in the batch may read Feature values of entities from one or
5610    /// more EntityTypes. Point-in-time correctness is guaranteed for Feature
5611    /// values of each read instance as of each instance's read timestamp.
5612    ///
5613    /// # Long running operations
5614    ///
5615    /// This method is used to start, and/or poll a [long-running Operation].
5616    /// The [Working with long-running operations] chapter in the [user guide]
5617    /// covers these operations in detail.
5618    ///
5619    /// [long-running operation]: https://google.aip.dev/151
5620    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5621    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5622    ///
5623    /// # Example
5624    /// ```
5625    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5626    /// use google_cloud_lro::Poller;
5627    /// use google_cloud_aiplatform_v1::Result;
5628    /// async fn sample(
5629    ///    client: &FeaturestoreService
5630    /// ) -> Result<()> {
5631    ///     let response = client.batch_read_feature_values()
5632    ///         /* set fields */
5633    ///         .poller().until_done().await?;
5634    ///     println!("response {:?}", response);
5635    ///     Ok(())
5636    /// }
5637    /// ```
5638    pub fn batch_read_feature_values(
5639        &self,
5640    ) -> super::builder::featurestore_service::BatchReadFeatureValues {
5641        super::builder::featurestore_service::BatchReadFeatureValues::new(self.inner.clone())
5642    }
5643
5644    /// Exports Feature values from all the entities of a target EntityType.
5645    ///
5646    /// # Long running operations
5647    ///
5648    /// This method is used to start, and/or poll a [long-running Operation].
5649    /// The [Working with long-running operations] chapter in the [user guide]
5650    /// covers these operations in detail.
5651    ///
5652    /// [long-running operation]: https://google.aip.dev/151
5653    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5654    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5655    ///
5656    /// # Example
5657    /// ```
5658    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5659    /// use google_cloud_lro::Poller;
5660    /// use google_cloud_aiplatform_v1::Result;
5661    /// async fn sample(
5662    ///    client: &FeaturestoreService
5663    /// ) -> Result<()> {
5664    ///     let response = client.export_feature_values()
5665    ///         /* set fields */
5666    ///         .poller().until_done().await?;
5667    ///     println!("response {:?}", response);
5668    ///     Ok(())
5669    /// }
5670    /// ```
5671    pub fn export_feature_values(
5672        &self,
5673    ) -> super::builder::featurestore_service::ExportFeatureValues {
5674        super::builder::featurestore_service::ExportFeatureValues::new(self.inner.clone())
5675    }
5676
5677    /// Delete Feature values from Featurestore.
5678    ///
5679    /// The progress of the deletion is tracked by the returned operation. The
5680    /// deleted feature values are guaranteed to be invisible to subsequent read
5681    /// operations after the operation is marked as successfully done.
5682    ///
5683    /// If a delete feature values operation fails, the feature values
5684    /// returned from reads and exports may be inconsistent. If consistency is
5685    /// required, the caller must retry the same delete request again and wait till
5686    /// the new operation returned is marked as successfully done.
5687    ///
5688    /// # Long running operations
5689    ///
5690    /// This method is used to start, and/or poll a [long-running Operation].
5691    /// The [Working with long-running operations] chapter in the [user guide]
5692    /// covers these operations in detail.
5693    ///
5694    /// [long-running operation]: https://google.aip.dev/151
5695    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
5696    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
5697    ///
5698    /// # Example
5699    /// ```
5700    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5701    /// use google_cloud_lro::Poller;
5702    /// use google_cloud_aiplatform_v1::Result;
5703    /// async fn sample(
5704    ///    client: &FeaturestoreService
5705    /// ) -> Result<()> {
5706    ///     let response = client.delete_feature_values()
5707    ///         /* set fields */
5708    ///         .poller().until_done().await?;
5709    ///     println!("response {:?}", response);
5710    ///     Ok(())
5711    /// }
5712    /// ```
5713    pub fn delete_feature_values(
5714        &self,
5715    ) -> super::builder::featurestore_service::DeleteFeatureValues {
5716        super::builder::featurestore_service::DeleteFeatureValues::new(self.inner.clone())
5717    }
5718
5719    /// Searches Features matching a query in a given project.
5720    ///
5721    /// # Example
5722    /// ```
5723    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5724    /// use google_cloud_gax::paginator::ItemPaginator as _;
5725    /// use google_cloud_aiplatform_v1::Result;
5726    /// async fn sample(
5727    ///    client: &FeaturestoreService
5728    /// ) -> Result<()> {
5729    ///     let mut list = client.search_features()
5730    ///         /* set fields */
5731    ///         .by_item();
5732    ///     while let Some(item) = list.next().await.transpose()? {
5733    ///         println!("{:?}", item);
5734    ///     }
5735    ///     Ok(())
5736    /// }
5737    /// ```
5738    pub fn search_features(&self) -> super::builder::featurestore_service::SearchFeatures {
5739        super::builder::featurestore_service::SearchFeatures::new(self.inner.clone())
5740    }
5741
5742    /// Lists information about the supported locations for this service.
5743    ///
5744    /// # Example
5745    /// ```
5746    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5747    /// use google_cloud_gax::paginator::ItemPaginator as _;
5748    /// use google_cloud_aiplatform_v1::Result;
5749    /// async fn sample(
5750    ///    client: &FeaturestoreService
5751    /// ) -> Result<()> {
5752    ///     let mut list = client.list_locations()
5753    ///         /* set fields */
5754    ///         .by_item();
5755    ///     while let Some(item) = list.next().await.transpose()? {
5756    ///         println!("{:?}", item);
5757    ///     }
5758    ///     Ok(())
5759    /// }
5760    /// ```
5761    pub fn list_locations(&self) -> super::builder::featurestore_service::ListLocations {
5762        super::builder::featurestore_service::ListLocations::new(self.inner.clone())
5763    }
5764
5765    /// Gets information about a location.
5766    ///
5767    /// # Example
5768    /// ```
5769    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5770    /// use google_cloud_aiplatform_v1::Result;
5771    /// async fn sample(
5772    ///    client: &FeaturestoreService
5773    /// ) -> Result<()> {
5774    ///     let response = client.get_location()
5775    ///         /* set fields */
5776    ///         .send().await?;
5777    ///     println!("response {:?}", response);
5778    ///     Ok(())
5779    /// }
5780    /// ```
5781    pub fn get_location(&self) -> super::builder::featurestore_service::GetLocation {
5782        super::builder::featurestore_service::GetLocation::new(self.inner.clone())
5783    }
5784
5785    /// Sets the access control policy on the specified resource. Replaces
5786    /// any existing policy.
5787    ///
5788    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
5789    /// errors.
5790    ///
5791    /// # Example
5792    /// ```
5793    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5794    /// use google_cloud_aiplatform_v1::Result;
5795    /// async fn sample(
5796    ///    client: &FeaturestoreService
5797    /// ) -> Result<()> {
5798    ///     let response = client.set_iam_policy()
5799    ///         /* set fields */
5800    ///         .send().await?;
5801    ///     println!("response {:?}", response);
5802    ///     Ok(())
5803    /// }
5804    /// ```
5805    pub fn set_iam_policy(&self) -> super::builder::featurestore_service::SetIamPolicy {
5806        super::builder::featurestore_service::SetIamPolicy::new(self.inner.clone())
5807    }
5808
5809    /// Gets the access control policy for a resource. Returns an empty policy
5810    /// if the resource exists and does not have a policy set.
5811    ///
5812    /// # Example
5813    /// ```
5814    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5815    /// use google_cloud_aiplatform_v1::Result;
5816    /// async fn sample(
5817    ///    client: &FeaturestoreService
5818    /// ) -> Result<()> {
5819    ///     let response = client.get_iam_policy()
5820    ///         /* set fields */
5821    ///         .send().await?;
5822    ///     println!("response {:?}", response);
5823    ///     Ok(())
5824    /// }
5825    /// ```
5826    pub fn get_iam_policy(&self) -> super::builder::featurestore_service::GetIamPolicy {
5827        super::builder::featurestore_service::GetIamPolicy::new(self.inner.clone())
5828    }
5829
5830    /// Returns permissions that a caller has on the specified resource. If the
5831    /// resource does not exist, this will return an empty set of
5832    /// permissions, not a `NOT_FOUND` error.
5833    ///
5834    /// Note: This operation is designed to be used for building
5835    /// permission-aware UIs and command-line tools, not for authorization
5836    /// checking. This operation may "fail open" without warning.
5837    ///
5838    /// # Example
5839    /// ```
5840    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5841    /// use google_cloud_aiplatform_v1::Result;
5842    /// async fn sample(
5843    ///    client: &FeaturestoreService
5844    /// ) -> Result<()> {
5845    ///     let response = client.test_iam_permissions()
5846    ///         /* set fields */
5847    ///         .send().await?;
5848    ///     println!("response {:?}", response);
5849    ///     Ok(())
5850    /// }
5851    /// ```
5852    pub fn test_iam_permissions(&self) -> super::builder::featurestore_service::TestIamPermissions {
5853        super::builder::featurestore_service::TestIamPermissions::new(self.inner.clone())
5854    }
5855
5856    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5857    ///
5858    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5859    ///
5860    /// # Example
5861    /// ```
5862    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5863    /// use google_cloud_gax::paginator::ItemPaginator as _;
5864    /// use google_cloud_aiplatform_v1::Result;
5865    /// async fn sample(
5866    ///    client: &FeaturestoreService
5867    /// ) -> Result<()> {
5868    ///     let mut list = client.list_operations()
5869    ///         /* set fields */
5870    ///         .by_item();
5871    ///     while let Some(item) = list.next().await.transpose()? {
5872    ///         println!("{:?}", item);
5873    ///     }
5874    ///     Ok(())
5875    /// }
5876    /// ```
5877    pub fn list_operations(&self) -> super::builder::featurestore_service::ListOperations {
5878        super::builder::featurestore_service::ListOperations::new(self.inner.clone())
5879    }
5880
5881    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5882    ///
5883    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5884    ///
5885    /// # Example
5886    /// ```
5887    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5888    /// use google_cloud_aiplatform_v1::Result;
5889    /// async fn sample(
5890    ///    client: &FeaturestoreService
5891    /// ) -> Result<()> {
5892    ///     let response = client.get_operation()
5893    ///         /* set fields */
5894    ///         .send().await?;
5895    ///     println!("response {:?}", response);
5896    ///     Ok(())
5897    /// }
5898    /// ```
5899    pub fn get_operation(&self) -> super::builder::featurestore_service::GetOperation {
5900        super::builder::featurestore_service::GetOperation::new(self.inner.clone())
5901    }
5902
5903    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5904    ///
5905    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5906    ///
5907    /// # Example
5908    /// ```
5909    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5910    /// use google_cloud_aiplatform_v1::Result;
5911    /// async fn sample(
5912    ///    client: &FeaturestoreService
5913    /// ) -> Result<()> {
5914    ///     client.delete_operation()
5915    ///         /* set fields */
5916    ///         .send().await?;
5917    ///     Ok(())
5918    /// }
5919    /// ```
5920    pub fn delete_operation(&self) -> super::builder::featurestore_service::DeleteOperation {
5921        super::builder::featurestore_service::DeleteOperation::new(self.inner.clone())
5922    }
5923
5924    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5925    ///
5926    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5927    ///
5928    /// # Example
5929    /// ```
5930    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5931    /// use google_cloud_aiplatform_v1::Result;
5932    /// async fn sample(
5933    ///    client: &FeaturestoreService
5934    /// ) -> Result<()> {
5935    ///     client.cancel_operation()
5936    ///         /* set fields */
5937    ///         .send().await?;
5938    ///     Ok(())
5939    /// }
5940    /// ```
5941    pub fn cancel_operation(&self) -> super::builder::featurestore_service::CancelOperation {
5942        super::builder::featurestore_service::CancelOperation::new(self.inner.clone())
5943    }
5944
5945    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
5946    ///
5947    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
5948    ///
5949    /// # Example
5950    /// ```
5951    /// # use google_cloud_aiplatform_v1::client::FeaturestoreService;
5952    /// use google_cloud_aiplatform_v1::Result;
5953    /// async fn sample(
5954    ///    client: &FeaturestoreService
5955    /// ) -> Result<()> {
5956    ///     let response = client.wait_operation()
5957    ///         /* set fields */
5958    ///         .send().await?;
5959    ///     println!("response {:?}", response);
5960    ///     Ok(())
5961    /// }
5962    /// ```
5963    pub fn wait_operation(&self) -> super::builder::featurestore_service::WaitOperation {
5964        super::builder::featurestore_service::WaitOperation::new(self.inner.clone())
5965    }
5966}
5967
5968/// Implements a client for the Vertex AI API.
5969///
5970/// # Example
5971/// ```
5972/// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
5973/// use google_cloud_gax::paginator::ItemPaginator as _;
5974/// async fn sample(
5975///    project_id: &str,
5976///    location_id: &str,
5977/// ) -> anyhow::Result<()> {
5978///     let client = GenAiCacheService::builder().build().await?;
5979///     let mut list = client.list_cached_contents()
5980///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
5981///         .by_item();
5982///     while let Some(item) = list.next().await.transpose()? {
5983///         println!("{:?}", item);
5984///     }
5985///     Ok(())
5986/// }
5987/// ```
5988///
5989/// # Service Description
5990///
5991/// Service for managing Vertex AI's CachedContent resource.
5992///
5993/// # Configuration
5994///
5995/// To configure `GenAiCacheService` use the `with_*` methods in the type returned
5996/// by [builder()][GenAiCacheService::builder]. The default configuration should
5997/// work for most applications. Common configuration changes include
5998///
5999/// * [with_endpoint()]: by default this client uses the global default endpoint
6000///   (`https://aiplatform.googleapis.com`). Applications using regional
6001///   endpoints or running in restricted networks (e.g. a network configured
6002///   with [Private Google Access with VPC Service Controls]) may want to
6003///   override this default.
6004/// * [with_credentials()]: by default this client uses
6005///   [Application Default Credentials]. Applications using custom
6006///   authentication may need to override this default.
6007///
6008/// [with_endpoint()]: super::builder::gen_ai_cache_service::ClientBuilder::with_endpoint
6009/// [with_credentials()]: super::builder::gen_ai_cache_service::ClientBuilder::with_credentials
6010/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6011/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6012///
6013/// # Pooling and Cloning
6014///
6015/// `GenAiCacheService` holds a connection pool internally, it is advised to
6016/// create one and reuse it. You do not need to wrap `GenAiCacheService` in
6017/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6018/// already uses an `Arc` internally.
6019#[cfg(feature = "gen-ai-cache-service")]
6020#[cfg_attr(docsrs, doc(cfg(feature = "gen-ai-cache-service")))]
6021#[derive(Clone, Debug)]
6022pub struct GenAiCacheService {
6023    inner: std::sync::Arc<dyn super::stub::dynamic::GenAiCacheService>,
6024}
6025
6026#[cfg(feature = "gen-ai-cache-service")]
6027impl GenAiCacheService {
6028    /// Returns a builder for [GenAiCacheService].
6029    ///
6030    /// ```
6031    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6032    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6033    /// let client = GenAiCacheService::builder().build().await?;
6034    /// # Ok(()) }
6035    /// ```
6036    pub fn builder() -> super::builder::gen_ai_cache_service::ClientBuilder {
6037        crate::new_client_builder(super::builder::gen_ai_cache_service::client::Factory)
6038    }
6039
6040    /// Creates a new client from the provided stub.
6041    ///
6042    /// The most common case for calling this function is in tests mocking the
6043    /// client's behavior.
6044    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6045    where
6046        T: super::stub::GenAiCacheService + 'static,
6047    {
6048        Self { inner: stub.into() }
6049    }
6050
6051    pub(crate) async fn new(
6052        config: gaxi::options::ClientConfig,
6053    ) -> crate::ClientBuilderResult<Self> {
6054        let inner = Self::build_inner(config).await?;
6055        Ok(Self { inner })
6056    }
6057
6058    async fn build_inner(
6059        conf: gaxi::options::ClientConfig,
6060    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GenAiCacheService>>
6061    {
6062        if gaxi::options::tracing_enabled(&conf) {
6063            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6064        }
6065        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6066    }
6067
6068    async fn build_transport(
6069        conf: gaxi::options::ClientConfig,
6070    ) -> crate::ClientBuilderResult<impl super::stub::GenAiCacheService> {
6071        super::transport::GenAiCacheService::new(conf).await
6072    }
6073
6074    async fn build_with_tracing(
6075        conf: gaxi::options::ClientConfig,
6076    ) -> crate::ClientBuilderResult<impl super::stub::GenAiCacheService> {
6077        Self::build_transport(conf)
6078            .await
6079            .map(super::tracing::GenAiCacheService::new)
6080    }
6081
6082    /// Creates cached content, this call will initialize the cached content in the
6083    /// data storage, and users need to pay for the cache data storage.
6084    ///
6085    /// # Example
6086    /// ```
6087    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6088    /// use google_cloud_aiplatform_v1::model::CachedContent;
6089    /// use google_cloud_aiplatform_v1::Result;
6090    /// async fn sample(
6091    ///    client: &GenAiCacheService, project_id: &str, location_id: &str
6092    /// ) -> Result<()> {
6093    ///     let response = client.create_cached_content()
6094    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
6095    ///         .set_cached_content(
6096    ///             CachedContent::new()/* set fields */
6097    ///         )
6098    ///         .send().await?;
6099    ///     println!("response {:?}", response);
6100    ///     Ok(())
6101    /// }
6102    /// ```
6103    pub fn create_cached_content(
6104        &self,
6105    ) -> super::builder::gen_ai_cache_service::CreateCachedContent {
6106        super::builder::gen_ai_cache_service::CreateCachedContent::new(self.inner.clone())
6107    }
6108
6109    /// Gets cached content configurations
6110    ///
6111    /// # Example
6112    /// ```
6113    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6114    /// use google_cloud_aiplatform_v1::Result;
6115    /// async fn sample(
6116    ///    client: &GenAiCacheService, project_id: &str, location_id: &str, cached_content_id: &str
6117    /// ) -> Result<()> {
6118    ///     let response = client.get_cached_content()
6119    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/cachedContents/{cached_content_id}"))
6120    ///         .send().await?;
6121    ///     println!("response {:?}", response);
6122    ///     Ok(())
6123    /// }
6124    /// ```
6125    pub fn get_cached_content(&self) -> super::builder::gen_ai_cache_service::GetCachedContent {
6126        super::builder::gen_ai_cache_service::GetCachedContent::new(self.inner.clone())
6127    }
6128
6129    /// Updates cached content configurations
6130    ///
6131    /// # Example
6132    /// ```
6133    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6134    /// # extern crate wkt as google_cloud_wkt;
6135    /// use google_cloud_wkt::FieldMask;
6136    /// use google_cloud_aiplatform_v1::model::CachedContent;
6137    /// use google_cloud_aiplatform_v1::Result;
6138    /// async fn sample(
6139    ///    client: &GenAiCacheService, project_id: &str, location_id: &str, cached_content_id: &str
6140    /// ) -> Result<()> {
6141    ///     let response = client.update_cached_content()
6142    ///         .set_cached_content(
6143    ///             CachedContent::new().set_name(format!("projects/{project_id}/locations/{location_id}/cachedContents/{cached_content_id}"))/* set fields */
6144    ///         )
6145    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
6146    ///         .send().await?;
6147    ///     println!("response {:?}", response);
6148    ///     Ok(())
6149    /// }
6150    /// ```
6151    pub fn update_cached_content(
6152        &self,
6153    ) -> super::builder::gen_ai_cache_service::UpdateCachedContent {
6154        super::builder::gen_ai_cache_service::UpdateCachedContent::new(self.inner.clone())
6155    }
6156
6157    /// Deletes cached content
6158    ///
6159    /// # Example
6160    /// ```
6161    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6162    /// use google_cloud_aiplatform_v1::Result;
6163    /// async fn sample(
6164    ///    client: &GenAiCacheService, project_id: &str, location_id: &str, cached_content_id: &str
6165    /// ) -> Result<()> {
6166    ///     client.delete_cached_content()
6167    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/cachedContents/{cached_content_id}"))
6168    ///         .send().await?;
6169    ///     Ok(())
6170    /// }
6171    /// ```
6172    pub fn delete_cached_content(
6173        &self,
6174    ) -> super::builder::gen_ai_cache_service::DeleteCachedContent {
6175        super::builder::gen_ai_cache_service::DeleteCachedContent::new(self.inner.clone())
6176    }
6177
6178    /// Lists cached contents in a project
6179    ///
6180    /// # Example
6181    /// ```
6182    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6183    /// use google_cloud_gax::paginator::ItemPaginator as _;
6184    /// use google_cloud_aiplatform_v1::Result;
6185    /// async fn sample(
6186    ///    client: &GenAiCacheService, project_id: &str, location_id: &str
6187    /// ) -> Result<()> {
6188    ///     let mut list = client.list_cached_contents()
6189    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
6190    ///         .by_item();
6191    ///     while let Some(item) = list.next().await.transpose()? {
6192    ///         println!("{:?}", item);
6193    ///     }
6194    ///     Ok(())
6195    /// }
6196    /// ```
6197    pub fn list_cached_contents(&self) -> super::builder::gen_ai_cache_service::ListCachedContents {
6198        super::builder::gen_ai_cache_service::ListCachedContents::new(self.inner.clone())
6199    }
6200
6201    /// Lists information about the supported locations for this service.
6202    ///
6203    /// # Example
6204    /// ```
6205    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6206    /// use google_cloud_gax::paginator::ItemPaginator as _;
6207    /// use google_cloud_aiplatform_v1::Result;
6208    /// async fn sample(
6209    ///    client: &GenAiCacheService
6210    /// ) -> Result<()> {
6211    ///     let mut list = client.list_locations()
6212    ///         /* set fields */
6213    ///         .by_item();
6214    ///     while let Some(item) = list.next().await.transpose()? {
6215    ///         println!("{:?}", item);
6216    ///     }
6217    ///     Ok(())
6218    /// }
6219    /// ```
6220    pub fn list_locations(&self) -> super::builder::gen_ai_cache_service::ListLocations {
6221        super::builder::gen_ai_cache_service::ListLocations::new(self.inner.clone())
6222    }
6223
6224    /// Gets information about a location.
6225    ///
6226    /// # Example
6227    /// ```
6228    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6229    /// use google_cloud_aiplatform_v1::Result;
6230    /// async fn sample(
6231    ///    client: &GenAiCacheService
6232    /// ) -> Result<()> {
6233    ///     let response = client.get_location()
6234    ///         /* set fields */
6235    ///         .send().await?;
6236    ///     println!("response {:?}", response);
6237    ///     Ok(())
6238    /// }
6239    /// ```
6240    pub fn get_location(&self) -> super::builder::gen_ai_cache_service::GetLocation {
6241        super::builder::gen_ai_cache_service::GetLocation::new(self.inner.clone())
6242    }
6243
6244    /// Sets the access control policy on the specified resource. Replaces
6245    /// any existing policy.
6246    ///
6247    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
6248    /// errors.
6249    ///
6250    /// # Example
6251    /// ```
6252    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6253    /// use google_cloud_aiplatform_v1::Result;
6254    /// async fn sample(
6255    ///    client: &GenAiCacheService
6256    /// ) -> Result<()> {
6257    ///     let response = client.set_iam_policy()
6258    ///         /* set fields */
6259    ///         .send().await?;
6260    ///     println!("response {:?}", response);
6261    ///     Ok(())
6262    /// }
6263    /// ```
6264    pub fn set_iam_policy(&self) -> super::builder::gen_ai_cache_service::SetIamPolicy {
6265        super::builder::gen_ai_cache_service::SetIamPolicy::new(self.inner.clone())
6266    }
6267
6268    /// Gets the access control policy for a resource. Returns an empty policy
6269    /// if the resource exists and does not have a policy set.
6270    ///
6271    /// # Example
6272    /// ```
6273    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6274    /// use google_cloud_aiplatform_v1::Result;
6275    /// async fn sample(
6276    ///    client: &GenAiCacheService
6277    /// ) -> Result<()> {
6278    ///     let response = client.get_iam_policy()
6279    ///         /* set fields */
6280    ///         .send().await?;
6281    ///     println!("response {:?}", response);
6282    ///     Ok(())
6283    /// }
6284    /// ```
6285    pub fn get_iam_policy(&self) -> super::builder::gen_ai_cache_service::GetIamPolicy {
6286        super::builder::gen_ai_cache_service::GetIamPolicy::new(self.inner.clone())
6287    }
6288
6289    /// Returns permissions that a caller has on the specified resource. If the
6290    /// resource does not exist, this will return an empty set of
6291    /// permissions, not a `NOT_FOUND` error.
6292    ///
6293    /// Note: This operation is designed to be used for building
6294    /// permission-aware UIs and command-line tools, not for authorization
6295    /// checking. This operation may "fail open" without warning.
6296    ///
6297    /// # Example
6298    /// ```
6299    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6300    /// use google_cloud_aiplatform_v1::Result;
6301    /// async fn sample(
6302    ///    client: &GenAiCacheService
6303    /// ) -> Result<()> {
6304    ///     let response = client.test_iam_permissions()
6305    ///         /* set fields */
6306    ///         .send().await?;
6307    ///     println!("response {:?}", response);
6308    ///     Ok(())
6309    /// }
6310    /// ```
6311    pub fn test_iam_permissions(&self) -> super::builder::gen_ai_cache_service::TestIamPermissions {
6312        super::builder::gen_ai_cache_service::TestIamPermissions::new(self.inner.clone())
6313    }
6314
6315    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6316    ///
6317    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6318    ///
6319    /// # Example
6320    /// ```
6321    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6322    /// use google_cloud_gax::paginator::ItemPaginator as _;
6323    /// use google_cloud_aiplatform_v1::Result;
6324    /// async fn sample(
6325    ///    client: &GenAiCacheService
6326    /// ) -> Result<()> {
6327    ///     let mut list = client.list_operations()
6328    ///         /* set fields */
6329    ///         .by_item();
6330    ///     while let Some(item) = list.next().await.transpose()? {
6331    ///         println!("{:?}", item);
6332    ///     }
6333    ///     Ok(())
6334    /// }
6335    /// ```
6336    pub fn list_operations(&self) -> super::builder::gen_ai_cache_service::ListOperations {
6337        super::builder::gen_ai_cache_service::ListOperations::new(self.inner.clone())
6338    }
6339
6340    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6341    ///
6342    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6343    ///
6344    /// # Example
6345    /// ```
6346    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6347    /// use google_cloud_aiplatform_v1::Result;
6348    /// async fn sample(
6349    ///    client: &GenAiCacheService
6350    /// ) -> Result<()> {
6351    ///     let response = client.get_operation()
6352    ///         /* set fields */
6353    ///         .send().await?;
6354    ///     println!("response {:?}", response);
6355    ///     Ok(())
6356    /// }
6357    /// ```
6358    pub fn get_operation(&self) -> super::builder::gen_ai_cache_service::GetOperation {
6359        super::builder::gen_ai_cache_service::GetOperation::new(self.inner.clone())
6360    }
6361
6362    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6363    ///
6364    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6365    ///
6366    /// # Example
6367    /// ```
6368    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6369    /// use google_cloud_aiplatform_v1::Result;
6370    /// async fn sample(
6371    ///    client: &GenAiCacheService
6372    /// ) -> Result<()> {
6373    ///     client.delete_operation()
6374    ///         /* set fields */
6375    ///         .send().await?;
6376    ///     Ok(())
6377    /// }
6378    /// ```
6379    pub fn delete_operation(&self) -> super::builder::gen_ai_cache_service::DeleteOperation {
6380        super::builder::gen_ai_cache_service::DeleteOperation::new(self.inner.clone())
6381    }
6382
6383    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6384    ///
6385    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6386    ///
6387    /// # Example
6388    /// ```
6389    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6390    /// use google_cloud_aiplatform_v1::Result;
6391    /// async fn sample(
6392    ///    client: &GenAiCacheService
6393    /// ) -> Result<()> {
6394    ///     client.cancel_operation()
6395    ///         /* set fields */
6396    ///         .send().await?;
6397    ///     Ok(())
6398    /// }
6399    /// ```
6400    pub fn cancel_operation(&self) -> super::builder::gen_ai_cache_service::CancelOperation {
6401        super::builder::gen_ai_cache_service::CancelOperation::new(self.inner.clone())
6402    }
6403
6404    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6405    ///
6406    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6407    ///
6408    /// # Example
6409    /// ```
6410    /// # use google_cloud_aiplatform_v1::client::GenAiCacheService;
6411    /// use google_cloud_aiplatform_v1::Result;
6412    /// async fn sample(
6413    ///    client: &GenAiCacheService
6414    /// ) -> Result<()> {
6415    ///     let response = client.wait_operation()
6416    ///         /* set fields */
6417    ///         .send().await?;
6418    ///     println!("response {:?}", response);
6419    ///     Ok(())
6420    /// }
6421    /// ```
6422    pub fn wait_operation(&self) -> super::builder::gen_ai_cache_service::WaitOperation {
6423        super::builder::gen_ai_cache_service::WaitOperation::new(self.inner.clone())
6424    }
6425}
6426
6427/// Implements a client for the Vertex AI API.
6428///
6429/// # Example
6430/// ```
6431/// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6432/// use google_cloud_gax::paginator::ItemPaginator as _;
6433/// async fn sample(
6434///    parent: &str,
6435/// ) -> anyhow::Result<()> {
6436///     let client = GenAiTuningService::builder().build().await?;
6437///     let mut list = client.list_tuning_jobs()
6438///         .set_parent(parent)
6439///         .by_item();
6440///     while let Some(item) = list.next().await.transpose()? {
6441///         println!("{:?}", item);
6442///     }
6443///     Ok(())
6444/// }
6445/// ```
6446///
6447/// # Service Description
6448///
6449/// A service for creating and managing GenAI Tuning Jobs.
6450///
6451/// # Configuration
6452///
6453/// To configure `GenAiTuningService` use the `with_*` methods in the type returned
6454/// by [builder()][GenAiTuningService::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::gen_ai_tuning_service::ClientBuilder::with_endpoint
6467/// [with_credentials()]: super::builder::gen_ai_tuning_service::ClientBuilder::with_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/// `GenAiTuningService` holds a connection pool internally, it is advised to
6474/// create one and reuse it. You do not need to wrap `GenAiTuningService` 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 = "gen-ai-tuning-service")]
6478#[cfg_attr(docsrs, doc(cfg(feature = "gen-ai-tuning-service")))]
6479#[derive(Clone, Debug)]
6480pub struct GenAiTuningService {
6481    inner: std::sync::Arc<dyn super::stub::dynamic::GenAiTuningService>,
6482}
6483
6484#[cfg(feature = "gen-ai-tuning-service")]
6485impl GenAiTuningService {
6486    /// Returns a builder for [GenAiTuningService].
6487    ///
6488    /// ```
6489    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6490    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6491    /// let client = GenAiTuningService::builder().build().await?;
6492    /// # Ok(()) }
6493    /// ```
6494    pub fn builder() -> super::builder::gen_ai_tuning_service::ClientBuilder {
6495        crate::new_client_builder(super::builder::gen_ai_tuning_service::client::Factory)
6496    }
6497
6498    /// Creates a new client from the provided stub.
6499    ///
6500    /// The most common case for calling this function is in tests mocking the
6501    /// client's behavior.
6502    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6503    where
6504        T: super::stub::GenAiTuningService + 'static,
6505    {
6506        Self { inner: stub.into() }
6507    }
6508
6509    pub(crate) async fn new(
6510        config: gaxi::options::ClientConfig,
6511    ) -> crate::ClientBuilderResult<Self> {
6512        let inner = Self::build_inner(config).await?;
6513        Ok(Self { inner })
6514    }
6515
6516    async fn build_inner(
6517        conf: gaxi::options::ClientConfig,
6518    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GenAiTuningService>>
6519    {
6520        if gaxi::options::tracing_enabled(&conf) {
6521            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6522        }
6523        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6524    }
6525
6526    async fn build_transport(
6527        conf: gaxi::options::ClientConfig,
6528    ) -> crate::ClientBuilderResult<impl super::stub::GenAiTuningService> {
6529        super::transport::GenAiTuningService::new(conf).await
6530    }
6531
6532    async fn build_with_tracing(
6533        conf: gaxi::options::ClientConfig,
6534    ) -> crate::ClientBuilderResult<impl super::stub::GenAiTuningService> {
6535        Self::build_transport(conf)
6536            .await
6537            .map(super::tracing::GenAiTuningService::new)
6538    }
6539
6540    /// Creates a TuningJob. A created TuningJob right away will be attempted to
6541    /// be run.
6542    ///
6543    /// # Example
6544    /// ```
6545    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6546    /// use google_cloud_aiplatform_v1::model::TuningJob;
6547    /// use google_cloud_aiplatform_v1::Result;
6548    /// async fn sample(
6549    ///    client: &GenAiTuningService, parent: &str
6550    /// ) -> Result<()> {
6551    ///     let response = client.create_tuning_job()
6552    ///         .set_parent(parent)
6553    ///         .set_tuning_job(
6554    ///             TuningJob::new()/* set fields */
6555    ///         )
6556    ///         .send().await?;
6557    ///     println!("response {:?}", response);
6558    ///     Ok(())
6559    /// }
6560    /// ```
6561    pub fn create_tuning_job(&self) -> super::builder::gen_ai_tuning_service::CreateTuningJob {
6562        super::builder::gen_ai_tuning_service::CreateTuningJob::new(self.inner.clone())
6563    }
6564
6565    /// Gets a TuningJob.
6566    ///
6567    /// # Example
6568    /// ```
6569    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6570    /// use google_cloud_aiplatform_v1::Result;
6571    /// async fn sample(
6572    ///    client: &GenAiTuningService, project_id: &str, location_id: &str, tuning_job_id: &str
6573    /// ) -> Result<()> {
6574    ///     let response = client.get_tuning_job()
6575    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/tuningJobs/{tuning_job_id}"))
6576    ///         .send().await?;
6577    ///     println!("response {:?}", response);
6578    ///     Ok(())
6579    /// }
6580    /// ```
6581    pub fn get_tuning_job(&self) -> super::builder::gen_ai_tuning_service::GetTuningJob {
6582        super::builder::gen_ai_tuning_service::GetTuningJob::new(self.inner.clone())
6583    }
6584
6585    /// Lists TuningJobs in a Location.
6586    ///
6587    /// # Example
6588    /// ```
6589    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6590    /// use google_cloud_gax::paginator::ItemPaginator as _;
6591    /// use google_cloud_aiplatform_v1::Result;
6592    /// async fn sample(
6593    ///    client: &GenAiTuningService, parent: &str
6594    /// ) -> Result<()> {
6595    ///     let mut list = client.list_tuning_jobs()
6596    ///         .set_parent(parent)
6597    ///         .by_item();
6598    ///     while let Some(item) = list.next().await.transpose()? {
6599    ///         println!("{:?}", item);
6600    ///     }
6601    ///     Ok(())
6602    /// }
6603    /// ```
6604    pub fn list_tuning_jobs(&self) -> super::builder::gen_ai_tuning_service::ListTuningJobs {
6605        super::builder::gen_ai_tuning_service::ListTuningJobs::new(self.inner.clone())
6606    }
6607
6608    /// Cancels a TuningJob.
6609    /// Starts asynchronous cancellation on the TuningJob. The server makes a best
6610    /// effort to cancel the job, but success is not guaranteed. Clients can use
6611    /// [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob]
6612    /// or other methods to check whether the cancellation succeeded or whether the
6613    /// job completed despite cancellation. On successful cancellation, the
6614    /// TuningJob is not deleted; instead it becomes a job with a
6615    /// [TuningJob.error][google.cloud.aiplatform.v1.TuningJob.error] value with a
6616    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
6617    /// `Code.CANCELLED`, and
6618    /// [TuningJob.state][google.cloud.aiplatform.v1.TuningJob.state] is set to
6619    /// `CANCELLED`.
6620    ///
6621    /// [google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob]: crate::client::GenAiTuningService::get_tuning_job
6622    /// [google.cloud.aiplatform.v1.TuningJob.error]: crate::model::TuningJob::error
6623    /// [google.cloud.aiplatform.v1.TuningJob.state]: crate::model::TuningJob::state
6624    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
6625    ///
6626    /// # Example
6627    /// ```
6628    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6629    /// use google_cloud_aiplatform_v1::Result;
6630    /// async fn sample(
6631    ///    client: &GenAiTuningService
6632    /// ) -> Result<()> {
6633    ///     client.cancel_tuning_job()
6634    ///         /* set fields */
6635    ///         .send().await?;
6636    ///     Ok(())
6637    /// }
6638    /// ```
6639    pub fn cancel_tuning_job(&self) -> super::builder::gen_ai_tuning_service::CancelTuningJob {
6640        super::builder::gen_ai_tuning_service::CancelTuningJob::new(self.inner.clone())
6641    }
6642
6643    /// Rebase a TunedModel.
6644    ///
6645    /// # Long running operations
6646    ///
6647    /// This method is used to start, and/or poll a [long-running Operation].
6648    /// The [Working with long-running operations] chapter in the [user guide]
6649    /// covers these operations in detail.
6650    ///
6651    /// [long-running operation]: https://google.aip.dev/151
6652    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
6653    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
6654    ///
6655    /// # Example
6656    /// ```
6657    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6658    /// use google_cloud_lro::Poller;
6659    /// use google_cloud_aiplatform_v1::Result;
6660    /// async fn sample(
6661    ///    client: &GenAiTuningService
6662    /// ) -> Result<()> {
6663    ///     let response = client.rebase_tuned_model()
6664    ///         /* set fields */
6665    ///         .poller().until_done().await?;
6666    ///     println!("response {:?}", response);
6667    ///     Ok(())
6668    /// }
6669    /// ```
6670    pub fn rebase_tuned_model(&self) -> super::builder::gen_ai_tuning_service::RebaseTunedModel {
6671        super::builder::gen_ai_tuning_service::RebaseTunedModel::new(self.inner.clone())
6672    }
6673
6674    /// Lists information about the supported locations for this service.
6675    ///
6676    /// # Example
6677    /// ```
6678    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6679    /// use google_cloud_gax::paginator::ItemPaginator as _;
6680    /// use google_cloud_aiplatform_v1::Result;
6681    /// async fn sample(
6682    ///    client: &GenAiTuningService
6683    /// ) -> Result<()> {
6684    ///     let mut list = client.list_locations()
6685    ///         /* set fields */
6686    ///         .by_item();
6687    ///     while let Some(item) = list.next().await.transpose()? {
6688    ///         println!("{:?}", item);
6689    ///     }
6690    ///     Ok(())
6691    /// }
6692    /// ```
6693    pub fn list_locations(&self) -> super::builder::gen_ai_tuning_service::ListLocations {
6694        super::builder::gen_ai_tuning_service::ListLocations::new(self.inner.clone())
6695    }
6696
6697    /// Gets information about a location.
6698    ///
6699    /// # Example
6700    /// ```
6701    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6702    /// use google_cloud_aiplatform_v1::Result;
6703    /// async fn sample(
6704    ///    client: &GenAiTuningService
6705    /// ) -> Result<()> {
6706    ///     let response = client.get_location()
6707    ///         /* set fields */
6708    ///         .send().await?;
6709    ///     println!("response {:?}", response);
6710    ///     Ok(())
6711    /// }
6712    /// ```
6713    pub fn get_location(&self) -> super::builder::gen_ai_tuning_service::GetLocation {
6714        super::builder::gen_ai_tuning_service::GetLocation::new(self.inner.clone())
6715    }
6716
6717    /// Sets the access control policy on the specified resource. Replaces
6718    /// any existing policy.
6719    ///
6720    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
6721    /// errors.
6722    ///
6723    /// # Example
6724    /// ```
6725    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6726    /// use google_cloud_aiplatform_v1::Result;
6727    /// async fn sample(
6728    ///    client: &GenAiTuningService
6729    /// ) -> Result<()> {
6730    ///     let response = client.set_iam_policy()
6731    ///         /* set fields */
6732    ///         .send().await?;
6733    ///     println!("response {:?}", response);
6734    ///     Ok(())
6735    /// }
6736    /// ```
6737    pub fn set_iam_policy(&self) -> super::builder::gen_ai_tuning_service::SetIamPolicy {
6738        super::builder::gen_ai_tuning_service::SetIamPolicy::new(self.inner.clone())
6739    }
6740
6741    /// Gets the access control policy for a resource. Returns an empty policy
6742    /// if the resource exists and does not have a policy set.
6743    ///
6744    /// # Example
6745    /// ```
6746    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6747    /// use google_cloud_aiplatform_v1::Result;
6748    /// async fn sample(
6749    ///    client: &GenAiTuningService
6750    /// ) -> Result<()> {
6751    ///     let response = client.get_iam_policy()
6752    ///         /* set fields */
6753    ///         .send().await?;
6754    ///     println!("response {:?}", response);
6755    ///     Ok(())
6756    /// }
6757    /// ```
6758    pub fn get_iam_policy(&self) -> super::builder::gen_ai_tuning_service::GetIamPolicy {
6759        super::builder::gen_ai_tuning_service::GetIamPolicy::new(self.inner.clone())
6760    }
6761
6762    /// Returns permissions that a caller has on the specified resource. If the
6763    /// resource does not exist, this will return an empty set of
6764    /// permissions, not a `NOT_FOUND` error.
6765    ///
6766    /// Note: This operation is designed to be used for building
6767    /// permission-aware UIs and command-line tools, not for authorization
6768    /// checking. This operation may "fail open" without warning.
6769    ///
6770    /// # Example
6771    /// ```
6772    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6773    /// use google_cloud_aiplatform_v1::Result;
6774    /// async fn sample(
6775    ///    client: &GenAiTuningService
6776    /// ) -> Result<()> {
6777    ///     let response = client.test_iam_permissions()
6778    ///         /* set fields */
6779    ///         .send().await?;
6780    ///     println!("response {:?}", response);
6781    ///     Ok(())
6782    /// }
6783    /// ```
6784    pub fn test_iam_permissions(
6785        &self,
6786    ) -> super::builder::gen_ai_tuning_service::TestIamPermissions {
6787        super::builder::gen_ai_tuning_service::TestIamPermissions::new(self.inner.clone())
6788    }
6789
6790    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6791    ///
6792    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6793    ///
6794    /// # Example
6795    /// ```
6796    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6797    /// use google_cloud_gax::paginator::ItemPaginator as _;
6798    /// use google_cloud_aiplatform_v1::Result;
6799    /// async fn sample(
6800    ///    client: &GenAiTuningService
6801    /// ) -> Result<()> {
6802    ///     let mut list = client.list_operations()
6803    ///         /* set fields */
6804    ///         .by_item();
6805    ///     while let Some(item) = list.next().await.transpose()? {
6806    ///         println!("{:?}", item);
6807    ///     }
6808    ///     Ok(())
6809    /// }
6810    /// ```
6811    pub fn list_operations(&self) -> super::builder::gen_ai_tuning_service::ListOperations {
6812        super::builder::gen_ai_tuning_service::ListOperations::new(self.inner.clone())
6813    }
6814
6815    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6816    ///
6817    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6818    ///
6819    /// # Example
6820    /// ```
6821    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6822    /// use google_cloud_aiplatform_v1::Result;
6823    /// async fn sample(
6824    ///    client: &GenAiTuningService
6825    /// ) -> Result<()> {
6826    ///     let response = client.get_operation()
6827    ///         /* set fields */
6828    ///         .send().await?;
6829    ///     println!("response {:?}", response);
6830    ///     Ok(())
6831    /// }
6832    /// ```
6833    pub fn get_operation(&self) -> super::builder::gen_ai_tuning_service::GetOperation {
6834        super::builder::gen_ai_tuning_service::GetOperation::new(self.inner.clone())
6835    }
6836
6837    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6838    ///
6839    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6840    ///
6841    /// # Example
6842    /// ```
6843    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6844    /// use google_cloud_aiplatform_v1::Result;
6845    /// async fn sample(
6846    ///    client: &GenAiTuningService
6847    /// ) -> Result<()> {
6848    ///     client.delete_operation()
6849    ///         /* set fields */
6850    ///         .send().await?;
6851    ///     Ok(())
6852    /// }
6853    /// ```
6854    pub fn delete_operation(&self) -> super::builder::gen_ai_tuning_service::DeleteOperation {
6855        super::builder::gen_ai_tuning_service::DeleteOperation::new(self.inner.clone())
6856    }
6857
6858    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6859    ///
6860    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6861    ///
6862    /// # Example
6863    /// ```
6864    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6865    /// use google_cloud_aiplatform_v1::Result;
6866    /// async fn sample(
6867    ///    client: &GenAiTuningService
6868    /// ) -> Result<()> {
6869    ///     client.cancel_operation()
6870    ///         /* set fields */
6871    ///         .send().await?;
6872    ///     Ok(())
6873    /// }
6874    /// ```
6875    pub fn cancel_operation(&self) -> super::builder::gen_ai_tuning_service::CancelOperation {
6876        super::builder::gen_ai_tuning_service::CancelOperation::new(self.inner.clone())
6877    }
6878
6879    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
6880    ///
6881    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
6882    ///
6883    /// # Example
6884    /// ```
6885    /// # use google_cloud_aiplatform_v1::client::GenAiTuningService;
6886    /// use google_cloud_aiplatform_v1::Result;
6887    /// async fn sample(
6888    ///    client: &GenAiTuningService
6889    /// ) -> Result<()> {
6890    ///     let response = client.wait_operation()
6891    ///         /* set fields */
6892    ///         .send().await?;
6893    ///     println!("response {:?}", response);
6894    ///     Ok(())
6895    /// }
6896    /// ```
6897    pub fn wait_operation(&self) -> super::builder::gen_ai_tuning_service::WaitOperation {
6898        super::builder::gen_ai_tuning_service::WaitOperation::new(self.inner.clone())
6899    }
6900}
6901
6902/// Implements a client for the Vertex AI API.
6903///
6904/// # Example
6905/// ```
6906/// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
6907/// use google_cloud_gax::paginator::ItemPaginator as _;
6908/// async fn sample(
6909///    parent: &str,
6910/// ) -> anyhow::Result<()> {
6911///     let client = IndexEndpointService::builder().build().await?;
6912///     let mut list = client.list_index_endpoints()
6913///         .set_parent(parent)
6914///         .by_item();
6915///     while let Some(item) = list.next().await.transpose()? {
6916///         println!("{:?}", item);
6917///     }
6918///     Ok(())
6919/// }
6920/// ```
6921///
6922/// # Service Description
6923///
6924/// A service for managing Vertex AI's IndexEndpoints.
6925///
6926/// # Configuration
6927///
6928/// To configure `IndexEndpointService` use the `with_*` methods in the type returned
6929/// by [builder()][IndexEndpointService::builder]. The default configuration should
6930/// work for most applications. Common configuration changes include
6931///
6932/// * [with_endpoint()]: by default this client uses the global default endpoint
6933///   (`https://aiplatform.googleapis.com`). Applications using regional
6934///   endpoints or running in restricted networks (e.g. a network configured
6935///   with [Private Google Access with VPC Service Controls]) may want to
6936///   override this default.
6937/// * [with_credentials()]: by default this client uses
6938///   [Application Default Credentials]. Applications using custom
6939///   authentication may need to override this default.
6940///
6941/// [with_endpoint()]: super::builder::index_endpoint_service::ClientBuilder::with_endpoint
6942/// [with_credentials()]: super::builder::index_endpoint_service::ClientBuilder::with_credentials
6943/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6944/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6945///
6946/// # Pooling and Cloning
6947///
6948/// `IndexEndpointService` holds a connection pool internally, it is advised to
6949/// create one and reuse it. You do not need to wrap `IndexEndpointService` in
6950/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6951/// already uses an `Arc` internally.
6952#[cfg(feature = "index-endpoint-service")]
6953#[cfg_attr(docsrs, doc(cfg(feature = "index-endpoint-service")))]
6954#[derive(Clone, Debug)]
6955pub struct IndexEndpointService {
6956    inner: std::sync::Arc<dyn super::stub::dynamic::IndexEndpointService>,
6957}
6958
6959#[cfg(feature = "index-endpoint-service")]
6960impl IndexEndpointService {
6961    /// Returns a builder for [IndexEndpointService].
6962    ///
6963    /// ```
6964    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6965    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
6966    /// let client = IndexEndpointService::builder().build().await?;
6967    /// # Ok(()) }
6968    /// ```
6969    pub fn builder() -> super::builder::index_endpoint_service::ClientBuilder {
6970        crate::new_client_builder(super::builder::index_endpoint_service::client::Factory)
6971    }
6972
6973    /// Creates a new client from the provided stub.
6974    ///
6975    /// The most common case for calling this function is in tests mocking the
6976    /// client's behavior.
6977    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6978    where
6979        T: super::stub::IndexEndpointService + 'static,
6980    {
6981        Self { inner: stub.into() }
6982    }
6983
6984    pub(crate) async fn new(
6985        config: gaxi::options::ClientConfig,
6986    ) -> crate::ClientBuilderResult<Self> {
6987        let inner = Self::build_inner(config).await?;
6988        Ok(Self { inner })
6989    }
6990
6991    async fn build_inner(
6992        conf: gaxi::options::ClientConfig,
6993    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::IndexEndpointService>>
6994    {
6995        if gaxi::options::tracing_enabled(&conf) {
6996            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6997        }
6998        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6999    }
7000
7001    async fn build_transport(
7002        conf: gaxi::options::ClientConfig,
7003    ) -> crate::ClientBuilderResult<impl super::stub::IndexEndpointService> {
7004        super::transport::IndexEndpointService::new(conf).await
7005    }
7006
7007    async fn build_with_tracing(
7008        conf: gaxi::options::ClientConfig,
7009    ) -> crate::ClientBuilderResult<impl super::stub::IndexEndpointService> {
7010        Self::build_transport(conf)
7011            .await
7012            .map(super::tracing::IndexEndpointService::new)
7013    }
7014
7015    /// Creates an IndexEndpoint.
7016    ///
7017    /// # Long running operations
7018    ///
7019    /// This method is used to start, and/or poll a [long-running Operation].
7020    /// The [Working with long-running operations] chapter in the [user guide]
7021    /// covers these operations in detail.
7022    ///
7023    /// [long-running operation]: https://google.aip.dev/151
7024    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7025    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7026    ///
7027    /// # Example
7028    /// ```
7029    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7030    /// use google_cloud_lro::Poller;
7031    /// use google_cloud_aiplatform_v1::model::IndexEndpoint;
7032    /// use google_cloud_aiplatform_v1::Result;
7033    /// async fn sample(
7034    ///    client: &IndexEndpointService, parent: &str
7035    /// ) -> Result<()> {
7036    ///     let response = client.create_index_endpoint()
7037    ///         .set_parent(parent)
7038    ///         .set_index_endpoint(
7039    ///             IndexEndpoint::new()/* set fields */
7040    ///         )
7041    ///         .poller().until_done().await?;
7042    ///     println!("response {:?}", response);
7043    ///     Ok(())
7044    /// }
7045    /// ```
7046    pub fn create_index_endpoint(
7047        &self,
7048    ) -> super::builder::index_endpoint_service::CreateIndexEndpoint {
7049        super::builder::index_endpoint_service::CreateIndexEndpoint::new(self.inner.clone())
7050    }
7051
7052    /// Gets an IndexEndpoint.
7053    ///
7054    /// # Example
7055    /// ```
7056    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7057    /// use google_cloud_aiplatform_v1::Result;
7058    /// async fn sample(
7059    ///    client: &IndexEndpointService, project_id: &str, location_id: &str, index_endpoint_id: &str
7060    /// ) -> Result<()> {
7061    ///     let response = client.get_index_endpoint()
7062    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/indexEndpoints/{index_endpoint_id}"))
7063    ///         .send().await?;
7064    ///     println!("response {:?}", response);
7065    ///     Ok(())
7066    /// }
7067    /// ```
7068    pub fn get_index_endpoint(&self) -> super::builder::index_endpoint_service::GetIndexEndpoint {
7069        super::builder::index_endpoint_service::GetIndexEndpoint::new(self.inner.clone())
7070    }
7071
7072    /// Lists IndexEndpoints in a Location.
7073    ///
7074    /// # Example
7075    /// ```
7076    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7077    /// use google_cloud_gax::paginator::ItemPaginator as _;
7078    /// use google_cloud_aiplatform_v1::Result;
7079    /// async fn sample(
7080    ///    client: &IndexEndpointService, parent: &str
7081    /// ) -> Result<()> {
7082    ///     let mut list = client.list_index_endpoints()
7083    ///         .set_parent(parent)
7084    ///         .by_item();
7085    ///     while let Some(item) = list.next().await.transpose()? {
7086    ///         println!("{:?}", item);
7087    ///     }
7088    ///     Ok(())
7089    /// }
7090    /// ```
7091    pub fn list_index_endpoints(
7092        &self,
7093    ) -> super::builder::index_endpoint_service::ListIndexEndpoints {
7094        super::builder::index_endpoint_service::ListIndexEndpoints::new(self.inner.clone())
7095    }
7096
7097    /// Updates an IndexEndpoint.
7098    ///
7099    /// # Example
7100    /// ```
7101    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7102    /// # extern crate wkt as google_cloud_wkt;
7103    /// use google_cloud_wkt::FieldMask;
7104    /// use google_cloud_aiplatform_v1::model::IndexEndpoint;
7105    /// use google_cloud_aiplatform_v1::Result;
7106    /// async fn sample(
7107    ///    client: &IndexEndpointService, project_id: &str, location_id: &str, index_endpoint_id: &str
7108    /// ) -> Result<()> {
7109    ///     let response = client.update_index_endpoint()
7110    ///         .set_index_endpoint(
7111    ///             IndexEndpoint::new().set_name(format!("projects/{project_id}/locations/{location_id}/indexEndpoints/{index_endpoint_id}"))/* set fields */
7112    ///         )
7113    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
7114    ///         .send().await?;
7115    ///     println!("response {:?}", response);
7116    ///     Ok(())
7117    /// }
7118    /// ```
7119    pub fn update_index_endpoint(
7120        &self,
7121    ) -> super::builder::index_endpoint_service::UpdateIndexEndpoint {
7122        super::builder::index_endpoint_service::UpdateIndexEndpoint::new(self.inner.clone())
7123    }
7124
7125    /// Deletes an IndexEndpoint.
7126    ///
7127    /// # Long running operations
7128    ///
7129    /// This method is used to start, and/or poll a [long-running Operation].
7130    /// The [Working with long-running operations] chapter in the [user guide]
7131    /// covers these operations in detail.
7132    ///
7133    /// [long-running operation]: https://google.aip.dev/151
7134    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7135    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7136    ///
7137    /// # Example
7138    /// ```
7139    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7140    /// use google_cloud_lro::Poller;
7141    /// use google_cloud_aiplatform_v1::Result;
7142    /// async fn sample(
7143    ///    client: &IndexEndpointService, project_id: &str, location_id: &str, index_endpoint_id: &str
7144    /// ) -> Result<()> {
7145    ///     client.delete_index_endpoint()
7146    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/indexEndpoints/{index_endpoint_id}"))
7147    ///         .poller().until_done().await?;
7148    ///     Ok(())
7149    /// }
7150    /// ```
7151    pub fn delete_index_endpoint(
7152        &self,
7153    ) -> super::builder::index_endpoint_service::DeleteIndexEndpoint {
7154        super::builder::index_endpoint_service::DeleteIndexEndpoint::new(self.inner.clone())
7155    }
7156
7157    /// Deploys an Index into this IndexEndpoint, creating a DeployedIndex within
7158    /// it.
7159    /// Only non-empty Indexes can be deployed.
7160    ///
7161    /// # Long running operations
7162    ///
7163    /// This method is used to start, and/or poll a [long-running Operation].
7164    /// The [Working with long-running operations] chapter in the [user guide]
7165    /// covers these operations in detail.
7166    ///
7167    /// [long-running operation]: https://google.aip.dev/151
7168    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7169    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7170    ///
7171    /// # Example
7172    /// ```
7173    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7174    /// use google_cloud_lro::Poller;
7175    /// use google_cloud_aiplatform_v1::Result;
7176    /// async fn sample(
7177    ///    client: &IndexEndpointService
7178    /// ) -> Result<()> {
7179    ///     let response = client.deploy_index()
7180    ///         /* set fields */
7181    ///         .poller().until_done().await?;
7182    ///     println!("response {:?}", response);
7183    ///     Ok(())
7184    /// }
7185    /// ```
7186    pub fn deploy_index(&self) -> super::builder::index_endpoint_service::DeployIndex {
7187        super::builder::index_endpoint_service::DeployIndex::new(self.inner.clone())
7188    }
7189
7190    /// Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it,
7191    /// and freeing all resources it's using.
7192    ///
7193    /// # Long running operations
7194    ///
7195    /// This method is used to start, and/or poll a [long-running Operation].
7196    /// The [Working with long-running operations] chapter in the [user guide]
7197    /// covers these operations in detail.
7198    ///
7199    /// [long-running operation]: https://google.aip.dev/151
7200    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7201    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7202    ///
7203    /// # Example
7204    /// ```
7205    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7206    /// use google_cloud_lro::Poller;
7207    /// use google_cloud_aiplatform_v1::Result;
7208    /// async fn sample(
7209    ///    client: &IndexEndpointService
7210    /// ) -> Result<()> {
7211    ///     let response = client.undeploy_index()
7212    ///         /* set fields */
7213    ///         .poller().until_done().await?;
7214    ///     println!("response {:?}", response);
7215    ///     Ok(())
7216    /// }
7217    /// ```
7218    pub fn undeploy_index(&self) -> super::builder::index_endpoint_service::UndeployIndex {
7219        super::builder::index_endpoint_service::UndeployIndex::new(self.inner.clone())
7220    }
7221
7222    /// Update an existing DeployedIndex under an IndexEndpoint.
7223    ///
7224    /// # Long running operations
7225    ///
7226    /// This method is used to start, and/or poll a [long-running Operation].
7227    /// The [Working with long-running operations] chapter in the [user guide]
7228    /// covers these operations in detail.
7229    ///
7230    /// [long-running operation]: https://google.aip.dev/151
7231    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7232    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7233    ///
7234    /// # Example
7235    /// ```
7236    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7237    /// use google_cloud_lro::Poller;
7238    /// use google_cloud_aiplatform_v1::Result;
7239    /// async fn sample(
7240    ///    client: &IndexEndpointService
7241    /// ) -> Result<()> {
7242    ///     let response = client.mutate_deployed_index()
7243    ///         /* set fields */
7244    ///         .poller().until_done().await?;
7245    ///     println!("response {:?}", response);
7246    ///     Ok(())
7247    /// }
7248    /// ```
7249    pub fn mutate_deployed_index(
7250        &self,
7251    ) -> super::builder::index_endpoint_service::MutateDeployedIndex {
7252        super::builder::index_endpoint_service::MutateDeployedIndex::new(self.inner.clone())
7253    }
7254
7255    /// Lists information about the supported locations for this service.
7256    ///
7257    /// # Example
7258    /// ```
7259    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7260    /// use google_cloud_gax::paginator::ItemPaginator as _;
7261    /// use google_cloud_aiplatform_v1::Result;
7262    /// async fn sample(
7263    ///    client: &IndexEndpointService
7264    /// ) -> Result<()> {
7265    ///     let mut list = client.list_locations()
7266    ///         /* set fields */
7267    ///         .by_item();
7268    ///     while let Some(item) = list.next().await.transpose()? {
7269    ///         println!("{:?}", item);
7270    ///     }
7271    ///     Ok(())
7272    /// }
7273    /// ```
7274    pub fn list_locations(&self) -> super::builder::index_endpoint_service::ListLocations {
7275        super::builder::index_endpoint_service::ListLocations::new(self.inner.clone())
7276    }
7277
7278    /// Gets information about a location.
7279    ///
7280    /// # Example
7281    /// ```
7282    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7283    /// use google_cloud_aiplatform_v1::Result;
7284    /// async fn sample(
7285    ///    client: &IndexEndpointService
7286    /// ) -> Result<()> {
7287    ///     let response = client.get_location()
7288    ///         /* set fields */
7289    ///         .send().await?;
7290    ///     println!("response {:?}", response);
7291    ///     Ok(())
7292    /// }
7293    /// ```
7294    pub fn get_location(&self) -> super::builder::index_endpoint_service::GetLocation {
7295        super::builder::index_endpoint_service::GetLocation::new(self.inner.clone())
7296    }
7297
7298    /// Sets the access control policy on the specified resource. Replaces
7299    /// any existing policy.
7300    ///
7301    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
7302    /// errors.
7303    ///
7304    /// # Example
7305    /// ```
7306    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7307    /// use google_cloud_aiplatform_v1::Result;
7308    /// async fn sample(
7309    ///    client: &IndexEndpointService
7310    /// ) -> Result<()> {
7311    ///     let response = client.set_iam_policy()
7312    ///         /* set fields */
7313    ///         .send().await?;
7314    ///     println!("response {:?}", response);
7315    ///     Ok(())
7316    /// }
7317    /// ```
7318    pub fn set_iam_policy(&self) -> super::builder::index_endpoint_service::SetIamPolicy {
7319        super::builder::index_endpoint_service::SetIamPolicy::new(self.inner.clone())
7320    }
7321
7322    /// Gets the access control policy for a resource. Returns an empty policy
7323    /// if the resource exists and does not have a policy set.
7324    ///
7325    /// # Example
7326    /// ```
7327    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7328    /// use google_cloud_aiplatform_v1::Result;
7329    /// async fn sample(
7330    ///    client: &IndexEndpointService
7331    /// ) -> Result<()> {
7332    ///     let response = client.get_iam_policy()
7333    ///         /* set fields */
7334    ///         .send().await?;
7335    ///     println!("response {:?}", response);
7336    ///     Ok(())
7337    /// }
7338    /// ```
7339    pub fn get_iam_policy(&self) -> super::builder::index_endpoint_service::GetIamPolicy {
7340        super::builder::index_endpoint_service::GetIamPolicy::new(self.inner.clone())
7341    }
7342
7343    /// Returns permissions that a caller has on the specified resource. If the
7344    /// resource does not exist, this will return an empty set of
7345    /// permissions, not a `NOT_FOUND` error.
7346    ///
7347    /// Note: This operation is designed to be used for building
7348    /// permission-aware UIs and command-line tools, not for authorization
7349    /// checking. This operation may "fail open" without warning.
7350    ///
7351    /// # Example
7352    /// ```
7353    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7354    /// use google_cloud_aiplatform_v1::Result;
7355    /// async fn sample(
7356    ///    client: &IndexEndpointService
7357    /// ) -> Result<()> {
7358    ///     let response = client.test_iam_permissions()
7359    ///         /* set fields */
7360    ///         .send().await?;
7361    ///     println!("response {:?}", response);
7362    ///     Ok(())
7363    /// }
7364    /// ```
7365    pub fn test_iam_permissions(
7366        &self,
7367    ) -> super::builder::index_endpoint_service::TestIamPermissions {
7368        super::builder::index_endpoint_service::TestIamPermissions::new(self.inner.clone())
7369    }
7370
7371    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7372    ///
7373    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7374    ///
7375    /// # Example
7376    /// ```
7377    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7378    /// use google_cloud_gax::paginator::ItemPaginator as _;
7379    /// use google_cloud_aiplatform_v1::Result;
7380    /// async fn sample(
7381    ///    client: &IndexEndpointService
7382    /// ) -> Result<()> {
7383    ///     let mut list = client.list_operations()
7384    ///         /* set fields */
7385    ///         .by_item();
7386    ///     while let Some(item) = list.next().await.transpose()? {
7387    ///         println!("{:?}", item);
7388    ///     }
7389    ///     Ok(())
7390    /// }
7391    /// ```
7392    pub fn list_operations(&self) -> super::builder::index_endpoint_service::ListOperations {
7393        super::builder::index_endpoint_service::ListOperations::new(self.inner.clone())
7394    }
7395
7396    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7397    ///
7398    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7399    ///
7400    /// # Example
7401    /// ```
7402    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7403    /// use google_cloud_aiplatform_v1::Result;
7404    /// async fn sample(
7405    ///    client: &IndexEndpointService
7406    /// ) -> Result<()> {
7407    ///     let response = client.get_operation()
7408    ///         /* set fields */
7409    ///         .send().await?;
7410    ///     println!("response {:?}", response);
7411    ///     Ok(())
7412    /// }
7413    /// ```
7414    pub fn get_operation(&self) -> super::builder::index_endpoint_service::GetOperation {
7415        super::builder::index_endpoint_service::GetOperation::new(self.inner.clone())
7416    }
7417
7418    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7419    ///
7420    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7421    ///
7422    /// # Example
7423    /// ```
7424    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7425    /// use google_cloud_aiplatform_v1::Result;
7426    /// async fn sample(
7427    ///    client: &IndexEndpointService
7428    /// ) -> Result<()> {
7429    ///     client.delete_operation()
7430    ///         /* set fields */
7431    ///         .send().await?;
7432    ///     Ok(())
7433    /// }
7434    /// ```
7435    pub fn delete_operation(&self) -> super::builder::index_endpoint_service::DeleteOperation {
7436        super::builder::index_endpoint_service::DeleteOperation::new(self.inner.clone())
7437    }
7438
7439    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7440    ///
7441    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7442    ///
7443    /// # Example
7444    /// ```
7445    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7446    /// use google_cloud_aiplatform_v1::Result;
7447    /// async fn sample(
7448    ///    client: &IndexEndpointService
7449    /// ) -> Result<()> {
7450    ///     client.cancel_operation()
7451    ///         /* set fields */
7452    ///         .send().await?;
7453    ///     Ok(())
7454    /// }
7455    /// ```
7456    pub fn cancel_operation(&self) -> super::builder::index_endpoint_service::CancelOperation {
7457        super::builder::index_endpoint_service::CancelOperation::new(self.inner.clone())
7458    }
7459
7460    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7461    ///
7462    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7463    ///
7464    /// # Example
7465    /// ```
7466    /// # use google_cloud_aiplatform_v1::client::IndexEndpointService;
7467    /// use google_cloud_aiplatform_v1::Result;
7468    /// async fn sample(
7469    ///    client: &IndexEndpointService
7470    /// ) -> Result<()> {
7471    ///     let response = client.wait_operation()
7472    ///         /* set fields */
7473    ///         .send().await?;
7474    ///     println!("response {:?}", response);
7475    ///     Ok(())
7476    /// }
7477    /// ```
7478    pub fn wait_operation(&self) -> super::builder::index_endpoint_service::WaitOperation {
7479        super::builder::index_endpoint_service::WaitOperation::new(self.inner.clone())
7480    }
7481}
7482
7483/// Implements a client for the Vertex AI API.
7484///
7485/// # Example
7486/// ```
7487/// # use google_cloud_aiplatform_v1::client::IndexService;
7488/// use google_cloud_gax::paginator::ItemPaginator as _;
7489/// async fn sample(
7490///    parent: &str,
7491/// ) -> anyhow::Result<()> {
7492///     let client = IndexService::builder().build().await?;
7493///     let mut list = client.list_indexes()
7494///         .set_parent(parent)
7495///         .by_item();
7496///     while let Some(item) = list.next().await.transpose()? {
7497///         println!("{:?}", item);
7498///     }
7499///     Ok(())
7500/// }
7501/// ```
7502///
7503/// # Service Description
7504///
7505/// A service for creating and managing Vertex AI's Index resources.
7506///
7507/// # Configuration
7508///
7509/// To configure `IndexService` use the `with_*` methods in the type returned
7510/// by [builder()][IndexService::builder]. The default configuration should
7511/// work for most applications. Common configuration changes include
7512///
7513/// * [with_endpoint()]: by default this client uses the global default endpoint
7514///   (`https://aiplatform.googleapis.com`). Applications using regional
7515///   endpoints or running in restricted networks (e.g. a network configured
7516///   with [Private Google Access with VPC Service Controls]) may want to
7517///   override this default.
7518/// * [with_credentials()]: by default this client uses
7519///   [Application Default Credentials]. Applications using custom
7520///   authentication may need to override this default.
7521///
7522/// [with_endpoint()]: super::builder::index_service::ClientBuilder::with_endpoint
7523/// [with_credentials()]: super::builder::index_service::ClientBuilder::with_credentials
7524/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7525/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7526///
7527/// # Pooling and Cloning
7528///
7529/// `IndexService` holds a connection pool internally, it is advised to
7530/// create one and reuse it. You do not need to wrap `IndexService` in
7531/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7532/// already uses an `Arc` internally.
7533#[cfg(feature = "index-service")]
7534#[cfg_attr(docsrs, doc(cfg(feature = "index-service")))]
7535#[derive(Clone, Debug)]
7536pub struct IndexService {
7537    inner: std::sync::Arc<dyn super::stub::dynamic::IndexService>,
7538}
7539
7540#[cfg(feature = "index-service")]
7541impl IndexService {
7542    /// Returns a builder for [IndexService].
7543    ///
7544    /// ```
7545    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7546    /// # use google_cloud_aiplatform_v1::client::IndexService;
7547    /// let client = IndexService::builder().build().await?;
7548    /// # Ok(()) }
7549    /// ```
7550    pub fn builder() -> super::builder::index_service::ClientBuilder {
7551        crate::new_client_builder(super::builder::index_service::client::Factory)
7552    }
7553
7554    /// Creates a new client from the provided stub.
7555    ///
7556    /// The most common case for calling this function is in tests mocking the
7557    /// client's behavior.
7558    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7559    where
7560        T: super::stub::IndexService + 'static,
7561    {
7562        Self { inner: stub.into() }
7563    }
7564
7565    pub(crate) async fn new(
7566        config: gaxi::options::ClientConfig,
7567    ) -> crate::ClientBuilderResult<Self> {
7568        let inner = Self::build_inner(config).await?;
7569        Ok(Self { inner })
7570    }
7571
7572    async fn build_inner(
7573        conf: gaxi::options::ClientConfig,
7574    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::IndexService>> {
7575        if gaxi::options::tracing_enabled(&conf) {
7576            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7577        }
7578        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7579    }
7580
7581    async fn build_transport(
7582        conf: gaxi::options::ClientConfig,
7583    ) -> crate::ClientBuilderResult<impl super::stub::IndexService> {
7584        super::transport::IndexService::new(conf).await
7585    }
7586
7587    async fn build_with_tracing(
7588        conf: gaxi::options::ClientConfig,
7589    ) -> crate::ClientBuilderResult<impl super::stub::IndexService> {
7590        Self::build_transport(conf)
7591            .await
7592            .map(super::tracing::IndexService::new)
7593    }
7594
7595    /// Creates an Index.
7596    ///
7597    /// # Long running operations
7598    ///
7599    /// This method is used to start, and/or poll a [long-running Operation].
7600    /// The [Working with long-running operations] chapter in the [user guide]
7601    /// covers these operations in detail.
7602    ///
7603    /// [long-running operation]: https://google.aip.dev/151
7604    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7605    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7606    ///
7607    /// # Example
7608    /// ```
7609    /// # use google_cloud_aiplatform_v1::client::IndexService;
7610    /// use google_cloud_lro::Poller;
7611    /// use google_cloud_aiplatform_v1::model::Index;
7612    /// use google_cloud_aiplatform_v1::Result;
7613    /// async fn sample(
7614    ///    client: &IndexService, parent: &str
7615    /// ) -> Result<()> {
7616    ///     let response = client.create_index()
7617    ///         .set_parent(parent)
7618    ///         .set_index(
7619    ///             Index::new()/* set fields */
7620    ///         )
7621    ///         .poller().until_done().await?;
7622    ///     println!("response {:?}", response);
7623    ///     Ok(())
7624    /// }
7625    /// ```
7626    pub fn create_index(&self) -> super::builder::index_service::CreateIndex {
7627        super::builder::index_service::CreateIndex::new(self.inner.clone())
7628    }
7629
7630    /// Gets an Index.
7631    ///
7632    /// # Example
7633    /// ```
7634    /// # use google_cloud_aiplatform_v1::client::IndexService;
7635    /// use google_cloud_aiplatform_v1::Result;
7636    /// async fn sample(
7637    ///    client: &IndexService, project_id: &str, location_id: &str, index_id: &str
7638    /// ) -> Result<()> {
7639    ///     let response = client.get_index()
7640    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/indexes/{index_id}"))
7641    ///         .send().await?;
7642    ///     println!("response {:?}", response);
7643    ///     Ok(())
7644    /// }
7645    /// ```
7646    pub fn get_index(&self) -> super::builder::index_service::GetIndex {
7647        super::builder::index_service::GetIndex::new(self.inner.clone())
7648    }
7649
7650    /// Lists Indexes in a Location.
7651    ///
7652    /// # Example
7653    /// ```
7654    /// # use google_cloud_aiplatform_v1::client::IndexService;
7655    /// use google_cloud_gax::paginator::ItemPaginator as _;
7656    /// use google_cloud_aiplatform_v1::Result;
7657    /// async fn sample(
7658    ///    client: &IndexService, parent: &str
7659    /// ) -> Result<()> {
7660    ///     let mut list = client.list_indexes()
7661    ///         .set_parent(parent)
7662    ///         .by_item();
7663    ///     while let Some(item) = list.next().await.transpose()? {
7664    ///         println!("{:?}", item);
7665    ///     }
7666    ///     Ok(())
7667    /// }
7668    /// ```
7669    pub fn list_indexes(&self) -> super::builder::index_service::ListIndexes {
7670        super::builder::index_service::ListIndexes::new(self.inner.clone())
7671    }
7672
7673    /// Updates an Index.
7674    ///
7675    /// # Long running operations
7676    ///
7677    /// This method is used to start, and/or poll a [long-running Operation].
7678    /// The [Working with long-running operations] chapter in the [user guide]
7679    /// covers these operations in detail.
7680    ///
7681    /// [long-running operation]: https://google.aip.dev/151
7682    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7683    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7684    ///
7685    /// # Example
7686    /// ```
7687    /// # use google_cloud_aiplatform_v1::client::IndexService;
7688    /// use google_cloud_lro::Poller;
7689    /// # extern crate wkt as google_cloud_wkt;
7690    /// use google_cloud_wkt::FieldMask;
7691    /// use google_cloud_aiplatform_v1::model::Index;
7692    /// use google_cloud_aiplatform_v1::Result;
7693    /// async fn sample(
7694    ///    client: &IndexService, project_id: &str, location_id: &str, index_id: &str
7695    /// ) -> Result<()> {
7696    ///     let response = client.update_index()
7697    ///         .set_index(
7698    ///             Index::new().set_name(format!("projects/{project_id}/locations/{location_id}/indexes/{index_id}"))/* set fields */
7699    ///         )
7700    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
7701    ///         .poller().until_done().await?;
7702    ///     println!("response {:?}", response);
7703    ///     Ok(())
7704    /// }
7705    /// ```
7706    pub fn update_index(&self) -> super::builder::index_service::UpdateIndex {
7707        super::builder::index_service::UpdateIndex::new(self.inner.clone())
7708    }
7709
7710    /// Deletes an Index.
7711    /// An Index can only be deleted when all its
7712    /// [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had
7713    /// been undeployed.
7714    ///
7715    /// [google.cloud.aiplatform.v1.Index.deployed_indexes]: crate::model::Index::deployed_indexes
7716    ///
7717    /// # Long running operations
7718    ///
7719    /// This method is used to start, and/or poll a [long-running Operation].
7720    /// The [Working with long-running operations] chapter in the [user guide]
7721    /// covers these operations in detail.
7722    ///
7723    /// [long-running operation]: https://google.aip.dev/151
7724    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
7725    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
7726    ///
7727    /// # Example
7728    /// ```
7729    /// # use google_cloud_aiplatform_v1::client::IndexService;
7730    /// use google_cloud_lro::Poller;
7731    /// use google_cloud_aiplatform_v1::Result;
7732    /// async fn sample(
7733    ///    client: &IndexService, project_id: &str, location_id: &str, index_id: &str
7734    /// ) -> Result<()> {
7735    ///     client.delete_index()
7736    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/indexes/{index_id}"))
7737    ///         .poller().until_done().await?;
7738    ///     Ok(())
7739    /// }
7740    /// ```
7741    pub fn delete_index(&self) -> super::builder::index_service::DeleteIndex {
7742        super::builder::index_service::DeleteIndex::new(self.inner.clone())
7743    }
7744
7745    /// Add/update Datapoints into an Index.
7746    ///
7747    /// # Example
7748    /// ```
7749    /// # use google_cloud_aiplatform_v1::client::IndexService;
7750    /// use google_cloud_aiplatform_v1::Result;
7751    /// async fn sample(
7752    ///    client: &IndexService
7753    /// ) -> Result<()> {
7754    ///     let response = client.upsert_datapoints()
7755    ///         /* set fields */
7756    ///         .send().await?;
7757    ///     println!("response {:?}", response);
7758    ///     Ok(())
7759    /// }
7760    /// ```
7761    pub fn upsert_datapoints(&self) -> super::builder::index_service::UpsertDatapoints {
7762        super::builder::index_service::UpsertDatapoints::new(self.inner.clone())
7763    }
7764
7765    /// Remove Datapoints from an Index.
7766    ///
7767    /// # Example
7768    /// ```
7769    /// # use google_cloud_aiplatform_v1::client::IndexService;
7770    /// use google_cloud_aiplatform_v1::Result;
7771    /// async fn sample(
7772    ///    client: &IndexService
7773    /// ) -> Result<()> {
7774    ///     let response = client.remove_datapoints()
7775    ///         /* set fields */
7776    ///         .send().await?;
7777    ///     println!("response {:?}", response);
7778    ///     Ok(())
7779    /// }
7780    /// ```
7781    pub fn remove_datapoints(&self) -> super::builder::index_service::RemoveDatapoints {
7782        super::builder::index_service::RemoveDatapoints::new(self.inner.clone())
7783    }
7784
7785    /// Lists information about the supported locations for this service.
7786    ///
7787    /// # Example
7788    /// ```
7789    /// # use google_cloud_aiplatform_v1::client::IndexService;
7790    /// use google_cloud_gax::paginator::ItemPaginator as _;
7791    /// use google_cloud_aiplatform_v1::Result;
7792    /// async fn sample(
7793    ///    client: &IndexService
7794    /// ) -> Result<()> {
7795    ///     let mut list = client.list_locations()
7796    ///         /* set fields */
7797    ///         .by_item();
7798    ///     while let Some(item) = list.next().await.transpose()? {
7799    ///         println!("{:?}", item);
7800    ///     }
7801    ///     Ok(())
7802    /// }
7803    /// ```
7804    pub fn list_locations(&self) -> super::builder::index_service::ListLocations {
7805        super::builder::index_service::ListLocations::new(self.inner.clone())
7806    }
7807
7808    /// Gets information about a location.
7809    ///
7810    /// # Example
7811    /// ```
7812    /// # use google_cloud_aiplatform_v1::client::IndexService;
7813    /// use google_cloud_aiplatform_v1::Result;
7814    /// async fn sample(
7815    ///    client: &IndexService
7816    /// ) -> Result<()> {
7817    ///     let response = client.get_location()
7818    ///         /* set fields */
7819    ///         .send().await?;
7820    ///     println!("response {:?}", response);
7821    ///     Ok(())
7822    /// }
7823    /// ```
7824    pub fn get_location(&self) -> super::builder::index_service::GetLocation {
7825        super::builder::index_service::GetLocation::new(self.inner.clone())
7826    }
7827
7828    /// Sets the access control policy on the specified resource. Replaces
7829    /// any existing policy.
7830    ///
7831    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
7832    /// errors.
7833    ///
7834    /// # Example
7835    /// ```
7836    /// # use google_cloud_aiplatform_v1::client::IndexService;
7837    /// use google_cloud_aiplatform_v1::Result;
7838    /// async fn sample(
7839    ///    client: &IndexService
7840    /// ) -> Result<()> {
7841    ///     let response = client.set_iam_policy()
7842    ///         /* set fields */
7843    ///         .send().await?;
7844    ///     println!("response {:?}", response);
7845    ///     Ok(())
7846    /// }
7847    /// ```
7848    pub fn set_iam_policy(&self) -> super::builder::index_service::SetIamPolicy {
7849        super::builder::index_service::SetIamPolicy::new(self.inner.clone())
7850    }
7851
7852    /// Gets the access control policy for a resource. Returns an empty policy
7853    /// if the resource exists and does not have a policy set.
7854    ///
7855    /// # Example
7856    /// ```
7857    /// # use google_cloud_aiplatform_v1::client::IndexService;
7858    /// use google_cloud_aiplatform_v1::Result;
7859    /// async fn sample(
7860    ///    client: &IndexService
7861    /// ) -> Result<()> {
7862    ///     let response = client.get_iam_policy()
7863    ///         /* set fields */
7864    ///         .send().await?;
7865    ///     println!("response {:?}", response);
7866    ///     Ok(())
7867    /// }
7868    /// ```
7869    pub fn get_iam_policy(&self) -> super::builder::index_service::GetIamPolicy {
7870        super::builder::index_service::GetIamPolicy::new(self.inner.clone())
7871    }
7872
7873    /// Returns permissions that a caller has on the specified resource. If the
7874    /// resource does not exist, this will return an empty set of
7875    /// permissions, not a `NOT_FOUND` error.
7876    ///
7877    /// Note: This operation is designed to be used for building
7878    /// permission-aware UIs and command-line tools, not for authorization
7879    /// checking. This operation may "fail open" without warning.
7880    ///
7881    /// # Example
7882    /// ```
7883    /// # use google_cloud_aiplatform_v1::client::IndexService;
7884    /// use google_cloud_aiplatform_v1::Result;
7885    /// async fn sample(
7886    ///    client: &IndexService
7887    /// ) -> Result<()> {
7888    ///     let response = client.test_iam_permissions()
7889    ///         /* set fields */
7890    ///         .send().await?;
7891    ///     println!("response {:?}", response);
7892    ///     Ok(())
7893    /// }
7894    /// ```
7895    pub fn test_iam_permissions(&self) -> super::builder::index_service::TestIamPermissions {
7896        super::builder::index_service::TestIamPermissions::new(self.inner.clone())
7897    }
7898
7899    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7900    ///
7901    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7902    ///
7903    /// # Example
7904    /// ```
7905    /// # use google_cloud_aiplatform_v1::client::IndexService;
7906    /// use google_cloud_gax::paginator::ItemPaginator as _;
7907    /// use google_cloud_aiplatform_v1::Result;
7908    /// async fn sample(
7909    ///    client: &IndexService
7910    /// ) -> Result<()> {
7911    ///     let mut list = client.list_operations()
7912    ///         /* set fields */
7913    ///         .by_item();
7914    ///     while let Some(item) = list.next().await.transpose()? {
7915    ///         println!("{:?}", item);
7916    ///     }
7917    ///     Ok(())
7918    /// }
7919    /// ```
7920    pub fn list_operations(&self) -> super::builder::index_service::ListOperations {
7921        super::builder::index_service::ListOperations::new(self.inner.clone())
7922    }
7923
7924    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7925    ///
7926    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7927    ///
7928    /// # Example
7929    /// ```
7930    /// # use google_cloud_aiplatform_v1::client::IndexService;
7931    /// use google_cloud_aiplatform_v1::Result;
7932    /// async fn sample(
7933    ///    client: &IndexService
7934    /// ) -> Result<()> {
7935    ///     let response = client.get_operation()
7936    ///         /* set fields */
7937    ///         .send().await?;
7938    ///     println!("response {:?}", response);
7939    ///     Ok(())
7940    /// }
7941    /// ```
7942    pub fn get_operation(&self) -> super::builder::index_service::GetOperation {
7943        super::builder::index_service::GetOperation::new(self.inner.clone())
7944    }
7945
7946    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7947    ///
7948    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7949    ///
7950    /// # Example
7951    /// ```
7952    /// # use google_cloud_aiplatform_v1::client::IndexService;
7953    /// use google_cloud_aiplatform_v1::Result;
7954    /// async fn sample(
7955    ///    client: &IndexService
7956    /// ) -> Result<()> {
7957    ///     client.delete_operation()
7958    ///         /* set fields */
7959    ///         .send().await?;
7960    ///     Ok(())
7961    /// }
7962    /// ```
7963    pub fn delete_operation(&self) -> super::builder::index_service::DeleteOperation {
7964        super::builder::index_service::DeleteOperation::new(self.inner.clone())
7965    }
7966
7967    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7968    ///
7969    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7970    ///
7971    /// # Example
7972    /// ```
7973    /// # use google_cloud_aiplatform_v1::client::IndexService;
7974    /// use google_cloud_aiplatform_v1::Result;
7975    /// async fn sample(
7976    ///    client: &IndexService
7977    /// ) -> Result<()> {
7978    ///     client.cancel_operation()
7979    ///         /* set fields */
7980    ///         .send().await?;
7981    ///     Ok(())
7982    /// }
7983    /// ```
7984    pub fn cancel_operation(&self) -> super::builder::index_service::CancelOperation {
7985        super::builder::index_service::CancelOperation::new(self.inner.clone())
7986    }
7987
7988    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
7989    ///
7990    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
7991    ///
7992    /// # Example
7993    /// ```
7994    /// # use google_cloud_aiplatform_v1::client::IndexService;
7995    /// use google_cloud_aiplatform_v1::Result;
7996    /// async fn sample(
7997    ///    client: &IndexService
7998    /// ) -> Result<()> {
7999    ///     let response = client.wait_operation()
8000    ///         /* set fields */
8001    ///         .send().await?;
8002    ///     println!("response {:?}", response);
8003    ///     Ok(())
8004    /// }
8005    /// ```
8006    pub fn wait_operation(&self) -> super::builder::index_service::WaitOperation {
8007        super::builder::index_service::WaitOperation::new(self.inner.clone())
8008    }
8009}
8010
8011/// Implements a client for the Vertex AI API.
8012///
8013/// # Example
8014/// ```
8015/// # use google_cloud_aiplatform_v1::client::JobService;
8016/// use google_cloud_gax::paginator::ItemPaginator as _;
8017/// async fn sample(
8018///    parent: &str,
8019/// ) -> anyhow::Result<()> {
8020///     let client = JobService::builder().build().await?;
8021///     let mut list = client.list_custom_jobs()
8022///         .set_parent(parent)
8023///         .by_item();
8024///     while let Some(item) = list.next().await.transpose()? {
8025///         println!("{:?}", item);
8026///     }
8027///     Ok(())
8028/// }
8029/// ```
8030///
8031/// # Service Description
8032///
8033/// A service for creating and managing Vertex AI's jobs.
8034///
8035/// # Configuration
8036///
8037/// To configure `JobService` use the `with_*` methods in the type returned
8038/// by [builder()][JobService::builder]. The default configuration should
8039/// work for most applications. Common configuration changes include
8040///
8041/// * [with_endpoint()]: by default this client uses the global default endpoint
8042///   (`https://aiplatform.googleapis.com`). Applications using regional
8043///   endpoints or running in restricted networks (e.g. a network configured
8044///   with [Private Google Access with VPC Service Controls]) may want to
8045///   override this default.
8046/// * [with_credentials()]: by default this client uses
8047///   [Application Default Credentials]. Applications using custom
8048///   authentication may need to override this default.
8049///
8050/// [with_endpoint()]: super::builder::job_service::ClientBuilder::with_endpoint
8051/// [with_credentials()]: super::builder::job_service::ClientBuilder::with_credentials
8052/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8053/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8054///
8055/// # Pooling and Cloning
8056///
8057/// `JobService` holds a connection pool internally, it is advised to
8058/// create one and reuse it. You do not need to wrap `JobService` in
8059/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8060/// already uses an `Arc` internally.
8061#[cfg(feature = "job-service")]
8062#[cfg_attr(docsrs, doc(cfg(feature = "job-service")))]
8063#[derive(Clone, Debug)]
8064pub struct JobService {
8065    inner: std::sync::Arc<dyn super::stub::dynamic::JobService>,
8066}
8067
8068#[cfg(feature = "job-service")]
8069impl JobService {
8070    /// Returns a builder for [JobService].
8071    ///
8072    /// ```
8073    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8074    /// # use google_cloud_aiplatform_v1::client::JobService;
8075    /// let client = JobService::builder().build().await?;
8076    /// # Ok(()) }
8077    /// ```
8078    pub fn builder() -> super::builder::job_service::ClientBuilder {
8079        crate::new_client_builder(super::builder::job_service::client::Factory)
8080    }
8081
8082    /// Creates a new client from the provided stub.
8083    ///
8084    /// The most common case for calling this function is in tests mocking the
8085    /// client's behavior.
8086    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8087    where
8088        T: super::stub::JobService + 'static,
8089    {
8090        Self { inner: stub.into() }
8091    }
8092
8093    pub(crate) async fn new(
8094        config: gaxi::options::ClientConfig,
8095    ) -> crate::ClientBuilderResult<Self> {
8096        let inner = Self::build_inner(config).await?;
8097        Ok(Self { inner })
8098    }
8099
8100    async fn build_inner(
8101        conf: gaxi::options::ClientConfig,
8102    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::JobService>> {
8103        if gaxi::options::tracing_enabled(&conf) {
8104            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8105        }
8106        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8107    }
8108
8109    async fn build_transport(
8110        conf: gaxi::options::ClientConfig,
8111    ) -> crate::ClientBuilderResult<impl super::stub::JobService> {
8112        super::transport::JobService::new(conf).await
8113    }
8114
8115    async fn build_with_tracing(
8116        conf: gaxi::options::ClientConfig,
8117    ) -> crate::ClientBuilderResult<impl super::stub::JobService> {
8118        Self::build_transport(conf)
8119            .await
8120            .map(super::tracing::JobService::new)
8121    }
8122
8123    /// Creates a CustomJob. A created CustomJob right away
8124    /// will be attempted to be run.
8125    ///
8126    /// # Example
8127    /// ```
8128    /// # use google_cloud_aiplatform_v1::client::JobService;
8129    /// use google_cloud_aiplatform_v1::model::CustomJob;
8130    /// use google_cloud_aiplatform_v1::Result;
8131    /// async fn sample(
8132    ///    client: &JobService, parent: &str
8133    /// ) -> Result<()> {
8134    ///     let response = client.create_custom_job()
8135    ///         .set_parent(parent)
8136    ///         .set_custom_job(
8137    ///             CustomJob::new()/* set fields */
8138    ///         )
8139    ///         .send().await?;
8140    ///     println!("response {:?}", response);
8141    ///     Ok(())
8142    /// }
8143    /// ```
8144    pub fn create_custom_job(&self) -> super::builder::job_service::CreateCustomJob {
8145        super::builder::job_service::CreateCustomJob::new(self.inner.clone())
8146    }
8147
8148    /// Gets a CustomJob.
8149    ///
8150    /// # Example
8151    /// ```
8152    /// # use google_cloud_aiplatform_v1::client::JobService;
8153    /// use google_cloud_aiplatform_v1::Result;
8154    /// async fn sample(
8155    ///    client: &JobService, project_id: &str, location_id: &str, custom_job_id: &str
8156    /// ) -> Result<()> {
8157    ///     let response = client.get_custom_job()
8158    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/customJobs/{custom_job_id}"))
8159    ///         .send().await?;
8160    ///     println!("response {:?}", response);
8161    ///     Ok(())
8162    /// }
8163    /// ```
8164    pub fn get_custom_job(&self) -> super::builder::job_service::GetCustomJob {
8165        super::builder::job_service::GetCustomJob::new(self.inner.clone())
8166    }
8167
8168    /// Lists CustomJobs in a Location.
8169    ///
8170    /// # Example
8171    /// ```
8172    /// # use google_cloud_aiplatform_v1::client::JobService;
8173    /// use google_cloud_gax::paginator::ItemPaginator as _;
8174    /// use google_cloud_aiplatform_v1::Result;
8175    /// async fn sample(
8176    ///    client: &JobService, parent: &str
8177    /// ) -> Result<()> {
8178    ///     let mut list = client.list_custom_jobs()
8179    ///         .set_parent(parent)
8180    ///         .by_item();
8181    ///     while let Some(item) = list.next().await.transpose()? {
8182    ///         println!("{:?}", item);
8183    ///     }
8184    ///     Ok(())
8185    /// }
8186    /// ```
8187    pub fn list_custom_jobs(&self) -> super::builder::job_service::ListCustomJobs {
8188        super::builder::job_service::ListCustomJobs::new(self.inner.clone())
8189    }
8190
8191    /// Deletes a CustomJob.
8192    ///
8193    /// # Long running operations
8194    ///
8195    /// This method is used to start, and/or poll a [long-running Operation].
8196    /// The [Working with long-running operations] chapter in the [user guide]
8197    /// covers these operations in detail.
8198    ///
8199    /// [long-running operation]: https://google.aip.dev/151
8200    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8201    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8202    ///
8203    /// # Example
8204    /// ```
8205    /// # use google_cloud_aiplatform_v1::client::JobService;
8206    /// use google_cloud_lro::Poller;
8207    /// use google_cloud_aiplatform_v1::Result;
8208    /// async fn sample(
8209    ///    client: &JobService, project_id: &str, location_id: &str, custom_job_id: &str
8210    /// ) -> Result<()> {
8211    ///     client.delete_custom_job()
8212    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/customJobs/{custom_job_id}"))
8213    ///         .poller().until_done().await?;
8214    ///     Ok(())
8215    /// }
8216    /// ```
8217    pub fn delete_custom_job(&self) -> super::builder::job_service::DeleteCustomJob {
8218        super::builder::job_service::DeleteCustomJob::new(self.inner.clone())
8219    }
8220
8221    /// Cancels a CustomJob.
8222    /// Starts asynchronous cancellation on the CustomJob. The server
8223    /// makes a best effort to cancel the job, but success is not
8224    /// guaranteed. Clients can use
8225    /// [JobService.GetCustomJob][google.cloud.aiplatform.v1.JobService.GetCustomJob]
8226    /// or other methods to check whether the cancellation succeeded or whether the
8227    /// job completed despite cancellation. On successful cancellation,
8228    /// the CustomJob is not deleted; instead it becomes a job with
8229    /// a [CustomJob.error][google.cloud.aiplatform.v1.CustomJob.error] value with
8230    /// a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
8231    /// `Code.CANCELLED`, and
8232    /// [CustomJob.state][google.cloud.aiplatform.v1.CustomJob.state] is set to
8233    /// `CANCELLED`.
8234    ///
8235    /// [google.cloud.aiplatform.v1.CustomJob.error]: crate::model::CustomJob::error
8236    /// [google.cloud.aiplatform.v1.CustomJob.state]: crate::model::CustomJob::state
8237    /// [google.cloud.aiplatform.v1.JobService.GetCustomJob]: crate::client::JobService::get_custom_job
8238    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
8239    ///
8240    /// # Example
8241    /// ```
8242    /// # use google_cloud_aiplatform_v1::client::JobService;
8243    /// use google_cloud_aiplatform_v1::Result;
8244    /// async fn sample(
8245    ///    client: &JobService
8246    /// ) -> Result<()> {
8247    ///     client.cancel_custom_job()
8248    ///         /* set fields */
8249    ///         .send().await?;
8250    ///     Ok(())
8251    /// }
8252    /// ```
8253    pub fn cancel_custom_job(&self) -> super::builder::job_service::CancelCustomJob {
8254        super::builder::job_service::CancelCustomJob::new(self.inner.clone())
8255    }
8256
8257    /// Creates a DataLabelingJob.
8258    ///
8259    /// # Example
8260    /// ```
8261    /// # use google_cloud_aiplatform_v1::client::JobService;
8262    /// use google_cloud_aiplatform_v1::model::DataLabelingJob;
8263    /// use google_cloud_aiplatform_v1::Result;
8264    /// async fn sample(
8265    ///    client: &JobService, parent: &str
8266    /// ) -> Result<()> {
8267    ///     let response = client.create_data_labeling_job()
8268    ///         .set_parent(parent)
8269    ///         .set_data_labeling_job(
8270    ///             DataLabelingJob::new()/* set fields */
8271    ///         )
8272    ///         .send().await?;
8273    ///     println!("response {:?}", response);
8274    ///     Ok(())
8275    /// }
8276    /// ```
8277    pub fn create_data_labeling_job(&self) -> super::builder::job_service::CreateDataLabelingJob {
8278        super::builder::job_service::CreateDataLabelingJob::new(self.inner.clone())
8279    }
8280
8281    /// Gets a DataLabelingJob.
8282    ///
8283    /// # Example
8284    /// ```
8285    /// # use google_cloud_aiplatform_v1::client::JobService;
8286    /// use google_cloud_aiplatform_v1::Result;
8287    /// async fn sample(
8288    ///    client: &JobService, project_id: &str, location_id: &str, data_labeling_job_id: &str
8289    /// ) -> Result<()> {
8290    ///     let response = client.get_data_labeling_job()
8291    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/dataLabelingJobs/{data_labeling_job_id}"))
8292    ///         .send().await?;
8293    ///     println!("response {:?}", response);
8294    ///     Ok(())
8295    /// }
8296    /// ```
8297    pub fn get_data_labeling_job(&self) -> super::builder::job_service::GetDataLabelingJob {
8298        super::builder::job_service::GetDataLabelingJob::new(self.inner.clone())
8299    }
8300
8301    /// Lists DataLabelingJobs in a Location.
8302    ///
8303    /// # Example
8304    /// ```
8305    /// # use google_cloud_aiplatform_v1::client::JobService;
8306    /// use google_cloud_gax::paginator::ItemPaginator as _;
8307    /// use google_cloud_aiplatform_v1::Result;
8308    /// async fn sample(
8309    ///    client: &JobService, parent: &str
8310    /// ) -> Result<()> {
8311    ///     let mut list = client.list_data_labeling_jobs()
8312    ///         .set_parent(parent)
8313    ///         .by_item();
8314    ///     while let Some(item) = list.next().await.transpose()? {
8315    ///         println!("{:?}", item);
8316    ///     }
8317    ///     Ok(())
8318    /// }
8319    /// ```
8320    pub fn list_data_labeling_jobs(&self) -> super::builder::job_service::ListDataLabelingJobs {
8321        super::builder::job_service::ListDataLabelingJobs::new(self.inner.clone())
8322    }
8323
8324    /// Deletes a DataLabelingJob.
8325    ///
8326    /// # Long running operations
8327    ///
8328    /// This method is used to start, and/or poll a [long-running Operation].
8329    /// The [Working with long-running operations] chapter in the [user guide]
8330    /// covers these operations in detail.
8331    ///
8332    /// [long-running operation]: https://google.aip.dev/151
8333    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8334    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8335    ///
8336    /// # Example
8337    /// ```
8338    /// # use google_cloud_aiplatform_v1::client::JobService;
8339    /// use google_cloud_lro::Poller;
8340    /// use google_cloud_aiplatform_v1::Result;
8341    /// async fn sample(
8342    ///    client: &JobService, project_id: &str, location_id: &str, data_labeling_job_id: &str
8343    /// ) -> Result<()> {
8344    ///     client.delete_data_labeling_job()
8345    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/dataLabelingJobs/{data_labeling_job_id}"))
8346    ///         .poller().until_done().await?;
8347    ///     Ok(())
8348    /// }
8349    /// ```
8350    pub fn delete_data_labeling_job(&self) -> super::builder::job_service::DeleteDataLabelingJob {
8351        super::builder::job_service::DeleteDataLabelingJob::new(self.inner.clone())
8352    }
8353
8354    /// Cancels a DataLabelingJob. Success of cancellation is not guaranteed.
8355    ///
8356    /// # Example
8357    /// ```
8358    /// # use google_cloud_aiplatform_v1::client::JobService;
8359    /// use google_cloud_aiplatform_v1::Result;
8360    /// async fn sample(
8361    ///    client: &JobService
8362    /// ) -> Result<()> {
8363    ///     client.cancel_data_labeling_job()
8364    ///         /* set fields */
8365    ///         .send().await?;
8366    ///     Ok(())
8367    /// }
8368    /// ```
8369    pub fn cancel_data_labeling_job(&self) -> super::builder::job_service::CancelDataLabelingJob {
8370        super::builder::job_service::CancelDataLabelingJob::new(self.inner.clone())
8371    }
8372
8373    /// Creates a HyperparameterTuningJob
8374    ///
8375    /// # Example
8376    /// ```
8377    /// # use google_cloud_aiplatform_v1::client::JobService;
8378    /// use google_cloud_aiplatform_v1::model::HyperparameterTuningJob;
8379    /// use google_cloud_aiplatform_v1::Result;
8380    /// async fn sample(
8381    ///    client: &JobService, parent: &str
8382    /// ) -> Result<()> {
8383    ///     let response = client.create_hyperparameter_tuning_job()
8384    ///         .set_parent(parent)
8385    ///         .set_hyperparameter_tuning_job(
8386    ///             HyperparameterTuningJob::new()/* set fields */
8387    ///         )
8388    ///         .send().await?;
8389    ///     println!("response {:?}", response);
8390    ///     Ok(())
8391    /// }
8392    /// ```
8393    pub fn create_hyperparameter_tuning_job(
8394        &self,
8395    ) -> super::builder::job_service::CreateHyperparameterTuningJob {
8396        super::builder::job_service::CreateHyperparameterTuningJob::new(self.inner.clone())
8397    }
8398
8399    /// Gets a HyperparameterTuningJob
8400    ///
8401    /// # Example
8402    /// ```
8403    /// # use google_cloud_aiplatform_v1::client::JobService;
8404    /// use google_cloud_aiplatform_v1::Result;
8405    /// async fn sample(
8406    ///    client: &JobService, project_id: &str, location_id: &str, hyperparameter_tuning_job_id: &str
8407    /// ) -> Result<()> {
8408    ///     let response = client.get_hyperparameter_tuning_job()
8409    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/hyperparameterTuningJobs/{hyperparameter_tuning_job_id}"))
8410    ///         .send().await?;
8411    ///     println!("response {:?}", response);
8412    ///     Ok(())
8413    /// }
8414    /// ```
8415    pub fn get_hyperparameter_tuning_job(
8416        &self,
8417    ) -> super::builder::job_service::GetHyperparameterTuningJob {
8418        super::builder::job_service::GetHyperparameterTuningJob::new(self.inner.clone())
8419    }
8420
8421    /// Lists HyperparameterTuningJobs in a Location.
8422    ///
8423    /// # Example
8424    /// ```
8425    /// # use google_cloud_aiplatform_v1::client::JobService;
8426    /// use google_cloud_gax::paginator::ItemPaginator as _;
8427    /// use google_cloud_aiplatform_v1::Result;
8428    /// async fn sample(
8429    ///    client: &JobService, parent: &str
8430    /// ) -> Result<()> {
8431    ///     let mut list = client.list_hyperparameter_tuning_jobs()
8432    ///         .set_parent(parent)
8433    ///         .by_item();
8434    ///     while let Some(item) = list.next().await.transpose()? {
8435    ///         println!("{:?}", item);
8436    ///     }
8437    ///     Ok(())
8438    /// }
8439    /// ```
8440    pub fn list_hyperparameter_tuning_jobs(
8441        &self,
8442    ) -> super::builder::job_service::ListHyperparameterTuningJobs {
8443        super::builder::job_service::ListHyperparameterTuningJobs::new(self.inner.clone())
8444    }
8445
8446    /// Deletes a HyperparameterTuningJob.
8447    ///
8448    /// # Long running operations
8449    ///
8450    /// This method is used to start, and/or poll a [long-running Operation].
8451    /// The [Working with long-running operations] chapter in the [user guide]
8452    /// covers these operations in detail.
8453    ///
8454    /// [long-running operation]: https://google.aip.dev/151
8455    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8456    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8457    ///
8458    /// # Example
8459    /// ```
8460    /// # use google_cloud_aiplatform_v1::client::JobService;
8461    /// use google_cloud_lro::Poller;
8462    /// use google_cloud_aiplatform_v1::Result;
8463    /// async fn sample(
8464    ///    client: &JobService, project_id: &str, location_id: &str, hyperparameter_tuning_job_id: &str
8465    /// ) -> Result<()> {
8466    ///     client.delete_hyperparameter_tuning_job()
8467    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/hyperparameterTuningJobs/{hyperparameter_tuning_job_id}"))
8468    ///         .poller().until_done().await?;
8469    ///     Ok(())
8470    /// }
8471    /// ```
8472    pub fn delete_hyperparameter_tuning_job(
8473        &self,
8474    ) -> super::builder::job_service::DeleteHyperparameterTuningJob {
8475        super::builder::job_service::DeleteHyperparameterTuningJob::new(self.inner.clone())
8476    }
8477
8478    /// Cancels a HyperparameterTuningJob.
8479    /// Starts asynchronous cancellation on the HyperparameterTuningJob. The server
8480    /// makes a best effort to cancel the job, but success is not
8481    /// guaranteed. Clients can use
8482    /// [JobService.GetHyperparameterTuningJob][google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob]
8483    /// or other methods to check whether the cancellation succeeded or whether the
8484    /// job completed despite cancellation. On successful cancellation,
8485    /// the HyperparameterTuningJob is not deleted; instead it becomes a job with
8486    /// a
8487    /// [HyperparameterTuningJob.error][google.cloud.aiplatform.v1.HyperparameterTuningJob.error]
8488    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
8489    /// corresponding to `Code.CANCELLED`, and
8490    /// [HyperparameterTuningJob.state][google.cloud.aiplatform.v1.HyperparameterTuningJob.state]
8491    /// is set to `CANCELLED`.
8492    ///
8493    /// [google.cloud.aiplatform.v1.HyperparameterTuningJob.error]: crate::model::HyperparameterTuningJob::error
8494    /// [google.cloud.aiplatform.v1.HyperparameterTuningJob.state]: crate::model::HyperparameterTuningJob::state
8495    /// [google.cloud.aiplatform.v1.JobService.GetHyperparameterTuningJob]: crate::client::JobService::get_hyperparameter_tuning_job
8496    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
8497    ///
8498    /// # Example
8499    /// ```
8500    /// # use google_cloud_aiplatform_v1::client::JobService;
8501    /// use google_cloud_aiplatform_v1::Result;
8502    /// async fn sample(
8503    ///    client: &JobService
8504    /// ) -> Result<()> {
8505    ///     client.cancel_hyperparameter_tuning_job()
8506    ///         /* set fields */
8507    ///         .send().await?;
8508    ///     Ok(())
8509    /// }
8510    /// ```
8511    pub fn cancel_hyperparameter_tuning_job(
8512        &self,
8513    ) -> super::builder::job_service::CancelHyperparameterTuningJob {
8514        super::builder::job_service::CancelHyperparameterTuningJob::new(self.inner.clone())
8515    }
8516
8517    /// Creates a NasJob
8518    ///
8519    /// # Example
8520    /// ```
8521    /// # use google_cloud_aiplatform_v1::client::JobService;
8522    /// use google_cloud_aiplatform_v1::model::NasJob;
8523    /// use google_cloud_aiplatform_v1::Result;
8524    /// async fn sample(
8525    ///    client: &JobService, parent: &str
8526    /// ) -> Result<()> {
8527    ///     let response = client.create_nas_job()
8528    ///         .set_parent(parent)
8529    ///         .set_nas_job(
8530    ///             NasJob::new()/* set fields */
8531    ///         )
8532    ///         .send().await?;
8533    ///     println!("response {:?}", response);
8534    ///     Ok(())
8535    /// }
8536    /// ```
8537    pub fn create_nas_job(&self) -> super::builder::job_service::CreateNasJob {
8538        super::builder::job_service::CreateNasJob::new(self.inner.clone())
8539    }
8540
8541    /// Gets a NasJob
8542    ///
8543    /// # Example
8544    /// ```
8545    /// # use google_cloud_aiplatform_v1::client::JobService;
8546    /// use google_cloud_aiplatform_v1::Result;
8547    /// async fn sample(
8548    ///    client: &JobService, project_id: &str, location_id: &str, nas_job_id: &str
8549    /// ) -> Result<()> {
8550    ///     let response = client.get_nas_job()
8551    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/nasJobs/{nas_job_id}"))
8552    ///         .send().await?;
8553    ///     println!("response {:?}", response);
8554    ///     Ok(())
8555    /// }
8556    /// ```
8557    pub fn get_nas_job(&self) -> super::builder::job_service::GetNasJob {
8558        super::builder::job_service::GetNasJob::new(self.inner.clone())
8559    }
8560
8561    /// Lists NasJobs in a Location.
8562    ///
8563    /// # Example
8564    /// ```
8565    /// # use google_cloud_aiplatform_v1::client::JobService;
8566    /// use google_cloud_gax::paginator::ItemPaginator as _;
8567    /// use google_cloud_aiplatform_v1::Result;
8568    /// async fn sample(
8569    ///    client: &JobService, parent: &str
8570    /// ) -> Result<()> {
8571    ///     let mut list = client.list_nas_jobs()
8572    ///         .set_parent(parent)
8573    ///         .by_item();
8574    ///     while let Some(item) = list.next().await.transpose()? {
8575    ///         println!("{:?}", item);
8576    ///     }
8577    ///     Ok(())
8578    /// }
8579    /// ```
8580    pub fn list_nas_jobs(&self) -> super::builder::job_service::ListNasJobs {
8581        super::builder::job_service::ListNasJobs::new(self.inner.clone())
8582    }
8583
8584    /// Deletes a NasJob.
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    ///
8596    /// # Example
8597    /// ```
8598    /// # use google_cloud_aiplatform_v1::client::JobService;
8599    /// use google_cloud_lro::Poller;
8600    /// use google_cloud_aiplatform_v1::Result;
8601    /// async fn sample(
8602    ///    client: &JobService, project_id: &str, location_id: &str, nas_job_id: &str
8603    /// ) -> Result<()> {
8604    ///     client.delete_nas_job()
8605    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/nasJobs/{nas_job_id}"))
8606    ///         .poller().until_done().await?;
8607    ///     Ok(())
8608    /// }
8609    /// ```
8610    pub fn delete_nas_job(&self) -> super::builder::job_service::DeleteNasJob {
8611        super::builder::job_service::DeleteNasJob::new(self.inner.clone())
8612    }
8613
8614    /// Cancels a NasJob.
8615    /// Starts asynchronous cancellation on the NasJob. The server
8616    /// makes a best effort to cancel the job, but success is not
8617    /// guaranteed. Clients can use
8618    /// [JobService.GetNasJob][google.cloud.aiplatform.v1.JobService.GetNasJob] or
8619    /// other methods to check whether the cancellation succeeded or whether the
8620    /// job completed despite cancellation. On successful cancellation,
8621    /// the NasJob is not deleted; instead it becomes a job with
8622    /// a [NasJob.error][google.cloud.aiplatform.v1.NasJob.error] value with a
8623    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
8624    /// `Code.CANCELLED`, and
8625    /// [NasJob.state][google.cloud.aiplatform.v1.NasJob.state] is set to
8626    /// `CANCELLED`.
8627    ///
8628    /// [google.cloud.aiplatform.v1.JobService.GetNasJob]: crate::client::JobService::get_nas_job
8629    /// [google.cloud.aiplatform.v1.NasJob.error]: crate::model::NasJob::error
8630    /// [google.cloud.aiplatform.v1.NasJob.state]: crate::model::NasJob::state
8631    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
8632    ///
8633    /// # Example
8634    /// ```
8635    /// # use google_cloud_aiplatform_v1::client::JobService;
8636    /// use google_cloud_aiplatform_v1::Result;
8637    /// async fn sample(
8638    ///    client: &JobService
8639    /// ) -> Result<()> {
8640    ///     client.cancel_nas_job()
8641    ///         /* set fields */
8642    ///         .send().await?;
8643    ///     Ok(())
8644    /// }
8645    /// ```
8646    pub fn cancel_nas_job(&self) -> super::builder::job_service::CancelNasJob {
8647        super::builder::job_service::CancelNasJob::new(self.inner.clone())
8648    }
8649
8650    /// Gets a NasTrialDetail.
8651    ///
8652    /// # Example
8653    /// ```
8654    /// # use google_cloud_aiplatform_v1::client::JobService;
8655    /// use google_cloud_aiplatform_v1::Result;
8656    /// async fn sample(
8657    ///    client: &JobService, project_id: &str, location_id: &str, nas_job_id: &str, nas_trial_detail_id: &str
8658    /// ) -> Result<()> {
8659    ///     let response = client.get_nas_trial_detail()
8660    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/nasJobs/{nas_job_id}/nasTrialDetails/{nas_trial_detail_id}"))
8661    ///         .send().await?;
8662    ///     println!("response {:?}", response);
8663    ///     Ok(())
8664    /// }
8665    /// ```
8666    pub fn get_nas_trial_detail(&self) -> super::builder::job_service::GetNasTrialDetail {
8667        super::builder::job_service::GetNasTrialDetail::new(self.inner.clone())
8668    }
8669
8670    /// List top NasTrialDetails of a NasJob.
8671    ///
8672    /// # Example
8673    /// ```
8674    /// # use google_cloud_aiplatform_v1::client::JobService;
8675    /// use google_cloud_gax::paginator::ItemPaginator as _;
8676    /// use google_cloud_aiplatform_v1::Result;
8677    /// async fn sample(
8678    ///    client: &JobService, project_id: &str, location_id: &str, nas_job_id: &str
8679    /// ) -> Result<()> {
8680    ///     let mut list = client.list_nas_trial_details()
8681    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/nasJobs/{nas_job_id}"))
8682    ///         .by_item();
8683    ///     while let Some(item) = list.next().await.transpose()? {
8684    ///         println!("{:?}", item);
8685    ///     }
8686    ///     Ok(())
8687    /// }
8688    /// ```
8689    pub fn list_nas_trial_details(&self) -> super::builder::job_service::ListNasTrialDetails {
8690        super::builder::job_service::ListNasTrialDetails::new(self.inner.clone())
8691    }
8692
8693    /// Creates a BatchPredictionJob. A BatchPredictionJob once created will
8694    /// right away be attempted to start.
8695    ///
8696    /// # Example
8697    /// ```
8698    /// # use google_cloud_aiplatform_v1::client::JobService;
8699    /// use google_cloud_aiplatform_v1::model::BatchPredictionJob;
8700    /// use google_cloud_aiplatform_v1::Result;
8701    /// async fn sample(
8702    ///    client: &JobService, parent: &str
8703    /// ) -> Result<()> {
8704    ///     let response = client.create_batch_prediction_job()
8705    ///         .set_parent(parent)
8706    ///         .set_batch_prediction_job(
8707    ///             BatchPredictionJob::new()/* set fields */
8708    ///         )
8709    ///         .send().await?;
8710    ///     println!("response {:?}", response);
8711    ///     Ok(())
8712    /// }
8713    /// ```
8714    pub fn create_batch_prediction_job(
8715        &self,
8716    ) -> super::builder::job_service::CreateBatchPredictionJob {
8717        super::builder::job_service::CreateBatchPredictionJob::new(self.inner.clone())
8718    }
8719
8720    /// Gets a BatchPredictionJob
8721    ///
8722    /// # Example
8723    /// ```
8724    /// # use google_cloud_aiplatform_v1::client::JobService;
8725    /// use google_cloud_aiplatform_v1::Result;
8726    /// async fn sample(
8727    ///    client: &JobService, project_id: &str, location_id: &str, batch_prediction_job_id: &str
8728    /// ) -> Result<()> {
8729    ///     let response = client.get_batch_prediction_job()
8730    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/batchPredictionJobs/{batch_prediction_job_id}"))
8731    ///         .send().await?;
8732    ///     println!("response {:?}", response);
8733    ///     Ok(())
8734    /// }
8735    /// ```
8736    pub fn get_batch_prediction_job(&self) -> super::builder::job_service::GetBatchPredictionJob {
8737        super::builder::job_service::GetBatchPredictionJob::new(self.inner.clone())
8738    }
8739
8740    /// Lists BatchPredictionJobs in a Location.
8741    ///
8742    /// # Example
8743    /// ```
8744    /// # use google_cloud_aiplatform_v1::client::JobService;
8745    /// use google_cloud_gax::paginator::ItemPaginator as _;
8746    /// use google_cloud_aiplatform_v1::Result;
8747    /// async fn sample(
8748    ///    client: &JobService, parent: &str
8749    /// ) -> Result<()> {
8750    ///     let mut list = client.list_batch_prediction_jobs()
8751    ///         .set_parent(parent)
8752    ///         .by_item();
8753    ///     while let Some(item) = list.next().await.transpose()? {
8754    ///         println!("{:?}", item);
8755    ///     }
8756    ///     Ok(())
8757    /// }
8758    /// ```
8759    pub fn list_batch_prediction_jobs(
8760        &self,
8761    ) -> super::builder::job_service::ListBatchPredictionJobs {
8762        super::builder::job_service::ListBatchPredictionJobs::new(self.inner.clone())
8763    }
8764
8765    /// Deletes a BatchPredictionJob. Can only be called on jobs that already
8766    /// finished.
8767    ///
8768    /// # Long running operations
8769    ///
8770    /// This method is used to start, and/or poll a [long-running Operation].
8771    /// The [Working with long-running operations] chapter in the [user guide]
8772    /// covers these operations in detail.
8773    ///
8774    /// [long-running operation]: https://google.aip.dev/151
8775    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8776    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8777    ///
8778    /// # Example
8779    /// ```
8780    /// # use google_cloud_aiplatform_v1::client::JobService;
8781    /// use google_cloud_lro::Poller;
8782    /// use google_cloud_aiplatform_v1::Result;
8783    /// async fn sample(
8784    ///    client: &JobService, project_id: &str, location_id: &str, batch_prediction_job_id: &str
8785    /// ) -> Result<()> {
8786    ///     client.delete_batch_prediction_job()
8787    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/batchPredictionJobs/{batch_prediction_job_id}"))
8788    ///         .poller().until_done().await?;
8789    ///     Ok(())
8790    /// }
8791    /// ```
8792    pub fn delete_batch_prediction_job(
8793        &self,
8794    ) -> super::builder::job_service::DeleteBatchPredictionJob {
8795        super::builder::job_service::DeleteBatchPredictionJob::new(self.inner.clone())
8796    }
8797
8798    /// Cancels a BatchPredictionJob.
8799    ///
8800    /// Starts asynchronous cancellation on the BatchPredictionJob. The server
8801    /// makes the best effort to cancel the job, but success is not
8802    /// guaranteed. Clients can use
8803    /// [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob]
8804    /// or other methods to check whether the cancellation succeeded or whether the
8805    /// job completed despite cancellation. On a successful cancellation,
8806    /// the BatchPredictionJob is not deleted;instead its
8807    /// [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state]
8808    /// is set to `CANCELLED`. Any files already outputted by the job are not
8809    /// deleted.
8810    ///
8811    /// [google.cloud.aiplatform.v1.BatchPredictionJob.state]: crate::model::BatchPredictionJob::state
8812    /// [google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob]: crate::client::JobService::get_batch_prediction_job
8813    ///
8814    /// # Example
8815    /// ```
8816    /// # use google_cloud_aiplatform_v1::client::JobService;
8817    /// use google_cloud_aiplatform_v1::Result;
8818    /// async fn sample(
8819    ///    client: &JobService
8820    /// ) -> Result<()> {
8821    ///     client.cancel_batch_prediction_job()
8822    ///         /* set fields */
8823    ///         .send().await?;
8824    ///     Ok(())
8825    /// }
8826    /// ```
8827    pub fn cancel_batch_prediction_job(
8828        &self,
8829    ) -> super::builder::job_service::CancelBatchPredictionJob {
8830        super::builder::job_service::CancelBatchPredictionJob::new(self.inner.clone())
8831    }
8832
8833    /// Creates a ModelDeploymentMonitoringJob. It will run periodically on a
8834    /// configured interval.
8835    ///
8836    /// # Example
8837    /// ```
8838    /// # use google_cloud_aiplatform_v1::client::JobService;
8839    /// use google_cloud_aiplatform_v1::model::ModelDeploymentMonitoringJob;
8840    /// use google_cloud_aiplatform_v1::Result;
8841    /// async fn sample(
8842    ///    client: &JobService, parent: &str
8843    /// ) -> Result<()> {
8844    ///     let response = client.create_model_deployment_monitoring_job()
8845    ///         .set_parent(parent)
8846    ///         .set_model_deployment_monitoring_job(
8847    ///             ModelDeploymentMonitoringJob::new()/* set fields */
8848    ///         )
8849    ///         .send().await?;
8850    ///     println!("response {:?}", response);
8851    ///     Ok(())
8852    /// }
8853    /// ```
8854    pub fn create_model_deployment_monitoring_job(
8855        &self,
8856    ) -> super::builder::job_service::CreateModelDeploymentMonitoringJob {
8857        super::builder::job_service::CreateModelDeploymentMonitoringJob::new(self.inner.clone())
8858    }
8859
8860    /// Searches Model Monitoring Statistics generated within a given time window.
8861    ///
8862    /// # Example
8863    /// ```
8864    /// # use google_cloud_aiplatform_v1::client::JobService;
8865    /// use google_cloud_gax::paginator::ItemPaginator as _;
8866    /// use google_cloud_aiplatform_v1::Result;
8867    /// async fn sample(
8868    ///    client: &JobService
8869    /// ) -> Result<()> {
8870    ///     let mut list = client.search_model_deployment_monitoring_stats_anomalies()
8871    ///         /* set fields */
8872    ///         .by_item();
8873    ///     while let Some(item) = list.next().await.transpose()? {
8874    ///         println!("{:?}", item);
8875    ///     }
8876    ///     Ok(())
8877    /// }
8878    /// ```
8879    pub fn search_model_deployment_monitoring_stats_anomalies(
8880        &self,
8881    ) -> super::builder::job_service::SearchModelDeploymentMonitoringStatsAnomalies {
8882        super::builder::job_service::SearchModelDeploymentMonitoringStatsAnomalies::new(
8883            self.inner.clone(),
8884        )
8885    }
8886
8887    /// Gets a ModelDeploymentMonitoringJob.
8888    ///
8889    /// # Example
8890    /// ```
8891    /// # use google_cloud_aiplatform_v1::client::JobService;
8892    /// use google_cloud_aiplatform_v1::Result;
8893    /// async fn sample(
8894    ///    client: &JobService, project_id: &str, location_id: &str, model_deployment_monitoring_job_id: &str
8895    /// ) -> Result<()> {
8896    ///     let response = client.get_model_deployment_monitoring_job()
8897    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job_id}"))
8898    ///         .send().await?;
8899    ///     println!("response {:?}", response);
8900    ///     Ok(())
8901    /// }
8902    /// ```
8903    pub fn get_model_deployment_monitoring_job(
8904        &self,
8905    ) -> super::builder::job_service::GetModelDeploymentMonitoringJob {
8906        super::builder::job_service::GetModelDeploymentMonitoringJob::new(self.inner.clone())
8907    }
8908
8909    /// Lists ModelDeploymentMonitoringJobs in a Location.
8910    ///
8911    /// # Example
8912    /// ```
8913    /// # use google_cloud_aiplatform_v1::client::JobService;
8914    /// use google_cloud_gax::paginator::ItemPaginator as _;
8915    /// use google_cloud_aiplatform_v1::Result;
8916    /// async fn sample(
8917    ///    client: &JobService, parent: &str
8918    /// ) -> Result<()> {
8919    ///     let mut list = client.list_model_deployment_monitoring_jobs()
8920    ///         .set_parent(parent)
8921    ///         .by_item();
8922    ///     while let Some(item) = list.next().await.transpose()? {
8923    ///         println!("{:?}", item);
8924    ///     }
8925    ///     Ok(())
8926    /// }
8927    /// ```
8928    pub fn list_model_deployment_monitoring_jobs(
8929        &self,
8930    ) -> super::builder::job_service::ListModelDeploymentMonitoringJobs {
8931        super::builder::job_service::ListModelDeploymentMonitoringJobs::new(self.inner.clone())
8932    }
8933
8934    /// Updates a ModelDeploymentMonitoringJob.
8935    ///
8936    /// # Long running operations
8937    ///
8938    /// This method is used to start, and/or poll a [long-running Operation].
8939    /// The [Working with long-running operations] chapter in the [user guide]
8940    /// covers these operations in detail.
8941    ///
8942    /// [long-running operation]: https://google.aip.dev/151
8943    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8944    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8945    ///
8946    /// # Example
8947    /// ```
8948    /// # use google_cloud_aiplatform_v1::client::JobService;
8949    /// use google_cloud_lro::Poller;
8950    /// # extern crate wkt as google_cloud_wkt;
8951    /// use google_cloud_wkt::FieldMask;
8952    /// use google_cloud_aiplatform_v1::model::ModelDeploymentMonitoringJob;
8953    /// use google_cloud_aiplatform_v1::Result;
8954    /// async fn sample(
8955    ///    client: &JobService, project_id: &str, location_id: &str, model_deployment_monitoring_job_id: &str
8956    /// ) -> Result<()> {
8957    ///     let response = client.update_model_deployment_monitoring_job()
8958    ///         .set_model_deployment_monitoring_job(
8959    ///             ModelDeploymentMonitoringJob::new().set_name(format!("projects/{project_id}/locations/{location_id}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job_id}"))/* set fields */
8960    ///         )
8961    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
8962    ///         .poller().until_done().await?;
8963    ///     println!("response {:?}", response);
8964    ///     Ok(())
8965    /// }
8966    /// ```
8967    pub fn update_model_deployment_monitoring_job(
8968        &self,
8969    ) -> super::builder::job_service::UpdateModelDeploymentMonitoringJob {
8970        super::builder::job_service::UpdateModelDeploymentMonitoringJob::new(self.inner.clone())
8971    }
8972
8973    /// Deletes a ModelDeploymentMonitoringJob.
8974    ///
8975    /// # Long running operations
8976    ///
8977    /// This method is used to start, and/or poll a [long-running Operation].
8978    /// The [Working with long-running operations] chapter in the [user guide]
8979    /// covers these operations in detail.
8980    ///
8981    /// [long-running operation]: https://google.aip.dev/151
8982    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
8983    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
8984    ///
8985    /// # Example
8986    /// ```
8987    /// # use google_cloud_aiplatform_v1::client::JobService;
8988    /// use google_cloud_lro::Poller;
8989    /// use google_cloud_aiplatform_v1::Result;
8990    /// async fn sample(
8991    ///    client: &JobService, project_id: &str, location_id: &str, model_deployment_monitoring_job_id: &str
8992    /// ) -> Result<()> {
8993    ///     client.delete_model_deployment_monitoring_job()
8994    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job_id}"))
8995    ///         .poller().until_done().await?;
8996    ///     Ok(())
8997    /// }
8998    /// ```
8999    pub fn delete_model_deployment_monitoring_job(
9000        &self,
9001    ) -> super::builder::job_service::DeleteModelDeploymentMonitoringJob {
9002        super::builder::job_service::DeleteModelDeploymentMonitoringJob::new(self.inner.clone())
9003    }
9004
9005    /// Pauses a ModelDeploymentMonitoringJob. If the job is running, the server
9006    /// makes a best effort to cancel the job. Will mark
9007    /// [ModelDeploymentMonitoringJob.state][google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state]
9008    /// to 'PAUSED'.
9009    ///
9010    /// [google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob.state]: crate::model::ModelDeploymentMonitoringJob::state
9011    ///
9012    /// # Example
9013    /// ```
9014    /// # use google_cloud_aiplatform_v1::client::JobService;
9015    /// use google_cloud_aiplatform_v1::Result;
9016    /// async fn sample(
9017    ///    client: &JobService
9018    /// ) -> Result<()> {
9019    ///     client.pause_model_deployment_monitoring_job()
9020    ///         /* set fields */
9021    ///         .send().await?;
9022    ///     Ok(())
9023    /// }
9024    /// ```
9025    pub fn pause_model_deployment_monitoring_job(
9026        &self,
9027    ) -> super::builder::job_service::PauseModelDeploymentMonitoringJob {
9028        super::builder::job_service::PauseModelDeploymentMonitoringJob::new(self.inner.clone())
9029    }
9030
9031    /// Resumes a paused ModelDeploymentMonitoringJob. It will start to run from
9032    /// next scheduled time. A deleted ModelDeploymentMonitoringJob can't be
9033    /// resumed.
9034    ///
9035    /// # Example
9036    /// ```
9037    /// # use google_cloud_aiplatform_v1::client::JobService;
9038    /// use google_cloud_aiplatform_v1::Result;
9039    /// async fn sample(
9040    ///    client: &JobService
9041    /// ) -> Result<()> {
9042    ///     client.resume_model_deployment_monitoring_job()
9043    ///         /* set fields */
9044    ///         .send().await?;
9045    ///     Ok(())
9046    /// }
9047    /// ```
9048    pub fn resume_model_deployment_monitoring_job(
9049        &self,
9050    ) -> super::builder::job_service::ResumeModelDeploymentMonitoringJob {
9051        super::builder::job_service::ResumeModelDeploymentMonitoringJob::new(self.inner.clone())
9052    }
9053
9054    /// Lists information about the supported locations for this service.
9055    ///
9056    /// # Example
9057    /// ```
9058    /// # use google_cloud_aiplatform_v1::client::JobService;
9059    /// use google_cloud_gax::paginator::ItemPaginator as _;
9060    /// use google_cloud_aiplatform_v1::Result;
9061    /// async fn sample(
9062    ///    client: &JobService
9063    /// ) -> Result<()> {
9064    ///     let mut list = client.list_locations()
9065    ///         /* set fields */
9066    ///         .by_item();
9067    ///     while let Some(item) = list.next().await.transpose()? {
9068    ///         println!("{:?}", item);
9069    ///     }
9070    ///     Ok(())
9071    /// }
9072    /// ```
9073    pub fn list_locations(&self) -> super::builder::job_service::ListLocations {
9074        super::builder::job_service::ListLocations::new(self.inner.clone())
9075    }
9076
9077    /// Gets information about a location.
9078    ///
9079    /// # Example
9080    /// ```
9081    /// # use google_cloud_aiplatform_v1::client::JobService;
9082    /// use google_cloud_aiplatform_v1::Result;
9083    /// async fn sample(
9084    ///    client: &JobService
9085    /// ) -> Result<()> {
9086    ///     let response = client.get_location()
9087    ///         /* set fields */
9088    ///         .send().await?;
9089    ///     println!("response {:?}", response);
9090    ///     Ok(())
9091    /// }
9092    /// ```
9093    pub fn get_location(&self) -> super::builder::job_service::GetLocation {
9094        super::builder::job_service::GetLocation::new(self.inner.clone())
9095    }
9096
9097    /// Sets the access control policy on the specified resource. Replaces
9098    /// any existing policy.
9099    ///
9100    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
9101    /// errors.
9102    ///
9103    /// # Example
9104    /// ```
9105    /// # use google_cloud_aiplatform_v1::client::JobService;
9106    /// use google_cloud_aiplatform_v1::Result;
9107    /// async fn sample(
9108    ///    client: &JobService
9109    /// ) -> Result<()> {
9110    ///     let response = client.set_iam_policy()
9111    ///         /* set fields */
9112    ///         .send().await?;
9113    ///     println!("response {:?}", response);
9114    ///     Ok(())
9115    /// }
9116    /// ```
9117    pub fn set_iam_policy(&self) -> super::builder::job_service::SetIamPolicy {
9118        super::builder::job_service::SetIamPolicy::new(self.inner.clone())
9119    }
9120
9121    /// Gets the access control policy for a resource. Returns an empty policy
9122    /// if the resource exists and does not have a policy set.
9123    ///
9124    /// # Example
9125    /// ```
9126    /// # use google_cloud_aiplatform_v1::client::JobService;
9127    /// use google_cloud_aiplatform_v1::Result;
9128    /// async fn sample(
9129    ///    client: &JobService
9130    /// ) -> Result<()> {
9131    ///     let response = client.get_iam_policy()
9132    ///         /* set fields */
9133    ///         .send().await?;
9134    ///     println!("response {:?}", response);
9135    ///     Ok(())
9136    /// }
9137    /// ```
9138    pub fn get_iam_policy(&self) -> super::builder::job_service::GetIamPolicy {
9139        super::builder::job_service::GetIamPolicy::new(self.inner.clone())
9140    }
9141
9142    /// Returns permissions that a caller has on the specified resource. If the
9143    /// resource does not exist, this will return an empty set of
9144    /// permissions, not a `NOT_FOUND` error.
9145    ///
9146    /// Note: This operation is designed to be used for building
9147    /// permission-aware UIs and command-line tools, not for authorization
9148    /// checking. This operation may "fail open" without warning.
9149    ///
9150    /// # Example
9151    /// ```
9152    /// # use google_cloud_aiplatform_v1::client::JobService;
9153    /// use google_cloud_aiplatform_v1::Result;
9154    /// async fn sample(
9155    ///    client: &JobService
9156    /// ) -> Result<()> {
9157    ///     let response = client.test_iam_permissions()
9158    ///         /* set fields */
9159    ///         .send().await?;
9160    ///     println!("response {:?}", response);
9161    ///     Ok(())
9162    /// }
9163    /// ```
9164    pub fn test_iam_permissions(&self) -> super::builder::job_service::TestIamPermissions {
9165        super::builder::job_service::TestIamPermissions::new(self.inner.clone())
9166    }
9167
9168    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9169    ///
9170    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9171    ///
9172    /// # Example
9173    /// ```
9174    /// # use google_cloud_aiplatform_v1::client::JobService;
9175    /// use google_cloud_gax::paginator::ItemPaginator as _;
9176    /// use google_cloud_aiplatform_v1::Result;
9177    /// async fn sample(
9178    ///    client: &JobService
9179    /// ) -> Result<()> {
9180    ///     let mut list = client.list_operations()
9181    ///         /* set fields */
9182    ///         .by_item();
9183    ///     while let Some(item) = list.next().await.transpose()? {
9184    ///         println!("{:?}", item);
9185    ///     }
9186    ///     Ok(())
9187    /// }
9188    /// ```
9189    pub fn list_operations(&self) -> super::builder::job_service::ListOperations {
9190        super::builder::job_service::ListOperations::new(self.inner.clone())
9191    }
9192
9193    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9194    ///
9195    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9196    ///
9197    /// # Example
9198    /// ```
9199    /// # use google_cloud_aiplatform_v1::client::JobService;
9200    /// use google_cloud_aiplatform_v1::Result;
9201    /// async fn sample(
9202    ///    client: &JobService
9203    /// ) -> Result<()> {
9204    ///     let response = client.get_operation()
9205    ///         /* set fields */
9206    ///         .send().await?;
9207    ///     println!("response {:?}", response);
9208    ///     Ok(())
9209    /// }
9210    /// ```
9211    pub fn get_operation(&self) -> super::builder::job_service::GetOperation {
9212        super::builder::job_service::GetOperation::new(self.inner.clone())
9213    }
9214
9215    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9216    ///
9217    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9218    ///
9219    /// # Example
9220    /// ```
9221    /// # use google_cloud_aiplatform_v1::client::JobService;
9222    /// use google_cloud_aiplatform_v1::Result;
9223    /// async fn sample(
9224    ///    client: &JobService
9225    /// ) -> Result<()> {
9226    ///     client.delete_operation()
9227    ///         /* set fields */
9228    ///         .send().await?;
9229    ///     Ok(())
9230    /// }
9231    /// ```
9232    pub fn delete_operation(&self) -> super::builder::job_service::DeleteOperation {
9233        super::builder::job_service::DeleteOperation::new(self.inner.clone())
9234    }
9235
9236    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9237    ///
9238    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9239    ///
9240    /// # Example
9241    /// ```
9242    /// # use google_cloud_aiplatform_v1::client::JobService;
9243    /// use google_cloud_aiplatform_v1::Result;
9244    /// async fn sample(
9245    ///    client: &JobService
9246    /// ) -> Result<()> {
9247    ///     client.cancel_operation()
9248    ///         /* set fields */
9249    ///         .send().await?;
9250    ///     Ok(())
9251    /// }
9252    /// ```
9253    pub fn cancel_operation(&self) -> super::builder::job_service::CancelOperation {
9254        super::builder::job_service::CancelOperation::new(self.inner.clone())
9255    }
9256
9257    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9258    ///
9259    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9260    ///
9261    /// # Example
9262    /// ```
9263    /// # use google_cloud_aiplatform_v1::client::JobService;
9264    /// use google_cloud_aiplatform_v1::Result;
9265    /// async fn sample(
9266    ///    client: &JobService
9267    /// ) -> Result<()> {
9268    ///     let response = client.wait_operation()
9269    ///         /* set fields */
9270    ///         .send().await?;
9271    ///     println!("response {:?}", response);
9272    ///     Ok(())
9273    /// }
9274    /// ```
9275    pub fn wait_operation(&self) -> super::builder::job_service::WaitOperation {
9276        super::builder::job_service::WaitOperation::new(self.inner.clone())
9277    }
9278}
9279
9280/// Implements a client for the Vertex AI API.
9281///
9282/// # Example
9283/// ```
9284/// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9285/// async fn sample(
9286/// ) -> anyhow::Result<()> {
9287///     let client = LlmUtilityService::builder().build().await?;
9288///     let response = client.count_tokens()
9289///         /* set fields */
9290///         .send().await?;
9291///     println!("response {:?}", response);
9292///     Ok(())
9293/// }
9294/// ```
9295///
9296/// # Service Description
9297///
9298/// Service for LLM related utility functions.
9299///
9300/// # Configuration
9301///
9302/// To configure `LlmUtilityService` use the `with_*` methods in the type returned
9303/// by [builder()][LlmUtilityService::builder]. The default configuration should
9304/// work for most applications. Common configuration changes include
9305///
9306/// * [with_endpoint()]: by default this client uses the global default endpoint
9307///   (`https://aiplatform.googleapis.com`). Applications using regional
9308///   endpoints or running in restricted networks (e.g. a network configured
9309///   with [Private Google Access with VPC Service Controls]) may want to
9310///   override this default.
9311/// * [with_credentials()]: by default this client uses
9312///   [Application Default Credentials]. Applications using custom
9313///   authentication may need to override this default.
9314///
9315/// [with_endpoint()]: super::builder::llm_utility_service::ClientBuilder::with_endpoint
9316/// [with_credentials()]: super::builder::llm_utility_service::ClientBuilder::with_credentials
9317/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9318/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9319///
9320/// # Pooling and Cloning
9321///
9322/// `LlmUtilityService` holds a connection pool internally, it is advised to
9323/// create one and reuse it. You do not need to wrap `LlmUtilityService` in
9324/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9325/// already uses an `Arc` internally.
9326#[cfg(feature = "llm-utility-service")]
9327#[cfg_attr(docsrs, doc(cfg(feature = "llm-utility-service")))]
9328#[derive(Clone, Debug)]
9329pub struct LlmUtilityService {
9330    inner: std::sync::Arc<dyn super::stub::dynamic::LlmUtilityService>,
9331}
9332
9333#[cfg(feature = "llm-utility-service")]
9334impl LlmUtilityService {
9335    /// Returns a builder for [LlmUtilityService].
9336    ///
9337    /// ```
9338    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9339    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9340    /// let client = LlmUtilityService::builder().build().await?;
9341    /// # Ok(()) }
9342    /// ```
9343    pub fn builder() -> super::builder::llm_utility_service::ClientBuilder {
9344        crate::new_client_builder(super::builder::llm_utility_service::client::Factory)
9345    }
9346
9347    /// Creates a new client from the provided stub.
9348    ///
9349    /// The most common case for calling this function is in tests mocking the
9350    /// client's behavior.
9351    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9352    where
9353        T: super::stub::LlmUtilityService + 'static,
9354    {
9355        Self { inner: stub.into() }
9356    }
9357
9358    pub(crate) async fn new(
9359        config: gaxi::options::ClientConfig,
9360    ) -> crate::ClientBuilderResult<Self> {
9361        let inner = Self::build_inner(config).await?;
9362        Ok(Self { inner })
9363    }
9364
9365    async fn build_inner(
9366        conf: gaxi::options::ClientConfig,
9367    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::LlmUtilityService>>
9368    {
9369        if gaxi::options::tracing_enabled(&conf) {
9370            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9371        }
9372        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9373    }
9374
9375    async fn build_transport(
9376        conf: gaxi::options::ClientConfig,
9377    ) -> crate::ClientBuilderResult<impl super::stub::LlmUtilityService> {
9378        super::transport::LlmUtilityService::new(conf).await
9379    }
9380
9381    async fn build_with_tracing(
9382        conf: gaxi::options::ClientConfig,
9383    ) -> crate::ClientBuilderResult<impl super::stub::LlmUtilityService> {
9384        Self::build_transport(conf)
9385            .await
9386            .map(super::tracing::LlmUtilityService::new)
9387    }
9388
9389    /// Perform a token counting.
9390    ///
9391    /// # Example
9392    /// ```
9393    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9394    /// use google_cloud_aiplatform_v1::Result;
9395    /// async fn sample(
9396    ///    client: &LlmUtilityService
9397    /// ) -> Result<()> {
9398    ///     let response = client.count_tokens()
9399    ///         /* set fields */
9400    ///         .send().await?;
9401    ///     println!("response {:?}", response);
9402    ///     Ok(())
9403    /// }
9404    /// ```
9405    pub fn count_tokens(&self) -> super::builder::llm_utility_service::CountTokens {
9406        super::builder::llm_utility_service::CountTokens::new(self.inner.clone())
9407    }
9408
9409    /// Return a list of tokens based on the input text.
9410    ///
9411    /// # Example
9412    /// ```
9413    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9414    /// use google_cloud_aiplatform_v1::Result;
9415    /// async fn sample(
9416    ///    client: &LlmUtilityService
9417    /// ) -> Result<()> {
9418    ///     let response = client.compute_tokens()
9419    ///         /* set fields */
9420    ///         .send().await?;
9421    ///     println!("response {:?}", response);
9422    ///     Ok(())
9423    /// }
9424    /// ```
9425    pub fn compute_tokens(&self) -> super::builder::llm_utility_service::ComputeTokens {
9426        super::builder::llm_utility_service::ComputeTokens::new(self.inner.clone())
9427    }
9428
9429    /// Lists information about the supported locations for this service.
9430    ///
9431    /// # Example
9432    /// ```
9433    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9434    /// use google_cloud_gax::paginator::ItemPaginator as _;
9435    /// use google_cloud_aiplatform_v1::Result;
9436    /// async fn sample(
9437    ///    client: &LlmUtilityService
9438    /// ) -> Result<()> {
9439    ///     let mut list = client.list_locations()
9440    ///         /* set fields */
9441    ///         .by_item();
9442    ///     while let Some(item) = list.next().await.transpose()? {
9443    ///         println!("{:?}", item);
9444    ///     }
9445    ///     Ok(())
9446    /// }
9447    /// ```
9448    pub fn list_locations(&self) -> super::builder::llm_utility_service::ListLocations {
9449        super::builder::llm_utility_service::ListLocations::new(self.inner.clone())
9450    }
9451
9452    /// Gets information about a location.
9453    ///
9454    /// # Example
9455    /// ```
9456    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9457    /// use google_cloud_aiplatform_v1::Result;
9458    /// async fn sample(
9459    ///    client: &LlmUtilityService
9460    /// ) -> Result<()> {
9461    ///     let response = client.get_location()
9462    ///         /* set fields */
9463    ///         .send().await?;
9464    ///     println!("response {:?}", response);
9465    ///     Ok(())
9466    /// }
9467    /// ```
9468    pub fn get_location(&self) -> super::builder::llm_utility_service::GetLocation {
9469        super::builder::llm_utility_service::GetLocation::new(self.inner.clone())
9470    }
9471
9472    /// Sets the access control policy on the specified resource. Replaces
9473    /// any existing policy.
9474    ///
9475    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
9476    /// errors.
9477    ///
9478    /// # Example
9479    /// ```
9480    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9481    /// use google_cloud_aiplatform_v1::Result;
9482    /// async fn sample(
9483    ///    client: &LlmUtilityService
9484    /// ) -> Result<()> {
9485    ///     let response = client.set_iam_policy()
9486    ///         /* set fields */
9487    ///         .send().await?;
9488    ///     println!("response {:?}", response);
9489    ///     Ok(())
9490    /// }
9491    /// ```
9492    pub fn set_iam_policy(&self) -> super::builder::llm_utility_service::SetIamPolicy {
9493        super::builder::llm_utility_service::SetIamPolicy::new(self.inner.clone())
9494    }
9495
9496    /// Gets the access control policy for a resource. Returns an empty policy
9497    /// if the resource exists and does not have a policy set.
9498    ///
9499    /// # Example
9500    /// ```
9501    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9502    /// use google_cloud_aiplatform_v1::Result;
9503    /// async fn sample(
9504    ///    client: &LlmUtilityService
9505    /// ) -> Result<()> {
9506    ///     let response = client.get_iam_policy()
9507    ///         /* set fields */
9508    ///         .send().await?;
9509    ///     println!("response {:?}", response);
9510    ///     Ok(())
9511    /// }
9512    /// ```
9513    pub fn get_iam_policy(&self) -> super::builder::llm_utility_service::GetIamPolicy {
9514        super::builder::llm_utility_service::GetIamPolicy::new(self.inner.clone())
9515    }
9516
9517    /// Returns permissions that a caller has on the specified resource. If the
9518    /// resource does not exist, this will return an empty set of
9519    /// permissions, not a `NOT_FOUND` error.
9520    ///
9521    /// Note: This operation is designed to be used for building
9522    /// permission-aware UIs and command-line tools, not for authorization
9523    /// checking. This operation may "fail open" without warning.
9524    ///
9525    /// # Example
9526    /// ```
9527    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9528    /// use google_cloud_aiplatform_v1::Result;
9529    /// async fn sample(
9530    ///    client: &LlmUtilityService
9531    /// ) -> Result<()> {
9532    ///     let response = client.test_iam_permissions()
9533    ///         /* set fields */
9534    ///         .send().await?;
9535    ///     println!("response {:?}", response);
9536    ///     Ok(())
9537    /// }
9538    /// ```
9539    pub fn test_iam_permissions(&self) -> super::builder::llm_utility_service::TestIamPermissions {
9540        super::builder::llm_utility_service::TestIamPermissions::new(self.inner.clone())
9541    }
9542
9543    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9544    ///
9545    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9546    ///
9547    /// # Example
9548    /// ```
9549    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9550    /// use google_cloud_gax::paginator::ItemPaginator as _;
9551    /// use google_cloud_aiplatform_v1::Result;
9552    /// async fn sample(
9553    ///    client: &LlmUtilityService
9554    /// ) -> Result<()> {
9555    ///     let mut list = client.list_operations()
9556    ///         /* set fields */
9557    ///         .by_item();
9558    ///     while let Some(item) = list.next().await.transpose()? {
9559    ///         println!("{:?}", item);
9560    ///     }
9561    ///     Ok(())
9562    /// }
9563    /// ```
9564    pub fn list_operations(&self) -> super::builder::llm_utility_service::ListOperations {
9565        super::builder::llm_utility_service::ListOperations::new(self.inner.clone())
9566    }
9567
9568    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9569    ///
9570    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9571    ///
9572    /// # Example
9573    /// ```
9574    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9575    /// use google_cloud_aiplatform_v1::Result;
9576    /// async fn sample(
9577    ///    client: &LlmUtilityService
9578    /// ) -> Result<()> {
9579    ///     let response = client.get_operation()
9580    ///         /* set fields */
9581    ///         .send().await?;
9582    ///     println!("response {:?}", response);
9583    ///     Ok(())
9584    /// }
9585    /// ```
9586    pub fn get_operation(&self) -> super::builder::llm_utility_service::GetOperation {
9587        super::builder::llm_utility_service::GetOperation::new(self.inner.clone())
9588    }
9589
9590    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9591    ///
9592    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9593    ///
9594    /// # Example
9595    /// ```
9596    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9597    /// use google_cloud_aiplatform_v1::Result;
9598    /// async fn sample(
9599    ///    client: &LlmUtilityService
9600    /// ) -> Result<()> {
9601    ///     client.delete_operation()
9602    ///         /* set fields */
9603    ///         .send().await?;
9604    ///     Ok(())
9605    /// }
9606    /// ```
9607    pub fn delete_operation(&self) -> super::builder::llm_utility_service::DeleteOperation {
9608        super::builder::llm_utility_service::DeleteOperation::new(self.inner.clone())
9609    }
9610
9611    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9612    ///
9613    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9614    ///
9615    /// # Example
9616    /// ```
9617    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9618    /// use google_cloud_aiplatform_v1::Result;
9619    /// async fn sample(
9620    ///    client: &LlmUtilityService
9621    /// ) -> Result<()> {
9622    ///     client.cancel_operation()
9623    ///         /* set fields */
9624    ///         .send().await?;
9625    ///     Ok(())
9626    /// }
9627    /// ```
9628    pub fn cancel_operation(&self) -> super::builder::llm_utility_service::CancelOperation {
9629        super::builder::llm_utility_service::CancelOperation::new(self.inner.clone())
9630    }
9631
9632    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9633    ///
9634    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9635    ///
9636    /// # Example
9637    /// ```
9638    /// # use google_cloud_aiplatform_v1::client::LlmUtilityService;
9639    /// use google_cloud_aiplatform_v1::Result;
9640    /// async fn sample(
9641    ///    client: &LlmUtilityService
9642    /// ) -> Result<()> {
9643    ///     let response = client.wait_operation()
9644    ///         /* set fields */
9645    ///         .send().await?;
9646    ///     println!("response {:?}", response);
9647    ///     Ok(())
9648    /// }
9649    /// ```
9650    pub fn wait_operation(&self) -> super::builder::llm_utility_service::WaitOperation {
9651        super::builder::llm_utility_service::WaitOperation::new(self.inner.clone())
9652    }
9653}
9654
9655/// Implements a client for the Vertex AI API.
9656///
9657/// # Example
9658/// ```
9659/// # use google_cloud_aiplatform_v1::client::MatchService;
9660/// async fn sample(
9661/// ) -> anyhow::Result<()> {
9662///     let client = MatchService::builder().build().await?;
9663///     let response = client.find_neighbors()
9664///         /* set fields */
9665///         .send().await?;
9666///     println!("response {:?}", response);
9667///     Ok(())
9668/// }
9669/// ```
9670///
9671/// # Service Description
9672///
9673/// MatchService is a Google managed service for efficient vector similarity
9674/// search at scale.
9675///
9676/// # Configuration
9677///
9678/// To configure `MatchService` use the `with_*` methods in the type returned
9679/// by [builder()][MatchService::builder]. The default configuration should
9680/// work for most applications. Common configuration changes include
9681///
9682/// * [with_endpoint()]: by default this client uses the global default endpoint
9683///   (`https://aiplatform.googleapis.com`). Applications using regional
9684///   endpoints or running in restricted networks (e.g. a network configured
9685///   with [Private Google Access with VPC Service Controls]) may want to
9686///   override this default.
9687/// * [with_credentials()]: by default this client uses
9688///   [Application Default Credentials]. Applications using custom
9689///   authentication may need to override this default.
9690///
9691/// [with_endpoint()]: super::builder::match_service::ClientBuilder::with_endpoint
9692/// [with_credentials()]: super::builder::match_service::ClientBuilder::with_credentials
9693/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9694/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9695///
9696/// # Pooling and Cloning
9697///
9698/// `MatchService` holds a connection pool internally, it is advised to
9699/// create one and reuse it. You do not need to wrap `MatchService` in
9700/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9701/// already uses an `Arc` internally.
9702#[cfg(feature = "match-service")]
9703#[cfg_attr(docsrs, doc(cfg(feature = "match-service")))]
9704#[derive(Clone, Debug)]
9705pub struct MatchService {
9706    inner: std::sync::Arc<dyn super::stub::dynamic::MatchService>,
9707}
9708
9709#[cfg(feature = "match-service")]
9710impl MatchService {
9711    /// Returns a builder for [MatchService].
9712    ///
9713    /// ```
9714    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9715    /// # use google_cloud_aiplatform_v1::client::MatchService;
9716    /// let client = MatchService::builder().build().await?;
9717    /// # Ok(()) }
9718    /// ```
9719    pub fn builder() -> super::builder::match_service::ClientBuilder {
9720        crate::new_client_builder(super::builder::match_service::client::Factory)
9721    }
9722
9723    /// Creates a new client from the provided stub.
9724    ///
9725    /// The most common case for calling this function is in tests mocking the
9726    /// client's behavior.
9727    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9728    where
9729        T: super::stub::MatchService + 'static,
9730    {
9731        Self { inner: stub.into() }
9732    }
9733
9734    pub(crate) async fn new(
9735        config: gaxi::options::ClientConfig,
9736    ) -> crate::ClientBuilderResult<Self> {
9737        let inner = Self::build_inner(config).await?;
9738        Ok(Self { inner })
9739    }
9740
9741    async fn build_inner(
9742        conf: gaxi::options::ClientConfig,
9743    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MatchService>> {
9744        if gaxi::options::tracing_enabled(&conf) {
9745            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9746        }
9747        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9748    }
9749
9750    async fn build_transport(
9751        conf: gaxi::options::ClientConfig,
9752    ) -> crate::ClientBuilderResult<impl super::stub::MatchService> {
9753        super::transport::MatchService::new(conf).await
9754    }
9755
9756    async fn build_with_tracing(
9757        conf: gaxi::options::ClientConfig,
9758    ) -> crate::ClientBuilderResult<impl super::stub::MatchService> {
9759        Self::build_transport(conf)
9760            .await
9761            .map(super::tracing::MatchService::new)
9762    }
9763
9764    /// Finds the nearest neighbors of each vector within the request.
9765    ///
9766    /// # Example
9767    /// ```
9768    /// # use google_cloud_aiplatform_v1::client::MatchService;
9769    /// use google_cloud_aiplatform_v1::Result;
9770    /// async fn sample(
9771    ///    client: &MatchService
9772    /// ) -> Result<()> {
9773    ///     let response = client.find_neighbors()
9774    ///         /* set fields */
9775    ///         .send().await?;
9776    ///     println!("response {:?}", response);
9777    ///     Ok(())
9778    /// }
9779    /// ```
9780    pub fn find_neighbors(&self) -> super::builder::match_service::FindNeighbors {
9781        super::builder::match_service::FindNeighbors::new(self.inner.clone())
9782    }
9783
9784    /// Reads the datapoints/vectors of the given IDs.
9785    /// A maximum of 1000 datapoints can be retrieved in a batch.
9786    ///
9787    /// # Example
9788    /// ```
9789    /// # use google_cloud_aiplatform_v1::client::MatchService;
9790    /// use google_cloud_aiplatform_v1::Result;
9791    /// async fn sample(
9792    ///    client: &MatchService
9793    /// ) -> Result<()> {
9794    ///     let response = client.read_index_datapoints()
9795    ///         /* set fields */
9796    ///         .send().await?;
9797    ///     println!("response {:?}", response);
9798    ///     Ok(())
9799    /// }
9800    /// ```
9801    pub fn read_index_datapoints(&self) -> super::builder::match_service::ReadIndexDatapoints {
9802        super::builder::match_service::ReadIndexDatapoints::new(self.inner.clone())
9803    }
9804
9805    /// Lists information about the supported locations for this service.
9806    ///
9807    /// # Example
9808    /// ```
9809    /// # use google_cloud_aiplatform_v1::client::MatchService;
9810    /// use google_cloud_gax::paginator::ItemPaginator as _;
9811    /// use google_cloud_aiplatform_v1::Result;
9812    /// async fn sample(
9813    ///    client: &MatchService
9814    /// ) -> Result<()> {
9815    ///     let mut list = client.list_locations()
9816    ///         /* set fields */
9817    ///         .by_item();
9818    ///     while let Some(item) = list.next().await.transpose()? {
9819    ///         println!("{:?}", item);
9820    ///     }
9821    ///     Ok(())
9822    /// }
9823    /// ```
9824    pub fn list_locations(&self) -> super::builder::match_service::ListLocations {
9825        super::builder::match_service::ListLocations::new(self.inner.clone())
9826    }
9827
9828    /// Gets information about a location.
9829    ///
9830    /// # Example
9831    /// ```
9832    /// # use google_cloud_aiplatform_v1::client::MatchService;
9833    /// use google_cloud_aiplatform_v1::Result;
9834    /// async fn sample(
9835    ///    client: &MatchService
9836    /// ) -> Result<()> {
9837    ///     let response = client.get_location()
9838    ///         /* set fields */
9839    ///         .send().await?;
9840    ///     println!("response {:?}", response);
9841    ///     Ok(())
9842    /// }
9843    /// ```
9844    pub fn get_location(&self) -> super::builder::match_service::GetLocation {
9845        super::builder::match_service::GetLocation::new(self.inner.clone())
9846    }
9847
9848    /// Sets the access control policy on the specified resource. Replaces
9849    /// any existing policy.
9850    ///
9851    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
9852    /// errors.
9853    ///
9854    /// # Example
9855    /// ```
9856    /// # use google_cloud_aiplatform_v1::client::MatchService;
9857    /// use google_cloud_aiplatform_v1::Result;
9858    /// async fn sample(
9859    ///    client: &MatchService
9860    /// ) -> Result<()> {
9861    ///     let response = client.set_iam_policy()
9862    ///         /* set fields */
9863    ///         .send().await?;
9864    ///     println!("response {:?}", response);
9865    ///     Ok(())
9866    /// }
9867    /// ```
9868    pub fn set_iam_policy(&self) -> super::builder::match_service::SetIamPolicy {
9869        super::builder::match_service::SetIamPolicy::new(self.inner.clone())
9870    }
9871
9872    /// Gets the access control policy for a resource. Returns an empty policy
9873    /// if the resource exists and does not have a policy set.
9874    ///
9875    /// # Example
9876    /// ```
9877    /// # use google_cloud_aiplatform_v1::client::MatchService;
9878    /// use google_cloud_aiplatform_v1::Result;
9879    /// async fn sample(
9880    ///    client: &MatchService
9881    /// ) -> Result<()> {
9882    ///     let response = client.get_iam_policy()
9883    ///         /* set fields */
9884    ///         .send().await?;
9885    ///     println!("response {:?}", response);
9886    ///     Ok(())
9887    /// }
9888    /// ```
9889    pub fn get_iam_policy(&self) -> super::builder::match_service::GetIamPolicy {
9890        super::builder::match_service::GetIamPolicy::new(self.inner.clone())
9891    }
9892
9893    /// Returns permissions that a caller has on the specified resource. If the
9894    /// resource does not exist, this will return an empty set of
9895    /// permissions, not a `NOT_FOUND` error.
9896    ///
9897    /// Note: This operation is designed to be used for building
9898    /// permission-aware UIs and command-line tools, not for authorization
9899    /// checking. This operation may "fail open" without warning.
9900    ///
9901    /// # Example
9902    /// ```
9903    /// # use google_cloud_aiplatform_v1::client::MatchService;
9904    /// use google_cloud_aiplatform_v1::Result;
9905    /// async fn sample(
9906    ///    client: &MatchService
9907    /// ) -> Result<()> {
9908    ///     let response = client.test_iam_permissions()
9909    ///         /* set fields */
9910    ///         .send().await?;
9911    ///     println!("response {:?}", response);
9912    ///     Ok(())
9913    /// }
9914    /// ```
9915    pub fn test_iam_permissions(&self) -> super::builder::match_service::TestIamPermissions {
9916        super::builder::match_service::TestIamPermissions::new(self.inner.clone())
9917    }
9918
9919    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9920    ///
9921    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9922    ///
9923    /// # Example
9924    /// ```
9925    /// # use google_cloud_aiplatform_v1::client::MatchService;
9926    /// use google_cloud_gax::paginator::ItemPaginator as _;
9927    /// use google_cloud_aiplatform_v1::Result;
9928    /// async fn sample(
9929    ///    client: &MatchService
9930    /// ) -> Result<()> {
9931    ///     let mut list = client.list_operations()
9932    ///         /* set fields */
9933    ///         .by_item();
9934    ///     while let Some(item) = list.next().await.transpose()? {
9935    ///         println!("{:?}", item);
9936    ///     }
9937    ///     Ok(())
9938    /// }
9939    /// ```
9940    pub fn list_operations(&self) -> super::builder::match_service::ListOperations {
9941        super::builder::match_service::ListOperations::new(self.inner.clone())
9942    }
9943
9944    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9945    ///
9946    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9947    ///
9948    /// # Example
9949    /// ```
9950    /// # use google_cloud_aiplatform_v1::client::MatchService;
9951    /// use google_cloud_aiplatform_v1::Result;
9952    /// async fn sample(
9953    ///    client: &MatchService
9954    /// ) -> Result<()> {
9955    ///     let response = client.get_operation()
9956    ///         /* set fields */
9957    ///         .send().await?;
9958    ///     println!("response {:?}", response);
9959    ///     Ok(())
9960    /// }
9961    /// ```
9962    pub fn get_operation(&self) -> super::builder::match_service::GetOperation {
9963        super::builder::match_service::GetOperation::new(self.inner.clone())
9964    }
9965
9966    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9967    ///
9968    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9969    ///
9970    /// # Example
9971    /// ```
9972    /// # use google_cloud_aiplatform_v1::client::MatchService;
9973    /// use google_cloud_aiplatform_v1::Result;
9974    /// async fn sample(
9975    ///    client: &MatchService
9976    /// ) -> Result<()> {
9977    ///     client.delete_operation()
9978    ///         /* set fields */
9979    ///         .send().await?;
9980    ///     Ok(())
9981    /// }
9982    /// ```
9983    pub fn delete_operation(&self) -> super::builder::match_service::DeleteOperation {
9984        super::builder::match_service::DeleteOperation::new(self.inner.clone())
9985    }
9986
9987    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
9988    ///
9989    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
9990    ///
9991    /// # Example
9992    /// ```
9993    /// # use google_cloud_aiplatform_v1::client::MatchService;
9994    /// use google_cloud_aiplatform_v1::Result;
9995    /// async fn sample(
9996    ///    client: &MatchService
9997    /// ) -> Result<()> {
9998    ///     client.cancel_operation()
9999    ///         /* set fields */
10000    ///         .send().await?;
10001    ///     Ok(())
10002    /// }
10003    /// ```
10004    pub fn cancel_operation(&self) -> super::builder::match_service::CancelOperation {
10005        super::builder::match_service::CancelOperation::new(self.inner.clone())
10006    }
10007
10008    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
10009    ///
10010    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
10011    ///
10012    /// # Example
10013    /// ```
10014    /// # use google_cloud_aiplatform_v1::client::MatchService;
10015    /// use google_cloud_aiplatform_v1::Result;
10016    /// async fn sample(
10017    ///    client: &MatchService
10018    /// ) -> Result<()> {
10019    ///     let response = client.wait_operation()
10020    ///         /* set fields */
10021    ///         .send().await?;
10022    ///     println!("response {:?}", response);
10023    ///     Ok(())
10024    /// }
10025    /// ```
10026    pub fn wait_operation(&self) -> super::builder::match_service::WaitOperation {
10027        super::builder::match_service::WaitOperation::new(self.inner.clone())
10028    }
10029}
10030
10031/// Implements a client for the Vertex AI API.
10032///
10033/// # Example
10034/// ```
10035/// # use google_cloud_aiplatform_v1::client::MetadataService;
10036/// use google_cloud_gax::paginator::ItemPaginator as _;
10037/// async fn sample(
10038///    parent: &str,
10039/// ) -> anyhow::Result<()> {
10040///     let client = MetadataService::builder().build().await?;
10041///     let mut list = client.list_metadata_stores()
10042///         .set_parent(parent)
10043///         .by_item();
10044///     while let Some(item) = list.next().await.transpose()? {
10045///         println!("{:?}", item);
10046///     }
10047///     Ok(())
10048/// }
10049/// ```
10050///
10051/// # Service Description
10052///
10053/// Service for reading and writing metadata entries.
10054///
10055/// # Configuration
10056///
10057/// To configure `MetadataService` use the `with_*` methods in the type returned
10058/// by [builder()][MetadataService::builder]. The default configuration should
10059/// work for most applications. Common configuration changes include
10060///
10061/// * [with_endpoint()]: by default this client uses the global default endpoint
10062///   (`https://aiplatform.googleapis.com`). Applications using regional
10063///   endpoints or running in restricted networks (e.g. a network configured
10064///   with [Private Google Access with VPC Service Controls]) may want to
10065///   override this default.
10066/// * [with_credentials()]: by default this client uses
10067///   [Application Default Credentials]. Applications using custom
10068///   authentication may need to override this default.
10069///
10070/// [with_endpoint()]: super::builder::metadata_service::ClientBuilder::with_endpoint
10071/// [with_credentials()]: super::builder::metadata_service::ClientBuilder::with_credentials
10072/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10073/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10074///
10075/// # Pooling and Cloning
10076///
10077/// `MetadataService` holds a connection pool internally, it is advised to
10078/// create one and reuse it. You do not need to wrap `MetadataService` in
10079/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10080/// already uses an `Arc` internally.
10081#[cfg(feature = "metadata-service")]
10082#[cfg_attr(docsrs, doc(cfg(feature = "metadata-service")))]
10083#[derive(Clone, Debug)]
10084pub struct MetadataService {
10085    inner: std::sync::Arc<dyn super::stub::dynamic::MetadataService>,
10086}
10087
10088#[cfg(feature = "metadata-service")]
10089impl MetadataService {
10090    /// Returns a builder for [MetadataService].
10091    ///
10092    /// ```
10093    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10094    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10095    /// let client = MetadataService::builder().build().await?;
10096    /// # Ok(()) }
10097    /// ```
10098    pub fn builder() -> super::builder::metadata_service::ClientBuilder {
10099        crate::new_client_builder(super::builder::metadata_service::client::Factory)
10100    }
10101
10102    /// Creates a new client from the provided stub.
10103    ///
10104    /// The most common case for calling this function is in tests mocking the
10105    /// client's behavior.
10106    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10107    where
10108        T: super::stub::MetadataService + 'static,
10109    {
10110        Self { inner: stub.into() }
10111    }
10112
10113    pub(crate) async fn new(
10114        config: gaxi::options::ClientConfig,
10115    ) -> crate::ClientBuilderResult<Self> {
10116        let inner = Self::build_inner(config).await?;
10117        Ok(Self { inner })
10118    }
10119
10120    async fn build_inner(
10121        conf: gaxi::options::ClientConfig,
10122    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MetadataService>> {
10123        if gaxi::options::tracing_enabled(&conf) {
10124            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10125        }
10126        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10127    }
10128
10129    async fn build_transport(
10130        conf: gaxi::options::ClientConfig,
10131    ) -> crate::ClientBuilderResult<impl super::stub::MetadataService> {
10132        super::transport::MetadataService::new(conf).await
10133    }
10134
10135    async fn build_with_tracing(
10136        conf: gaxi::options::ClientConfig,
10137    ) -> crate::ClientBuilderResult<impl super::stub::MetadataService> {
10138        Self::build_transport(conf)
10139            .await
10140            .map(super::tracing::MetadataService::new)
10141    }
10142
10143    /// Initializes a MetadataStore, including allocation of resources.
10144    ///
10145    /// # Long running operations
10146    ///
10147    /// This method is used to start, and/or poll a [long-running Operation].
10148    /// The [Working with long-running operations] chapter in the [user guide]
10149    /// covers these operations in detail.
10150    ///
10151    /// [long-running operation]: https://google.aip.dev/151
10152    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
10153    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
10154    ///
10155    /// # Example
10156    /// ```
10157    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10158    /// use google_cloud_lro::Poller;
10159    /// use google_cloud_aiplatform_v1::model::MetadataStore;
10160    /// use google_cloud_aiplatform_v1::Result;
10161    /// async fn sample(
10162    ///    client: &MetadataService, parent: &str
10163    /// ) -> Result<()> {
10164    ///     let response = client.create_metadata_store()
10165    ///         .set_parent(parent)
10166    ///         .set_metadata_store(
10167    ///             MetadataStore::new()/* set fields */
10168    ///         )
10169    ///         .poller().until_done().await?;
10170    ///     println!("response {:?}", response);
10171    ///     Ok(())
10172    /// }
10173    /// ```
10174    pub fn create_metadata_store(&self) -> super::builder::metadata_service::CreateMetadataStore {
10175        super::builder::metadata_service::CreateMetadataStore::new(self.inner.clone())
10176    }
10177
10178    /// Retrieves a specific MetadataStore.
10179    ///
10180    /// # Example
10181    /// ```
10182    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10183    /// use google_cloud_aiplatform_v1::Result;
10184    /// async fn sample(
10185    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str
10186    /// ) -> Result<()> {
10187    ///     let response = client.get_metadata_store()
10188    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}"))
10189    ///         .send().await?;
10190    ///     println!("response {:?}", response);
10191    ///     Ok(())
10192    /// }
10193    /// ```
10194    pub fn get_metadata_store(&self) -> super::builder::metadata_service::GetMetadataStore {
10195        super::builder::metadata_service::GetMetadataStore::new(self.inner.clone())
10196    }
10197
10198    /// Lists MetadataStores for a Location.
10199    ///
10200    /// # Example
10201    /// ```
10202    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10203    /// use google_cloud_gax::paginator::ItemPaginator as _;
10204    /// use google_cloud_aiplatform_v1::Result;
10205    /// async fn sample(
10206    ///    client: &MetadataService, parent: &str
10207    /// ) -> Result<()> {
10208    ///     let mut list = client.list_metadata_stores()
10209    ///         .set_parent(parent)
10210    ///         .by_item();
10211    ///     while let Some(item) = list.next().await.transpose()? {
10212    ///         println!("{:?}", item);
10213    ///     }
10214    ///     Ok(())
10215    /// }
10216    /// ```
10217    pub fn list_metadata_stores(&self) -> super::builder::metadata_service::ListMetadataStores {
10218        super::builder::metadata_service::ListMetadataStores::new(self.inner.clone())
10219    }
10220
10221    /// Deletes a single MetadataStore and all its child resources (Artifacts,
10222    /// Executions, and Contexts).
10223    ///
10224    /// # Long running operations
10225    ///
10226    /// This method is used to start, and/or poll a [long-running Operation].
10227    /// The [Working with long-running operations] chapter in the [user guide]
10228    /// covers these operations in detail.
10229    ///
10230    /// [long-running operation]: https://google.aip.dev/151
10231    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
10232    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
10233    ///
10234    /// # Example
10235    /// ```
10236    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10237    /// use google_cloud_lro::Poller;
10238    /// use google_cloud_aiplatform_v1::Result;
10239    /// async fn sample(
10240    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str
10241    /// ) -> Result<()> {
10242    ///     client.delete_metadata_store()
10243    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}"))
10244    ///         .poller().until_done().await?;
10245    ///     Ok(())
10246    /// }
10247    /// ```
10248    pub fn delete_metadata_store(&self) -> super::builder::metadata_service::DeleteMetadataStore {
10249        super::builder::metadata_service::DeleteMetadataStore::new(self.inner.clone())
10250    }
10251
10252    /// Creates an Artifact associated with a MetadataStore.
10253    ///
10254    /// # Example
10255    /// ```
10256    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10257    /// use google_cloud_aiplatform_v1::model::Artifact;
10258    /// use google_cloud_aiplatform_v1::Result;
10259    /// async fn sample(
10260    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str
10261    /// ) -> Result<()> {
10262    ///     let response = client.create_artifact()
10263    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}"))
10264    ///         .set_artifact_id("artifact_id_value")
10265    ///         .set_artifact(
10266    ///             Artifact::new()/* set fields */
10267    ///         )
10268    ///         .send().await?;
10269    ///     println!("response {:?}", response);
10270    ///     Ok(())
10271    /// }
10272    /// ```
10273    pub fn create_artifact(&self) -> super::builder::metadata_service::CreateArtifact {
10274        super::builder::metadata_service::CreateArtifact::new(self.inner.clone())
10275    }
10276
10277    /// Retrieves a specific Artifact.
10278    ///
10279    /// # Example
10280    /// ```
10281    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10282    /// use google_cloud_aiplatform_v1::Result;
10283    /// async fn sample(
10284    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str, artifact_id: &str
10285    /// ) -> Result<()> {
10286    ///     let response = client.get_artifact()
10287    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}/artifacts/{artifact_id}"))
10288    ///         .send().await?;
10289    ///     println!("response {:?}", response);
10290    ///     Ok(())
10291    /// }
10292    /// ```
10293    pub fn get_artifact(&self) -> super::builder::metadata_service::GetArtifact {
10294        super::builder::metadata_service::GetArtifact::new(self.inner.clone())
10295    }
10296
10297    /// Lists Artifacts in the MetadataStore.
10298    ///
10299    /// # Example
10300    /// ```
10301    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10302    /// use google_cloud_gax::paginator::ItemPaginator as _;
10303    /// use google_cloud_aiplatform_v1::Result;
10304    /// async fn sample(
10305    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str
10306    /// ) -> Result<()> {
10307    ///     let mut list = client.list_artifacts()
10308    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}"))
10309    ///         .by_item();
10310    ///     while let Some(item) = list.next().await.transpose()? {
10311    ///         println!("{:?}", item);
10312    ///     }
10313    ///     Ok(())
10314    /// }
10315    /// ```
10316    pub fn list_artifacts(&self) -> super::builder::metadata_service::ListArtifacts {
10317        super::builder::metadata_service::ListArtifacts::new(self.inner.clone())
10318    }
10319
10320    /// Updates a stored Artifact.
10321    ///
10322    /// # Example
10323    /// ```
10324    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10325    /// # extern crate wkt as google_cloud_wkt;
10326    /// use google_cloud_wkt::FieldMask;
10327    /// use google_cloud_aiplatform_v1::model::Artifact;
10328    /// use google_cloud_aiplatform_v1::Result;
10329    /// async fn sample(
10330    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str, artifact_id: &str
10331    /// ) -> Result<()> {
10332    ///     let response = client.update_artifact()
10333    ///         .set_artifact(
10334    ///             Artifact::new().set_name(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}/artifacts/{artifact_id}"))/* set fields */
10335    ///         )
10336    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
10337    ///         .send().await?;
10338    ///     println!("response {:?}", response);
10339    ///     Ok(())
10340    /// }
10341    /// ```
10342    pub fn update_artifact(&self) -> super::builder::metadata_service::UpdateArtifact {
10343        super::builder::metadata_service::UpdateArtifact::new(self.inner.clone())
10344    }
10345
10346    /// Deletes an Artifact.
10347    ///
10348    /// # Long running operations
10349    ///
10350    /// This method is used to start, and/or poll a [long-running Operation].
10351    /// The [Working with long-running operations] chapter in the [user guide]
10352    /// covers these operations in detail.
10353    ///
10354    /// [long-running operation]: https://google.aip.dev/151
10355    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
10356    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
10357    ///
10358    /// # Example
10359    /// ```
10360    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10361    /// use google_cloud_lro::Poller;
10362    /// use google_cloud_aiplatform_v1::Result;
10363    /// async fn sample(
10364    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str, artifact_id: &str
10365    /// ) -> Result<()> {
10366    ///     client.delete_artifact()
10367    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}/artifacts/{artifact_id}"))
10368    ///         .poller().until_done().await?;
10369    ///     Ok(())
10370    /// }
10371    /// ```
10372    pub fn delete_artifact(&self) -> super::builder::metadata_service::DeleteArtifact {
10373        super::builder::metadata_service::DeleteArtifact::new(self.inner.clone())
10374    }
10375
10376    /// Purges Artifacts.
10377    ///
10378    /// # Long running operations
10379    ///
10380    /// This method is used to start, and/or poll a [long-running Operation].
10381    /// The [Working with long-running operations] chapter in the [user guide]
10382    /// covers these operations in detail.
10383    ///
10384    /// [long-running operation]: https://google.aip.dev/151
10385    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
10386    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
10387    ///
10388    /// # Example
10389    /// ```
10390    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10391    /// use google_cloud_lro::Poller;
10392    /// use google_cloud_aiplatform_v1::Result;
10393    /// async fn sample(
10394    ///    client: &MetadataService
10395    /// ) -> Result<()> {
10396    ///     let response = client.purge_artifacts()
10397    ///         /* set fields */
10398    ///         .poller().until_done().await?;
10399    ///     println!("response {:?}", response);
10400    ///     Ok(())
10401    /// }
10402    /// ```
10403    pub fn purge_artifacts(&self) -> super::builder::metadata_service::PurgeArtifacts {
10404        super::builder::metadata_service::PurgeArtifacts::new(self.inner.clone())
10405    }
10406
10407    /// Creates a Context associated with a MetadataStore.
10408    ///
10409    /// # Example
10410    /// ```
10411    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10412    /// use google_cloud_aiplatform_v1::model::Context;
10413    /// use google_cloud_aiplatform_v1::Result;
10414    /// async fn sample(
10415    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str
10416    /// ) -> Result<()> {
10417    ///     let response = client.create_context()
10418    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}"))
10419    ///         .set_context_id("context_id_value")
10420    ///         .set_context(
10421    ///             Context::new()/* set fields */
10422    ///         )
10423    ///         .send().await?;
10424    ///     println!("response {:?}", response);
10425    ///     Ok(())
10426    /// }
10427    /// ```
10428    pub fn create_context(&self) -> super::builder::metadata_service::CreateContext {
10429        super::builder::metadata_service::CreateContext::new(self.inner.clone())
10430    }
10431
10432    /// Retrieves a specific Context.
10433    ///
10434    /// # Example
10435    /// ```
10436    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10437    /// use google_cloud_aiplatform_v1::Result;
10438    /// async fn sample(
10439    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str, context_id: &str
10440    /// ) -> Result<()> {
10441    ///     let response = client.get_context()
10442    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}/contexts/{context_id}"))
10443    ///         .send().await?;
10444    ///     println!("response {:?}", response);
10445    ///     Ok(())
10446    /// }
10447    /// ```
10448    pub fn get_context(&self) -> super::builder::metadata_service::GetContext {
10449        super::builder::metadata_service::GetContext::new(self.inner.clone())
10450    }
10451
10452    /// Lists Contexts on the MetadataStore.
10453    ///
10454    /// # Example
10455    /// ```
10456    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10457    /// use google_cloud_gax::paginator::ItemPaginator as _;
10458    /// use google_cloud_aiplatform_v1::Result;
10459    /// async fn sample(
10460    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str
10461    /// ) -> Result<()> {
10462    ///     let mut list = client.list_contexts()
10463    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}"))
10464    ///         .by_item();
10465    ///     while let Some(item) = list.next().await.transpose()? {
10466    ///         println!("{:?}", item);
10467    ///     }
10468    ///     Ok(())
10469    /// }
10470    /// ```
10471    pub fn list_contexts(&self) -> super::builder::metadata_service::ListContexts {
10472        super::builder::metadata_service::ListContexts::new(self.inner.clone())
10473    }
10474
10475    /// Updates a stored Context.
10476    ///
10477    /// # Example
10478    /// ```
10479    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10480    /// # extern crate wkt as google_cloud_wkt;
10481    /// use google_cloud_wkt::FieldMask;
10482    /// use google_cloud_aiplatform_v1::model::Context;
10483    /// use google_cloud_aiplatform_v1::Result;
10484    /// async fn sample(
10485    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str, context_id: &str
10486    /// ) -> Result<()> {
10487    ///     let response = client.update_context()
10488    ///         .set_context(
10489    ///             Context::new().set_name(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}/contexts/{context_id}"))/* set fields */
10490    ///         )
10491    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
10492    ///         .send().await?;
10493    ///     println!("response {:?}", response);
10494    ///     Ok(())
10495    /// }
10496    /// ```
10497    pub fn update_context(&self) -> super::builder::metadata_service::UpdateContext {
10498        super::builder::metadata_service::UpdateContext::new(self.inner.clone())
10499    }
10500
10501    /// Deletes a stored Context.
10502    ///
10503    /// # Long running operations
10504    ///
10505    /// This method is used to start, and/or poll a [long-running Operation].
10506    /// The [Working with long-running operations] chapter in the [user guide]
10507    /// covers these operations in detail.
10508    ///
10509    /// [long-running operation]: https://google.aip.dev/151
10510    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
10511    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
10512    ///
10513    /// # Example
10514    /// ```
10515    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10516    /// use google_cloud_lro::Poller;
10517    /// use google_cloud_aiplatform_v1::Result;
10518    /// async fn sample(
10519    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str, context_id: &str
10520    /// ) -> Result<()> {
10521    ///     client.delete_context()
10522    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}/contexts/{context_id}"))
10523    ///         .poller().until_done().await?;
10524    ///     Ok(())
10525    /// }
10526    /// ```
10527    pub fn delete_context(&self) -> super::builder::metadata_service::DeleteContext {
10528        super::builder::metadata_service::DeleteContext::new(self.inner.clone())
10529    }
10530
10531    /// Purges Contexts.
10532    ///
10533    /// # Long running operations
10534    ///
10535    /// This method is used to start, and/or poll a [long-running Operation].
10536    /// The [Working with long-running operations] chapter in the [user guide]
10537    /// covers these operations in detail.
10538    ///
10539    /// [long-running operation]: https://google.aip.dev/151
10540    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
10541    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
10542    ///
10543    /// # Example
10544    /// ```
10545    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10546    /// use google_cloud_lro::Poller;
10547    /// use google_cloud_aiplatform_v1::Result;
10548    /// async fn sample(
10549    ///    client: &MetadataService
10550    /// ) -> Result<()> {
10551    ///     let response = client.purge_contexts()
10552    ///         /* set fields */
10553    ///         .poller().until_done().await?;
10554    ///     println!("response {:?}", response);
10555    ///     Ok(())
10556    /// }
10557    /// ```
10558    pub fn purge_contexts(&self) -> super::builder::metadata_service::PurgeContexts {
10559        super::builder::metadata_service::PurgeContexts::new(self.inner.clone())
10560    }
10561
10562    /// Adds a set of Artifacts and Executions to a Context. If any of the
10563    /// Artifacts or Executions have already been added to a Context, they are
10564    /// simply skipped.
10565    ///
10566    /// # Example
10567    /// ```
10568    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10569    /// use google_cloud_aiplatform_v1::Result;
10570    /// async fn sample(
10571    ///    client: &MetadataService
10572    /// ) -> Result<()> {
10573    ///     let response = client.add_context_artifacts_and_executions()
10574    ///         /* set fields */
10575    ///         .send().await?;
10576    ///     println!("response {:?}", response);
10577    ///     Ok(())
10578    /// }
10579    /// ```
10580    pub fn add_context_artifacts_and_executions(
10581        &self,
10582    ) -> super::builder::metadata_service::AddContextArtifactsAndExecutions {
10583        super::builder::metadata_service::AddContextArtifactsAndExecutions::new(self.inner.clone())
10584    }
10585
10586    /// Adds a set of Contexts as children to a parent Context. If any of the
10587    /// child Contexts have already been added to the parent Context, they are
10588    /// simply skipped. If this call would create a cycle or cause any Context to
10589    /// have more than 10 parents, the request will fail with an INVALID_ARGUMENT
10590    /// error.
10591    ///
10592    /// # Example
10593    /// ```
10594    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10595    /// use google_cloud_aiplatform_v1::Result;
10596    /// async fn sample(
10597    ///    client: &MetadataService
10598    /// ) -> Result<()> {
10599    ///     let response = client.add_context_children()
10600    ///         /* set fields */
10601    ///         .send().await?;
10602    ///     println!("response {:?}", response);
10603    ///     Ok(())
10604    /// }
10605    /// ```
10606    pub fn add_context_children(&self) -> super::builder::metadata_service::AddContextChildren {
10607        super::builder::metadata_service::AddContextChildren::new(self.inner.clone())
10608    }
10609
10610    /// Remove a set of children contexts from a parent Context. If any of the
10611    /// child Contexts were NOT added to the parent Context, they are
10612    /// simply skipped.
10613    ///
10614    /// # Example
10615    /// ```
10616    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10617    /// use google_cloud_aiplatform_v1::Result;
10618    /// async fn sample(
10619    ///    client: &MetadataService
10620    /// ) -> Result<()> {
10621    ///     let response = client.remove_context_children()
10622    ///         /* set fields */
10623    ///         .send().await?;
10624    ///     println!("response {:?}", response);
10625    ///     Ok(())
10626    /// }
10627    /// ```
10628    pub fn remove_context_children(
10629        &self,
10630    ) -> super::builder::metadata_service::RemoveContextChildren {
10631        super::builder::metadata_service::RemoveContextChildren::new(self.inner.clone())
10632    }
10633
10634    /// Retrieves Artifacts and Executions within the specified Context, connected
10635    /// by Event edges and returned as a LineageSubgraph.
10636    ///
10637    /// # Example
10638    /// ```
10639    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10640    /// use google_cloud_aiplatform_v1::Result;
10641    /// async fn sample(
10642    ///    client: &MetadataService
10643    /// ) -> Result<()> {
10644    ///     let response = client.query_context_lineage_subgraph()
10645    ///         /* set fields */
10646    ///         .send().await?;
10647    ///     println!("response {:?}", response);
10648    ///     Ok(())
10649    /// }
10650    /// ```
10651    pub fn query_context_lineage_subgraph(
10652        &self,
10653    ) -> super::builder::metadata_service::QueryContextLineageSubgraph {
10654        super::builder::metadata_service::QueryContextLineageSubgraph::new(self.inner.clone())
10655    }
10656
10657    /// Creates an Execution associated with a MetadataStore.
10658    ///
10659    /// # Example
10660    /// ```
10661    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10662    /// use google_cloud_aiplatform_v1::model::Execution;
10663    /// use google_cloud_aiplatform_v1::Result;
10664    /// async fn sample(
10665    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str
10666    /// ) -> Result<()> {
10667    ///     let response = client.create_execution()
10668    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}"))
10669    ///         .set_execution_id("execution_id_value")
10670    ///         .set_execution(
10671    ///             Execution::new()/* set fields */
10672    ///         )
10673    ///         .send().await?;
10674    ///     println!("response {:?}", response);
10675    ///     Ok(())
10676    /// }
10677    /// ```
10678    pub fn create_execution(&self) -> super::builder::metadata_service::CreateExecution {
10679        super::builder::metadata_service::CreateExecution::new(self.inner.clone())
10680    }
10681
10682    /// Retrieves a specific Execution.
10683    ///
10684    /// # Example
10685    /// ```
10686    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10687    /// use google_cloud_aiplatform_v1::Result;
10688    /// async fn sample(
10689    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str, execution_id: &str
10690    /// ) -> Result<()> {
10691    ///     let response = client.get_execution()
10692    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}/executions/{execution_id}"))
10693    ///         .send().await?;
10694    ///     println!("response {:?}", response);
10695    ///     Ok(())
10696    /// }
10697    /// ```
10698    pub fn get_execution(&self) -> super::builder::metadata_service::GetExecution {
10699        super::builder::metadata_service::GetExecution::new(self.inner.clone())
10700    }
10701
10702    /// Lists Executions in the MetadataStore.
10703    ///
10704    /// # Example
10705    /// ```
10706    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10707    /// use google_cloud_gax::paginator::ItemPaginator as _;
10708    /// use google_cloud_aiplatform_v1::Result;
10709    /// async fn sample(
10710    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str
10711    /// ) -> Result<()> {
10712    ///     let mut list = client.list_executions()
10713    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}"))
10714    ///         .by_item();
10715    ///     while let Some(item) = list.next().await.transpose()? {
10716    ///         println!("{:?}", item);
10717    ///     }
10718    ///     Ok(())
10719    /// }
10720    /// ```
10721    pub fn list_executions(&self) -> super::builder::metadata_service::ListExecutions {
10722        super::builder::metadata_service::ListExecutions::new(self.inner.clone())
10723    }
10724
10725    /// Updates a stored Execution.
10726    ///
10727    /// # Example
10728    /// ```
10729    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10730    /// # extern crate wkt as google_cloud_wkt;
10731    /// use google_cloud_wkt::FieldMask;
10732    /// use google_cloud_aiplatform_v1::model::Execution;
10733    /// use google_cloud_aiplatform_v1::Result;
10734    /// async fn sample(
10735    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str, execution_id: &str
10736    /// ) -> Result<()> {
10737    ///     let response = client.update_execution()
10738    ///         .set_execution(
10739    ///             Execution::new().set_name(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}/executions/{execution_id}"))/* set fields */
10740    ///         )
10741    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
10742    ///         .send().await?;
10743    ///     println!("response {:?}", response);
10744    ///     Ok(())
10745    /// }
10746    /// ```
10747    pub fn update_execution(&self) -> super::builder::metadata_service::UpdateExecution {
10748        super::builder::metadata_service::UpdateExecution::new(self.inner.clone())
10749    }
10750
10751    /// Deletes an Execution.
10752    ///
10753    /// # Long running operations
10754    ///
10755    /// This method is used to start, and/or poll a [long-running Operation].
10756    /// The [Working with long-running operations] chapter in the [user guide]
10757    /// covers these operations in detail.
10758    ///
10759    /// [long-running operation]: https://google.aip.dev/151
10760    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
10761    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
10762    ///
10763    /// # Example
10764    /// ```
10765    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10766    /// use google_cloud_lro::Poller;
10767    /// use google_cloud_aiplatform_v1::Result;
10768    /// async fn sample(
10769    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str, execution_id: &str
10770    /// ) -> Result<()> {
10771    ///     client.delete_execution()
10772    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}/executions/{execution_id}"))
10773    ///         .poller().until_done().await?;
10774    ///     Ok(())
10775    /// }
10776    /// ```
10777    pub fn delete_execution(&self) -> super::builder::metadata_service::DeleteExecution {
10778        super::builder::metadata_service::DeleteExecution::new(self.inner.clone())
10779    }
10780
10781    /// Purges Executions.
10782    ///
10783    /// # Long running operations
10784    ///
10785    /// This method is used to start, and/or poll a [long-running Operation].
10786    /// The [Working with long-running operations] chapter in the [user guide]
10787    /// covers these operations in detail.
10788    ///
10789    /// [long-running operation]: https://google.aip.dev/151
10790    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
10791    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
10792    ///
10793    /// # Example
10794    /// ```
10795    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10796    /// use google_cloud_lro::Poller;
10797    /// use google_cloud_aiplatform_v1::Result;
10798    /// async fn sample(
10799    ///    client: &MetadataService
10800    /// ) -> Result<()> {
10801    ///     let response = client.purge_executions()
10802    ///         /* set fields */
10803    ///         .poller().until_done().await?;
10804    ///     println!("response {:?}", response);
10805    ///     Ok(())
10806    /// }
10807    /// ```
10808    pub fn purge_executions(&self) -> super::builder::metadata_service::PurgeExecutions {
10809        super::builder::metadata_service::PurgeExecutions::new(self.inner.clone())
10810    }
10811
10812    /// Adds Events to the specified Execution. An Event indicates whether an
10813    /// Artifact was used as an input or output for an Execution. If an Event
10814    /// already exists between the Execution and the Artifact, the Event is
10815    /// skipped.
10816    ///
10817    /// # Example
10818    /// ```
10819    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10820    /// use google_cloud_aiplatform_v1::Result;
10821    /// async fn sample(
10822    ///    client: &MetadataService
10823    /// ) -> Result<()> {
10824    ///     let response = client.add_execution_events()
10825    ///         /* set fields */
10826    ///         .send().await?;
10827    ///     println!("response {:?}", response);
10828    ///     Ok(())
10829    /// }
10830    /// ```
10831    pub fn add_execution_events(&self) -> super::builder::metadata_service::AddExecutionEvents {
10832        super::builder::metadata_service::AddExecutionEvents::new(self.inner.clone())
10833    }
10834
10835    /// Obtains the set of input and output Artifacts for this Execution, in the
10836    /// form of LineageSubgraph that also contains the Execution and connecting
10837    /// Events.
10838    ///
10839    /// # Example
10840    /// ```
10841    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10842    /// use google_cloud_aiplatform_v1::Result;
10843    /// async fn sample(
10844    ///    client: &MetadataService
10845    /// ) -> Result<()> {
10846    ///     let response = client.query_execution_inputs_and_outputs()
10847    ///         /* set fields */
10848    ///         .send().await?;
10849    ///     println!("response {:?}", response);
10850    ///     Ok(())
10851    /// }
10852    /// ```
10853    pub fn query_execution_inputs_and_outputs(
10854        &self,
10855    ) -> super::builder::metadata_service::QueryExecutionInputsAndOutputs {
10856        super::builder::metadata_service::QueryExecutionInputsAndOutputs::new(self.inner.clone())
10857    }
10858
10859    /// Creates a MetadataSchema.
10860    ///
10861    /// # Example
10862    /// ```
10863    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10864    /// use google_cloud_aiplatform_v1::model::MetadataSchema;
10865    /// use google_cloud_aiplatform_v1::Result;
10866    /// async fn sample(
10867    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str
10868    /// ) -> Result<()> {
10869    ///     let response = client.create_metadata_schema()
10870    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}"))
10871    ///         .set_metadata_schema(
10872    ///             MetadataSchema::new()/* set fields */
10873    ///         )
10874    ///         .send().await?;
10875    ///     println!("response {:?}", response);
10876    ///     Ok(())
10877    /// }
10878    /// ```
10879    pub fn create_metadata_schema(&self) -> super::builder::metadata_service::CreateMetadataSchema {
10880        super::builder::metadata_service::CreateMetadataSchema::new(self.inner.clone())
10881    }
10882
10883    /// Retrieves a specific MetadataSchema.
10884    ///
10885    /// # Example
10886    /// ```
10887    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10888    /// use google_cloud_aiplatform_v1::Result;
10889    /// async fn sample(
10890    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str, metadata_schema_id: &str
10891    /// ) -> Result<()> {
10892    ///     let response = client.get_metadata_schema()
10893    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}/metadataSchemas/{metadata_schema_id}"))
10894    ///         .send().await?;
10895    ///     println!("response {:?}", response);
10896    ///     Ok(())
10897    /// }
10898    /// ```
10899    pub fn get_metadata_schema(&self) -> super::builder::metadata_service::GetMetadataSchema {
10900        super::builder::metadata_service::GetMetadataSchema::new(self.inner.clone())
10901    }
10902
10903    /// Lists MetadataSchemas.
10904    ///
10905    /// # Example
10906    /// ```
10907    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10908    /// use google_cloud_gax::paginator::ItemPaginator as _;
10909    /// use google_cloud_aiplatform_v1::Result;
10910    /// async fn sample(
10911    ///    client: &MetadataService, project_id: &str, location_id: &str, metadata_store_id: &str
10912    /// ) -> Result<()> {
10913    ///     let mut list = client.list_metadata_schemas()
10914    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/metadataStores/{metadata_store_id}"))
10915    ///         .by_item();
10916    ///     while let Some(item) = list.next().await.transpose()? {
10917    ///         println!("{:?}", item);
10918    ///     }
10919    ///     Ok(())
10920    /// }
10921    /// ```
10922    pub fn list_metadata_schemas(&self) -> super::builder::metadata_service::ListMetadataSchemas {
10923        super::builder::metadata_service::ListMetadataSchemas::new(self.inner.clone())
10924    }
10925
10926    /// Retrieves lineage of an Artifact represented through Artifacts and
10927    /// Executions connected by Event edges and returned as a LineageSubgraph.
10928    ///
10929    /// # Example
10930    /// ```
10931    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10932    /// use google_cloud_aiplatform_v1::Result;
10933    /// async fn sample(
10934    ///    client: &MetadataService
10935    /// ) -> Result<()> {
10936    ///     let response = client.query_artifact_lineage_subgraph()
10937    ///         /* set fields */
10938    ///         .send().await?;
10939    ///     println!("response {:?}", response);
10940    ///     Ok(())
10941    /// }
10942    /// ```
10943    pub fn query_artifact_lineage_subgraph(
10944        &self,
10945    ) -> super::builder::metadata_service::QueryArtifactLineageSubgraph {
10946        super::builder::metadata_service::QueryArtifactLineageSubgraph::new(self.inner.clone())
10947    }
10948
10949    /// Lists information about the supported locations for this service.
10950    ///
10951    /// # Example
10952    /// ```
10953    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10954    /// use google_cloud_gax::paginator::ItemPaginator as _;
10955    /// use google_cloud_aiplatform_v1::Result;
10956    /// async fn sample(
10957    ///    client: &MetadataService
10958    /// ) -> Result<()> {
10959    ///     let mut list = client.list_locations()
10960    ///         /* set fields */
10961    ///         .by_item();
10962    ///     while let Some(item) = list.next().await.transpose()? {
10963    ///         println!("{:?}", item);
10964    ///     }
10965    ///     Ok(())
10966    /// }
10967    /// ```
10968    pub fn list_locations(&self) -> super::builder::metadata_service::ListLocations {
10969        super::builder::metadata_service::ListLocations::new(self.inner.clone())
10970    }
10971
10972    /// Gets information about a location.
10973    ///
10974    /// # Example
10975    /// ```
10976    /// # use google_cloud_aiplatform_v1::client::MetadataService;
10977    /// use google_cloud_aiplatform_v1::Result;
10978    /// async fn sample(
10979    ///    client: &MetadataService
10980    /// ) -> Result<()> {
10981    ///     let response = client.get_location()
10982    ///         /* set fields */
10983    ///         .send().await?;
10984    ///     println!("response {:?}", response);
10985    ///     Ok(())
10986    /// }
10987    /// ```
10988    pub fn get_location(&self) -> super::builder::metadata_service::GetLocation {
10989        super::builder::metadata_service::GetLocation::new(self.inner.clone())
10990    }
10991
10992    /// Sets the access control policy on the specified resource. Replaces
10993    /// any existing policy.
10994    ///
10995    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
10996    /// errors.
10997    ///
10998    /// # Example
10999    /// ```
11000    /// # use google_cloud_aiplatform_v1::client::MetadataService;
11001    /// use google_cloud_aiplatform_v1::Result;
11002    /// async fn sample(
11003    ///    client: &MetadataService
11004    /// ) -> Result<()> {
11005    ///     let response = client.set_iam_policy()
11006    ///         /* set fields */
11007    ///         .send().await?;
11008    ///     println!("response {:?}", response);
11009    ///     Ok(())
11010    /// }
11011    /// ```
11012    pub fn set_iam_policy(&self) -> super::builder::metadata_service::SetIamPolicy {
11013        super::builder::metadata_service::SetIamPolicy::new(self.inner.clone())
11014    }
11015
11016    /// Gets the access control policy for a resource. Returns an empty policy
11017    /// if the resource exists and does not have a policy set.
11018    ///
11019    /// # Example
11020    /// ```
11021    /// # use google_cloud_aiplatform_v1::client::MetadataService;
11022    /// use google_cloud_aiplatform_v1::Result;
11023    /// async fn sample(
11024    ///    client: &MetadataService
11025    /// ) -> Result<()> {
11026    ///     let response = client.get_iam_policy()
11027    ///         /* set fields */
11028    ///         .send().await?;
11029    ///     println!("response {:?}", response);
11030    ///     Ok(())
11031    /// }
11032    /// ```
11033    pub fn get_iam_policy(&self) -> super::builder::metadata_service::GetIamPolicy {
11034        super::builder::metadata_service::GetIamPolicy::new(self.inner.clone())
11035    }
11036
11037    /// Returns permissions that a caller has on the specified resource. If the
11038    /// resource does not exist, this will return an empty set of
11039    /// permissions, not a `NOT_FOUND` error.
11040    ///
11041    /// Note: This operation is designed to be used for building
11042    /// permission-aware UIs and command-line tools, not for authorization
11043    /// checking. This operation may "fail open" without warning.
11044    ///
11045    /// # Example
11046    /// ```
11047    /// # use google_cloud_aiplatform_v1::client::MetadataService;
11048    /// use google_cloud_aiplatform_v1::Result;
11049    /// async fn sample(
11050    ///    client: &MetadataService
11051    /// ) -> Result<()> {
11052    ///     let response = client.test_iam_permissions()
11053    ///         /* set fields */
11054    ///         .send().await?;
11055    ///     println!("response {:?}", response);
11056    ///     Ok(())
11057    /// }
11058    /// ```
11059    pub fn test_iam_permissions(&self) -> super::builder::metadata_service::TestIamPermissions {
11060        super::builder::metadata_service::TestIamPermissions::new(self.inner.clone())
11061    }
11062
11063    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11064    ///
11065    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11066    ///
11067    /// # Example
11068    /// ```
11069    /// # use google_cloud_aiplatform_v1::client::MetadataService;
11070    /// use google_cloud_gax::paginator::ItemPaginator as _;
11071    /// use google_cloud_aiplatform_v1::Result;
11072    /// async fn sample(
11073    ///    client: &MetadataService
11074    /// ) -> Result<()> {
11075    ///     let mut list = client.list_operations()
11076    ///         /* set fields */
11077    ///         .by_item();
11078    ///     while let Some(item) = list.next().await.transpose()? {
11079    ///         println!("{:?}", item);
11080    ///     }
11081    ///     Ok(())
11082    /// }
11083    /// ```
11084    pub fn list_operations(&self) -> super::builder::metadata_service::ListOperations {
11085        super::builder::metadata_service::ListOperations::new(self.inner.clone())
11086    }
11087
11088    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11089    ///
11090    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11091    ///
11092    /// # Example
11093    /// ```
11094    /// # use google_cloud_aiplatform_v1::client::MetadataService;
11095    /// use google_cloud_aiplatform_v1::Result;
11096    /// async fn sample(
11097    ///    client: &MetadataService
11098    /// ) -> Result<()> {
11099    ///     let response = client.get_operation()
11100    ///         /* set fields */
11101    ///         .send().await?;
11102    ///     println!("response {:?}", response);
11103    ///     Ok(())
11104    /// }
11105    /// ```
11106    pub fn get_operation(&self) -> super::builder::metadata_service::GetOperation {
11107        super::builder::metadata_service::GetOperation::new(self.inner.clone())
11108    }
11109
11110    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11111    ///
11112    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11113    ///
11114    /// # Example
11115    /// ```
11116    /// # use google_cloud_aiplatform_v1::client::MetadataService;
11117    /// use google_cloud_aiplatform_v1::Result;
11118    /// async fn sample(
11119    ///    client: &MetadataService
11120    /// ) -> Result<()> {
11121    ///     client.delete_operation()
11122    ///         /* set fields */
11123    ///         .send().await?;
11124    ///     Ok(())
11125    /// }
11126    /// ```
11127    pub fn delete_operation(&self) -> super::builder::metadata_service::DeleteOperation {
11128        super::builder::metadata_service::DeleteOperation::new(self.inner.clone())
11129    }
11130
11131    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11132    ///
11133    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11134    ///
11135    /// # Example
11136    /// ```
11137    /// # use google_cloud_aiplatform_v1::client::MetadataService;
11138    /// use google_cloud_aiplatform_v1::Result;
11139    /// async fn sample(
11140    ///    client: &MetadataService
11141    /// ) -> Result<()> {
11142    ///     client.cancel_operation()
11143    ///         /* set fields */
11144    ///         .send().await?;
11145    ///     Ok(())
11146    /// }
11147    /// ```
11148    pub fn cancel_operation(&self) -> super::builder::metadata_service::CancelOperation {
11149        super::builder::metadata_service::CancelOperation::new(self.inner.clone())
11150    }
11151
11152    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11153    ///
11154    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11155    ///
11156    /// # Example
11157    /// ```
11158    /// # use google_cloud_aiplatform_v1::client::MetadataService;
11159    /// use google_cloud_aiplatform_v1::Result;
11160    /// async fn sample(
11161    ///    client: &MetadataService
11162    /// ) -> Result<()> {
11163    ///     let response = client.wait_operation()
11164    ///         /* set fields */
11165    ///         .send().await?;
11166    ///     println!("response {:?}", response);
11167    ///     Ok(())
11168    /// }
11169    /// ```
11170    pub fn wait_operation(&self) -> super::builder::metadata_service::WaitOperation {
11171        super::builder::metadata_service::WaitOperation::new(self.inner.clone())
11172    }
11173}
11174
11175/// Implements a client for the Vertex AI API.
11176///
11177/// # Example
11178/// ```
11179/// # use google_cloud_aiplatform_v1::client::MigrationService;
11180/// use google_cloud_gax::paginator::ItemPaginator as _;
11181/// async fn sample(
11182/// ) -> anyhow::Result<()> {
11183///     let client = MigrationService::builder().build().await?;
11184///     let mut list = client.search_migratable_resources()
11185///         /* set fields */
11186///         .by_item();
11187///     while let Some(item) = list.next().await.transpose()? {
11188///         println!("{:?}", item);
11189///     }
11190///     Ok(())
11191/// }
11192/// ```
11193///
11194/// # Service Description
11195///
11196/// A service that migrates resources from automl.googleapis.com,
11197/// datalabeling.googleapis.com and ml.googleapis.com to Vertex AI.
11198///
11199/// # Configuration
11200///
11201/// To configure `MigrationService` use the `with_*` methods in the type returned
11202/// by [builder()][MigrationService::builder]. The default configuration should
11203/// work for most applications. Common configuration changes include
11204///
11205/// * [with_endpoint()]: by default this client uses the global default endpoint
11206///   (`https://aiplatform.googleapis.com`). Applications using regional
11207///   endpoints or running in restricted networks (e.g. a network configured
11208///   with [Private Google Access with VPC Service Controls]) may want to
11209///   override this default.
11210/// * [with_credentials()]: by default this client uses
11211///   [Application Default Credentials]. Applications using custom
11212///   authentication may need to override this default.
11213///
11214/// [with_endpoint()]: super::builder::migration_service::ClientBuilder::with_endpoint
11215/// [with_credentials()]: super::builder::migration_service::ClientBuilder::with_credentials
11216/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11217/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11218///
11219/// # Pooling and Cloning
11220///
11221/// `MigrationService` holds a connection pool internally, it is advised to
11222/// create one and reuse it. You do not need to wrap `MigrationService` in
11223/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11224/// already uses an `Arc` internally.
11225#[cfg(feature = "migration-service")]
11226#[cfg_attr(docsrs, doc(cfg(feature = "migration-service")))]
11227#[derive(Clone, Debug)]
11228pub struct MigrationService {
11229    inner: std::sync::Arc<dyn super::stub::dynamic::MigrationService>,
11230}
11231
11232#[cfg(feature = "migration-service")]
11233impl MigrationService {
11234    /// Returns a builder for [MigrationService].
11235    ///
11236    /// ```
11237    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11238    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11239    /// let client = MigrationService::builder().build().await?;
11240    /// # Ok(()) }
11241    /// ```
11242    pub fn builder() -> super::builder::migration_service::ClientBuilder {
11243        crate::new_client_builder(super::builder::migration_service::client::Factory)
11244    }
11245
11246    /// Creates a new client from the provided stub.
11247    ///
11248    /// The most common case for calling this function is in tests mocking the
11249    /// client's behavior.
11250    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11251    where
11252        T: super::stub::MigrationService + 'static,
11253    {
11254        Self { inner: stub.into() }
11255    }
11256
11257    pub(crate) async fn new(
11258        config: gaxi::options::ClientConfig,
11259    ) -> crate::ClientBuilderResult<Self> {
11260        let inner = Self::build_inner(config).await?;
11261        Ok(Self { inner })
11262    }
11263
11264    async fn build_inner(
11265        conf: gaxi::options::ClientConfig,
11266    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MigrationService>>
11267    {
11268        if gaxi::options::tracing_enabled(&conf) {
11269            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11270        }
11271        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11272    }
11273
11274    async fn build_transport(
11275        conf: gaxi::options::ClientConfig,
11276    ) -> crate::ClientBuilderResult<impl super::stub::MigrationService> {
11277        super::transport::MigrationService::new(conf).await
11278    }
11279
11280    async fn build_with_tracing(
11281        conf: gaxi::options::ClientConfig,
11282    ) -> crate::ClientBuilderResult<impl super::stub::MigrationService> {
11283        Self::build_transport(conf)
11284            .await
11285            .map(super::tracing::MigrationService::new)
11286    }
11287
11288    /// Searches all of the resources in automl.googleapis.com,
11289    /// datalabeling.googleapis.com and ml.googleapis.com that can be migrated to
11290    /// Vertex AI's given location.
11291    ///
11292    /// # Example
11293    /// ```
11294    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11295    /// use google_cloud_gax::paginator::ItemPaginator as _;
11296    /// use google_cloud_aiplatform_v1::Result;
11297    /// async fn sample(
11298    ///    client: &MigrationService
11299    /// ) -> Result<()> {
11300    ///     let mut list = client.search_migratable_resources()
11301    ///         /* set fields */
11302    ///         .by_item();
11303    ///     while let Some(item) = list.next().await.transpose()? {
11304    ///         println!("{:?}", item);
11305    ///     }
11306    ///     Ok(())
11307    /// }
11308    /// ```
11309    pub fn search_migratable_resources(
11310        &self,
11311    ) -> super::builder::migration_service::SearchMigratableResources {
11312        super::builder::migration_service::SearchMigratableResources::new(self.inner.clone())
11313    }
11314
11315    /// Batch migrates resources from ml.googleapis.com, automl.googleapis.com,
11316    /// and datalabeling.googleapis.com to Vertex AI.
11317    ///
11318    /// # Long running operations
11319    ///
11320    /// This method is used to start, and/or poll a [long-running Operation].
11321    /// The [Working with long-running operations] chapter in the [user guide]
11322    /// covers these operations in detail.
11323    ///
11324    /// [long-running operation]: https://google.aip.dev/151
11325    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
11326    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
11327    ///
11328    /// # Example
11329    /// ```
11330    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11331    /// use google_cloud_lro::Poller;
11332    /// use google_cloud_aiplatform_v1::Result;
11333    /// async fn sample(
11334    ///    client: &MigrationService
11335    /// ) -> Result<()> {
11336    ///     let response = client.batch_migrate_resources()
11337    ///         /* set fields */
11338    ///         .poller().until_done().await?;
11339    ///     println!("response {:?}", response);
11340    ///     Ok(())
11341    /// }
11342    /// ```
11343    pub fn batch_migrate_resources(
11344        &self,
11345    ) -> super::builder::migration_service::BatchMigrateResources {
11346        super::builder::migration_service::BatchMigrateResources::new(self.inner.clone())
11347    }
11348
11349    /// Lists information about the supported locations for this service.
11350    ///
11351    /// # Example
11352    /// ```
11353    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11354    /// use google_cloud_gax::paginator::ItemPaginator as _;
11355    /// use google_cloud_aiplatform_v1::Result;
11356    /// async fn sample(
11357    ///    client: &MigrationService
11358    /// ) -> Result<()> {
11359    ///     let mut list = client.list_locations()
11360    ///         /* set fields */
11361    ///         .by_item();
11362    ///     while let Some(item) = list.next().await.transpose()? {
11363    ///         println!("{:?}", item);
11364    ///     }
11365    ///     Ok(())
11366    /// }
11367    /// ```
11368    pub fn list_locations(&self) -> super::builder::migration_service::ListLocations {
11369        super::builder::migration_service::ListLocations::new(self.inner.clone())
11370    }
11371
11372    /// Gets information about a location.
11373    ///
11374    /// # Example
11375    /// ```
11376    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11377    /// use google_cloud_aiplatform_v1::Result;
11378    /// async fn sample(
11379    ///    client: &MigrationService
11380    /// ) -> Result<()> {
11381    ///     let response = client.get_location()
11382    ///         /* set fields */
11383    ///         .send().await?;
11384    ///     println!("response {:?}", response);
11385    ///     Ok(())
11386    /// }
11387    /// ```
11388    pub fn get_location(&self) -> super::builder::migration_service::GetLocation {
11389        super::builder::migration_service::GetLocation::new(self.inner.clone())
11390    }
11391
11392    /// Sets the access control policy on the specified resource. Replaces
11393    /// any existing policy.
11394    ///
11395    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
11396    /// errors.
11397    ///
11398    /// # Example
11399    /// ```
11400    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11401    /// use google_cloud_aiplatform_v1::Result;
11402    /// async fn sample(
11403    ///    client: &MigrationService
11404    /// ) -> Result<()> {
11405    ///     let response = client.set_iam_policy()
11406    ///         /* set fields */
11407    ///         .send().await?;
11408    ///     println!("response {:?}", response);
11409    ///     Ok(())
11410    /// }
11411    /// ```
11412    pub fn set_iam_policy(&self) -> super::builder::migration_service::SetIamPolicy {
11413        super::builder::migration_service::SetIamPolicy::new(self.inner.clone())
11414    }
11415
11416    /// Gets the access control policy for a resource. Returns an empty policy
11417    /// if the resource exists and does not have a policy set.
11418    ///
11419    /// # Example
11420    /// ```
11421    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11422    /// use google_cloud_aiplatform_v1::Result;
11423    /// async fn sample(
11424    ///    client: &MigrationService
11425    /// ) -> Result<()> {
11426    ///     let response = client.get_iam_policy()
11427    ///         /* set fields */
11428    ///         .send().await?;
11429    ///     println!("response {:?}", response);
11430    ///     Ok(())
11431    /// }
11432    /// ```
11433    pub fn get_iam_policy(&self) -> super::builder::migration_service::GetIamPolicy {
11434        super::builder::migration_service::GetIamPolicy::new(self.inner.clone())
11435    }
11436
11437    /// Returns permissions that a caller has on the specified resource. If the
11438    /// resource does not exist, this will return an empty set of
11439    /// permissions, not a `NOT_FOUND` error.
11440    ///
11441    /// Note: This operation is designed to be used for building
11442    /// permission-aware UIs and command-line tools, not for authorization
11443    /// checking. This operation may "fail open" without warning.
11444    ///
11445    /// # Example
11446    /// ```
11447    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11448    /// use google_cloud_aiplatform_v1::Result;
11449    /// async fn sample(
11450    ///    client: &MigrationService
11451    /// ) -> Result<()> {
11452    ///     let response = client.test_iam_permissions()
11453    ///         /* set fields */
11454    ///         .send().await?;
11455    ///     println!("response {:?}", response);
11456    ///     Ok(())
11457    /// }
11458    /// ```
11459    pub fn test_iam_permissions(&self) -> super::builder::migration_service::TestIamPermissions {
11460        super::builder::migration_service::TestIamPermissions::new(self.inner.clone())
11461    }
11462
11463    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11464    ///
11465    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11466    ///
11467    /// # Example
11468    /// ```
11469    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11470    /// use google_cloud_gax::paginator::ItemPaginator as _;
11471    /// use google_cloud_aiplatform_v1::Result;
11472    /// async fn sample(
11473    ///    client: &MigrationService
11474    /// ) -> Result<()> {
11475    ///     let mut list = client.list_operations()
11476    ///         /* set fields */
11477    ///         .by_item();
11478    ///     while let Some(item) = list.next().await.transpose()? {
11479    ///         println!("{:?}", item);
11480    ///     }
11481    ///     Ok(())
11482    /// }
11483    /// ```
11484    pub fn list_operations(&self) -> super::builder::migration_service::ListOperations {
11485        super::builder::migration_service::ListOperations::new(self.inner.clone())
11486    }
11487
11488    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11489    ///
11490    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11491    ///
11492    /// # Example
11493    /// ```
11494    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11495    /// use google_cloud_aiplatform_v1::Result;
11496    /// async fn sample(
11497    ///    client: &MigrationService
11498    /// ) -> Result<()> {
11499    ///     let response = client.get_operation()
11500    ///         /* set fields */
11501    ///         .send().await?;
11502    ///     println!("response {:?}", response);
11503    ///     Ok(())
11504    /// }
11505    /// ```
11506    pub fn get_operation(&self) -> super::builder::migration_service::GetOperation {
11507        super::builder::migration_service::GetOperation::new(self.inner.clone())
11508    }
11509
11510    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11511    ///
11512    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11513    ///
11514    /// # Example
11515    /// ```
11516    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11517    /// use google_cloud_aiplatform_v1::Result;
11518    /// async fn sample(
11519    ///    client: &MigrationService
11520    /// ) -> Result<()> {
11521    ///     client.delete_operation()
11522    ///         /* set fields */
11523    ///         .send().await?;
11524    ///     Ok(())
11525    /// }
11526    /// ```
11527    pub fn delete_operation(&self) -> super::builder::migration_service::DeleteOperation {
11528        super::builder::migration_service::DeleteOperation::new(self.inner.clone())
11529    }
11530
11531    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11532    ///
11533    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11534    ///
11535    /// # Example
11536    /// ```
11537    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11538    /// use google_cloud_aiplatform_v1::Result;
11539    /// async fn sample(
11540    ///    client: &MigrationService
11541    /// ) -> Result<()> {
11542    ///     client.cancel_operation()
11543    ///         /* set fields */
11544    ///         .send().await?;
11545    ///     Ok(())
11546    /// }
11547    /// ```
11548    pub fn cancel_operation(&self) -> super::builder::migration_service::CancelOperation {
11549        super::builder::migration_service::CancelOperation::new(self.inner.clone())
11550    }
11551
11552    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11553    ///
11554    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11555    ///
11556    /// # Example
11557    /// ```
11558    /// # use google_cloud_aiplatform_v1::client::MigrationService;
11559    /// use google_cloud_aiplatform_v1::Result;
11560    /// async fn sample(
11561    ///    client: &MigrationService
11562    /// ) -> Result<()> {
11563    ///     let response = client.wait_operation()
11564    ///         /* set fields */
11565    ///         .send().await?;
11566    ///     println!("response {:?}", response);
11567    ///     Ok(())
11568    /// }
11569    /// ```
11570    pub fn wait_operation(&self) -> super::builder::migration_service::WaitOperation {
11571        super::builder::migration_service::WaitOperation::new(self.inner.clone())
11572    }
11573}
11574
11575/// Implements a client for the Vertex AI API.
11576///
11577/// # Example
11578/// ```
11579/// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11580/// async fn sample(
11581///    publisher_id: &str,
11582///    model_id: &str,
11583/// ) -> anyhow::Result<()> {
11584///     let client = ModelGardenService::builder().build().await?;
11585///     let response = client.get_publisher_model()
11586///         .set_name(format!("publishers/{publisher_id}/models/{model_id}"))
11587///         .send().await?;
11588///     println!("response {:?}", response);
11589///     Ok(())
11590/// }
11591/// ```
11592///
11593/// # Service Description
11594///
11595/// The interface of Model Garden Service.
11596///
11597/// # Configuration
11598///
11599/// To configure `ModelGardenService` use the `with_*` methods in the type returned
11600/// by [builder()][ModelGardenService::builder]. The default configuration should
11601/// work for most applications. Common configuration changes include
11602///
11603/// * [with_endpoint()]: by default this client uses the global default endpoint
11604///   (`https://aiplatform.googleapis.com`). Applications using regional
11605///   endpoints or running in restricted networks (e.g. a network configured
11606///   with [Private Google Access with VPC Service Controls]) may want to
11607///   override this default.
11608/// * [with_credentials()]: by default this client uses
11609///   [Application Default Credentials]. Applications using custom
11610///   authentication may need to override this default.
11611///
11612/// [with_endpoint()]: super::builder::model_garden_service::ClientBuilder::with_endpoint
11613/// [with_credentials()]: super::builder::model_garden_service::ClientBuilder::with_credentials
11614/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11615/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11616///
11617/// # Pooling and Cloning
11618///
11619/// `ModelGardenService` holds a connection pool internally, it is advised to
11620/// create one and reuse it. You do not need to wrap `ModelGardenService` in
11621/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11622/// already uses an `Arc` internally.
11623#[cfg(feature = "model-garden-service")]
11624#[cfg_attr(docsrs, doc(cfg(feature = "model-garden-service")))]
11625#[derive(Clone, Debug)]
11626pub struct ModelGardenService {
11627    inner: std::sync::Arc<dyn super::stub::dynamic::ModelGardenService>,
11628}
11629
11630#[cfg(feature = "model-garden-service")]
11631impl ModelGardenService {
11632    /// Returns a builder for [ModelGardenService].
11633    ///
11634    /// ```
11635    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11636    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11637    /// let client = ModelGardenService::builder().build().await?;
11638    /// # Ok(()) }
11639    /// ```
11640    pub fn builder() -> super::builder::model_garden_service::ClientBuilder {
11641        crate::new_client_builder(super::builder::model_garden_service::client::Factory)
11642    }
11643
11644    /// Creates a new client from the provided stub.
11645    ///
11646    /// The most common case for calling this function is in tests mocking the
11647    /// client's behavior.
11648    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11649    where
11650        T: super::stub::ModelGardenService + 'static,
11651    {
11652        Self { inner: stub.into() }
11653    }
11654
11655    pub(crate) async fn new(
11656        config: gaxi::options::ClientConfig,
11657    ) -> crate::ClientBuilderResult<Self> {
11658        let inner = Self::build_inner(config).await?;
11659        Ok(Self { inner })
11660    }
11661
11662    async fn build_inner(
11663        conf: gaxi::options::ClientConfig,
11664    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ModelGardenService>>
11665    {
11666        if gaxi::options::tracing_enabled(&conf) {
11667            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11668        }
11669        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11670    }
11671
11672    async fn build_transport(
11673        conf: gaxi::options::ClientConfig,
11674    ) -> crate::ClientBuilderResult<impl super::stub::ModelGardenService> {
11675        super::transport::ModelGardenService::new(conf).await
11676    }
11677
11678    async fn build_with_tracing(
11679        conf: gaxi::options::ClientConfig,
11680    ) -> crate::ClientBuilderResult<impl super::stub::ModelGardenService> {
11681        Self::build_transport(conf)
11682            .await
11683            .map(super::tracing::ModelGardenService::new)
11684    }
11685
11686    /// Gets a Model Garden publisher model.
11687    ///
11688    /// # Example
11689    /// ```
11690    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11691    /// use google_cloud_aiplatform_v1::Result;
11692    /// async fn sample(
11693    ///    client: &ModelGardenService, publisher_id: &str, model_id: &str
11694    /// ) -> Result<()> {
11695    ///     let response = client.get_publisher_model()
11696    ///         .set_name(format!("publishers/{publisher_id}/models/{model_id}"))
11697    ///         .send().await?;
11698    ///     println!("response {:?}", response);
11699    ///     Ok(())
11700    /// }
11701    /// ```
11702    pub fn get_publisher_model(&self) -> super::builder::model_garden_service::GetPublisherModel {
11703        super::builder::model_garden_service::GetPublisherModel::new(self.inner.clone())
11704    }
11705
11706    /// Deploys a model to a new endpoint.
11707    ///
11708    /// # Long running operations
11709    ///
11710    /// This method is used to start, and/or poll a [long-running Operation].
11711    /// The [Working with long-running operations] chapter in the [user guide]
11712    /// covers these operations in detail.
11713    ///
11714    /// [long-running operation]: https://google.aip.dev/151
11715    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
11716    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
11717    ///
11718    /// # Example
11719    /// ```
11720    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11721    /// use google_cloud_lro::Poller;
11722    /// use google_cloud_aiplatform_v1::Result;
11723    /// async fn sample(
11724    ///    client: &ModelGardenService
11725    /// ) -> Result<()> {
11726    ///     let response = client.deploy()
11727    ///         /* set fields */
11728    ///         .poller().until_done().await?;
11729    ///     println!("response {:?}", response);
11730    ///     Ok(())
11731    /// }
11732    /// ```
11733    pub fn deploy(&self) -> super::builder::model_garden_service::Deploy {
11734        super::builder::model_garden_service::Deploy::new(self.inner.clone())
11735    }
11736
11737    /// Lists information about the supported locations for this service.
11738    ///
11739    /// # Example
11740    /// ```
11741    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11742    /// use google_cloud_gax::paginator::ItemPaginator as _;
11743    /// use google_cloud_aiplatform_v1::Result;
11744    /// async fn sample(
11745    ///    client: &ModelGardenService
11746    /// ) -> Result<()> {
11747    ///     let mut list = client.list_locations()
11748    ///         /* set fields */
11749    ///         .by_item();
11750    ///     while let Some(item) = list.next().await.transpose()? {
11751    ///         println!("{:?}", item);
11752    ///     }
11753    ///     Ok(())
11754    /// }
11755    /// ```
11756    pub fn list_locations(&self) -> super::builder::model_garden_service::ListLocations {
11757        super::builder::model_garden_service::ListLocations::new(self.inner.clone())
11758    }
11759
11760    /// Gets information about a location.
11761    ///
11762    /// # Example
11763    /// ```
11764    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11765    /// use google_cloud_aiplatform_v1::Result;
11766    /// async fn sample(
11767    ///    client: &ModelGardenService
11768    /// ) -> Result<()> {
11769    ///     let response = client.get_location()
11770    ///         /* set fields */
11771    ///         .send().await?;
11772    ///     println!("response {:?}", response);
11773    ///     Ok(())
11774    /// }
11775    /// ```
11776    pub fn get_location(&self) -> super::builder::model_garden_service::GetLocation {
11777        super::builder::model_garden_service::GetLocation::new(self.inner.clone())
11778    }
11779
11780    /// Sets the access control policy on the specified resource. Replaces
11781    /// any existing policy.
11782    ///
11783    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
11784    /// errors.
11785    ///
11786    /// # Example
11787    /// ```
11788    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11789    /// use google_cloud_aiplatform_v1::Result;
11790    /// async fn sample(
11791    ///    client: &ModelGardenService
11792    /// ) -> Result<()> {
11793    ///     let response = client.set_iam_policy()
11794    ///         /* set fields */
11795    ///         .send().await?;
11796    ///     println!("response {:?}", response);
11797    ///     Ok(())
11798    /// }
11799    /// ```
11800    pub fn set_iam_policy(&self) -> super::builder::model_garden_service::SetIamPolicy {
11801        super::builder::model_garden_service::SetIamPolicy::new(self.inner.clone())
11802    }
11803
11804    /// Gets the access control policy for a resource. Returns an empty policy
11805    /// if the resource exists and does not have a policy set.
11806    ///
11807    /// # Example
11808    /// ```
11809    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11810    /// use google_cloud_aiplatform_v1::Result;
11811    /// async fn sample(
11812    ///    client: &ModelGardenService
11813    /// ) -> Result<()> {
11814    ///     let response = client.get_iam_policy()
11815    ///         /* set fields */
11816    ///         .send().await?;
11817    ///     println!("response {:?}", response);
11818    ///     Ok(())
11819    /// }
11820    /// ```
11821    pub fn get_iam_policy(&self) -> super::builder::model_garden_service::GetIamPolicy {
11822        super::builder::model_garden_service::GetIamPolicy::new(self.inner.clone())
11823    }
11824
11825    /// Returns permissions that a caller has on the specified resource. If the
11826    /// resource does not exist, this will return an empty set of
11827    /// permissions, not a `NOT_FOUND` error.
11828    ///
11829    /// Note: This operation is designed to be used for building
11830    /// permission-aware UIs and command-line tools, not for authorization
11831    /// checking. This operation may "fail open" without warning.
11832    ///
11833    /// # Example
11834    /// ```
11835    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11836    /// use google_cloud_aiplatform_v1::Result;
11837    /// async fn sample(
11838    ///    client: &ModelGardenService
11839    /// ) -> Result<()> {
11840    ///     let response = client.test_iam_permissions()
11841    ///         /* set fields */
11842    ///         .send().await?;
11843    ///     println!("response {:?}", response);
11844    ///     Ok(())
11845    /// }
11846    /// ```
11847    pub fn test_iam_permissions(&self) -> super::builder::model_garden_service::TestIamPermissions {
11848        super::builder::model_garden_service::TestIamPermissions::new(self.inner.clone())
11849    }
11850
11851    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11852    ///
11853    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11854    ///
11855    /// # Example
11856    /// ```
11857    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11858    /// use google_cloud_gax::paginator::ItemPaginator as _;
11859    /// use google_cloud_aiplatform_v1::Result;
11860    /// async fn sample(
11861    ///    client: &ModelGardenService
11862    /// ) -> Result<()> {
11863    ///     let mut list = client.list_operations()
11864    ///         /* set fields */
11865    ///         .by_item();
11866    ///     while let Some(item) = list.next().await.transpose()? {
11867    ///         println!("{:?}", item);
11868    ///     }
11869    ///     Ok(())
11870    /// }
11871    /// ```
11872    pub fn list_operations(&self) -> super::builder::model_garden_service::ListOperations {
11873        super::builder::model_garden_service::ListOperations::new(self.inner.clone())
11874    }
11875
11876    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11877    ///
11878    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11879    ///
11880    /// # Example
11881    /// ```
11882    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11883    /// use google_cloud_aiplatform_v1::Result;
11884    /// async fn sample(
11885    ///    client: &ModelGardenService
11886    /// ) -> Result<()> {
11887    ///     let response = client.get_operation()
11888    ///         /* set fields */
11889    ///         .send().await?;
11890    ///     println!("response {:?}", response);
11891    ///     Ok(())
11892    /// }
11893    /// ```
11894    pub fn get_operation(&self) -> super::builder::model_garden_service::GetOperation {
11895        super::builder::model_garden_service::GetOperation::new(self.inner.clone())
11896    }
11897
11898    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11899    ///
11900    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11901    ///
11902    /// # Example
11903    /// ```
11904    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11905    /// use google_cloud_aiplatform_v1::Result;
11906    /// async fn sample(
11907    ///    client: &ModelGardenService
11908    /// ) -> Result<()> {
11909    ///     client.delete_operation()
11910    ///         /* set fields */
11911    ///         .send().await?;
11912    ///     Ok(())
11913    /// }
11914    /// ```
11915    pub fn delete_operation(&self) -> super::builder::model_garden_service::DeleteOperation {
11916        super::builder::model_garden_service::DeleteOperation::new(self.inner.clone())
11917    }
11918
11919    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11920    ///
11921    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11922    ///
11923    /// # Example
11924    /// ```
11925    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11926    /// use google_cloud_aiplatform_v1::Result;
11927    /// async fn sample(
11928    ///    client: &ModelGardenService
11929    /// ) -> Result<()> {
11930    ///     client.cancel_operation()
11931    ///         /* set fields */
11932    ///         .send().await?;
11933    ///     Ok(())
11934    /// }
11935    /// ```
11936    pub fn cancel_operation(&self) -> super::builder::model_garden_service::CancelOperation {
11937        super::builder::model_garden_service::CancelOperation::new(self.inner.clone())
11938    }
11939
11940    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
11941    ///
11942    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
11943    ///
11944    /// # Example
11945    /// ```
11946    /// # use google_cloud_aiplatform_v1::client::ModelGardenService;
11947    /// use google_cloud_aiplatform_v1::Result;
11948    /// async fn sample(
11949    ///    client: &ModelGardenService
11950    /// ) -> Result<()> {
11951    ///     let response = client.wait_operation()
11952    ///         /* set fields */
11953    ///         .send().await?;
11954    ///     println!("response {:?}", response);
11955    ///     Ok(())
11956    /// }
11957    /// ```
11958    pub fn wait_operation(&self) -> super::builder::model_garden_service::WaitOperation {
11959        super::builder::model_garden_service::WaitOperation::new(self.inner.clone())
11960    }
11961}
11962
11963/// Implements a client for the Vertex AI API.
11964///
11965/// # Example
11966/// ```
11967/// # use google_cloud_aiplatform_v1::client::ModelService;
11968/// use google_cloud_gax::paginator::ItemPaginator as _;
11969/// async fn sample(
11970///    parent: &str,
11971/// ) -> anyhow::Result<()> {
11972///     let client = ModelService::builder().build().await?;
11973///     let mut list = client.list_models()
11974///         .set_parent(parent)
11975///         .by_item();
11976///     while let Some(item) = list.next().await.transpose()? {
11977///         println!("{:?}", item);
11978///     }
11979///     Ok(())
11980/// }
11981/// ```
11982///
11983/// # Service Description
11984///
11985/// A service for managing Vertex AI's machine learning Models.
11986///
11987/// # Configuration
11988///
11989/// To configure `ModelService` use the `with_*` methods in the type returned
11990/// by [builder()][ModelService::builder]. The default configuration should
11991/// work for most applications. Common configuration changes include
11992///
11993/// * [with_endpoint()]: by default this client uses the global default endpoint
11994///   (`https://aiplatform.googleapis.com`). Applications using regional
11995///   endpoints or running in restricted networks (e.g. a network configured
11996///   with [Private Google Access with VPC Service Controls]) may want to
11997///   override this default.
11998/// * [with_credentials()]: by default this client uses
11999///   [Application Default Credentials]. Applications using custom
12000///   authentication may need to override this default.
12001///
12002/// [with_endpoint()]: super::builder::model_service::ClientBuilder::with_endpoint
12003/// [with_credentials()]: super::builder::model_service::ClientBuilder::with_credentials
12004/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12005/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12006///
12007/// # Pooling and Cloning
12008///
12009/// `ModelService` holds a connection pool internally, it is advised to
12010/// create one and reuse it. You do not need to wrap `ModelService` in
12011/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12012/// already uses an `Arc` internally.
12013#[cfg(feature = "model-service")]
12014#[cfg_attr(docsrs, doc(cfg(feature = "model-service")))]
12015#[derive(Clone, Debug)]
12016pub struct ModelService {
12017    inner: std::sync::Arc<dyn super::stub::dynamic::ModelService>,
12018}
12019
12020#[cfg(feature = "model-service")]
12021impl ModelService {
12022    /// Returns a builder for [ModelService].
12023    ///
12024    /// ```
12025    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12026    /// # use google_cloud_aiplatform_v1::client::ModelService;
12027    /// let client = ModelService::builder().build().await?;
12028    /// # Ok(()) }
12029    /// ```
12030    pub fn builder() -> super::builder::model_service::ClientBuilder {
12031        crate::new_client_builder(super::builder::model_service::client::Factory)
12032    }
12033
12034    /// Creates a new client from the provided stub.
12035    ///
12036    /// The most common case for calling this function is in tests mocking the
12037    /// client's behavior.
12038    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12039    where
12040        T: super::stub::ModelService + 'static,
12041    {
12042        Self { inner: stub.into() }
12043    }
12044
12045    pub(crate) async fn new(
12046        config: gaxi::options::ClientConfig,
12047    ) -> crate::ClientBuilderResult<Self> {
12048        let inner = Self::build_inner(config).await?;
12049        Ok(Self { inner })
12050    }
12051
12052    async fn build_inner(
12053        conf: gaxi::options::ClientConfig,
12054    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ModelService>> {
12055        if gaxi::options::tracing_enabled(&conf) {
12056            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12057        }
12058        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12059    }
12060
12061    async fn build_transport(
12062        conf: gaxi::options::ClientConfig,
12063    ) -> crate::ClientBuilderResult<impl super::stub::ModelService> {
12064        super::transport::ModelService::new(conf).await
12065    }
12066
12067    async fn build_with_tracing(
12068        conf: gaxi::options::ClientConfig,
12069    ) -> crate::ClientBuilderResult<impl super::stub::ModelService> {
12070        Self::build_transport(conf)
12071            .await
12072            .map(super::tracing::ModelService::new)
12073    }
12074
12075    /// Uploads a Model artifact into Vertex AI.
12076    ///
12077    /// # Long running operations
12078    ///
12079    /// This method is used to start, and/or poll a [long-running Operation].
12080    /// The [Working with long-running operations] chapter in the [user guide]
12081    /// covers these operations in detail.
12082    ///
12083    /// [long-running operation]: https://google.aip.dev/151
12084    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
12085    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
12086    ///
12087    /// # Example
12088    /// ```
12089    /// # use google_cloud_aiplatform_v1::client::ModelService;
12090    /// use google_cloud_lro::Poller;
12091    /// use google_cloud_aiplatform_v1::Result;
12092    /// async fn sample(
12093    ///    client: &ModelService
12094    /// ) -> Result<()> {
12095    ///     let response = client.upload_model()
12096    ///         /* set fields */
12097    ///         .poller().until_done().await?;
12098    ///     println!("response {:?}", response);
12099    ///     Ok(())
12100    /// }
12101    /// ```
12102    pub fn upload_model(&self) -> super::builder::model_service::UploadModel {
12103        super::builder::model_service::UploadModel::new(self.inner.clone())
12104    }
12105
12106    /// Gets a Model.
12107    ///
12108    /// # Example
12109    /// ```
12110    /// # use google_cloud_aiplatform_v1::client::ModelService;
12111    /// use google_cloud_aiplatform_v1::Result;
12112    /// async fn sample(
12113    ///    client: &ModelService, project_id: &str, location_id: &str, model_id: &str
12114    /// ) -> Result<()> {
12115    ///     let response = client.get_model()
12116    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/models/{model_id}"))
12117    ///         .send().await?;
12118    ///     println!("response {:?}", response);
12119    ///     Ok(())
12120    /// }
12121    /// ```
12122    pub fn get_model(&self) -> super::builder::model_service::GetModel {
12123        super::builder::model_service::GetModel::new(self.inner.clone())
12124    }
12125
12126    /// Lists Models in a Location.
12127    ///
12128    /// # Example
12129    /// ```
12130    /// # use google_cloud_aiplatform_v1::client::ModelService;
12131    /// use google_cloud_gax::paginator::ItemPaginator as _;
12132    /// use google_cloud_aiplatform_v1::Result;
12133    /// async fn sample(
12134    ///    client: &ModelService, parent: &str
12135    /// ) -> Result<()> {
12136    ///     let mut list = client.list_models()
12137    ///         .set_parent(parent)
12138    ///         .by_item();
12139    ///     while let Some(item) = list.next().await.transpose()? {
12140    ///         println!("{:?}", item);
12141    ///     }
12142    ///     Ok(())
12143    /// }
12144    /// ```
12145    pub fn list_models(&self) -> super::builder::model_service::ListModels {
12146        super::builder::model_service::ListModels::new(self.inner.clone())
12147    }
12148
12149    /// Lists versions of the specified model.
12150    ///
12151    /// # Example
12152    /// ```
12153    /// # use google_cloud_aiplatform_v1::client::ModelService;
12154    /// use google_cloud_gax::paginator::ItemPaginator as _;
12155    /// use google_cloud_aiplatform_v1::Result;
12156    /// async fn sample(
12157    ///    client: &ModelService
12158    /// ) -> Result<()> {
12159    ///     let mut list = client.list_model_versions()
12160    ///         /* set fields */
12161    ///         .by_item();
12162    ///     while let Some(item) = list.next().await.transpose()? {
12163    ///         println!("{:?}", item);
12164    ///     }
12165    ///     Ok(())
12166    /// }
12167    /// ```
12168    pub fn list_model_versions(&self) -> super::builder::model_service::ListModelVersions {
12169        super::builder::model_service::ListModelVersions::new(self.inner.clone())
12170    }
12171
12172    /// Lists checkpoints of the specified model version.
12173    ///
12174    /// # Example
12175    /// ```
12176    /// # use google_cloud_aiplatform_v1::client::ModelService;
12177    /// use google_cloud_gax::paginator::ItemPaginator as _;
12178    /// use google_cloud_aiplatform_v1::Result;
12179    /// async fn sample(
12180    ///    client: &ModelService
12181    /// ) -> Result<()> {
12182    ///     let mut list = client.list_model_version_checkpoints()
12183    ///         /* set fields */
12184    ///         .by_item();
12185    ///     while let Some(item) = list.next().await.transpose()? {
12186    ///         println!("{:?}", item);
12187    ///     }
12188    ///     Ok(())
12189    /// }
12190    /// ```
12191    pub fn list_model_version_checkpoints(
12192        &self,
12193    ) -> super::builder::model_service::ListModelVersionCheckpoints {
12194        super::builder::model_service::ListModelVersionCheckpoints::new(self.inner.clone())
12195    }
12196
12197    /// Updates a Model.
12198    ///
12199    /// # Example
12200    /// ```
12201    /// # use google_cloud_aiplatform_v1::client::ModelService;
12202    /// # extern crate wkt as google_cloud_wkt;
12203    /// use google_cloud_wkt::FieldMask;
12204    /// use google_cloud_aiplatform_v1::model::Model;
12205    /// use google_cloud_aiplatform_v1::Result;
12206    /// async fn sample(
12207    ///    client: &ModelService, project_id: &str, location_id: &str, model_id: &str
12208    /// ) -> Result<()> {
12209    ///     let response = client.update_model()
12210    ///         .set_model(
12211    ///             Model::new().set_name(format!("projects/{project_id}/locations/{location_id}/models/{model_id}"))/* set fields */
12212    ///         )
12213    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
12214    ///         .send().await?;
12215    ///     println!("response {:?}", response);
12216    ///     Ok(())
12217    /// }
12218    /// ```
12219    pub fn update_model(&self) -> super::builder::model_service::UpdateModel {
12220        super::builder::model_service::UpdateModel::new(self.inner.clone())
12221    }
12222
12223    /// Incrementally update the dataset used for an examples model.
12224    ///
12225    /// # Long running operations
12226    ///
12227    /// This method is used to start, and/or poll a [long-running Operation].
12228    /// The [Working with long-running operations] chapter in the [user guide]
12229    /// covers these operations in detail.
12230    ///
12231    /// [long-running operation]: https://google.aip.dev/151
12232    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
12233    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
12234    ///
12235    /// # Example
12236    /// ```
12237    /// # use google_cloud_aiplatform_v1::client::ModelService;
12238    /// use google_cloud_lro::Poller;
12239    /// use google_cloud_aiplatform_v1::Result;
12240    /// async fn sample(
12241    ///    client: &ModelService
12242    /// ) -> Result<()> {
12243    ///     let response = client.update_explanation_dataset()
12244    ///         /* set fields */
12245    ///         .poller().until_done().await?;
12246    ///     println!("response {:?}", response);
12247    ///     Ok(())
12248    /// }
12249    /// ```
12250    pub fn update_explanation_dataset(
12251        &self,
12252    ) -> super::builder::model_service::UpdateExplanationDataset {
12253        super::builder::model_service::UpdateExplanationDataset::new(self.inner.clone())
12254    }
12255
12256    /// Deletes a Model.
12257    ///
12258    /// A model cannot be deleted if any
12259    /// [Endpoint][google.cloud.aiplatform.v1.Endpoint] resource has a
12260    /// [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] based on the
12261    /// model in its
12262    /// [deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models]
12263    /// field.
12264    ///
12265    /// [google.cloud.aiplatform.v1.DeployedModel]: crate::model::DeployedModel
12266    /// [google.cloud.aiplatform.v1.Endpoint]: crate::model::Endpoint
12267    /// [google.cloud.aiplatform.v1.Endpoint.deployed_models]: crate::model::Endpoint::deployed_models
12268    ///
12269    /// # Long running operations
12270    ///
12271    /// This method is used to start, and/or poll a [long-running Operation].
12272    /// The [Working with long-running operations] chapter in the [user guide]
12273    /// covers these operations in detail.
12274    ///
12275    /// [long-running operation]: https://google.aip.dev/151
12276    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
12277    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
12278    ///
12279    /// # Example
12280    /// ```
12281    /// # use google_cloud_aiplatform_v1::client::ModelService;
12282    /// use google_cloud_lro::Poller;
12283    /// use google_cloud_aiplatform_v1::Result;
12284    /// async fn sample(
12285    ///    client: &ModelService, project_id: &str, location_id: &str, model_id: &str
12286    /// ) -> Result<()> {
12287    ///     client.delete_model()
12288    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/models/{model_id}"))
12289    ///         .poller().until_done().await?;
12290    ///     Ok(())
12291    /// }
12292    /// ```
12293    pub fn delete_model(&self) -> super::builder::model_service::DeleteModel {
12294        super::builder::model_service::DeleteModel::new(self.inner.clone())
12295    }
12296
12297    /// Deletes a Model version.
12298    ///
12299    /// Model version can only be deleted if there are no
12300    /// [DeployedModels][google.cloud.aiplatform.v1.DeployedModel] created from it.
12301    /// Deleting the only version in the Model is not allowed. Use
12302    /// [DeleteModel][google.cloud.aiplatform.v1.ModelService.DeleteModel] for
12303    /// deleting the Model instead.
12304    ///
12305    /// [google.cloud.aiplatform.v1.DeployedModel]: crate::model::DeployedModel
12306    /// [google.cloud.aiplatform.v1.ModelService.DeleteModel]: crate::client::ModelService::delete_model
12307    ///
12308    /// # Long running operations
12309    ///
12310    /// This method is used to start, and/or poll a [long-running Operation].
12311    /// The [Working with long-running operations] chapter in the [user guide]
12312    /// covers these operations in detail.
12313    ///
12314    /// [long-running operation]: https://google.aip.dev/151
12315    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
12316    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
12317    ///
12318    /// # Example
12319    /// ```
12320    /// # use google_cloud_aiplatform_v1::client::ModelService;
12321    /// use google_cloud_lro::Poller;
12322    /// use google_cloud_aiplatform_v1::Result;
12323    /// async fn sample(
12324    ///    client: &ModelService, project_id: &str, location_id: &str, model_id: &str
12325    /// ) -> Result<()> {
12326    ///     client.delete_model_version()
12327    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/models/{model_id}"))
12328    ///         .poller().until_done().await?;
12329    ///     Ok(())
12330    /// }
12331    /// ```
12332    pub fn delete_model_version(&self) -> super::builder::model_service::DeleteModelVersion {
12333        super::builder::model_service::DeleteModelVersion::new(self.inner.clone())
12334    }
12335
12336    /// Merges a set of aliases for a Model version.
12337    ///
12338    /// # Example
12339    /// ```
12340    /// # use google_cloud_aiplatform_v1::client::ModelService;
12341    /// use google_cloud_aiplatform_v1::Result;
12342    /// async fn sample(
12343    ///    client: &ModelService
12344    /// ) -> Result<()> {
12345    ///     let response = client.merge_version_aliases()
12346    ///         /* set fields */
12347    ///         .send().await?;
12348    ///     println!("response {:?}", response);
12349    ///     Ok(())
12350    /// }
12351    /// ```
12352    pub fn merge_version_aliases(&self) -> super::builder::model_service::MergeVersionAliases {
12353        super::builder::model_service::MergeVersionAliases::new(self.inner.clone())
12354    }
12355
12356    /// Exports a trained, exportable Model to a location specified by the
12357    /// user. A Model is considered to be exportable if it has at least one
12358    /// [supported export
12359    /// format][google.cloud.aiplatform.v1.Model.supported_export_formats].
12360    ///
12361    /// [google.cloud.aiplatform.v1.Model.supported_export_formats]: crate::model::Model::supported_export_formats
12362    ///
12363    /// # Long running operations
12364    ///
12365    /// This method is used to start, and/or poll a [long-running Operation].
12366    /// The [Working with long-running operations] chapter in the [user guide]
12367    /// covers these operations in detail.
12368    ///
12369    /// [long-running operation]: https://google.aip.dev/151
12370    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
12371    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
12372    ///
12373    /// # Example
12374    /// ```
12375    /// # use google_cloud_aiplatform_v1::client::ModelService;
12376    /// use google_cloud_lro::Poller;
12377    /// use google_cloud_aiplatform_v1::Result;
12378    /// async fn sample(
12379    ///    client: &ModelService
12380    /// ) -> Result<()> {
12381    ///     let response = client.export_model()
12382    ///         /* set fields */
12383    ///         .poller().until_done().await?;
12384    ///     println!("response {:?}", response);
12385    ///     Ok(())
12386    /// }
12387    /// ```
12388    pub fn export_model(&self) -> super::builder::model_service::ExportModel {
12389        super::builder::model_service::ExportModel::new(self.inner.clone())
12390    }
12391
12392    /// Copies an already existing Vertex AI Model into the specified Location.
12393    /// The source Model must exist in the same Project.
12394    /// When copying custom Models, the users themselves are responsible for
12395    /// [Model.metadata][google.cloud.aiplatform.v1.Model.metadata] content to be
12396    /// region-agnostic, as well as making sure that any resources (e.g. files) it
12397    /// depends on remain accessible.
12398    ///
12399    /// [google.cloud.aiplatform.v1.Model.metadata]: crate::model::Model::metadata
12400    ///
12401    /// # Long running operations
12402    ///
12403    /// This method is used to start, and/or poll a [long-running Operation].
12404    /// The [Working with long-running operations] chapter in the [user guide]
12405    /// covers these operations in detail.
12406    ///
12407    /// [long-running operation]: https://google.aip.dev/151
12408    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
12409    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
12410    ///
12411    /// # Example
12412    /// ```
12413    /// # use google_cloud_aiplatform_v1::client::ModelService;
12414    /// use google_cloud_lro::Poller;
12415    /// use google_cloud_aiplatform_v1::Result;
12416    /// async fn sample(
12417    ///    client: &ModelService
12418    /// ) -> Result<()> {
12419    ///     let response = client.copy_model()
12420    ///         /* set fields */
12421    ///         .poller().until_done().await?;
12422    ///     println!("response {:?}", response);
12423    ///     Ok(())
12424    /// }
12425    /// ```
12426    pub fn copy_model(&self) -> super::builder::model_service::CopyModel {
12427        super::builder::model_service::CopyModel::new(self.inner.clone())
12428    }
12429
12430    /// Imports an externally generated ModelEvaluation.
12431    ///
12432    /// # Example
12433    /// ```
12434    /// # use google_cloud_aiplatform_v1::client::ModelService;
12435    /// use google_cloud_aiplatform_v1::Result;
12436    /// async fn sample(
12437    ///    client: &ModelService
12438    /// ) -> Result<()> {
12439    ///     let response = client.import_model_evaluation()
12440    ///         /* set fields */
12441    ///         .send().await?;
12442    ///     println!("response {:?}", response);
12443    ///     Ok(())
12444    /// }
12445    /// ```
12446    pub fn import_model_evaluation(&self) -> super::builder::model_service::ImportModelEvaluation {
12447        super::builder::model_service::ImportModelEvaluation::new(self.inner.clone())
12448    }
12449
12450    /// Imports a list of externally generated ModelEvaluationSlice.
12451    ///
12452    /// # Example
12453    /// ```
12454    /// # use google_cloud_aiplatform_v1::client::ModelService;
12455    /// use google_cloud_aiplatform_v1::Result;
12456    /// async fn sample(
12457    ///    client: &ModelService
12458    /// ) -> Result<()> {
12459    ///     let response = client.batch_import_model_evaluation_slices()
12460    ///         /* set fields */
12461    ///         .send().await?;
12462    ///     println!("response {:?}", response);
12463    ///     Ok(())
12464    /// }
12465    /// ```
12466    pub fn batch_import_model_evaluation_slices(
12467        &self,
12468    ) -> super::builder::model_service::BatchImportModelEvaluationSlices {
12469        super::builder::model_service::BatchImportModelEvaluationSlices::new(self.inner.clone())
12470    }
12471
12472    /// Imports a list of externally generated EvaluatedAnnotations.
12473    ///
12474    /// # Example
12475    /// ```
12476    /// # use google_cloud_aiplatform_v1::client::ModelService;
12477    /// use google_cloud_aiplatform_v1::Result;
12478    /// async fn sample(
12479    ///    client: &ModelService
12480    /// ) -> Result<()> {
12481    ///     let response = client.batch_import_evaluated_annotations()
12482    ///         /* set fields */
12483    ///         .send().await?;
12484    ///     println!("response {:?}", response);
12485    ///     Ok(())
12486    /// }
12487    /// ```
12488    pub fn batch_import_evaluated_annotations(
12489        &self,
12490    ) -> super::builder::model_service::BatchImportEvaluatedAnnotations {
12491        super::builder::model_service::BatchImportEvaluatedAnnotations::new(self.inner.clone())
12492    }
12493
12494    /// Gets a ModelEvaluation.
12495    ///
12496    /// # Example
12497    /// ```
12498    /// # use google_cloud_aiplatform_v1::client::ModelService;
12499    /// use google_cloud_aiplatform_v1::Result;
12500    /// async fn sample(
12501    ///    client: &ModelService, project_id: &str, location_id: &str, model_id: &str, evaluation_id: &str
12502    /// ) -> Result<()> {
12503    ///     let response = client.get_model_evaluation()
12504    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/models/{model_id}/evaluations/{evaluation_id}"))
12505    ///         .send().await?;
12506    ///     println!("response {:?}", response);
12507    ///     Ok(())
12508    /// }
12509    /// ```
12510    pub fn get_model_evaluation(&self) -> super::builder::model_service::GetModelEvaluation {
12511        super::builder::model_service::GetModelEvaluation::new(self.inner.clone())
12512    }
12513
12514    /// Lists ModelEvaluations in a Model.
12515    ///
12516    /// # Example
12517    /// ```
12518    /// # use google_cloud_aiplatform_v1::client::ModelService;
12519    /// use google_cloud_gax::paginator::ItemPaginator as _;
12520    /// use google_cloud_aiplatform_v1::Result;
12521    /// async fn sample(
12522    ///    client: &ModelService, project_id: &str, location_id: &str, model_id: &str
12523    /// ) -> Result<()> {
12524    ///     let mut list = client.list_model_evaluations()
12525    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/models/{model_id}"))
12526    ///         .by_item();
12527    ///     while let Some(item) = list.next().await.transpose()? {
12528    ///         println!("{:?}", item);
12529    ///     }
12530    ///     Ok(())
12531    /// }
12532    /// ```
12533    pub fn list_model_evaluations(&self) -> super::builder::model_service::ListModelEvaluations {
12534        super::builder::model_service::ListModelEvaluations::new(self.inner.clone())
12535    }
12536
12537    /// Gets a ModelEvaluationSlice.
12538    ///
12539    /// # Example
12540    /// ```
12541    /// # use google_cloud_aiplatform_v1::client::ModelService;
12542    /// use google_cloud_aiplatform_v1::Result;
12543    /// async fn sample(
12544    ///    client: &ModelService, project_id: &str, location_id: &str, model_id: &str, evaluation_id: &str, slice_id: &str
12545    /// ) -> Result<()> {
12546    ///     let response = client.get_model_evaluation_slice()
12547    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/models/{model_id}/evaluations/{evaluation_id}/slices/{slice_id}"))
12548    ///         .send().await?;
12549    ///     println!("response {:?}", response);
12550    ///     Ok(())
12551    /// }
12552    /// ```
12553    pub fn get_model_evaluation_slice(
12554        &self,
12555    ) -> super::builder::model_service::GetModelEvaluationSlice {
12556        super::builder::model_service::GetModelEvaluationSlice::new(self.inner.clone())
12557    }
12558
12559    /// Lists ModelEvaluationSlices in a ModelEvaluation.
12560    ///
12561    /// # Example
12562    /// ```
12563    /// # use google_cloud_aiplatform_v1::client::ModelService;
12564    /// use google_cloud_gax::paginator::ItemPaginator as _;
12565    /// use google_cloud_aiplatform_v1::Result;
12566    /// async fn sample(
12567    ///    client: &ModelService, project_id: &str, location_id: &str, model_id: &str, evaluation_id: &str
12568    /// ) -> Result<()> {
12569    ///     let mut list = client.list_model_evaluation_slices()
12570    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/models/{model_id}/evaluations/{evaluation_id}"))
12571    ///         .by_item();
12572    ///     while let Some(item) = list.next().await.transpose()? {
12573    ///         println!("{:?}", item);
12574    ///     }
12575    ///     Ok(())
12576    /// }
12577    /// ```
12578    pub fn list_model_evaluation_slices(
12579        &self,
12580    ) -> super::builder::model_service::ListModelEvaluationSlices {
12581        super::builder::model_service::ListModelEvaluationSlices::new(self.inner.clone())
12582    }
12583
12584    /// Lists information about the supported locations for this service.
12585    ///
12586    /// # Example
12587    /// ```
12588    /// # use google_cloud_aiplatform_v1::client::ModelService;
12589    /// use google_cloud_gax::paginator::ItemPaginator as _;
12590    /// use google_cloud_aiplatform_v1::Result;
12591    /// async fn sample(
12592    ///    client: &ModelService
12593    /// ) -> Result<()> {
12594    ///     let mut list = client.list_locations()
12595    ///         /* set fields */
12596    ///         .by_item();
12597    ///     while let Some(item) = list.next().await.transpose()? {
12598    ///         println!("{:?}", item);
12599    ///     }
12600    ///     Ok(())
12601    /// }
12602    /// ```
12603    pub fn list_locations(&self) -> super::builder::model_service::ListLocations {
12604        super::builder::model_service::ListLocations::new(self.inner.clone())
12605    }
12606
12607    /// Gets information about a location.
12608    ///
12609    /// # Example
12610    /// ```
12611    /// # use google_cloud_aiplatform_v1::client::ModelService;
12612    /// use google_cloud_aiplatform_v1::Result;
12613    /// async fn sample(
12614    ///    client: &ModelService
12615    /// ) -> Result<()> {
12616    ///     let response = client.get_location()
12617    ///         /* set fields */
12618    ///         .send().await?;
12619    ///     println!("response {:?}", response);
12620    ///     Ok(())
12621    /// }
12622    /// ```
12623    pub fn get_location(&self) -> super::builder::model_service::GetLocation {
12624        super::builder::model_service::GetLocation::new(self.inner.clone())
12625    }
12626
12627    /// Sets the access control policy on the specified resource. Replaces
12628    /// any existing policy.
12629    ///
12630    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
12631    /// errors.
12632    ///
12633    /// # Example
12634    /// ```
12635    /// # use google_cloud_aiplatform_v1::client::ModelService;
12636    /// use google_cloud_aiplatform_v1::Result;
12637    /// async fn sample(
12638    ///    client: &ModelService
12639    /// ) -> Result<()> {
12640    ///     let response = client.set_iam_policy()
12641    ///         /* set fields */
12642    ///         .send().await?;
12643    ///     println!("response {:?}", response);
12644    ///     Ok(())
12645    /// }
12646    /// ```
12647    pub fn set_iam_policy(&self) -> super::builder::model_service::SetIamPolicy {
12648        super::builder::model_service::SetIamPolicy::new(self.inner.clone())
12649    }
12650
12651    /// Gets the access control policy for a resource. Returns an empty policy
12652    /// if the resource exists and does not have a policy set.
12653    ///
12654    /// # Example
12655    /// ```
12656    /// # use google_cloud_aiplatform_v1::client::ModelService;
12657    /// use google_cloud_aiplatform_v1::Result;
12658    /// async fn sample(
12659    ///    client: &ModelService
12660    /// ) -> Result<()> {
12661    ///     let response = client.get_iam_policy()
12662    ///         /* set fields */
12663    ///         .send().await?;
12664    ///     println!("response {:?}", response);
12665    ///     Ok(())
12666    /// }
12667    /// ```
12668    pub fn get_iam_policy(&self) -> super::builder::model_service::GetIamPolicy {
12669        super::builder::model_service::GetIamPolicy::new(self.inner.clone())
12670    }
12671
12672    /// Returns permissions that a caller has on the specified resource. If the
12673    /// resource does not exist, this will return an empty set of
12674    /// permissions, not a `NOT_FOUND` error.
12675    ///
12676    /// Note: This operation is designed to be used for building
12677    /// permission-aware UIs and command-line tools, not for authorization
12678    /// checking. This operation may "fail open" without warning.
12679    ///
12680    /// # Example
12681    /// ```
12682    /// # use google_cloud_aiplatform_v1::client::ModelService;
12683    /// use google_cloud_aiplatform_v1::Result;
12684    /// async fn sample(
12685    ///    client: &ModelService
12686    /// ) -> Result<()> {
12687    ///     let response = client.test_iam_permissions()
12688    ///         /* set fields */
12689    ///         .send().await?;
12690    ///     println!("response {:?}", response);
12691    ///     Ok(())
12692    /// }
12693    /// ```
12694    pub fn test_iam_permissions(&self) -> super::builder::model_service::TestIamPermissions {
12695        super::builder::model_service::TestIamPermissions::new(self.inner.clone())
12696    }
12697
12698    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
12699    ///
12700    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
12701    ///
12702    /// # Example
12703    /// ```
12704    /// # use google_cloud_aiplatform_v1::client::ModelService;
12705    /// use google_cloud_gax::paginator::ItemPaginator as _;
12706    /// use google_cloud_aiplatform_v1::Result;
12707    /// async fn sample(
12708    ///    client: &ModelService
12709    /// ) -> Result<()> {
12710    ///     let mut list = client.list_operations()
12711    ///         /* set fields */
12712    ///         .by_item();
12713    ///     while let Some(item) = list.next().await.transpose()? {
12714    ///         println!("{:?}", item);
12715    ///     }
12716    ///     Ok(())
12717    /// }
12718    /// ```
12719    pub fn list_operations(&self) -> super::builder::model_service::ListOperations {
12720        super::builder::model_service::ListOperations::new(self.inner.clone())
12721    }
12722
12723    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
12724    ///
12725    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
12726    ///
12727    /// # Example
12728    /// ```
12729    /// # use google_cloud_aiplatform_v1::client::ModelService;
12730    /// use google_cloud_aiplatform_v1::Result;
12731    /// async fn sample(
12732    ///    client: &ModelService
12733    /// ) -> Result<()> {
12734    ///     let response = client.get_operation()
12735    ///         /* set fields */
12736    ///         .send().await?;
12737    ///     println!("response {:?}", response);
12738    ///     Ok(())
12739    /// }
12740    /// ```
12741    pub fn get_operation(&self) -> super::builder::model_service::GetOperation {
12742        super::builder::model_service::GetOperation::new(self.inner.clone())
12743    }
12744
12745    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
12746    ///
12747    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
12748    ///
12749    /// # Example
12750    /// ```
12751    /// # use google_cloud_aiplatform_v1::client::ModelService;
12752    /// use google_cloud_aiplatform_v1::Result;
12753    /// async fn sample(
12754    ///    client: &ModelService
12755    /// ) -> Result<()> {
12756    ///     client.delete_operation()
12757    ///         /* set fields */
12758    ///         .send().await?;
12759    ///     Ok(())
12760    /// }
12761    /// ```
12762    pub fn delete_operation(&self) -> super::builder::model_service::DeleteOperation {
12763        super::builder::model_service::DeleteOperation::new(self.inner.clone())
12764    }
12765
12766    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
12767    ///
12768    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
12769    ///
12770    /// # Example
12771    /// ```
12772    /// # use google_cloud_aiplatform_v1::client::ModelService;
12773    /// use google_cloud_aiplatform_v1::Result;
12774    /// async fn sample(
12775    ///    client: &ModelService
12776    /// ) -> Result<()> {
12777    ///     client.cancel_operation()
12778    ///         /* set fields */
12779    ///         .send().await?;
12780    ///     Ok(())
12781    /// }
12782    /// ```
12783    pub fn cancel_operation(&self) -> super::builder::model_service::CancelOperation {
12784        super::builder::model_service::CancelOperation::new(self.inner.clone())
12785    }
12786
12787    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
12788    ///
12789    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
12790    ///
12791    /// # Example
12792    /// ```
12793    /// # use google_cloud_aiplatform_v1::client::ModelService;
12794    /// use google_cloud_aiplatform_v1::Result;
12795    /// async fn sample(
12796    ///    client: &ModelService
12797    /// ) -> Result<()> {
12798    ///     let response = client.wait_operation()
12799    ///         /* set fields */
12800    ///         .send().await?;
12801    ///     println!("response {:?}", response);
12802    ///     Ok(())
12803    /// }
12804    /// ```
12805    pub fn wait_operation(&self) -> super::builder::model_service::WaitOperation {
12806        super::builder::model_service::WaitOperation::new(self.inner.clone())
12807    }
12808}
12809
12810/// Implements a client for the Vertex AI API.
12811///
12812/// # Example
12813/// ```
12814/// # use google_cloud_aiplatform_v1::client::NotebookService;
12815/// use google_cloud_gax::paginator::ItemPaginator as _;
12816/// async fn sample(
12817///    parent: &str,
12818/// ) -> anyhow::Result<()> {
12819///     let client = NotebookService::builder().build().await?;
12820///     let mut list = client.list_notebook_runtime_templates()
12821///         .set_parent(parent)
12822///         .by_item();
12823///     while let Some(item) = list.next().await.transpose()? {
12824///         println!("{:?}", item);
12825///     }
12826///     Ok(())
12827/// }
12828/// ```
12829///
12830/// # Service Description
12831///
12832/// The interface for Vertex Notebook service (a.k.a. Colab on Workbench).
12833///
12834/// # Configuration
12835///
12836/// To configure `NotebookService` use the `with_*` methods in the type returned
12837/// by [builder()][NotebookService::builder]. The default configuration should
12838/// work for most applications. Common configuration changes include
12839///
12840/// * [with_endpoint()]: by default this client uses the global default endpoint
12841///   (`https://aiplatform.googleapis.com`). Applications using regional
12842///   endpoints or running in restricted networks (e.g. a network configured
12843///   with [Private Google Access with VPC Service Controls]) may want to
12844///   override this default.
12845/// * [with_credentials()]: by default this client uses
12846///   [Application Default Credentials]. Applications using custom
12847///   authentication may need to override this default.
12848///
12849/// [with_endpoint()]: super::builder::notebook_service::ClientBuilder::with_endpoint
12850/// [with_credentials()]: super::builder::notebook_service::ClientBuilder::with_credentials
12851/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12852/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12853///
12854/// # Pooling and Cloning
12855///
12856/// `NotebookService` holds a connection pool internally, it is advised to
12857/// create one and reuse it. You do not need to wrap `NotebookService` in
12858/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12859/// already uses an `Arc` internally.
12860#[cfg(feature = "notebook-service")]
12861#[cfg_attr(docsrs, doc(cfg(feature = "notebook-service")))]
12862#[derive(Clone, Debug)]
12863pub struct NotebookService {
12864    inner: std::sync::Arc<dyn super::stub::dynamic::NotebookService>,
12865}
12866
12867#[cfg(feature = "notebook-service")]
12868impl NotebookService {
12869    /// Returns a builder for [NotebookService].
12870    ///
12871    /// ```
12872    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12873    /// # use google_cloud_aiplatform_v1::client::NotebookService;
12874    /// let client = NotebookService::builder().build().await?;
12875    /// # Ok(()) }
12876    /// ```
12877    pub fn builder() -> super::builder::notebook_service::ClientBuilder {
12878        crate::new_client_builder(super::builder::notebook_service::client::Factory)
12879    }
12880
12881    /// Creates a new client from the provided stub.
12882    ///
12883    /// The most common case for calling this function is in tests mocking the
12884    /// client's behavior.
12885    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12886    where
12887        T: super::stub::NotebookService + 'static,
12888    {
12889        Self { inner: stub.into() }
12890    }
12891
12892    pub(crate) async fn new(
12893        config: gaxi::options::ClientConfig,
12894    ) -> crate::ClientBuilderResult<Self> {
12895        let inner = Self::build_inner(config).await?;
12896        Ok(Self { inner })
12897    }
12898
12899    async fn build_inner(
12900        conf: gaxi::options::ClientConfig,
12901    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NotebookService>> {
12902        if gaxi::options::tracing_enabled(&conf) {
12903            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12904        }
12905        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12906    }
12907
12908    async fn build_transport(
12909        conf: gaxi::options::ClientConfig,
12910    ) -> crate::ClientBuilderResult<impl super::stub::NotebookService> {
12911        super::transport::NotebookService::new(conf).await
12912    }
12913
12914    async fn build_with_tracing(
12915        conf: gaxi::options::ClientConfig,
12916    ) -> crate::ClientBuilderResult<impl super::stub::NotebookService> {
12917        Self::build_transport(conf)
12918            .await
12919            .map(super::tracing::NotebookService::new)
12920    }
12921
12922    /// Creates a NotebookRuntimeTemplate.
12923    ///
12924    /// # Long running operations
12925    ///
12926    /// This method is used to start, and/or poll a [long-running Operation].
12927    /// The [Working with long-running operations] chapter in the [user guide]
12928    /// covers these operations in detail.
12929    ///
12930    /// [long-running operation]: https://google.aip.dev/151
12931    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
12932    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
12933    ///
12934    /// # Example
12935    /// ```
12936    /// # use google_cloud_aiplatform_v1::client::NotebookService;
12937    /// use google_cloud_lro::Poller;
12938    /// use google_cloud_aiplatform_v1::model::NotebookRuntimeTemplate;
12939    /// use google_cloud_aiplatform_v1::Result;
12940    /// async fn sample(
12941    ///    client: &NotebookService, parent: &str
12942    /// ) -> Result<()> {
12943    ///     let response = client.create_notebook_runtime_template()
12944    ///         .set_parent(parent)
12945    ///         .set_notebook_runtime_template(
12946    ///             NotebookRuntimeTemplate::new()/* set fields */
12947    ///         )
12948    ///         .poller().until_done().await?;
12949    ///     println!("response {:?}", response);
12950    ///     Ok(())
12951    /// }
12952    /// ```
12953    pub fn create_notebook_runtime_template(
12954        &self,
12955    ) -> super::builder::notebook_service::CreateNotebookRuntimeTemplate {
12956        super::builder::notebook_service::CreateNotebookRuntimeTemplate::new(self.inner.clone())
12957    }
12958
12959    /// Gets a NotebookRuntimeTemplate.
12960    ///
12961    /// # Example
12962    /// ```
12963    /// # use google_cloud_aiplatform_v1::client::NotebookService;
12964    /// use google_cloud_aiplatform_v1::Result;
12965    /// async fn sample(
12966    ///    client: &NotebookService, project_id: &str, location_id: &str, notebook_runtime_template_id: &str
12967    /// ) -> Result<()> {
12968    ///     let response = client.get_notebook_runtime_template()
12969    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/notebookRuntimeTemplates/{notebook_runtime_template_id}"))
12970    ///         .send().await?;
12971    ///     println!("response {:?}", response);
12972    ///     Ok(())
12973    /// }
12974    /// ```
12975    pub fn get_notebook_runtime_template(
12976        &self,
12977    ) -> super::builder::notebook_service::GetNotebookRuntimeTemplate {
12978        super::builder::notebook_service::GetNotebookRuntimeTemplate::new(self.inner.clone())
12979    }
12980
12981    /// Lists NotebookRuntimeTemplates in a Location.
12982    ///
12983    /// # Example
12984    /// ```
12985    /// # use google_cloud_aiplatform_v1::client::NotebookService;
12986    /// use google_cloud_gax::paginator::ItemPaginator as _;
12987    /// use google_cloud_aiplatform_v1::Result;
12988    /// async fn sample(
12989    ///    client: &NotebookService, parent: &str
12990    /// ) -> Result<()> {
12991    ///     let mut list = client.list_notebook_runtime_templates()
12992    ///         .set_parent(parent)
12993    ///         .by_item();
12994    ///     while let Some(item) = list.next().await.transpose()? {
12995    ///         println!("{:?}", item);
12996    ///     }
12997    ///     Ok(())
12998    /// }
12999    /// ```
13000    pub fn list_notebook_runtime_templates(
13001        &self,
13002    ) -> super::builder::notebook_service::ListNotebookRuntimeTemplates {
13003        super::builder::notebook_service::ListNotebookRuntimeTemplates::new(self.inner.clone())
13004    }
13005
13006    /// Deletes a NotebookRuntimeTemplate.
13007    ///
13008    /// # Long running operations
13009    ///
13010    /// This method is used to start, and/or poll a [long-running Operation].
13011    /// The [Working with long-running operations] chapter in the [user guide]
13012    /// covers these operations in detail.
13013    ///
13014    /// [long-running operation]: https://google.aip.dev/151
13015    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
13016    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
13017    ///
13018    /// # Example
13019    /// ```
13020    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13021    /// use google_cloud_lro::Poller;
13022    /// use google_cloud_aiplatform_v1::Result;
13023    /// async fn sample(
13024    ///    client: &NotebookService, project_id: &str, location_id: &str, notebook_runtime_template_id: &str
13025    /// ) -> Result<()> {
13026    ///     client.delete_notebook_runtime_template()
13027    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/notebookRuntimeTemplates/{notebook_runtime_template_id}"))
13028    ///         .poller().until_done().await?;
13029    ///     Ok(())
13030    /// }
13031    /// ```
13032    pub fn delete_notebook_runtime_template(
13033        &self,
13034    ) -> super::builder::notebook_service::DeleteNotebookRuntimeTemplate {
13035        super::builder::notebook_service::DeleteNotebookRuntimeTemplate::new(self.inner.clone())
13036    }
13037
13038    /// Updates a NotebookRuntimeTemplate.
13039    ///
13040    /// # Example
13041    /// ```
13042    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13043    /// # extern crate wkt as google_cloud_wkt;
13044    /// use google_cloud_wkt::FieldMask;
13045    /// use google_cloud_aiplatform_v1::model::NotebookRuntimeTemplate;
13046    /// use google_cloud_aiplatform_v1::Result;
13047    /// async fn sample(
13048    ///    client: &NotebookService, project_id: &str, location_id: &str, notebook_runtime_template_id: &str
13049    /// ) -> Result<()> {
13050    ///     let response = client.update_notebook_runtime_template()
13051    ///         .set_notebook_runtime_template(
13052    ///             NotebookRuntimeTemplate::new().set_name(format!("projects/{project_id}/locations/{location_id}/notebookRuntimeTemplates/{notebook_runtime_template_id}"))/* set fields */
13053    ///         )
13054    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
13055    ///         .send().await?;
13056    ///     println!("response {:?}", response);
13057    ///     Ok(())
13058    /// }
13059    /// ```
13060    pub fn update_notebook_runtime_template(
13061        &self,
13062    ) -> super::builder::notebook_service::UpdateNotebookRuntimeTemplate {
13063        super::builder::notebook_service::UpdateNotebookRuntimeTemplate::new(self.inner.clone())
13064    }
13065
13066    /// Assigns a NotebookRuntime to a user for a particular Notebook file. This
13067    /// method will either returns an existing assignment or generates a new one.
13068    ///
13069    /// # Long running operations
13070    ///
13071    /// This method is used to start, and/or poll a [long-running Operation].
13072    /// The [Working with long-running operations] chapter in the [user guide]
13073    /// covers these operations in detail.
13074    ///
13075    /// [long-running operation]: https://google.aip.dev/151
13076    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
13077    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
13078    ///
13079    /// # Example
13080    /// ```
13081    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13082    /// use google_cloud_lro::Poller;
13083    /// use google_cloud_aiplatform_v1::Result;
13084    /// async fn sample(
13085    ///    client: &NotebookService
13086    /// ) -> Result<()> {
13087    ///     let response = client.assign_notebook_runtime()
13088    ///         /* set fields */
13089    ///         .poller().until_done().await?;
13090    ///     println!("response {:?}", response);
13091    ///     Ok(())
13092    /// }
13093    /// ```
13094    pub fn assign_notebook_runtime(
13095        &self,
13096    ) -> super::builder::notebook_service::AssignNotebookRuntime {
13097        super::builder::notebook_service::AssignNotebookRuntime::new(self.inner.clone())
13098    }
13099
13100    /// Gets a NotebookRuntime.
13101    ///
13102    /// # Example
13103    /// ```
13104    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13105    /// use google_cloud_aiplatform_v1::Result;
13106    /// async fn sample(
13107    ///    client: &NotebookService, project_id: &str, location_id: &str, notebook_runtime_id: &str
13108    /// ) -> Result<()> {
13109    ///     let response = client.get_notebook_runtime()
13110    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/notebookRuntimes/{notebook_runtime_id}"))
13111    ///         .send().await?;
13112    ///     println!("response {:?}", response);
13113    ///     Ok(())
13114    /// }
13115    /// ```
13116    pub fn get_notebook_runtime(&self) -> super::builder::notebook_service::GetNotebookRuntime {
13117        super::builder::notebook_service::GetNotebookRuntime::new(self.inner.clone())
13118    }
13119
13120    /// Lists NotebookRuntimes in a Location.
13121    ///
13122    /// # Example
13123    /// ```
13124    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13125    /// use google_cloud_gax::paginator::ItemPaginator as _;
13126    /// use google_cloud_aiplatform_v1::Result;
13127    /// async fn sample(
13128    ///    client: &NotebookService, parent: &str
13129    /// ) -> Result<()> {
13130    ///     let mut list = client.list_notebook_runtimes()
13131    ///         .set_parent(parent)
13132    ///         .by_item();
13133    ///     while let Some(item) = list.next().await.transpose()? {
13134    ///         println!("{:?}", item);
13135    ///     }
13136    ///     Ok(())
13137    /// }
13138    /// ```
13139    pub fn list_notebook_runtimes(&self) -> super::builder::notebook_service::ListNotebookRuntimes {
13140        super::builder::notebook_service::ListNotebookRuntimes::new(self.inner.clone())
13141    }
13142
13143    /// Deletes a NotebookRuntime.
13144    ///
13145    /// # Long running operations
13146    ///
13147    /// This method is used to start, and/or poll a [long-running Operation].
13148    /// The [Working with long-running operations] chapter in the [user guide]
13149    /// covers these operations in detail.
13150    ///
13151    /// [long-running operation]: https://google.aip.dev/151
13152    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
13153    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
13154    ///
13155    /// # Example
13156    /// ```
13157    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13158    /// use google_cloud_lro::Poller;
13159    /// use google_cloud_aiplatform_v1::Result;
13160    /// async fn sample(
13161    ///    client: &NotebookService, project_id: &str, location_id: &str, notebook_runtime_id: &str
13162    /// ) -> Result<()> {
13163    ///     client.delete_notebook_runtime()
13164    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/notebookRuntimes/{notebook_runtime_id}"))
13165    ///         .poller().until_done().await?;
13166    ///     Ok(())
13167    /// }
13168    /// ```
13169    pub fn delete_notebook_runtime(
13170        &self,
13171    ) -> super::builder::notebook_service::DeleteNotebookRuntime {
13172        super::builder::notebook_service::DeleteNotebookRuntime::new(self.inner.clone())
13173    }
13174
13175    /// Upgrades a NotebookRuntime.
13176    ///
13177    /// # Long running operations
13178    ///
13179    /// This method is used to start, and/or poll a [long-running Operation].
13180    /// The [Working with long-running operations] chapter in the [user guide]
13181    /// covers these operations in detail.
13182    ///
13183    /// [long-running operation]: https://google.aip.dev/151
13184    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
13185    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
13186    ///
13187    /// # Example
13188    /// ```
13189    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13190    /// use google_cloud_lro::Poller;
13191    /// use google_cloud_aiplatform_v1::Result;
13192    /// async fn sample(
13193    ///    client: &NotebookService
13194    /// ) -> Result<()> {
13195    ///     let response = client.upgrade_notebook_runtime()
13196    ///         /* set fields */
13197    ///         .poller().until_done().await?;
13198    ///     println!("response {:?}", response);
13199    ///     Ok(())
13200    /// }
13201    /// ```
13202    pub fn upgrade_notebook_runtime(
13203        &self,
13204    ) -> super::builder::notebook_service::UpgradeNotebookRuntime {
13205        super::builder::notebook_service::UpgradeNotebookRuntime::new(self.inner.clone())
13206    }
13207
13208    /// Starts a NotebookRuntime.
13209    ///
13210    /// # Long running operations
13211    ///
13212    /// This method is used to start, and/or poll a [long-running Operation].
13213    /// The [Working with long-running operations] chapter in the [user guide]
13214    /// covers these operations in detail.
13215    ///
13216    /// [long-running operation]: https://google.aip.dev/151
13217    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
13218    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
13219    ///
13220    /// # Example
13221    /// ```
13222    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13223    /// use google_cloud_lro::Poller;
13224    /// use google_cloud_aiplatform_v1::Result;
13225    /// async fn sample(
13226    ///    client: &NotebookService
13227    /// ) -> Result<()> {
13228    ///     let response = client.start_notebook_runtime()
13229    ///         /* set fields */
13230    ///         .poller().until_done().await?;
13231    ///     println!("response {:?}", response);
13232    ///     Ok(())
13233    /// }
13234    /// ```
13235    pub fn start_notebook_runtime(&self) -> super::builder::notebook_service::StartNotebookRuntime {
13236        super::builder::notebook_service::StartNotebookRuntime::new(self.inner.clone())
13237    }
13238
13239    /// Stops a NotebookRuntime.
13240    ///
13241    /// # Long running operations
13242    ///
13243    /// This method is used to start, and/or poll a [long-running Operation].
13244    /// The [Working with long-running operations] chapter in the [user guide]
13245    /// covers these operations in detail.
13246    ///
13247    /// [long-running operation]: https://google.aip.dev/151
13248    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
13249    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
13250    ///
13251    /// # Example
13252    /// ```
13253    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13254    /// use google_cloud_lro::Poller;
13255    /// use google_cloud_aiplatform_v1::Result;
13256    /// async fn sample(
13257    ///    client: &NotebookService
13258    /// ) -> Result<()> {
13259    ///     let response = client.stop_notebook_runtime()
13260    ///         /* set fields */
13261    ///         .poller().until_done().await?;
13262    ///     println!("response {:?}", response);
13263    ///     Ok(())
13264    /// }
13265    /// ```
13266    pub fn stop_notebook_runtime(&self) -> super::builder::notebook_service::StopNotebookRuntime {
13267        super::builder::notebook_service::StopNotebookRuntime::new(self.inner.clone())
13268    }
13269
13270    /// Creates a NotebookExecutionJob.
13271    ///
13272    /// # Long running operations
13273    ///
13274    /// This method is used to start, and/or poll a [long-running Operation].
13275    /// The [Working with long-running operations] chapter in the [user guide]
13276    /// covers these operations in detail.
13277    ///
13278    /// [long-running operation]: https://google.aip.dev/151
13279    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
13280    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
13281    ///
13282    /// # Example
13283    /// ```
13284    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13285    /// use google_cloud_lro::Poller;
13286    /// use google_cloud_aiplatform_v1::model::NotebookExecutionJob;
13287    /// use google_cloud_aiplatform_v1::Result;
13288    /// async fn sample(
13289    ///    client: &NotebookService, parent: &str
13290    /// ) -> Result<()> {
13291    ///     let response = client.create_notebook_execution_job()
13292    ///         .set_parent(parent)
13293    ///         .set_notebook_execution_job(
13294    ///             NotebookExecutionJob::new()/* set fields */
13295    ///         )
13296    ///         .poller().until_done().await?;
13297    ///     println!("response {:?}", response);
13298    ///     Ok(())
13299    /// }
13300    /// ```
13301    pub fn create_notebook_execution_job(
13302        &self,
13303    ) -> super::builder::notebook_service::CreateNotebookExecutionJob {
13304        super::builder::notebook_service::CreateNotebookExecutionJob::new(self.inner.clone())
13305    }
13306
13307    /// Gets a NotebookExecutionJob.
13308    ///
13309    /// # Example
13310    /// ```
13311    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13312    /// use google_cloud_aiplatform_v1::Result;
13313    /// async fn sample(
13314    ///    client: &NotebookService, project_id: &str, location_id: &str, notebook_execution_job_id: &str
13315    /// ) -> Result<()> {
13316    ///     let response = client.get_notebook_execution_job()
13317    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/notebookExecutionJobs/{notebook_execution_job_id}"))
13318    ///         .send().await?;
13319    ///     println!("response {:?}", response);
13320    ///     Ok(())
13321    /// }
13322    /// ```
13323    pub fn get_notebook_execution_job(
13324        &self,
13325    ) -> super::builder::notebook_service::GetNotebookExecutionJob {
13326        super::builder::notebook_service::GetNotebookExecutionJob::new(self.inner.clone())
13327    }
13328
13329    /// Lists NotebookExecutionJobs in a Location.
13330    ///
13331    /// # Example
13332    /// ```
13333    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13334    /// use google_cloud_gax::paginator::ItemPaginator as _;
13335    /// use google_cloud_aiplatform_v1::Result;
13336    /// async fn sample(
13337    ///    client: &NotebookService, parent: &str
13338    /// ) -> Result<()> {
13339    ///     let mut list = client.list_notebook_execution_jobs()
13340    ///         .set_parent(parent)
13341    ///         .by_item();
13342    ///     while let Some(item) = list.next().await.transpose()? {
13343    ///         println!("{:?}", item);
13344    ///     }
13345    ///     Ok(())
13346    /// }
13347    /// ```
13348    pub fn list_notebook_execution_jobs(
13349        &self,
13350    ) -> super::builder::notebook_service::ListNotebookExecutionJobs {
13351        super::builder::notebook_service::ListNotebookExecutionJobs::new(self.inner.clone())
13352    }
13353
13354    /// Deletes a NotebookExecutionJob.
13355    ///
13356    /// # Long running operations
13357    ///
13358    /// This method is used to start, and/or poll a [long-running Operation].
13359    /// The [Working with long-running operations] chapter in the [user guide]
13360    /// covers these operations in detail.
13361    ///
13362    /// [long-running operation]: https://google.aip.dev/151
13363    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
13364    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
13365    ///
13366    /// # Example
13367    /// ```
13368    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13369    /// use google_cloud_lro::Poller;
13370    /// use google_cloud_aiplatform_v1::Result;
13371    /// async fn sample(
13372    ///    client: &NotebookService, project_id: &str, location_id: &str, notebook_execution_job_id: &str
13373    /// ) -> Result<()> {
13374    ///     client.delete_notebook_execution_job()
13375    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/notebookExecutionJobs/{notebook_execution_job_id}"))
13376    ///         .poller().until_done().await?;
13377    ///     Ok(())
13378    /// }
13379    /// ```
13380    pub fn delete_notebook_execution_job(
13381        &self,
13382    ) -> super::builder::notebook_service::DeleteNotebookExecutionJob {
13383        super::builder::notebook_service::DeleteNotebookExecutionJob::new(self.inner.clone())
13384    }
13385
13386    /// Lists information about the supported locations for this service.
13387    ///
13388    /// # Example
13389    /// ```
13390    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13391    /// use google_cloud_gax::paginator::ItemPaginator as _;
13392    /// use google_cloud_aiplatform_v1::Result;
13393    /// async fn sample(
13394    ///    client: &NotebookService
13395    /// ) -> Result<()> {
13396    ///     let mut list = client.list_locations()
13397    ///         /* set fields */
13398    ///         .by_item();
13399    ///     while let Some(item) = list.next().await.transpose()? {
13400    ///         println!("{:?}", item);
13401    ///     }
13402    ///     Ok(())
13403    /// }
13404    /// ```
13405    pub fn list_locations(&self) -> super::builder::notebook_service::ListLocations {
13406        super::builder::notebook_service::ListLocations::new(self.inner.clone())
13407    }
13408
13409    /// Gets information about a location.
13410    ///
13411    /// # Example
13412    /// ```
13413    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13414    /// use google_cloud_aiplatform_v1::Result;
13415    /// async fn sample(
13416    ///    client: &NotebookService
13417    /// ) -> Result<()> {
13418    ///     let response = client.get_location()
13419    ///         /* set fields */
13420    ///         .send().await?;
13421    ///     println!("response {:?}", response);
13422    ///     Ok(())
13423    /// }
13424    /// ```
13425    pub fn get_location(&self) -> super::builder::notebook_service::GetLocation {
13426        super::builder::notebook_service::GetLocation::new(self.inner.clone())
13427    }
13428
13429    /// Sets the access control policy on the specified resource. Replaces
13430    /// any existing policy.
13431    ///
13432    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
13433    /// errors.
13434    ///
13435    /// # Example
13436    /// ```
13437    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13438    /// use google_cloud_aiplatform_v1::Result;
13439    /// async fn sample(
13440    ///    client: &NotebookService
13441    /// ) -> Result<()> {
13442    ///     let response = client.set_iam_policy()
13443    ///         /* set fields */
13444    ///         .send().await?;
13445    ///     println!("response {:?}", response);
13446    ///     Ok(())
13447    /// }
13448    /// ```
13449    pub fn set_iam_policy(&self) -> super::builder::notebook_service::SetIamPolicy {
13450        super::builder::notebook_service::SetIamPolicy::new(self.inner.clone())
13451    }
13452
13453    /// Gets the access control policy for a resource. Returns an empty policy
13454    /// if the resource exists and does not have a policy set.
13455    ///
13456    /// # Example
13457    /// ```
13458    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13459    /// use google_cloud_aiplatform_v1::Result;
13460    /// async fn sample(
13461    ///    client: &NotebookService
13462    /// ) -> Result<()> {
13463    ///     let response = client.get_iam_policy()
13464    ///         /* set fields */
13465    ///         .send().await?;
13466    ///     println!("response {:?}", response);
13467    ///     Ok(())
13468    /// }
13469    /// ```
13470    pub fn get_iam_policy(&self) -> super::builder::notebook_service::GetIamPolicy {
13471        super::builder::notebook_service::GetIamPolicy::new(self.inner.clone())
13472    }
13473
13474    /// Returns permissions that a caller has on the specified resource. If the
13475    /// resource does not exist, this will return an empty set of
13476    /// permissions, not a `NOT_FOUND` error.
13477    ///
13478    /// Note: This operation is designed to be used for building
13479    /// permission-aware UIs and command-line tools, not for authorization
13480    /// checking. This operation may "fail open" without warning.
13481    ///
13482    /// # Example
13483    /// ```
13484    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13485    /// use google_cloud_aiplatform_v1::Result;
13486    /// async fn sample(
13487    ///    client: &NotebookService
13488    /// ) -> Result<()> {
13489    ///     let response = client.test_iam_permissions()
13490    ///         /* set fields */
13491    ///         .send().await?;
13492    ///     println!("response {:?}", response);
13493    ///     Ok(())
13494    /// }
13495    /// ```
13496    pub fn test_iam_permissions(&self) -> super::builder::notebook_service::TestIamPermissions {
13497        super::builder::notebook_service::TestIamPermissions::new(self.inner.clone())
13498    }
13499
13500    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
13501    ///
13502    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
13503    ///
13504    /// # Example
13505    /// ```
13506    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13507    /// use google_cloud_gax::paginator::ItemPaginator as _;
13508    /// use google_cloud_aiplatform_v1::Result;
13509    /// async fn sample(
13510    ///    client: &NotebookService
13511    /// ) -> Result<()> {
13512    ///     let mut list = client.list_operations()
13513    ///         /* set fields */
13514    ///         .by_item();
13515    ///     while let Some(item) = list.next().await.transpose()? {
13516    ///         println!("{:?}", item);
13517    ///     }
13518    ///     Ok(())
13519    /// }
13520    /// ```
13521    pub fn list_operations(&self) -> super::builder::notebook_service::ListOperations {
13522        super::builder::notebook_service::ListOperations::new(self.inner.clone())
13523    }
13524
13525    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
13526    ///
13527    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
13528    ///
13529    /// # Example
13530    /// ```
13531    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13532    /// use google_cloud_aiplatform_v1::Result;
13533    /// async fn sample(
13534    ///    client: &NotebookService
13535    /// ) -> Result<()> {
13536    ///     let response = client.get_operation()
13537    ///         /* set fields */
13538    ///         .send().await?;
13539    ///     println!("response {:?}", response);
13540    ///     Ok(())
13541    /// }
13542    /// ```
13543    pub fn get_operation(&self) -> super::builder::notebook_service::GetOperation {
13544        super::builder::notebook_service::GetOperation::new(self.inner.clone())
13545    }
13546
13547    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
13548    ///
13549    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
13550    ///
13551    /// # Example
13552    /// ```
13553    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13554    /// use google_cloud_aiplatform_v1::Result;
13555    /// async fn sample(
13556    ///    client: &NotebookService
13557    /// ) -> Result<()> {
13558    ///     client.delete_operation()
13559    ///         /* set fields */
13560    ///         .send().await?;
13561    ///     Ok(())
13562    /// }
13563    /// ```
13564    pub fn delete_operation(&self) -> super::builder::notebook_service::DeleteOperation {
13565        super::builder::notebook_service::DeleteOperation::new(self.inner.clone())
13566    }
13567
13568    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
13569    ///
13570    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
13571    ///
13572    /// # Example
13573    /// ```
13574    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13575    /// use google_cloud_aiplatform_v1::Result;
13576    /// async fn sample(
13577    ///    client: &NotebookService
13578    /// ) -> Result<()> {
13579    ///     client.cancel_operation()
13580    ///         /* set fields */
13581    ///         .send().await?;
13582    ///     Ok(())
13583    /// }
13584    /// ```
13585    pub fn cancel_operation(&self) -> super::builder::notebook_service::CancelOperation {
13586        super::builder::notebook_service::CancelOperation::new(self.inner.clone())
13587    }
13588
13589    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
13590    ///
13591    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
13592    ///
13593    /// # Example
13594    /// ```
13595    /// # use google_cloud_aiplatform_v1::client::NotebookService;
13596    /// use google_cloud_aiplatform_v1::Result;
13597    /// async fn sample(
13598    ///    client: &NotebookService
13599    /// ) -> Result<()> {
13600    ///     let response = client.wait_operation()
13601    ///         /* set fields */
13602    ///         .send().await?;
13603    ///     println!("response {:?}", response);
13604    ///     Ok(())
13605    /// }
13606    /// ```
13607    pub fn wait_operation(&self) -> super::builder::notebook_service::WaitOperation {
13608        super::builder::notebook_service::WaitOperation::new(self.inner.clone())
13609    }
13610}
13611
13612/// Implements a client for the Vertex AI API.
13613///
13614/// # Example
13615/// ```
13616/// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
13617/// use google_cloud_gax::paginator::ItemPaginator as _;
13618/// async fn sample(
13619///    parent: &str,
13620/// ) -> anyhow::Result<()> {
13621///     let client = PersistentResourceService::builder().build().await?;
13622///     let mut list = client.list_persistent_resources()
13623///         .set_parent(parent)
13624///         .by_item();
13625///     while let Some(item) = list.next().await.transpose()? {
13626///         println!("{:?}", item);
13627///     }
13628///     Ok(())
13629/// }
13630/// ```
13631///
13632/// # Service Description
13633///
13634/// A service for managing Vertex AI's machine learning PersistentResource.
13635///
13636/// # Configuration
13637///
13638/// To configure `PersistentResourceService` use the `with_*` methods in the type returned
13639/// by [builder()][PersistentResourceService::builder]. The default configuration should
13640/// work for most applications. Common configuration changes include
13641///
13642/// * [with_endpoint()]: by default this client uses the global default endpoint
13643///   (`https://aiplatform.googleapis.com`). Applications using regional
13644///   endpoints or running in restricted networks (e.g. a network configured
13645///   with [Private Google Access with VPC Service Controls]) may want to
13646///   override this default.
13647/// * [with_credentials()]: by default this client uses
13648///   [Application Default Credentials]. Applications using custom
13649///   authentication may need to override this default.
13650///
13651/// [with_endpoint()]: super::builder::persistent_resource_service::ClientBuilder::with_endpoint
13652/// [with_credentials()]: super::builder::persistent_resource_service::ClientBuilder::with_credentials
13653/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13654/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13655///
13656/// # Pooling and Cloning
13657///
13658/// `PersistentResourceService` holds a connection pool internally, it is advised to
13659/// create one and reuse it. You do not need to wrap `PersistentResourceService` in
13660/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13661/// already uses an `Arc` internally.
13662#[cfg(feature = "persistent-resource-service")]
13663#[cfg_attr(docsrs, doc(cfg(feature = "persistent-resource-service")))]
13664#[derive(Clone, Debug)]
13665pub struct PersistentResourceService {
13666    inner: std::sync::Arc<dyn super::stub::dynamic::PersistentResourceService>,
13667}
13668
13669#[cfg(feature = "persistent-resource-service")]
13670impl PersistentResourceService {
13671    /// Returns a builder for [PersistentResourceService].
13672    ///
13673    /// ```
13674    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13675    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
13676    /// let client = PersistentResourceService::builder().build().await?;
13677    /// # Ok(()) }
13678    /// ```
13679    pub fn builder() -> super::builder::persistent_resource_service::ClientBuilder {
13680        crate::new_client_builder(super::builder::persistent_resource_service::client::Factory)
13681    }
13682
13683    /// Creates a new client from the provided stub.
13684    ///
13685    /// The most common case for calling this function is in tests mocking the
13686    /// client's behavior.
13687    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13688    where
13689        T: super::stub::PersistentResourceService + 'static,
13690    {
13691        Self { inner: stub.into() }
13692    }
13693
13694    pub(crate) async fn new(
13695        config: gaxi::options::ClientConfig,
13696    ) -> crate::ClientBuilderResult<Self> {
13697        let inner = Self::build_inner(config).await?;
13698        Ok(Self { inner })
13699    }
13700
13701    async fn build_inner(
13702        conf: gaxi::options::ClientConfig,
13703    ) -> crate::ClientBuilderResult<
13704        std::sync::Arc<dyn super::stub::dynamic::PersistentResourceService>,
13705    > {
13706        if gaxi::options::tracing_enabled(&conf) {
13707            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13708        }
13709        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13710    }
13711
13712    async fn build_transport(
13713        conf: gaxi::options::ClientConfig,
13714    ) -> crate::ClientBuilderResult<impl super::stub::PersistentResourceService> {
13715        super::transport::PersistentResourceService::new(conf).await
13716    }
13717
13718    async fn build_with_tracing(
13719        conf: gaxi::options::ClientConfig,
13720    ) -> crate::ClientBuilderResult<impl super::stub::PersistentResourceService> {
13721        Self::build_transport(conf)
13722            .await
13723            .map(super::tracing::PersistentResourceService::new)
13724    }
13725
13726    /// Creates a PersistentResource.
13727    ///
13728    /// # Long running operations
13729    ///
13730    /// This method is used to start, and/or poll a [long-running Operation].
13731    /// The [Working with long-running operations] chapter in the [user guide]
13732    /// covers these operations in detail.
13733    ///
13734    /// [long-running operation]: https://google.aip.dev/151
13735    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
13736    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
13737    ///
13738    /// # Example
13739    /// ```
13740    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
13741    /// use google_cloud_lro::Poller;
13742    /// use google_cloud_aiplatform_v1::model::PersistentResource;
13743    /// use google_cloud_aiplatform_v1::Result;
13744    /// async fn sample(
13745    ///    client: &PersistentResourceService, parent: &str
13746    /// ) -> Result<()> {
13747    ///     let response = client.create_persistent_resource()
13748    ///         .set_parent(parent)
13749    ///         .set_persistent_resource(
13750    ///             PersistentResource::new()/* set fields */
13751    ///         )
13752    ///         .poller().until_done().await?;
13753    ///     println!("response {:?}", response);
13754    ///     Ok(())
13755    /// }
13756    /// ```
13757    pub fn create_persistent_resource(
13758        &self,
13759    ) -> super::builder::persistent_resource_service::CreatePersistentResource {
13760        super::builder::persistent_resource_service::CreatePersistentResource::new(
13761            self.inner.clone(),
13762        )
13763    }
13764
13765    /// Gets a PersistentResource.
13766    ///
13767    /// # Example
13768    /// ```
13769    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
13770    /// use google_cloud_aiplatform_v1::Result;
13771    /// async fn sample(
13772    ///    client: &PersistentResourceService, project_id: &str, location_id: &str, persistent_resource_id: &str
13773    /// ) -> Result<()> {
13774    ///     let response = client.get_persistent_resource()
13775    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/persistentResources/{persistent_resource_id}"))
13776    ///         .send().await?;
13777    ///     println!("response {:?}", response);
13778    ///     Ok(())
13779    /// }
13780    /// ```
13781    pub fn get_persistent_resource(
13782        &self,
13783    ) -> super::builder::persistent_resource_service::GetPersistentResource {
13784        super::builder::persistent_resource_service::GetPersistentResource::new(self.inner.clone())
13785    }
13786
13787    /// Lists PersistentResources in a Location.
13788    ///
13789    /// # Example
13790    /// ```
13791    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
13792    /// use google_cloud_gax::paginator::ItemPaginator as _;
13793    /// use google_cloud_aiplatform_v1::Result;
13794    /// async fn sample(
13795    ///    client: &PersistentResourceService, parent: &str
13796    /// ) -> Result<()> {
13797    ///     let mut list = client.list_persistent_resources()
13798    ///         .set_parent(parent)
13799    ///         .by_item();
13800    ///     while let Some(item) = list.next().await.transpose()? {
13801    ///         println!("{:?}", item);
13802    ///     }
13803    ///     Ok(())
13804    /// }
13805    /// ```
13806    pub fn list_persistent_resources(
13807        &self,
13808    ) -> super::builder::persistent_resource_service::ListPersistentResources {
13809        super::builder::persistent_resource_service::ListPersistentResources::new(
13810            self.inner.clone(),
13811        )
13812    }
13813
13814    /// Deletes a PersistentResource.
13815    ///
13816    /// # Long running operations
13817    ///
13818    /// This method is used to start, and/or poll a [long-running Operation].
13819    /// The [Working with long-running operations] chapter in the [user guide]
13820    /// covers these operations in detail.
13821    ///
13822    /// [long-running operation]: https://google.aip.dev/151
13823    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
13824    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
13825    ///
13826    /// # Example
13827    /// ```
13828    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
13829    /// use google_cloud_lro::Poller;
13830    /// use google_cloud_aiplatform_v1::Result;
13831    /// async fn sample(
13832    ///    client: &PersistentResourceService, project_id: &str, location_id: &str, persistent_resource_id: &str
13833    /// ) -> Result<()> {
13834    ///     client.delete_persistent_resource()
13835    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/persistentResources/{persistent_resource_id}"))
13836    ///         .poller().until_done().await?;
13837    ///     Ok(())
13838    /// }
13839    /// ```
13840    pub fn delete_persistent_resource(
13841        &self,
13842    ) -> super::builder::persistent_resource_service::DeletePersistentResource {
13843        super::builder::persistent_resource_service::DeletePersistentResource::new(
13844            self.inner.clone(),
13845        )
13846    }
13847
13848    /// Updates a PersistentResource.
13849    ///
13850    /// # Long running operations
13851    ///
13852    /// This method is used to start, and/or poll a [long-running Operation].
13853    /// The [Working with long-running operations] chapter in the [user guide]
13854    /// covers these operations in detail.
13855    ///
13856    /// [long-running operation]: https://google.aip.dev/151
13857    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
13858    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
13859    ///
13860    /// # Example
13861    /// ```
13862    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
13863    /// use google_cloud_lro::Poller;
13864    /// # extern crate wkt as google_cloud_wkt;
13865    /// use google_cloud_wkt::FieldMask;
13866    /// use google_cloud_aiplatform_v1::model::PersistentResource;
13867    /// use google_cloud_aiplatform_v1::Result;
13868    /// async fn sample(
13869    ///    client: &PersistentResourceService, project_id: &str, location_id: &str, persistent_resource_id: &str
13870    /// ) -> Result<()> {
13871    ///     let response = client.update_persistent_resource()
13872    ///         .set_persistent_resource(
13873    ///             PersistentResource::new().set_name(format!("projects/{project_id}/locations/{location_id}/persistentResources/{persistent_resource_id}"))/* set fields */
13874    ///         )
13875    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
13876    ///         .poller().until_done().await?;
13877    ///     println!("response {:?}", response);
13878    ///     Ok(())
13879    /// }
13880    /// ```
13881    pub fn update_persistent_resource(
13882        &self,
13883    ) -> super::builder::persistent_resource_service::UpdatePersistentResource {
13884        super::builder::persistent_resource_service::UpdatePersistentResource::new(
13885            self.inner.clone(),
13886        )
13887    }
13888
13889    /// Reboots a PersistentResource.
13890    ///
13891    /// # Long running operations
13892    ///
13893    /// This method is used to start, and/or poll a [long-running Operation].
13894    /// The [Working with long-running operations] chapter in the [user guide]
13895    /// covers these operations in detail.
13896    ///
13897    /// [long-running operation]: https://google.aip.dev/151
13898    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
13899    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
13900    ///
13901    /// # Example
13902    /// ```
13903    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
13904    /// use google_cloud_lro::Poller;
13905    /// use google_cloud_aiplatform_v1::Result;
13906    /// async fn sample(
13907    ///    client: &PersistentResourceService
13908    /// ) -> Result<()> {
13909    ///     let response = client.reboot_persistent_resource()
13910    ///         /* set fields */
13911    ///         .poller().until_done().await?;
13912    ///     println!("response {:?}", response);
13913    ///     Ok(())
13914    /// }
13915    /// ```
13916    pub fn reboot_persistent_resource(
13917        &self,
13918    ) -> super::builder::persistent_resource_service::RebootPersistentResource {
13919        super::builder::persistent_resource_service::RebootPersistentResource::new(
13920            self.inner.clone(),
13921        )
13922    }
13923
13924    /// Lists information about the supported locations for this service.
13925    ///
13926    /// # Example
13927    /// ```
13928    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
13929    /// use google_cloud_gax::paginator::ItemPaginator as _;
13930    /// use google_cloud_aiplatform_v1::Result;
13931    /// async fn sample(
13932    ///    client: &PersistentResourceService
13933    /// ) -> Result<()> {
13934    ///     let mut list = client.list_locations()
13935    ///         /* set fields */
13936    ///         .by_item();
13937    ///     while let Some(item) = list.next().await.transpose()? {
13938    ///         println!("{:?}", item);
13939    ///     }
13940    ///     Ok(())
13941    /// }
13942    /// ```
13943    pub fn list_locations(&self) -> super::builder::persistent_resource_service::ListLocations {
13944        super::builder::persistent_resource_service::ListLocations::new(self.inner.clone())
13945    }
13946
13947    /// Gets information about a location.
13948    ///
13949    /// # Example
13950    /// ```
13951    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
13952    /// use google_cloud_aiplatform_v1::Result;
13953    /// async fn sample(
13954    ///    client: &PersistentResourceService
13955    /// ) -> Result<()> {
13956    ///     let response = client.get_location()
13957    ///         /* set fields */
13958    ///         .send().await?;
13959    ///     println!("response {:?}", response);
13960    ///     Ok(())
13961    /// }
13962    /// ```
13963    pub fn get_location(&self) -> super::builder::persistent_resource_service::GetLocation {
13964        super::builder::persistent_resource_service::GetLocation::new(self.inner.clone())
13965    }
13966
13967    /// Sets the access control policy on the specified resource. Replaces
13968    /// any existing policy.
13969    ///
13970    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
13971    /// errors.
13972    ///
13973    /// # Example
13974    /// ```
13975    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
13976    /// use google_cloud_aiplatform_v1::Result;
13977    /// async fn sample(
13978    ///    client: &PersistentResourceService
13979    /// ) -> Result<()> {
13980    ///     let response = client.set_iam_policy()
13981    ///         /* set fields */
13982    ///         .send().await?;
13983    ///     println!("response {:?}", response);
13984    ///     Ok(())
13985    /// }
13986    /// ```
13987    pub fn set_iam_policy(&self) -> super::builder::persistent_resource_service::SetIamPolicy {
13988        super::builder::persistent_resource_service::SetIamPolicy::new(self.inner.clone())
13989    }
13990
13991    /// Gets the access control policy for a resource. Returns an empty policy
13992    /// if the resource exists and does not have a policy set.
13993    ///
13994    /// # Example
13995    /// ```
13996    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
13997    /// use google_cloud_aiplatform_v1::Result;
13998    /// async fn sample(
13999    ///    client: &PersistentResourceService
14000    /// ) -> Result<()> {
14001    ///     let response = client.get_iam_policy()
14002    ///         /* set fields */
14003    ///         .send().await?;
14004    ///     println!("response {:?}", response);
14005    ///     Ok(())
14006    /// }
14007    /// ```
14008    pub fn get_iam_policy(&self) -> super::builder::persistent_resource_service::GetIamPolicy {
14009        super::builder::persistent_resource_service::GetIamPolicy::new(self.inner.clone())
14010    }
14011
14012    /// Returns permissions that a caller has on the specified resource. If the
14013    /// resource does not exist, this will return an empty set of
14014    /// permissions, not a `NOT_FOUND` error.
14015    ///
14016    /// Note: This operation is designed to be used for building
14017    /// permission-aware UIs and command-line tools, not for authorization
14018    /// checking. This operation may "fail open" without warning.
14019    ///
14020    /// # Example
14021    /// ```
14022    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
14023    /// use google_cloud_aiplatform_v1::Result;
14024    /// async fn sample(
14025    ///    client: &PersistentResourceService
14026    /// ) -> Result<()> {
14027    ///     let response = client.test_iam_permissions()
14028    ///         /* set fields */
14029    ///         .send().await?;
14030    ///     println!("response {:?}", response);
14031    ///     Ok(())
14032    /// }
14033    /// ```
14034    pub fn test_iam_permissions(
14035        &self,
14036    ) -> super::builder::persistent_resource_service::TestIamPermissions {
14037        super::builder::persistent_resource_service::TestIamPermissions::new(self.inner.clone())
14038    }
14039
14040    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
14041    ///
14042    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
14043    ///
14044    /// # Example
14045    /// ```
14046    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
14047    /// use google_cloud_gax::paginator::ItemPaginator as _;
14048    /// use google_cloud_aiplatform_v1::Result;
14049    /// async fn sample(
14050    ///    client: &PersistentResourceService
14051    /// ) -> Result<()> {
14052    ///     let mut list = client.list_operations()
14053    ///         /* set fields */
14054    ///         .by_item();
14055    ///     while let Some(item) = list.next().await.transpose()? {
14056    ///         println!("{:?}", item);
14057    ///     }
14058    ///     Ok(())
14059    /// }
14060    /// ```
14061    pub fn list_operations(&self) -> super::builder::persistent_resource_service::ListOperations {
14062        super::builder::persistent_resource_service::ListOperations::new(self.inner.clone())
14063    }
14064
14065    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
14066    ///
14067    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
14068    ///
14069    /// # Example
14070    /// ```
14071    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
14072    /// use google_cloud_aiplatform_v1::Result;
14073    /// async fn sample(
14074    ///    client: &PersistentResourceService
14075    /// ) -> Result<()> {
14076    ///     let response = client.get_operation()
14077    ///         /* set fields */
14078    ///         .send().await?;
14079    ///     println!("response {:?}", response);
14080    ///     Ok(())
14081    /// }
14082    /// ```
14083    pub fn get_operation(&self) -> super::builder::persistent_resource_service::GetOperation {
14084        super::builder::persistent_resource_service::GetOperation::new(self.inner.clone())
14085    }
14086
14087    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
14088    ///
14089    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
14090    ///
14091    /// # Example
14092    /// ```
14093    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
14094    /// use google_cloud_aiplatform_v1::Result;
14095    /// async fn sample(
14096    ///    client: &PersistentResourceService
14097    /// ) -> Result<()> {
14098    ///     client.delete_operation()
14099    ///         /* set fields */
14100    ///         .send().await?;
14101    ///     Ok(())
14102    /// }
14103    /// ```
14104    pub fn delete_operation(&self) -> super::builder::persistent_resource_service::DeleteOperation {
14105        super::builder::persistent_resource_service::DeleteOperation::new(self.inner.clone())
14106    }
14107
14108    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
14109    ///
14110    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
14111    ///
14112    /// # Example
14113    /// ```
14114    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
14115    /// use google_cloud_aiplatform_v1::Result;
14116    /// async fn sample(
14117    ///    client: &PersistentResourceService
14118    /// ) -> Result<()> {
14119    ///     client.cancel_operation()
14120    ///         /* set fields */
14121    ///         .send().await?;
14122    ///     Ok(())
14123    /// }
14124    /// ```
14125    pub fn cancel_operation(&self) -> super::builder::persistent_resource_service::CancelOperation {
14126        super::builder::persistent_resource_service::CancelOperation::new(self.inner.clone())
14127    }
14128
14129    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
14130    ///
14131    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
14132    ///
14133    /// # Example
14134    /// ```
14135    /// # use google_cloud_aiplatform_v1::client::PersistentResourceService;
14136    /// use google_cloud_aiplatform_v1::Result;
14137    /// async fn sample(
14138    ///    client: &PersistentResourceService
14139    /// ) -> Result<()> {
14140    ///     let response = client.wait_operation()
14141    ///         /* set fields */
14142    ///         .send().await?;
14143    ///     println!("response {:?}", response);
14144    ///     Ok(())
14145    /// }
14146    /// ```
14147    pub fn wait_operation(&self) -> super::builder::persistent_resource_service::WaitOperation {
14148        super::builder::persistent_resource_service::WaitOperation::new(self.inner.clone())
14149    }
14150}
14151
14152/// Implements a client for the Vertex AI API.
14153///
14154/// # Example
14155/// ```
14156/// # use google_cloud_aiplatform_v1::client::PipelineService;
14157/// use google_cloud_gax::paginator::ItemPaginator as _;
14158/// async fn sample(
14159///    parent: &str,
14160/// ) -> anyhow::Result<()> {
14161///     let client = PipelineService::builder().build().await?;
14162///     let mut list = client.list_training_pipelines()
14163///         .set_parent(parent)
14164///         .by_item();
14165///     while let Some(item) = list.next().await.transpose()? {
14166///         println!("{:?}", item);
14167///     }
14168///     Ok(())
14169/// }
14170/// ```
14171///
14172/// # Service Description
14173///
14174/// A service for creating and managing Vertex AI's pipelines. This includes both
14175/// `TrainingPipeline` resources (used for AutoML and custom training) and
14176/// `PipelineJob` resources (used for Vertex AI Pipelines).
14177///
14178/// # Configuration
14179///
14180/// To configure `PipelineService` use the `with_*` methods in the type returned
14181/// by [builder()][PipelineService::builder]. The default configuration should
14182/// work for most applications. Common configuration changes include
14183///
14184/// * [with_endpoint()]: by default this client uses the global default endpoint
14185///   (`https://aiplatform.googleapis.com`). Applications using regional
14186///   endpoints or running in restricted networks (e.g. a network configured
14187///   with [Private Google Access with VPC Service Controls]) may want to
14188///   override this default.
14189/// * [with_credentials()]: by default this client uses
14190///   [Application Default Credentials]. Applications using custom
14191///   authentication may need to override this default.
14192///
14193/// [with_endpoint()]: super::builder::pipeline_service::ClientBuilder::with_endpoint
14194/// [with_credentials()]: super::builder::pipeline_service::ClientBuilder::with_credentials
14195/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14196/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14197///
14198/// # Pooling and Cloning
14199///
14200/// `PipelineService` holds a connection pool internally, it is advised to
14201/// create one and reuse it. You do not need to wrap `PipelineService` in
14202/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14203/// already uses an `Arc` internally.
14204#[cfg(feature = "pipeline-service")]
14205#[cfg_attr(docsrs, doc(cfg(feature = "pipeline-service")))]
14206#[derive(Clone, Debug)]
14207pub struct PipelineService {
14208    inner: std::sync::Arc<dyn super::stub::dynamic::PipelineService>,
14209}
14210
14211#[cfg(feature = "pipeline-service")]
14212impl PipelineService {
14213    /// Returns a builder for [PipelineService].
14214    ///
14215    /// ```
14216    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14217    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14218    /// let client = PipelineService::builder().build().await?;
14219    /// # Ok(()) }
14220    /// ```
14221    pub fn builder() -> super::builder::pipeline_service::ClientBuilder {
14222        crate::new_client_builder(super::builder::pipeline_service::client::Factory)
14223    }
14224
14225    /// Creates a new client from the provided stub.
14226    ///
14227    /// The most common case for calling this function is in tests mocking the
14228    /// client's behavior.
14229    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14230    where
14231        T: super::stub::PipelineService + 'static,
14232    {
14233        Self { inner: stub.into() }
14234    }
14235
14236    pub(crate) async fn new(
14237        config: gaxi::options::ClientConfig,
14238    ) -> crate::ClientBuilderResult<Self> {
14239        let inner = Self::build_inner(config).await?;
14240        Ok(Self { inner })
14241    }
14242
14243    async fn build_inner(
14244        conf: gaxi::options::ClientConfig,
14245    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PipelineService>> {
14246        if gaxi::options::tracing_enabled(&conf) {
14247            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14248        }
14249        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14250    }
14251
14252    async fn build_transport(
14253        conf: gaxi::options::ClientConfig,
14254    ) -> crate::ClientBuilderResult<impl super::stub::PipelineService> {
14255        super::transport::PipelineService::new(conf).await
14256    }
14257
14258    async fn build_with_tracing(
14259        conf: gaxi::options::ClientConfig,
14260    ) -> crate::ClientBuilderResult<impl super::stub::PipelineService> {
14261        Self::build_transport(conf)
14262            .await
14263            .map(super::tracing::PipelineService::new)
14264    }
14265
14266    /// Creates a TrainingPipeline. A created TrainingPipeline right away will be
14267    /// attempted to be run.
14268    ///
14269    /// # Example
14270    /// ```
14271    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14272    /// use google_cloud_aiplatform_v1::model::TrainingPipeline;
14273    /// use google_cloud_aiplatform_v1::Result;
14274    /// async fn sample(
14275    ///    client: &PipelineService, parent: &str
14276    /// ) -> Result<()> {
14277    ///     let response = client.create_training_pipeline()
14278    ///         .set_parent(parent)
14279    ///         .set_training_pipeline(
14280    ///             TrainingPipeline::new()/* set fields */
14281    ///         )
14282    ///         .send().await?;
14283    ///     println!("response {:?}", response);
14284    ///     Ok(())
14285    /// }
14286    /// ```
14287    pub fn create_training_pipeline(
14288        &self,
14289    ) -> super::builder::pipeline_service::CreateTrainingPipeline {
14290        super::builder::pipeline_service::CreateTrainingPipeline::new(self.inner.clone())
14291    }
14292
14293    /// Gets a TrainingPipeline.
14294    ///
14295    /// # Example
14296    /// ```
14297    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14298    /// use google_cloud_aiplatform_v1::Result;
14299    /// async fn sample(
14300    ///    client: &PipelineService, project_id: &str, location_id: &str, training_pipeline_id: &str
14301    /// ) -> Result<()> {
14302    ///     let response = client.get_training_pipeline()
14303    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/trainingPipelines/{training_pipeline_id}"))
14304    ///         .send().await?;
14305    ///     println!("response {:?}", response);
14306    ///     Ok(())
14307    /// }
14308    /// ```
14309    pub fn get_training_pipeline(&self) -> super::builder::pipeline_service::GetTrainingPipeline {
14310        super::builder::pipeline_service::GetTrainingPipeline::new(self.inner.clone())
14311    }
14312
14313    /// Lists TrainingPipelines in a Location.
14314    ///
14315    /// # Example
14316    /// ```
14317    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14318    /// use google_cloud_gax::paginator::ItemPaginator as _;
14319    /// use google_cloud_aiplatform_v1::Result;
14320    /// async fn sample(
14321    ///    client: &PipelineService, parent: &str
14322    /// ) -> Result<()> {
14323    ///     let mut list = client.list_training_pipelines()
14324    ///         .set_parent(parent)
14325    ///         .by_item();
14326    ///     while let Some(item) = list.next().await.transpose()? {
14327    ///         println!("{:?}", item);
14328    ///     }
14329    ///     Ok(())
14330    /// }
14331    /// ```
14332    pub fn list_training_pipelines(
14333        &self,
14334    ) -> super::builder::pipeline_service::ListTrainingPipelines {
14335        super::builder::pipeline_service::ListTrainingPipelines::new(self.inner.clone())
14336    }
14337
14338    /// Deletes a TrainingPipeline.
14339    ///
14340    /// # Long running operations
14341    ///
14342    /// This method is used to start, and/or poll a [long-running Operation].
14343    /// The [Working with long-running operations] chapter in the [user guide]
14344    /// covers these operations in detail.
14345    ///
14346    /// [long-running operation]: https://google.aip.dev/151
14347    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
14348    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
14349    ///
14350    /// # Example
14351    /// ```
14352    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14353    /// use google_cloud_lro::Poller;
14354    /// use google_cloud_aiplatform_v1::Result;
14355    /// async fn sample(
14356    ///    client: &PipelineService, project_id: &str, location_id: &str, training_pipeline_id: &str
14357    /// ) -> Result<()> {
14358    ///     client.delete_training_pipeline()
14359    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/trainingPipelines/{training_pipeline_id}"))
14360    ///         .poller().until_done().await?;
14361    ///     Ok(())
14362    /// }
14363    /// ```
14364    pub fn delete_training_pipeline(
14365        &self,
14366    ) -> super::builder::pipeline_service::DeleteTrainingPipeline {
14367        super::builder::pipeline_service::DeleteTrainingPipeline::new(self.inner.clone())
14368    }
14369
14370    /// Cancels a TrainingPipeline.
14371    /// Starts asynchronous cancellation on the TrainingPipeline. The server
14372    /// makes a best effort to cancel the pipeline, but success is not
14373    /// guaranteed. Clients can use
14374    /// [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]
14375    /// or other methods to check whether the cancellation succeeded or whether the
14376    /// pipeline completed despite cancellation. On successful cancellation,
14377    /// the TrainingPipeline is not deleted; instead it becomes a pipeline with
14378    /// a
14379    /// [TrainingPipeline.error][google.cloud.aiplatform.v1.TrainingPipeline.error]
14380    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
14381    /// corresponding to `Code.CANCELLED`, and
14382    /// [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state]
14383    /// is set to `CANCELLED`.
14384    ///
14385    /// [google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]: crate::client::PipelineService::get_training_pipeline
14386    /// [google.cloud.aiplatform.v1.TrainingPipeline.error]: crate::model::TrainingPipeline::error
14387    /// [google.cloud.aiplatform.v1.TrainingPipeline.state]: crate::model::TrainingPipeline::state
14388    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
14389    ///
14390    /// # Example
14391    /// ```
14392    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14393    /// use google_cloud_aiplatform_v1::Result;
14394    /// async fn sample(
14395    ///    client: &PipelineService
14396    /// ) -> Result<()> {
14397    ///     client.cancel_training_pipeline()
14398    ///         /* set fields */
14399    ///         .send().await?;
14400    ///     Ok(())
14401    /// }
14402    /// ```
14403    pub fn cancel_training_pipeline(
14404        &self,
14405    ) -> super::builder::pipeline_service::CancelTrainingPipeline {
14406        super::builder::pipeline_service::CancelTrainingPipeline::new(self.inner.clone())
14407    }
14408
14409    /// Creates a PipelineJob. A PipelineJob will run immediately when created.
14410    ///
14411    /// # Example
14412    /// ```
14413    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14414    /// use google_cloud_aiplatform_v1::model::PipelineJob;
14415    /// use google_cloud_aiplatform_v1::Result;
14416    /// async fn sample(
14417    ///    client: &PipelineService, parent: &str
14418    /// ) -> Result<()> {
14419    ///     let response = client.create_pipeline_job()
14420    ///         .set_parent(parent)
14421    ///         .set_pipeline_job(
14422    ///             PipelineJob::new()/* set fields */
14423    ///         )
14424    ///         .send().await?;
14425    ///     println!("response {:?}", response);
14426    ///     Ok(())
14427    /// }
14428    /// ```
14429    pub fn create_pipeline_job(&self) -> super::builder::pipeline_service::CreatePipelineJob {
14430        super::builder::pipeline_service::CreatePipelineJob::new(self.inner.clone())
14431    }
14432
14433    /// Gets a PipelineJob.
14434    ///
14435    /// # Example
14436    /// ```
14437    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14438    /// use google_cloud_aiplatform_v1::Result;
14439    /// async fn sample(
14440    ///    client: &PipelineService, project_id: &str, location_id: &str, pipeline_job_id: &str
14441    /// ) -> Result<()> {
14442    ///     let response = client.get_pipeline_job()
14443    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/pipelineJobs/{pipeline_job_id}"))
14444    ///         .send().await?;
14445    ///     println!("response {:?}", response);
14446    ///     Ok(())
14447    /// }
14448    /// ```
14449    pub fn get_pipeline_job(&self) -> super::builder::pipeline_service::GetPipelineJob {
14450        super::builder::pipeline_service::GetPipelineJob::new(self.inner.clone())
14451    }
14452
14453    /// Lists PipelineJobs in a Location.
14454    ///
14455    /// # Example
14456    /// ```
14457    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14458    /// use google_cloud_gax::paginator::ItemPaginator as _;
14459    /// use google_cloud_aiplatform_v1::Result;
14460    /// async fn sample(
14461    ///    client: &PipelineService, parent: &str
14462    /// ) -> Result<()> {
14463    ///     let mut list = client.list_pipeline_jobs()
14464    ///         .set_parent(parent)
14465    ///         .by_item();
14466    ///     while let Some(item) = list.next().await.transpose()? {
14467    ///         println!("{:?}", item);
14468    ///     }
14469    ///     Ok(())
14470    /// }
14471    /// ```
14472    pub fn list_pipeline_jobs(&self) -> super::builder::pipeline_service::ListPipelineJobs {
14473        super::builder::pipeline_service::ListPipelineJobs::new(self.inner.clone())
14474    }
14475
14476    /// Deletes a PipelineJob.
14477    ///
14478    /// # Long running operations
14479    ///
14480    /// This method is used to start, and/or poll a [long-running Operation].
14481    /// The [Working with long-running operations] chapter in the [user guide]
14482    /// covers these operations in detail.
14483    ///
14484    /// [long-running operation]: https://google.aip.dev/151
14485    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
14486    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
14487    ///
14488    /// # Example
14489    /// ```
14490    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14491    /// use google_cloud_lro::Poller;
14492    /// use google_cloud_aiplatform_v1::Result;
14493    /// async fn sample(
14494    ///    client: &PipelineService, project_id: &str, location_id: &str, pipeline_job_id: &str
14495    /// ) -> Result<()> {
14496    ///     client.delete_pipeline_job()
14497    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/pipelineJobs/{pipeline_job_id}"))
14498    ///         .poller().until_done().await?;
14499    ///     Ok(())
14500    /// }
14501    /// ```
14502    pub fn delete_pipeline_job(&self) -> super::builder::pipeline_service::DeletePipelineJob {
14503        super::builder::pipeline_service::DeletePipelineJob::new(self.inner.clone())
14504    }
14505
14506    /// Batch deletes PipelineJobs
14507    /// The Operation is atomic. If it fails, none of the PipelineJobs are deleted.
14508    /// If it succeeds, all of the PipelineJobs are deleted.
14509    ///
14510    /// # Long running operations
14511    ///
14512    /// This method is used to start, and/or poll a [long-running Operation].
14513    /// The [Working with long-running operations] chapter in the [user guide]
14514    /// covers these operations in detail.
14515    ///
14516    /// [long-running operation]: https://google.aip.dev/151
14517    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
14518    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
14519    ///
14520    /// # Example
14521    /// ```
14522    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14523    /// use google_cloud_lro::Poller;
14524    /// use google_cloud_aiplatform_v1::Result;
14525    /// async fn sample(
14526    ///    client: &PipelineService
14527    /// ) -> Result<()> {
14528    ///     let response = client.batch_delete_pipeline_jobs()
14529    ///         /* set fields */
14530    ///         .poller().until_done().await?;
14531    ///     println!("response {:?}", response);
14532    ///     Ok(())
14533    /// }
14534    /// ```
14535    pub fn batch_delete_pipeline_jobs(
14536        &self,
14537    ) -> super::builder::pipeline_service::BatchDeletePipelineJobs {
14538        super::builder::pipeline_service::BatchDeletePipelineJobs::new(self.inner.clone())
14539    }
14540
14541    /// Cancels a PipelineJob.
14542    /// Starts asynchronous cancellation on the PipelineJob. The server
14543    /// makes a best effort to cancel the pipeline, but success is not
14544    /// guaranteed. Clients can use
14545    /// [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob]
14546    /// or other methods to check whether the cancellation succeeded or whether the
14547    /// pipeline completed despite cancellation. On successful cancellation,
14548    /// the PipelineJob is not deleted; instead it becomes a pipeline with
14549    /// a [PipelineJob.error][google.cloud.aiplatform.v1.PipelineJob.error] value
14550    /// with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding
14551    /// to `Code.CANCELLED`, and
14552    /// [PipelineJob.state][google.cloud.aiplatform.v1.PipelineJob.state] is set to
14553    /// `CANCELLED`.
14554    ///
14555    /// [google.cloud.aiplatform.v1.PipelineJob.error]: crate::model::PipelineJob::error
14556    /// [google.cloud.aiplatform.v1.PipelineJob.state]: crate::model::PipelineJob::state
14557    /// [google.cloud.aiplatform.v1.PipelineService.GetPipelineJob]: crate::client::PipelineService::get_pipeline_job
14558    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
14559    ///
14560    /// # Example
14561    /// ```
14562    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14563    /// use google_cloud_aiplatform_v1::Result;
14564    /// async fn sample(
14565    ///    client: &PipelineService
14566    /// ) -> Result<()> {
14567    ///     client.cancel_pipeline_job()
14568    ///         /* set fields */
14569    ///         .send().await?;
14570    ///     Ok(())
14571    /// }
14572    /// ```
14573    pub fn cancel_pipeline_job(&self) -> super::builder::pipeline_service::CancelPipelineJob {
14574        super::builder::pipeline_service::CancelPipelineJob::new(self.inner.clone())
14575    }
14576
14577    /// Batch cancel PipelineJobs.
14578    /// Firstly the server will check if all the jobs are in non-terminal states,
14579    /// and skip the jobs that are already terminated.
14580    /// If the operation failed, none of the pipeline jobs are cancelled.
14581    /// The server will poll the states of all the pipeline jobs periodically
14582    /// to check the cancellation status.
14583    /// This operation will return an LRO.
14584    ///
14585    /// # Long running operations
14586    ///
14587    /// This method is used to start, and/or poll a [long-running Operation].
14588    /// The [Working with long-running operations] chapter in the [user guide]
14589    /// covers these operations in detail.
14590    ///
14591    /// [long-running operation]: https://google.aip.dev/151
14592    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
14593    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
14594    ///
14595    /// # Example
14596    /// ```
14597    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14598    /// use google_cloud_lro::Poller;
14599    /// use google_cloud_aiplatform_v1::Result;
14600    /// async fn sample(
14601    ///    client: &PipelineService
14602    /// ) -> Result<()> {
14603    ///     let response = client.batch_cancel_pipeline_jobs()
14604    ///         /* set fields */
14605    ///         .poller().until_done().await?;
14606    ///     println!("response {:?}", response);
14607    ///     Ok(())
14608    /// }
14609    /// ```
14610    pub fn batch_cancel_pipeline_jobs(
14611        &self,
14612    ) -> super::builder::pipeline_service::BatchCancelPipelineJobs {
14613        super::builder::pipeline_service::BatchCancelPipelineJobs::new(self.inner.clone())
14614    }
14615
14616    /// Lists information about the supported locations for this service.
14617    ///
14618    /// # Example
14619    /// ```
14620    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14621    /// use google_cloud_gax::paginator::ItemPaginator as _;
14622    /// use google_cloud_aiplatform_v1::Result;
14623    /// async fn sample(
14624    ///    client: &PipelineService
14625    /// ) -> Result<()> {
14626    ///     let mut list = client.list_locations()
14627    ///         /* set fields */
14628    ///         .by_item();
14629    ///     while let Some(item) = list.next().await.transpose()? {
14630    ///         println!("{:?}", item);
14631    ///     }
14632    ///     Ok(())
14633    /// }
14634    /// ```
14635    pub fn list_locations(&self) -> super::builder::pipeline_service::ListLocations {
14636        super::builder::pipeline_service::ListLocations::new(self.inner.clone())
14637    }
14638
14639    /// Gets information about a location.
14640    ///
14641    /// # Example
14642    /// ```
14643    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14644    /// use google_cloud_aiplatform_v1::Result;
14645    /// async fn sample(
14646    ///    client: &PipelineService
14647    /// ) -> Result<()> {
14648    ///     let response = client.get_location()
14649    ///         /* set fields */
14650    ///         .send().await?;
14651    ///     println!("response {:?}", response);
14652    ///     Ok(())
14653    /// }
14654    /// ```
14655    pub fn get_location(&self) -> super::builder::pipeline_service::GetLocation {
14656        super::builder::pipeline_service::GetLocation::new(self.inner.clone())
14657    }
14658
14659    /// Sets the access control policy on the specified resource. Replaces
14660    /// any existing policy.
14661    ///
14662    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
14663    /// errors.
14664    ///
14665    /// # Example
14666    /// ```
14667    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14668    /// use google_cloud_aiplatform_v1::Result;
14669    /// async fn sample(
14670    ///    client: &PipelineService
14671    /// ) -> Result<()> {
14672    ///     let response = client.set_iam_policy()
14673    ///         /* set fields */
14674    ///         .send().await?;
14675    ///     println!("response {:?}", response);
14676    ///     Ok(())
14677    /// }
14678    /// ```
14679    pub fn set_iam_policy(&self) -> super::builder::pipeline_service::SetIamPolicy {
14680        super::builder::pipeline_service::SetIamPolicy::new(self.inner.clone())
14681    }
14682
14683    /// Gets the access control policy for a resource. Returns an empty policy
14684    /// if the resource exists and does not have a policy set.
14685    ///
14686    /// # Example
14687    /// ```
14688    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14689    /// use google_cloud_aiplatform_v1::Result;
14690    /// async fn sample(
14691    ///    client: &PipelineService
14692    /// ) -> Result<()> {
14693    ///     let response = client.get_iam_policy()
14694    ///         /* set fields */
14695    ///         .send().await?;
14696    ///     println!("response {:?}", response);
14697    ///     Ok(())
14698    /// }
14699    /// ```
14700    pub fn get_iam_policy(&self) -> super::builder::pipeline_service::GetIamPolicy {
14701        super::builder::pipeline_service::GetIamPolicy::new(self.inner.clone())
14702    }
14703
14704    /// Returns permissions that a caller has on the specified resource. If the
14705    /// resource does not exist, this will return an empty set of
14706    /// permissions, not a `NOT_FOUND` error.
14707    ///
14708    /// Note: This operation is designed to be used for building
14709    /// permission-aware UIs and command-line tools, not for authorization
14710    /// checking. This operation may "fail open" without warning.
14711    ///
14712    /// # Example
14713    /// ```
14714    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14715    /// use google_cloud_aiplatform_v1::Result;
14716    /// async fn sample(
14717    ///    client: &PipelineService
14718    /// ) -> Result<()> {
14719    ///     let response = client.test_iam_permissions()
14720    ///         /* set fields */
14721    ///         .send().await?;
14722    ///     println!("response {:?}", response);
14723    ///     Ok(())
14724    /// }
14725    /// ```
14726    pub fn test_iam_permissions(&self) -> super::builder::pipeline_service::TestIamPermissions {
14727        super::builder::pipeline_service::TestIamPermissions::new(self.inner.clone())
14728    }
14729
14730    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
14731    ///
14732    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
14733    ///
14734    /// # Example
14735    /// ```
14736    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14737    /// use google_cloud_gax::paginator::ItemPaginator as _;
14738    /// use google_cloud_aiplatform_v1::Result;
14739    /// async fn sample(
14740    ///    client: &PipelineService
14741    /// ) -> Result<()> {
14742    ///     let mut list = client.list_operations()
14743    ///         /* set fields */
14744    ///         .by_item();
14745    ///     while let Some(item) = list.next().await.transpose()? {
14746    ///         println!("{:?}", item);
14747    ///     }
14748    ///     Ok(())
14749    /// }
14750    /// ```
14751    pub fn list_operations(&self) -> super::builder::pipeline_service::ListOperations {
14752        super::builder::pipeline_service::ListOperations::new(self.inner.clone())
14753    }
14754
14755    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
14756    ///
14757    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
14758    ///
14759    /// # Example
14760    /// ```
14761    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14762    /// use google_cloud_aiplatform_v1::Result;
14763    /// async fn sample(
14764    ///    client: &PipelineService
14765    /// ) -> Result<()> {
14766    ///     let response = client.get_operation()
14767    ///         /* set fields */
14768    ///         .send().await?;
14769    ///     println!("response {:?}", response);
14770    ///     Ok(())
14771    /// }
14772    /// ```
14773    pub fn get_operation(&self) -> super::builder::pipeline_service::GetOperation {
14774        super::builder::pipeline_service::GetOperation::new(self.inner.clone())
14775    }
14776
14777    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
14778    ///
14779    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
14780    ///
14781    /// # Example
14782    /// ```
14783    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14784    /// use google_cloud_aiplatform_v1::Result;
14785    /// async fn sample(
14786    ///    client: &PipelineService
14787    /// ) -> Result<()> {
14788    ///     client.delete_operation()
14789    ///         /* set fields */
14790    ///         .send().await?;
14791    ///     Ok(())
14792    /// }
14793    /// ```
14794    pub fn delete_operation(&self) -> super::builder::pipeline_service::DeleteOperation {
14795        super::builder::pipeline_service::DeleteOperation::new(self.inner.clone())
14796    }
14797
14798    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
14799    ///
14800    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
14801    ///
14802    /// # Example
14803    /// ```
14804    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14805    /// use google_cloud_aiplatform_v1::Result;
14806    /// async fn sample(
14807    ///    client: &PipelineService
14808    /// ) -> Result<()> {
14809    ///     client.cancel_operation()
14810    ///         /* set fields */
14811    ///         .send().await?;
14812    ///     Ok(())
14813    /// }
14814    /// ```
14815    pub fn cancel_operation(&self) -> super::builder::pipeline_service::CancelOperation {
14816        super::builder::pipeline_service::CancelOperation::new(self.inner.clone())
14817    }
14818
14819    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
14820    ///
14821    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
14822    ///
14823    /// # Example
14824    /// ```
14825    /// # use google_cloud_aiplatform_v1::client::PipelineService;
14826    /// use google_cloud_aiplatform_v1::Result;
14827    /// async fn sample(
14828    ///    client: &PipelineService
14829    /// ) -> Result<()> {
14830    ///     let response = client.wait_operation()
14831    ///         /* set fields */
14832    ///         .send().await?;
14833    ///     println!("response {:?}", response);
14834    ///     Ok(())
14835    /// }
14836    /// ```
14837    pub fn wait_operation(&self) -> super::builder::pipeline_service::WaitOperation {
14838        super::builder::pipeline_service::WaitOperation::new(self.inner.clone())
14839    }
14840}
14841
14842/// Implements a client for the Vertex AI API.
14843///
14844/// # Example
14845/// ```
14846/// # use google_cloud_aiplatform_v1::client::PredictionService;
14847/// async fn sample(
14848/// ) -> anyhow::Result<()> {
14849///     let client = PredictionService::builder().build().await?;
14850///     let response = client.predict()
14851///         /* set fields */
14852///         .send().await?;
14853///     println!("response {:?}", response);
14854///     Ok(())
14855/// }
14856/// ```
14857///
14858/// # Service Description
14859///
14860/// A service for online predictions and explanations.
14861///
14862/// # Configuration
14863///
14864/// To configure `PredictionService` use the `with_*` methods in the type returned
14865/// by [builder()][PredictionService::builder]. The default configuration should
14866/// work for most applications. Common configuration changes include
14867///
14868/// * [with_endpoint()]: by default this client uses the global default endpoint
14869///   (`https://aiplatform.googleapis.com`). Applications using regional
14870///   endpoints or running in restricted networks (e.g. a network configured
14871///   with [Private Google Access with VPC Service Controls]) may want to
14872///   override this default.
14873/// * [with_credentials()]: by default this client uses
14874///   [Application Default Credentials]. Applications using custom
14875///   authentication may need to override this default.
14876///
14877/// [with_endpoint()]: super::builder::prediction_service::ClientBuilder::with_endpoint
14878/// [with_credentials()]: super::builder::prediction_service::ClientBuilder::with_credentials
14879/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14880/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14881///
14882/// # Pooling and Cloning
14883///
14884/// `PredictionService` holds a connection pool internally, it is advised to
14885/// create one and reuse it. You do not need to wrap `PredictionService` in
14886/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14887/// already uses an `Arc` internally.
14888#[cfg(feature = "prediction-service")]
14889#[cfg_attr(docsrs, doc(cfg(feature = "prediction-service")))]
14890#[derive(Clone, Debug)]
14891pub struct PredictionService {
14892    inner: std::sync::Arc<dyn super::stub::dynamic::PredictionService>,
14893}
14894
14895#[cfg(feature = "prediction-service")]
14896impl PredictionService {
14897    /// Returns a builder for [PredictionService].
14898    ///
14899    /// ```
14900    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14901    /// # use google_cloud_aiplatform_v1::client::PredictionService;
14902    /// let client = PredictionService::builder().build().await?;
14903    /// # Ok(()) }
14904    /// ```
14905    pub fn builder() -> super::builder::prediction_service::ClientBuilder {
14906        crate::new_client_builder(super::builder::prediction_service::client::Factory)
14907    }
14908
14909    /// Creates a new client from the provided stub.
14910    ///
14911    /// The most common case for calling this function is in tests mocking the
14912    /// client's behavior.
14913    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14914    where
14915        T: super::stub::PredictionService + 'static,
14916    {
14917        Self { inner: stub.into() }
14918    }
14919
14920    pub(crate) async fn new(
14921        config: gaxi::options::ClientConfig,
14922    ) -> crate::ClientBuilderResult<Self> {
14923        let inner = Self::build_inner(config).await?;
14924        Ok(Self { inner })
14925    }
14926
14927    async fn build_inner(
14928        conf: gaxi::options::ClientConfig,
14929    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PredictionService>>
14930    {
14931        if gaxi::options::tracing_enabled(&conf) {
14932            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14933        }
14934        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14935    }
14936
14937    async fn build_transport(
14938        conf: gaxi::options::ClientConfig,
14939    ) -> crate::ClientBuilderResult<impl super::stub::PredictionService> {
14940        super::transport::PredictionService::new(conf).await
14941    }
14942
14943    async fn build_with_tracing(
14944        conf: gaxi::options::ClientConfig,
14945    ) -> crate::ClientBuilderResult<impl super::stub::PredictionService> {
14946        Self::build_transport(conf)
14947            .await
14948            .map(super::tracing::PredictionService::new)
14949    }
14950
14951    /// Perform an online prediction.
14952    ///
14953    /// # Example
14954    /// ```
14955    /// # use google_cloud_aiplatform_v1::client::PredictionService;
14956    /// use google_cloud_aiplatform_v1::Result;
14957    /// async fn sample(
14958    ///    client: &PredictionService
14959    /// ) -> Result<()> {
14960    ///     let response = client.predict()
14961    ///         /* set fields */
14962    ///         .send().await?;
14963    ///     println!("response {:?}", response);
14964    ///     Ok(())
14965    /// }
14966    /// ```
14967    pub fn predict(&self) -> super::builder::prediction_service::Predict {
14968        super::builder::prediction_service::Predict::new(self.inner.clone())
14969    }
14970
14971    /// Perform an online prediction with an arbitrary HTTP payload.
14972    ///
14973    /// The response includes the following HTTP headers:
14974    ///
14975    /// * `X-Vertex-AI-Endpoint-Id`: ID of the
14976    ///   [Endpoint][google.cloud.aiplatform.v1.Endpoint] that served this
14977    ///   prediction.
14978    ///
14979    /// * `X-Vertex-AI-Deployed-Model-Id`: ID of the Endpoint's
14980    ///   [DeployedModel][google.cloud.aiplatform.v1.DeployedModel] that served this
14981    ///   prediction.
14982    ///
14983    ///
14984    /// [google.cloud.aiplatform.v1.DeployedModel]: crate::model::DeployedModel
14985    /// [google.cloud.aiplatform.v1.Endpoint]: crate::model::Endpoint
14986    ///
14987    /// # Example
14988    /// ```
14989    /// # use google_cloud_aiplatform_v1::client::PredictionService;
14990    /// use google_cloud_aiplatform_v1::Result;
14991    /// async fn sample(
14992    ///    client: &PredictionService
14993    /// ) -> Result<()> {
14994    ///     let response = client.raw_predict()
14995    ///         /* set fields */
14996    ///         .send().await?;
14997    ///     println!("response {:?}", response);
14998    ///     Ok(())
14999    /// }
15000    /// ```
15001    pub fn raw_predict(&self) -> super::builder::prediction_service::RawPredict {
15002        super::builder::prediction_service::RawPredict::new(self.inner.clone())
15003    }
15004
15005    /// Perform an unary online prediction request to a gRPC model server for
15006    /// Vertex first-party products and frameworks.
15007    ///
15008    /// # Example
15009    /// ```
15010    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15011    /// use google_cloud_aiplatform_v1::Result;
15012    /// async fn sample(
15013    ///    client: &PredictionService
15014    /// ) -> Result<()> {
15015    ///     let response = client.direct_predict()
15016    ///         /* set fields */
15017    ///         .send().await?;
15018    ///     println!("response {:?}", response);
15019    ///     Ok(())
15020    /// }
15021    /// ```
15022    pub fn direct_predict(&self) -> super::builder::prediction_service::DirectPredict {
15023        super::builder::prediction_service::DirectPredict::new(self.inner.clone())
15024    }
15025
15026    /// Perform an unary online prediction request to a gRPC model server for
15027    /// custom containers.
15028    ///
15029    /// # Example
15030    /// ```
15031    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15032    /// use google_cloud_aiplatform_v1::Result;
15033    /// async fn sample(
15034    ///    client: &PredictionService
15035    /// ) -> Result<()> {
15036    ///     let response = client.direct_raw_predict()
15037    ///         /* set fields */
15038    ///         .send().await?;
15039    ///     println!("response {:?}", response);
15040    ///     Ok(())
15041    /// }
15042    /// ```
15043    pub fn direct_raw_predict(&self) -> super::builder::prediction_service::DirectRawPredict {
15044        super::builder::prediction_service::DirectRawPredict::new(self.inner.clone())
15045    }
15046
15047    /// Perform an online explanation.
15048    ///
15049    /// If
15050    /// [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]
15051    /// is specified, the corresponding DeployModel must have
15052    /// [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec]
15053    /// populated. If
15054    /// [deployed_model_id][google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]
15055    /// is not specified, all DeployedModels must have
15056    /// [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec]
15057    /// populated.
15058    ///
15059    /// [google.cloud.aiplatform.v1.DeployedModel.explanation_spec]: crate::model::DeployedModel::explanation_spec
15060    /// [google.cloud.aiplatform.v1.ExplainRequest.deployed_model_id]: crate::model::ExplainRequest::deployed_model_id
15061    ///
15062    /// # Example
15063    /// ```
15064    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15065    /// use google_cloud_aiplatform_v1::Result;
15066    /// async fn sample(
15067    ///    client: &PredictionService
15068    /// ) -> Result<()> {
15069    ///     let response = client.explain()
15070    ///         /* set fields */
15071    ///         .send().await?;
15072    ///     println!("response {:?}", response);
15073    ///     Ok(())
15074    /// }
15075    /// ```
15076    pub fn explain(&self) -> super::builder::prediction_service::Explain {
15077        super::builder::prediction_service::Explain::new(self.inner.clone())
15078    }
15079
15080    /// Generate content with multimodal inputs.
15081    ///
15082    /// # Example
15083    /// ```
15084    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15085    /// use google_cloud_aiplatform_v1::Result;
15086    /// async fn sample(
15087    ///    client: &PredictionService
15088    /// ) -> Result<()> {
15089    ///     let response = client.generate_content()
15090    ///         /* set fields */
15091    ///         .send().await?;
15092    ///     println!("response {:?}", response);
15093    ///     Ok(())
15094    /// }
15095    /// ```
15096    pub fn generate_content(&self) -> super::builder::prediction_service::GenerateContent {
15097        super::builder::prediction_service::GenerateContent::new(self.inner.clone())
15098    }
15099
15100    /// Embed content with multimodal inputs.
15101    ///
15102    /// # Example
15103    /// ```
15104    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15105    /// use google_cloud_aiplatform_v1::Result;
15106    /// async fn sample(
15107    ///    client: &PredictionService
15108    /// ) -> Result<()> {
15109    ///     let response = client.embed_content()
15110    ///         /* set fields */
15111    ///         .send().await?;
15112    ///     println!("response {:?}", response);
15113    ///     Ok(())
15114    /// }
15115    /// ```
15116    pub fn embed_content(&self) -> super::builder::prediction_service::EmbedContent {
15117        super::builder::prediction_service::EmbedContent::new(self.inner.clone())
15118    }
15119
15120    /// Lists information about the supported locations for this service.
15121    ///
15122    /// # Example
15123    /// ```
15124    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15125    /// use google_cloud_gax::paginator::ItemPaginator as _;
15126    /// use google_cloud_aiplatform_v1::Result;
15127    /// async fn sample(
15128    ///    client: &PredictionService
15129    /// ) -> Result<()> {
15130    ///     let mut list = client.list_locations()
15131    ///         /* set fields */
15132    ///         .by_item();
15133    ///     while let Some(item) = list.next().await.transpose()? {
15134    ///         println!("{:?}", item);
15135    ///     }
15136    ///     Ok(())
15137    /// }
15138    /// ```
15139    pub fn list_locations(&self) -> super::builder::prediction_service::ListLocations {
15140        super::builder::prediction_service::ListLocations::new(self.inner.clone())
15141    }
15142
15143    /// Gets information about a location.
15144    ///
15145    /// # Example
15146    /// ```
15147    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15148    /// use google_cloud_aiplatform_v1::Result;
15149    /// async fn sample(
15150    ///    client: &PredictionService
15151    /// ) -> Result<()> {
15152    ///     let response = client.get_location()
15153    ///         /* set fields */
15154    ///         .send().await?;
15155    ///     println!("response {:?}", response);
15156    ///     Ok(())
15157    /// }
15158    /// ```
15159    pub fn get_location(&self) -> super::builder::prediction_service::GetLocation {
15160        super::builder::prediction_service::GetLocation::new(self.inner.clone())
15161    }
15162
15163    /// Sets the access control policy on the specified resource. Replaces
15164    /// any existing policy.
15165    ///
15166    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
15167    /// errors.
15168    ///
15169    /// # Example
15170    /// ```
15171    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15172    /// use google_cloud_aiplatform_v1::Result;
15173    /// async fn sample(
15174    ///    client: &PredictionService
15175    /// ) -> Result<()> {
15176    ///     let response = client.set_iam_policy()
15177    ///         /* set fields */
15178    ///         .send().await?;
15179    ///     println!("response {:?}", response);
15180    ///     Ok(())
15181    /// }
15182    /// ```
15183    pub fn set_iam_policy(&self) -> super::builder::prediction_service::SetIamPolicy {
15184        super::builder::prediction_service::SetIamPolicy::new(self.inner.clone())
15185    }
15186
15187    /// Gets the access control policy for a resource. Returns an empty policy
15188    /// if the resource exists and does not have a policy set.
15189    ///
15190    /// # Example
15191    /// ```
15192    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15193    /// use google_cloud_aiplatform_v1::Result;
15194    /// async fn sample(
15195    ///    client: &PredictionService
15196    /// ) -> Result<()> {
15197    ///     let response = client.get_iam_policy()
15198    ///         /* set fields */
15199    ///         .send().await?;
15200    ///     println!("response {:?}", response);
15201    ///     Ok(())
15202    /// }
15203    /// ```
15204    pub fn get_iam_policy(&self) -> super::builder::prediction_service::GetIamPolicy {
15205        super::builder::prediction_service::GetIamPolicy::new(self.inner.clone())
15206    }
15207
15208    /// Returns permissions that a caller has on the specified resource. If the
15209    /// resource does not exist, this will return an empty set of
15210    /// permissions, not a `NOT_FOUND` error.
15211    ///
15212    /// Note: This operation is designed to be used for building
15213    /// permission-aware UIs and command-line tools, not for authorization
15214    /// checking. This operation may "fail open" without warning.
15215    ///
15216    /// # Example
15217    /// ```
15218    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15219    /// use google_cloud_aiplatform_v1::Result;
15220    /// async fn sample(
15221    ///    client: &PredictionService
15222    /// ) -> Result<()> {
15223    ///     let response = client.test_iam_permissions()
15224    ///         /* set fields */
15225    ///         .send().await?;
15226    ///     println!("response {:?}", response);
15227    ///     Ok(())
15228    /// }
15229    /// ```
15230    pub fn test_iam_permissions(&self) -> super::builder::prediction_service::TestIamPermissions {
15231        super::builder::prediction_service::TestIamPermissions::new(self.inner.clone())
15232    }
15233
15234    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
15235    ///
15236    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
15237    ///
15238    /// # Example
15239    /// ```
15240    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15241    /// use google_cloud_gax::paginator::ItemPaginator as _;
15242    /// use google_cloud_aiplatform_v1::Result;
15243    /// async fn sample(
15244    ///    client: &PredictionService
15245    /// ) -> Result<()> {
15246    ///     let mut list = client.list_operations()
15247    ///         /* set fields */
15248    ///         .by_item();
15249    ///     while let Some(item) = list.next().await.transpose()? {
15250    ///         println!("{:?}", item);
15251    ///     }
15252    ///     Ok(())
15253    /// }
15254    /// ```
15255    pub fn list_operations(&self) -> super::builder::prediction_service::ListOperations {
15256        super::builder::prediction_service::ListOperations::new(self.inner.clone())
15257    }
15258
15259    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
15260    ///
15261    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
15262    ///
15263    /// # Example
15264    /// ```
15265    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15266    /// use google_cloud_aiplatform_v1::Result;
15267    /// async fn sample(
15268    ///    client: &PredictionService
15269    /// ) -> Result<()> {
15270    ///     let response = client.get_operation()
15271    ///         /* set fields */
15272    ///         .send().await?;
15273    ///     println!("response {:?}", response);
15274    ///     Ok(())
15275    /// }
15276    /// ```
15277    pub fn get_operation(&self) -> super::builder::prediction_service::GetOperation {
15278        super::builder::prediction_service::GetOperation::new(self.inner.clone())
15279    }
15280
15281    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
15282    ///
15283    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
15284    ///
15285    /// # Example
15286    /// ```
15287    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15288    /// use google_cloud_aiplatform_v1::Result;
15289    /// async fn sample(
15290    ///    client: &PredictionService
15291    /// ) -> Result<()> {
15292    ///     client.delete_operation()
15293    ///         /* set fields */
15294    ///         .send().await?;
15295    ///     Ok(())
15296    /// }
15297    /// ```
15298    pub fn delete_operation(&self) -> super::builder::prediction_service::DeleteOperation {
15299        super::builder::prediction_service::DeleteOperation::new(self.inner.clone())
15300    }
15301
15302    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
15303    ///
15304    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
15305    ///
15306    /// # Example
15307    /// ```
15308    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15309    /// use google_cloud_aiplatform_v1::Result;
15310    /// async fn sample(
15311    ///    client: &PredictionService
15312    /// ) -> Result<()> {
15313    ///     client.cancel_operation()
15314    ///         /* set fields */
15315    ///         .send().await?;
15316    ///     Ok(())
15317    /// }
15318    /// ```
15319    pub fn cancel_operation(&self) -> super::builder::prediction_service::CancelOperation {
15320        super::builder::prediction_service::CancelOperation::new(self.inner.clone())
15321    }
15322
15323    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
15324    ///
15325    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
15326    ///
15327    /// # Example
15328    /// ```
15329    /// # use google_cloud_aiplatform_v1::client::PredictionService;
15330    /// use google_cloud_aiplatform_v1::Result;
15331    /// async fn sample(
15332    ///    client: &PredictionService
15333    /// ) -> Result<()> {
15334    ///     let response = client.wait_operation()
15335    ///         /* set fields */
15336    ///         .send().await?;
15337    ///     println!("response {:?}", response);
15338    ///     Ok(())
15339    /// }
15340    /// ```
15341    pub fn wait_operation(&self) -> super::builder::prediction_service::WaitOperation {
15342        super::builder::prediction_service::WaitOperation::new(self.inner.clone())
15343    }
15344}
15345
15346/// Implements a client for the Vertex AI API.
15347///
15348/// # Example
15349/// ```
15350/// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15351/// async fn sample(
15352/// ) -> anyhow::Result<()> {
15353///     let client = ReasoningEngineExecutionService::builder().build().await?;
15354///     let response = client.query_reasoning_engine()
15355///         /* set fields */
15356///         .send().await?;
15357///     println!("response {:?}", response);
15358///     Ok(())
15359/// }
15360/// ```
15361///
15362/// # Service Description
15363///
15364/// A service for executing queries on Reasoning Engine.
15365///
15366/// # Configuration
15367///
15368/// To configure `ReasoningEngineExecutionService` use the `with_*` methods in the type returned
15369/// by [builder()][ReasoningEngineExecutionService::builder]. The default configuration should
15370/// work for most applications. Common configuration changes include
15371///
15372/// * [with_endpoint()]: by default this client uses the global default endpoint
15373///   (`https://aiplatform.googleapis.com`). Applications using regional
15374///   endpoints or running in restricted networks (e.g. a network configured
15375///   with [Private Google Access with VPC Service Controls]) may want to
15376///   override this default.
15377/// * [with_credentials()]: by default this client uses
15378///   [Application Default Credentials]. Applications using custom
15379///   authentication may need to override this default.
15380///
15381/// [with_endpoint()]: super::builder::reasoning_engine_execution_service::ClientBuilder::with_endpoint
15382/// [with_credentials()]: super::builder::reasoning_engine_execution_service::ClientBuilder::with_credentials
15383/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15384/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15385///
15386/// # Pooling and Cloning
15387///
15388/// `ReasoningEngineExecutionService` holds a connection pool internally, it is advised to
15389/// create one and reuse it. You do not need to wrap `ReasoningEngineExecutionService` in
15390/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15391/// already uses an `Arc` internally.
15392#[cfg(feature = "reasoning-engine-execution-service")]
15393#[cfg_attr(docsrs, doc(cfg(feature = "reasoning-engine-execution-service")))]
15394#[derive(Clone, Debug)]
15395pub struct ReasoningEngineExecutionService {
15396    inner: std::sync::Arc<dyn super::stub::dynamic::ReasoningEngineExecutionService>,
15397}
15398
15399#[cfg(feature = "reasoning-engine-execution-service")]
15400impl ReasoningEngineExecutionService {
15401    /// Returns a builder for [ReasoningEngineExecutionService].
15402    ///
15403    /// ```
15404    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15405    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15406    /// let client = ReasoningEngineExecutionService::builder().build().await?;
15407    /// # Ok(()) }
15408    /// ```
15409    pub fn builder() -> super::builder::reasoning_engine_execution_service::ClientBuilder {
15410        crate::new_client_builder(
15411            super::builder::reasoning_engine_execution_service::client::Factory,
15412        )
15413    }
15414
15415    /// Creates a new client from the provided stub.
15416    ///
15417    /// The most common case for calling this function is in tests mocking the
15418    /// client's behavior.
15419    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15420    where
15421        T: super::stub::ReasoningEngineExecutionService + 'static,
15422    {
15423        Self { inner: stub.into() }
15424    }
15425
15426    pub(crate) async fn new(
15427        config: gaxi::options::ClientConfig,
15428    ) -> crate::ClientBuilderResult<Self> {
15429        let inner = Self::build_inner(config).await?;
15430        Ok(Self { inner })
15431    }
15432
15433    async fn build_inner(
15434        conf: gaxi::options::ClientConfig,
15435    ) -> crate::ClientBuilderResult<
15436        std::sync::Arc<dyn super::stub::dynamic::ReasoningEngineExecutionService>,
15437    > {
15438        if gaxi::options::tracing_enabled(&conf) {
15439            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15440        }
15441        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15442    }
15443
15444    async fn build_transport(
15445        conf: gaxi::options::ClientConfig,
15446    ) -> crate::ClientBuilderResult<impl super::stub::ReasoningEngineExecutionService> {
15447        super::transport::ReasoningEngineExecutionService::new(conf).await
15448    }
15449
15450    async fn build_with_tracing(
15451        conf: gaxi::options::ClientConfig,
15452    ) -> crate::ClientBuilderResult<impl super::stub::ReasoningEngineExecutionService> {
15453        Self::build_transport(conf)
15454            .await
15455            .map(super::tracing::ReasoningEngineExecutionService::new)
15456    }
15457
15458    /// Queries using a reasoning engine.
15459    ///
15460    /// # Example
15461    /// ```
15462    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15463    /// use google_cloud_aiplatform_v1::Result;
15464    /// async fn sample(
15465    ///    client: &ReasoningEngineExecutionService
15466    /// ) -> Result<()> {
15467    ///     let response = client.query_reasoning_engine()
15468    ///         /* set fields */
15469    ///         .send().await?;
15470    ///     println!("response {:?}", response);
15471    ///     Ok(())
15472    /// }
15473    /// ```
15474    pub fn query_reasoning_engine(
15475        &self,
15476    ) -> super::builder::reasoning_engine_execution_service::QueryReasoningEngine {
15477        super::builder::reasoning_engine_execution_service::QueryReasoningEngine::new(
15478            self.inner.clone(),
15479        )
15480    }
15481
15482    /// Async query using a reasoning engine.
15483    ///
15484    /// # Long running operations
15485    ///
15486    /// This method is used to start, and/or poll a [long-running Operation].
15487    /// The [Working with long-running operations] chapter in the [user guide]
15488    /// covers these operations in detail.
15489    ///
15490    /// [long-running operation]: https://google.aip.dev/151
15491    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
15492    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
15493    ///
15494    /// # Example
15495    /// ```
15496    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15497    /// use google_cloud_lro::Poller;
15498    /// use google_cloud_aiplatform_v1::Result;
15499    /// async fn sample(
15500    ///    client: &ReasoningEngineExecutionService
15501    /// ) -> Result<()> {
15502    ///     let response = client.async_query_reasoning_engine()
15503    ///         /* set fields */
15504    ///         .poller().until_done().await?;
15505    ///     println!("response {:?}", response);
15506    ///     Ok(())
15507    /// }
15508    /// ```
15509    pub fn async_query_reasoning_engine(
15510        &self,
15511    ) -> super::builder::reasoning_engine_execution_service::AsyncQueryReasoningEngine {
15512        super::builder::reasoning_engine_execution_service::AsyncQueryReasoningEngine::new(
15513            self.inner.clone(),
15514        )
15515    }
15516
15517    /// Cancels an AsyncQueryReasoningEngine operation.
15518    ///
15519    /// # Example
15520    /// ```
15521    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15522    /// use google_cloud_aiplatform_v1::Result;
15523    /// async fn sample(
15524    ///    client: &ReasoningEngineExecutionService
15525    /// ) -> Result<()> {
15526    ///     let response = client.cancel_async_query_reasoning_engine()
15527    ///         /* set fields */
15528    ///         .send().await?;
15529    ///     println!("response {:?}", response);
15530    ///     Ok(())
15531    /// }
15532    /// ```
15533    pub fn cancel_async_query_reasoning_engine(
15534        &self,
15535    ) -> super::builder::reasoning_engine_execution_service::CancelAsyncQueryReasoningEngine {
15536        super::builder::reasoning_engine_execution_service::CancelAsyncQueryReasoningEngine::new(
15537            self.inner.clone(),
15538        )
15539    }
15540
15541    /// Lists information about the supported locations for this service.
15542    ///
15543    /// # Example
15544    /// ```
15545    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15546    /// use google_cloud_gax::paginator::ItemPaginator as _;
15547    /// use google_cloud_aiplatform_v1::Result;
15548    /// async fn sample(
15549    ///    client: &ReasoningEngineExecutionService
15550    /// ) -> Result<()> {
15551    ///     let mut list = client.list_locations()
15552    ///         /* set fields */
15553    ///         .by_item();
15554    ///     while let Some(item) = list.next().await.transpose()? {
15555    ///         println!("{:?}", item);
15556    ///     }
15557    ///     Ok(())
15558    /// }
15559    /// ```
15560    pub fn list_locations(
15561        &self,
15562    ) -> super::builder::reasoning_engine_execution_service::ListLocations {
15563        super::builder::reasoning_engine_execution_service::ListLocations::new(self.inner.clone())
15564    }
15565
15566    /// Gets information about a location.
15567    ///
15568    /// # Example
15569    /// ```
15570    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15571    /// use google_cloud_aiplatform_v1::Result;
15572    /// async fn sample(
15573    ///    client: &ReasoningEngineExecutionService
15574    /// ) -> Result<()> {
15575    ///     let response = client.get_location()
15576    ///         /* set fields */
15577    ///         .send().await?;
15578    ///     println!("response {:?}", response);
15579    ///     Ok(())
15580    /// }
15581    /// ```
15582    pub fn get_location(&self) -> super::builder::reasoning_engine_execution_service::GetLocation {
15583        super::builder::reasoning_engine_execution_service::GetLocation::new(self.inner.clone())
15584    }
15585
15586    /// Sets the access control policy on the specified resource. Replaces
15587    /// any existing policy.
15588    ///
15589    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
15590    /// errors.
15591    ///
15592    /// # Example
15593    /// ```
15594    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15595    /// use google_cloud_aiplatform_v1::Result;
15596    /// async fn sample(
15597    ///    client: &ReasoningEngineExecutionService
15598    /// ) -> Result<()> {
15599    ///     let response = client.set_iam_policy()
15600    ///         /* set fields */
15601    ///         .send().await?;
15602    ///     println!("response {:?}", response);
15603    ///     Ok(())
15604    /// }
15605    /// ```
15606    pub fn set_iam_policy(
15607        &self,
15608    ) -> super::builder::reasoning_engine_execution_service::SetIamPolicy {
15609        super::builder::reasoning_engine_execution_service::SetIamPolicy::new(self.inner.clone())
15610    }
15611
15612    /// Gets the access control policy for a resource. Returns an empty policy
15613    /// if the resource exists and does not have a policy set.
15614    ///
15615    /// # Example
15616    /// ```
15617    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15618    /// use google_cloud_aiplatform_v1::Result;
15619    /// async fn sample(
15620    ///    client: &ReasoningEngineExecutionService
15621    /// ) -> Result<()> {
15622    ///     let response = client.get_iam_policy()
15623    ///         /* set fields */
15624    ///         .send().await?;
15625    ///     println!("response {:?}", response);
15626    ///     Ok(())
15627    /// }
15628    /// ```
15629    pub fn get_iam_policy(
15630        &self,
15631    ) -> super::builder::reasoning_engine_execution_service::GetIamPolicy {
15632        super::builder::reasoning_engine_execution_service::GetIamPolicy::new(self.inner.clone())
15633    }
15634
15635    /// Returns permissions that a caller has on the specified resource. If the
15636    /// resource does not exist, this will return an empty set of
15637    /// permissions, not a `NOT_FOUND` error.
15638    ///
15639    /// Note: This operation is designed to be used for building
15640    /// permission-aware UIs and command-line tools, not for authorization
15641    /// checking. This operation may "fail open" without warning.
15642    ///
15643    /// # Example
15644    /// ```
15645    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15646    /// use google_cloud_aiplatform_v1::Result;
15647    /// async fn sample(
15648    ///    client: &ReasoningEngineExecutionService
15649    /// ) -> Result<()> {
15650    ///     let response = client.test_iam_permissions()
15651    ///         /* set fields */
15652    ///         .send().await?;
15653    ///     println!("response {:?}", response);
15654    ///     Ok(())
15655    /// }
15656    /// ```
15657    pub fn test_iam_permissions(
15658        &self,
15659    ) -> super::builder::reasoning_engine_execution_service::TestIamPermissions {
15660        super::builder::reasoning_engine_execution_service::TestIamPermissions::new(
15661            self.inner.clone(),
15662        )
15663    }
15664
15665    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
15666    ///
15667    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
15668    ///
15669    /// # Example
15670    /// ```
15671    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15672    /// use google_cloud_gax::paginator::ItemPaginator as _;
15673    /// use google_cloud_aiplatform_v1::Result;
15674    /// async fn sample(
15675    ///    client: &ReasoningEngineExecutionService
15676    /// ) -> Result<()> {
15677    ///     let mut list = client.list_operations()
15678    ///         /* set fields */
15679    ///         .by_item();
15680    ///     while let Some(item) = list.next().await.transpose()? {
15681    ///         println!("{:?}", item);
15682    ///     }
15683    ///     Ok(())
15684    /// }
15685    /// ```
15686    pub fn list_operations(
15687        &self,
15688    ) -> super::builder::reasoning_engine_execution_service::ListOperations {
15689        super::builder::reasoning_engine_execution_service::ListOperations::new(self.inner.clone())
15690    }
15691
15692    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
15693    ///
15694    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
15695    ///
15696    /// # Example
15697    /// ```
15698    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15699    /// use google_cloud_aiplatform_v1::Result;
15700    /// async fn sample(
15701    ///    client: &ReasoningEngineExecutionService
15702    /// ) -> Result<()> {
15703    ///     let response = client.get_operation()
15704    ///         /* set fields */
15705    ///         .send().await?;
15706    ///     println!("response {:?}", response);
15707    ///     Ok(())
15708    /// }
15709    /// ```
15710    pub fn get_operation(
15711        &self,
15712    ) -> super::builder::reasoning_engine_execution_service::GetOperation {
15713        super::builder::reasoning_engine_execution_service::GetOperation::new(self.inner.clone())
15714    }
15715
15716    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
15717    ///
15718    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
15719    ///
15720    /// # Example
15721    /// ```
15722    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15723    /// use google_cloud_aiplatform_v1::Result;
15724    /// async fn sample(
15725    ///    client: &ReasoningEngineExecutionService
15726    /// ) -> Result<()> {
15727    ///     client.delete_operation()
15728    ///         /* set fields */
15729    ///         .send().await?;
15730    ///     Ok(())
15731    /// }
15732    /// ```
15733    pub fn delete_operation(
15734        &self,
15735    ) -> super::builder::reasoning_engine_execution_service::DeleteOperation {
15736        super::builder::reasoning_engine_execution_service::DeleteOperation::new(self.inner.clone())
15737    }
15738
15739    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
15740    ///
15741    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
15742    ///
15743    /// # Example
15744    /// ```
15745    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15746    /// use google_cloud_aiplatform_v1::Result;
15747    /// async fn sample(
15748    ///    client: &ReasoningEngineExecutionService
15749    /// ) -> Result<()> {
15750    ///     client.cancel_operation()
15751    ///         /* set fields */
15752    ///         .send().await?;
15753    ///     Ok(())
15754    /// }
15755    /// ```
15756    pub fn cancel_operation(
15757        &self,
15758    ) -> super::builder::reasoning_engine_execution_service::CancelOperation {
15759        super::builder::reasoning_engine_execution_service::CancelOperation::new(self.inner.clone())
15760    }
15761
15762    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
15763    ///
15764    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
15765    ///
15766    /// # Example
15767    /// ```
15768    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineExecutionService;
15769    /// use google_cloud_aiplatform_v1::Result;
15770    /// async fn sample(
15771    ///    client: &ReasoningEngineExecutionService
15772    /// ) -> Result<()> {
15773    ///     let response = client.wait_operation()
15774    ///         /* set fields */
15775    ///         .send().await?;
15776    ///     println!("response {:?}", response);
15777    ///     Ok(())
15778    /// }
15779    /// ```
15780    pub fn wait_operation(
15781        &self,
15782    ) -> super::builder::reasoning_engine_execution_service::WaitOperation {
15783        super::builder::reasoning_engine_execution_service::WaitOperation::new(self.inner.clone())
15784    }
15785}
15786
15787/// Implements a client for the Vertex AI API.
15788///
15789/// # Example
15790/// ```
15791/// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
15792/// use google_cloud_gax::paginator::ItemPaginator as _;
15793/// async fn sample(
15794///    parent: &str,
15795/// ) -> anyhow::Result<()> {
15796///     let client = ReasoningEngineService::builder().build().await?;
15797///     let mut list = client.list_reasoning_engines()
15798///         .set_parent(parent)
15799///         .by_item();
15800///     while let Some(item) = list.next().await.transpose()? {
15801///         println!("{:?}", item);
15802///     }
15803///     Ok(())
15804/// }
15805/// ```
15806///
15807/// # Service Description
15808///
15809/// A service for managing Vertex AI's Reasoning Engines.
15810///
15811/// # Configuration
15812///
15813/// To configure `ReasoningEngineService` use the `with_*` methods in the type returned
15814/// by [builder()][ReasoningEngineService::builder]. The default configuration should
15815/// work for most applications. Common configuration changes include
15816///
15817/// * [with_endpoint()]: by default this client uses the global default endpoint
15818///   (`https://aiplatform.googleapis.com`). Applications using regional
15819///   endpoints or running in restricted networks (e.g. a network configured
15820///   with [Private Google Access with VPC Service Controls]) may want to
15821///   override this default.
15822/// * [with_credentials()]: by default this client uses
15823///   [Application Default Credentials]. Applications using custom
15824///   authentication may need to override this default.
15825///
15826/// [with_endpoint()]: super::builder::reasoning_engine_service::ClientBuilder::with_endpoint
15827/// [with_credentials()]: super::builder::reasoning_engine_service::ClientBuilder::with_credentials
15828/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15829/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15830///
15831/// # Pooling and Cloning
15832///
15833/// `ReasoningEngineService` holds a connection pool internally, it is advised to
15834/// create one and reuse it. You do not need to wrap `ReasoningEngineService` in
15835/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15836/// already uses an `Arc` internally.
15837#[cfg(feature = "reasoning-engine-service")]
15838#[cfg_attr(docsrs, doc(cfg(feature = "reasoning-engine-service")))]
15839#[derive(Clone, Debug)]
15840pub struct ReasoningEngineService {
15841    inner: std::sync::Arc<dyn super::stub::dynamic::ReasoningEngineService>,
15842}
15843
15844#[cfg(feature = "reasoning-engine-service")]
15845impl ReasoningEngineService {
15846    /// Returns a builder for [ReasoningEngineService].
15847    ///
15848    /// ```
15849    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15850    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
15851    /// let client = ReasoningEngineService::builder().build().await?;
15852    /// # Ok(()) }
15853    /// ```
15854    pub fn builder() -> super::builder::reasoning_engine_service::ClientBuilder {
15855        crate::new_client_builder(super::builder::reasoning_engine_service::client::Factory)
15856    }
15857
15858    /// Creates a new client from the provided stub.
15859    ///
15860    /// The most common case for calling this function is in tests mocking the
15861    /// client's behavior.
15862    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15863    where
15864        T: super::stub::ReasoningEngineService + 'static,
15865    {
15866        Self { inner: stub.into() }
15867    }
15868
15869    pub(crate) async fn new(
15870        config: gaxi::options::ClientConfig,
15871    ) -> crate::ClientBuilderResult<Self> {
15872        let inner = Self::build_inner(config).await?;
15873        Ok(Self { inner })
15874    }
15875
15876    async fn build_inner(
15877        conf: gaxi::options::ClientConfig,
15878    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReasoningEngineService>>
15879    {
15880        if gaxi::options::tracing_enabled(&conf) {
15881            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15882        }
15883        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15884    }
15885
15886    async fn build_transport(
15887        conf: gaxi::options::ClientConfig,
15888    ) -> crate::ClientBuilderResult<impl super::stub::ReasoningEngineService> {
15889        super::transport::ReasoningEngineService::new(conf).await
15890    }
15891
15892    async fn build_with_tracing(
15893        conf: gaxi::options::ClientConfig,
15894    ) -> crate::ClientBuilderResult<impl super::stub::ReasoningEngineService> {
15895        Self::build_transport(conf)
15896            .await
15897            .map(super::tracing::ReasoningEngineService::new)
15898    }
15899
15900    /// Creates a reasoning engine.
15901    ///
15902    /// # Long running operations
15903    ///
15904    /// This method is used to start, and/or poll a [long-running Operation].
15905    /// The [Working with long-running operations] chapter in the [user guide]
15906    /// covers these operations in detail.
15907    ///
15908    /// [long-running operation]: https://google.aip.dev/151
15909    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
15910    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
15911    ///
15912    /// # Example
15913    /// ```
15914    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
15915    /// use google_cloud_lro::Poller;
15916    /// use google_cloud_aiplatform_v1::model::ReasoningEngine;
15917    /// use google_cloud_aiplatform_v1::Result;
15918    /// async fn sample(
15919    ///    client: &ReasoningEngineService, parent: &str
15920    /// ) -> Result<()> {
15921    ///     let response = client.create_reasoning_engine()
15922    ///         .set_parent(parent)
15923    ///         .set_reasoning_engine(
15924    ///             ReasoningEngine::new()/* set fields */
15925    ///         )
15926    ///         .poller().until_done().await?;
15927    ///     println!("response {:?}", response);
15928    ///     Ok(())
15929    /// }
15930    /// ```
15931    pub fn create_reasoning_engine(
15932        &self,
15933    ) -> super::builder::reasoning_engine_service::CreateReasoningEngine {
15934        super::builder::reasoning_engine_service::CreateReasoningEngine::new(self.inner.clone())
15935    }
15936
15937    /// Gets a reasoning engine.
15938    ///
15939    /// # Example
15940    /// ```
15941    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
15942    /// use google_cloud_aiplatform_v1::Result;
15943    /// async fn sample(
15944    ///    client: &ReasoningEngineService, project_id: &str, location_id: &str, reasoning_engine_id: &str
15945    /// ) -> Result<()> {
15946    ///     let response = client.get_reasoning_engine()
15947    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/reasoningEngines/{reasoning_engine_id}"))
15948    ///         .send().await?;
15949    ///     println!("response {:?}", response);
15950    ///     Ok(())
15951    /// }
15952    /// ```
15953    pub fn get_reasoning_engine(
15954        &self,
15955    ) -> super::builder::reasoning_engine_service::GetReasoningEngine {
15956        super::builder::reasoning_engine_service::GetReasoningEngine::new(self.inner.clone())
15957    }
15958
15959    /// Lists reasoning engines in a location.
15960    ///
15961    /// # Example
15962    /// ```
15963    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
15964    /// use google_cloud_gax::paginator::ItemPaginator as _;
15965    /// use google_cloud_aiplatform_v1::Result;
15966    /// async fn sample(
15967    ///    client: &ReasoningEngineService, parent: &str
15968    /// ) -> Result<()> {
15969    ///     let mut list = client.list_reasoning_engines()
15970    ///         .set_parent(parent)
15971    ///         .by_item();
15972    ///     while let Some(item) = list.next().await.transpose()? {
15973    ///         println!("{:?}", item);
15974    ///     }
15975    ///     Ok(())
15976    /// }
15977    /// ```
15978    pub fn list_reasoning_engines(
15979        &self,
15980    ) -> super::builder::reasoning_engine_service::ListReasoningEngines {
15981        super::builder::reasoning_engine_service::ListReasoningEngines::new(self.inner.clone())
15982    }
15983
15984    /// Updates a reasoning engine.
15985    ///
15986    /// # Long running operations
15987    ///
15988    /// This method is used to start, and/or poll a [long-running Operation].
15989    /// The [Working with long-running operations] chapter in the [user guide]
15990    /// covers these operations in detail.
15991    ///
15992    /// [long-running operation]: https://google.aip.dev/151
15993    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
15994    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
15995    ///
15996    /// # Example
15997    /// ```
15998    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
15999    /// use google_cloud_lro::Poller;
16000    /// # extern crate wkt as google_cloud_wkt;
16001    /// use google_cloud_wkt::FieldMask;
16002    /// use google_cloud_aiplatform_v1::model::ReasoningEngine;
16003    /// use google_cloud_aiplatform_v1::Result;
16004    /// async fn sample(
16005    ///    client: &ReasoningEngineService, project_id: &str, location_id: &str, reasoning_engine_id: &str
16006    /// ) -> Result<()> {
16007    ///     let response = client.update_reasoning_engine()
16008    ///         .set_reasoning_engine(
16009    ///             ReasoningEngine::new().set_name(format!("projects/{project_id}/locations/{location_id}/reasoningEngines/{reasoning_engine_id}"))/* set fields */
16010    ///         )
16011    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
16012    ///         .poller().until_done().await?;
16013    ///     println!("response {:?}", response);
16014    ///     Ok(())
16015    /// }
16016    /// ```
16017    pub fn update_reasoning_engine(
16018        &self,
16019    ) -> super::builder::reasoning_engine_service::UpdateReasoningEngine {
16020        super::builder::reasoning_engine_service::UpdateReasoningEngine::new(self.inner.clone())
16021    }
16022
16023    /// Deletes a reasoning engine.
16024    ///
16025    /// # Long running operations
16026    ///
16027    /// This method is used to start, and/or poll a [long-running Operation].
16028    /// The [Working with long-running operations] chapter in the [user guide]
16029    /// covers these operations in detail.
16030    ///
16031    /// [long-running operation]: https://google.aip.dev/151
16032    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
16033    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
16034    ///
16035    /// # Example
16036    /// ```
16037    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
16038    /// use google_cloud_lro::Poller;
16039    /// use google_cloud_aiplatform_v1::Result;
16040    /// async fn sample(
16041    ///    client: &ReasoningEngineService, project_id: &str, location_id: &str, reasoning_engine_id: &str
16042    /// ) -> Result<()> {
16043    ///     client.delete_reasoning_engine()
16044    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/reasoningEngines/{reasoning_engine_id}"))
16045    ///         .poller().until_done().await?;
16046    ///     Ok(())
16047    /// }
16048    /// ```
16049    pub fn delete_reasoning_engine(
16050        &self,
16051    ) -> super::builder::reasoning_engine_service::DeleteReasoningEngine {
16052        super::builder::reasoning_engine_service::DeleteReasoningEngine::new(self.inner.clone())
16053    }
16054
16055    /// Lists information about the supported locations for this service.
16056    ///
16057    /// # Example
16058    /// ```
16059    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
16060    /// use google_cloud_gax::paginator::ItemPaginator as _;
16061    /// use google_cloud_aiplatform_v1::Result;
16062    /// async fn sample(
16063    ///    client: &ReasoningEngineService
16064    /// ) -> Result<()> {
16065    ///     let mut list = client.list_locations()
16066    ///         /* set fields */
16067    ///         .by_item();
16068    ///     while let Some(item) = list.next().await.transpose()? {
16069    ///         println!("{:?}", item);
16070    ///     }
16071    ///     Ok(())
16072    /// }
16073    /// ```
16074    pub fn list_locations(&self) -> super::builder::reasoning_engine_service::ListLocations {
16075        super::builder::reasoning_engine_service::ListLocations::new(self.inner.clone())
16076    }
16077
16078    /// Gets information about a location.
16079    ///
16080    /// # Example
16081    /// ```
16082    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
16083    /// use google_cloud_aiplatform_v1::Result;
16084    /// async fn sample(
16085    ///    client: &ReasoningEngineService
16086    /// ) -> Result<()> {
16087    ///     let response = client.get_location()
16088    ///         /* set fields */
16089    ///         .send().await?;
16090    ///     println!("response {:?}", response);
16091    ///     Ok(())
16092    /// }
16093    /// ```
16094    pub fn get_location(&self) -> super::builder::reasoning_engine_service::GetLocation {
16095        super::builder::reasoning_engine_service::GetLocation::new(self.inner.clone())
16096    }
16097
16098    /// Sets the access control policy on the specified resource. Replaces
16099    /// any existing policy.
16100    ///
16101    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
16102    /// errors.
16103    ///
16104    /// # Example
16105    /// ```
16106    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
16107    /// use google_cloud_aiplatform_v1::Result;
16108    /// async fn sample(
16109    ///    client: &ReasoningEngineService
16110    /// ) -> Result<()> {
16111    ///     let response = client.set_iam_policy()
16112    ///         /* set fields */
16113    ///         .send().await?;
16114    ///     println!("response {:?}", response);
16115    ///     Ok(())
16116    /// }
16117    /// ```
16118    pub fn set_iam_policy(&self) -> super::builder::reasoning_engine_service::SetIamPolicy {
16119        super::builder::reasoning_engine_service::SetIamPolicy::new(self.inner.clone())
16120    }
16121
16122    /// Gets the access control policy for a resource. Returns an empty policy
16123    /// if the resource exists and does not have a policy set.
16124    ///
16125    /// # Example
16126    /// ```
16127    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
16128    /// use google_cloud_aiplatform_v1::Result;
16129    /// async fn sample(
16130    ///    client: &ReasoningEngineService
16131    /// ) -> Result<()> {
16132    ///     let response = client.get_iam_policy()
16133    ///         /* set fields */
16134    ///         .send().await?;
16135    ///     println!("response {:?}", response);
16136    ///     Ok(())
16137    /// }
16138    /// ```
16139    pub fn get_iam_policy(&self) -> super::builder::reasoning_engine_service::GetIamPolicy {
16140        super::builder::reasoning_engine_service::GetIamPolicy::new(self.inner.clone())
16141    }
16142
16143    /// Returns permissions that a caller has on the specified resource. If the
16144    /// resource does not exist, this will return an empty set of
16145    /// permissions, not a `NOT_FOUND` error.
16146    ///
16147    /// Note: This operation is designed to be used for building
16148    /// permission-aware UIs and command-line tools, not for authorization
16149    /// checking. This operation may "fail open" without warning.
16150    ///
16151    /// # Example
16152    /// ```
16153    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
16154    /// use google_cloud_aiplatform_v1::Result;
16155    /// async fn sample(
16156    ///    client: &ReasoningEngineService
16157    /// ) -> Result<()> {
16158    ///     let response = client.test_iam_permissions()
16159    ///         /* set fields */
16160    ///         .send().await?;
16161    ///     println!("response {:?}", response);
16162    ///     Ok(())
16163    /// }
16164    /// ```
16165    pub fn test_iam_permissions(
16166        &self,
16167    ) -> super::builder::reasoning_engine_service::TestIamPermissions {
16168        super::builder::reasoning_engine_service::TestIamPermissions::new(self.inner.clone())
16169    }
16170
16171    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
16172    ///
16173    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
16174    ///
16175    /// # Example
16176    /// ```
16177    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
16178    /// use google_cloud_gax::paginator::ItemPaginator as _;
16179    /// use google_cloud_aiplatform_v1::Result;
16180    /// async fn sample(
16181    ///    client: &ReasoningEngineService
16182    /// ) -> Result<()> {
16183    ///     let mut list = client.list_operations()
16184    ///         /* set fields */
16185    ///         .by_item();
16186    ///     while let Some(item) = list.next().await.transpose()? {
16187    ///         println!("{:?}", item);
16188    ///     }
16189    ///     Ok(())
16190    /// }
16191    /// ```
16192    pub fn list_operations(&self) -> super::builder::reasoning_engine_service::ListOperations {
16193        super::builder::reasoning_engine_service::ListOperations::new(self.inner.clone())
16194    }
16195
16196    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
16197    ///
16198    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
16199    ///
16200    /// # Example
16201    /// ```
16202    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
16203    /// use google_cloud_aiplatform_v1::Result;
16204    /// async fn sample(
16205    ///    client: &ReasoningEngineService
16206    /// ) -> Result<()> {
16207    ///     let response = client.get_operation()
16208    ///         /* set fields */
16209    ///         .send().await?;
16210    ///     println!("response {:?}", response);
16211    ///     Ok(())
16212    /// }
16213    /// ```
16214    pub fn get_operation(&self) -> super::builder::reasoning_engine_service::GetOperation {
16215        super::builder::reasoning_engine_service::GetOperation::new(self.inner.clone())
16216    }
16217
16218    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
16219    ///
16220    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
16221    ///
16222    /// # Example
16223    /// ```
16224    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
16225    /// use google_cloud_aiplatform_v1::Result;
16226    /// async fn sample(
16227    ///    client: &ReasoningEngineService
16228    /// ) -> Result<()> {
16229    ///     client.delete_operation()
16230    ///         /* set fields */
16231    ///         .send().await?;
16232    ///     Ok(())
16233    /// }
16234    /// ```
16235    pub fn delete_operation(&self) -> super::builder::reasoning_engine_service::DeleteOperation {
16236        super::builder::reasoning_engine_service::DeleteOperation::new(self.inner.clone())
16237    }
16238
16239    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
16240    ///
16241    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
16242    ///
16243    /// # Example
16244    /// ```
16245    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
16246    /// use google_cloud_aiplatform_v1::Result;
16247    /// async fn sample(
16248    ///    client: &ReasoningEngineService
16249    /// ) -> Result<()> {
16250    ///     client.cancel_operation()
16251    ///         /* set fields */
16252    ///         .send().await?;
16253    ///     Ok(())
16254    /// }
16255    /// ```
16256    pub fn cancel_operation(&self) -> super::builder::reasoning_engine_service::CancelOperation {
16257        super::builder::reasoning_engine_service::CancelOperation::new(self.inner.clone())
16258    }
16259
16260    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
16261    ///
16262    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
16263    ///
16264    /// # Example
16265    /// ```
16266    /// # use google_cloud_aiplatform_v1::client::ReasoningEngineService;
16267    /// use google_cloud_aiplatform_v1::Result;
16268    /// async fn sample(
16269    ///    client: &ReasoningEngineService
16270    /// ) -> Result<()> {
16271    ///     let response = client.wait_operation()
16272    ///         /* set fields */
16273    ///         .send().await?;
16274    ///     println!("response {:?}", response);
16275    ///     Ok(())
16276    /// }
16277    /// ```
16278    pub fn wait_operation(&self) -> super::builder::reasoning_engine_service::WaitOperation {
16279        super::builder::reasoning_engine_service::WaitOperation::new(self.inner.clone())
16280    }
16281}
16282
16283/// Implements a client for the Vertex AI API.
16284///
16285/// # Example
16286/// ```
16287/// # use google_cloud_aiplatform_v1::client::ScheduleService;
16288/// use google_cloud_gax::paginator::ItemPaginator as _;
16289/// async fn sample(
16290///    parent: &str,
16291/// ) -> anyhow::Result<()> {
16292///     let client = ScheduleService::builder().build().await?;
16293///     let mut list = client.list_schedules()
16294///         .set_parent(parent)
16295///         .by_item();
16296///     while let Some(item) = list.next().await.transpose()? {
16297///         println!("{:?}", item);
16298///     }
16299///     Ok(())
16300/// }
16301/// ```
16302///
16303/// # Service Description
16304///
16305/// A service for creating and managing Vertex AI's Schedule resources to
16306/// periodically launch shceudled runs to make API calls.
16307///
16308/// # Configuration
16309///
16310/// To configure `ScheduleService` use the `with_*` methods in the type returned
16311/// by [builder()][ScheduleService::builder]. The default configuration should
16312/// work for most applications. Common configuration changes include
16313///
16314/// * [with_endpoint()]: by default this client uses the global default endpoint
16315///   (`https://aiplatform.googleapis.com`). Applications using regional
16316///   endpoints or running in restricted networks (e.g. a network configured
16317///   with [Private Google Access with VPC Service Controls]) may want to
16318///   override this default.
16319/// * [with_credentials()]: by default this client uses
16320///   [Application Default Credentials]. Applications using custom
16321///   authentication may need to override this default.
16322///
16323/// [with_endpoint()]: super::builder::schedule_service::ClientBuilder::with_endpoint
16324/// [with_credentials()]: super::builder::schedule_service::ClientBuilder::with_credentials
16325/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16326/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16327///
16328/// # Pooling and Cloning
16329///
16330/// `ScheduleService` holds a connection pool internally, it is advised to
16331/// create one and reuse it. You do not need to wrap `ScheduleService` in
16332/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16333/// already uses an `Arc` internally.
16334#[cfg(feature = "schedule-service")]
16335#[cfg_attr(docsrs, doc(cfg(feature = "schedule-service")))]
16336#[derive(Clone, Debug)]
16337pub struct ScheduleService {
16338    inner: std::sync::Arc<dyn super::stub::dynamic::ScheduleService>,
16339}
16340
16341#[cfg(feature = "schedule-service")]
16342impl ScheduleService {
16343    /// Returns a builder for [ScheduleService].
16344    ///
16345    /// ```
16346    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16347    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16348    /// let client = ScheduleService::builder().build().await?;
16349    /// # Ok(()) }
16350    /// ```
16351    pub fn builder() -> super::builder::schedule_service::ClientBuilder {
16352        crate::new_client_builder(super::builder::schedule_service::client::Factory)
16353    }
16354
16355    /// Creates a new client from the provided stub.
16356    ///
16357    /// The most common case for calling this function is in tests mocking the
16358    /// client's behavior.
16359    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16360    where
16361        T: super::stub::ScheduleService + 'static,
16362    {
16363        Self { inner: stub.into() }
16364    }
16365
16366    pub(crate) async fn new(
16367        config: gaxi::options::ClientConfig,
16368    ) -> crate::ClientBuilderResult<Self> {
16369        let inner = Self::build_inner(config).await?;
16370        Ok(Self { inner })
16371    }
16372
16373    async fn build_inner(
16374        conf: gaxi::options::ClientConfig,
16375    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ScheduleService>> {
16376        if gaxi::options::tracing_enabled(&conf) {
16377            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16378        }
16379        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16380    }
16381
16382    async fn build_transport(
16383        conf: gaxi::options::ClientConfig,
16384    ) -> crate::ClientBuilderResult<impl super::stub::ScheduleService> {
16385        super::transport::ScheduleService::new(conf).await
16386    }
16387
16388    async fn build_with_tracing(
16389        conf: gaxi::options::ClientConfig,
16390    ) -> crate::ClientBuilderResult<impl super::stub::ScheduleService> {
16391        Self::build_transport(conf)
16392            .await
16393            .map(super::tracing::ScheduleService::new)
16394    }
16395
16396    /// Creates a Schedule.
16397    ///
16398    /// # Example
16399    /// ```
16400    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16401    /// use google_cloud_aiplatform_v1::model::Schedule;
16402    /// use google_cloud_aiplatform_v1::Result;
16403    /// async fn sample(
16404    ///    client: &ScheduleService, parent: &str
16405    /// ) -> Result<()> {
16406    ///     let response = client.create_schedule()
16407    ///         .set_parent(parent)
16408    ///         .set_schedule(
16409    ///             Schedule::new()/* set fields */
16410    ///         )
16411    ///         .send().await?;
16412    ///     println!("response {:?}", response);
16413    ///     Ok(())
16414    /// }
16415    /// ```
16416    pub fn create_schedule(&self) -> super::builder::schedule_service::CreateSchedule {
16417        super::builder::schedule_service::CreateSchedule::new(self.inner.clone())
16418    }
16419
16420    /// Deletes a Schedule.
16421    ///
16422    /// # Long running operations
16423    ///
16424    /// This method is used to start, and/or poll a [long-running Operation].
16425    /// The [Working with long-running operations] chapter in the [user guide]
16426    /// covers these operations in detail.
16427    ///
16428    /// [long-running operation]: https://google.aip.dev/151
16429    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
16430    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
16431    ///
16432    /// # Example
16433    /// ```
16434    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16435    /// use google_cloud_lro::Poller;
16436    /// use google_cloud_aiplatform_v1::Result;
16437    /// async fn sample(
16438    ///    client: &ScheduleService, project_id: &str, location_id: &str, schedule_id: &str
16439    /// ) -> Result<()> {
16440    ///     client.delete_schedule()
16441    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/schedules/{schedule_id}"))
16442    ///         .poller().until_done().await?;
16443    ///     Ok(())
16444    /// }
16445    /// ```
16446    pub fn delete_schedule(&self) -> super::builder::schedule_service::DeleteSchedule {
16447        super::builder::schedule_service::DeleteSchedule::new(self.inner.clone())
16448    }
16449
16450    /// Gets a Schedule.
16451    ///
16452    /// # Example
16453    /// ```
16454    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16455    /// use google_cloud_aiplatform_v1::Result;
16456    /// async fn sample(
16457    ///    client: &ScheduleService, project_id: &str, location_id: &str, schedule_id: &str
16458    /// ) -> Result<()> {
16459    ///     let response = client.get_schedule()
16460    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/schedules/{schedule_id}"))
16461    ///         .send().await?;
16462    ///     println!("response {:?}", response);
16463    ///     Ok(())
16464    /// }
16465    /// ```
16466    pub fn get_schedule(&self) -> super::builder::schedule_service::GetSchedule {
16467        super::builder::schedule_service::GetSchedule::new(self.inner.clone())
16468    }
16469
16470    /// Lists Schedules in a Location.
16471    ///
16472    /// # Example
16473    /// ```
16474    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16475    /// use google_cloud_gax::paginator::ItemPaginator as _;
16476    /// use google_cloud_aiplatform_v1::Result;
16477    /// async fn sample(
16478    ///    client: &ScheduleService, parent: &str
16479    /// ) -> Result<()> {
16480    ///     let mut list = client.list_schedules()
16481    ///         .set_parent(parent)
16482    ///         .by_item();
16483    ///     while let Some(item) = list.next().await.transpose()? {
16484    ///         println!("{:?}", item);
16485    ///     }
16486    ///     Ok(())
16487    /// }
16488    /// ```
16489    pub fn list_schedules(&self) -> super::builder::schedule_service::ListSchedules {
16490        super::builder::schedule_service::ListSchedules::new(self.inner.clone())
16491    }
16492
16493    /// Pauses a Schedule. Will mark
16494    /// [Schedule.state][google.cloud.aiplatform.v1.Schedule.state] to 'PAUSED'. If
16495    /// the schedule is paused, no new runs will be created. Already created runs
16496    /// will NOT be paused or canceled.
16497    ///
16498    /// [google.cloud.aiplatform.v1.Schedule.state]: crate::model::Schedule::state
16499    ///
16500    /// # Example
16501    /// ```
16502    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16503    /// use google_cloud_aiplatform_v1::Result;
16504    /// async fn sample(
16505    ///    client: &ScheduleService
16506    /// ) -> Result<()> {
16507    ///     client.pause_schedule()
16508    ///         /* set fields */
16509    ///         .send().await?;
16510    ///     Ok(())
16511    /// }
16512    /// ```
16513    pub fn pause_schedule(&self) -> super::builder::schedule_service::PauseSchedule {
16514        super::builder::schedule_service::PauseSchedule::new(self.inner.clone())
16515    }
16516
16517    /// Resumes a paused Schedule to start scheduling new runs. Will mark
16518    /// [Schedule.state][google.cloud.aiplatform.v1.Schedule.state] to 'ACTIVE'.
16519    /// Only paused Schedule can be resumed.
16520    ///
16521    /// When the Schedule is resumed, new runs will be scheduled starting from the
16522    /// next execution time after the current time based on the time_specification
16523    /// in the Schedule. If
16524    /// [Schedule.catch_up][google.cloud.aiplatform.v1.Schedule.catch_up] is set up
16525    /// true, all missed runs will be scheduled for backfill first.
16526    ///
16527    /// [google.cloud.aiplatform.v1.Schedule.catch_up]: crate::model::Schedule::catch_up
16528    /// [google.cloud.aiplatform.v1.Schedule.state]: crate::model::Schedule::state
16529    ///
16530    /// # Example
16531    /// ```
16532    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16533    /// use google_cloud_aiplatform_v1::Result;
16534    /// async fn sample(
16535    ///    client: &ScheduleService
16536    /// ) -> Result<()> {
16537    ///     client.resume_schedule()
16538    ///         /* set fields */
16539    ///         .send().await?;
16540    ///     Ok(())
16541    /// }
16542    /// ```
16543    pub fn resume_schedule(&self) -> super::builder::schedule_service::ResumeSchedule {
16544        super::builder::schedule_service::ResumeSchedule::new(self.inner.clone())
16545    }
16546
16547    /// Updates an active or paused Schedule.
16548    ///
16549    /// When the Schedule is updated, new runs will be scheduled starting from the
16550    /// updated next execution time after the update time based on the
16551    /// time_specification in the updated Schedule. All unstarted runs before the
16552    /// update time will be skipped while already created runs will NOT be paused
16553    /// or canceled.
16554    ///
16555    /// # Example
16556    /// ```
16557    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16558    /// # extern crate wkt as google_cloud_wkt;
16559    /// use google_cloud_wkt::FieldMask;
16560    /// use google_cloud_aiplatform_v1::model::Schedule;
16561    /// use google_cloud_aiplatform_v1::Result;
16562    /// async fn sample(
16563    ///    client: &ScheduleService, project_id: &str, location_id: &str, schedule_id: &str
16564    /// ) -> Result<()> {
16565    ///     let response = client.update_schedule()
16566    ///         .set_schedule(
16567    ///             Schedule::new().set_name(format!("projects/{project_id}/locations/{location_id}/schedules/{schedule_id}"))/* set fields */
16568    ///         )
16569    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
16570    ///         .send().await?;
16571    ///     println!("response {:?}", response);
16572    ///     Ok(())
16573    /// }
16574    /// ```
16575    pub fn update_schedule(&self) -> super::builder::schedule_service::UpdateSchedule {
16576        super::builder::schedule_service::UpdateSchedule::new(self.inner.clone())
16577    }
16578
16579    /// Lists information about the supported locations for this service.
16580    ///
16581    /// # Example
16582    /// ```
16583    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16584    /// use google_cloud_gax::paginator::ItemPaginator as _;
16585    /// use google_cloud_aiplatform_v1::Result;
16586    /// async fn sample(
16587    ///    client: &ScheduleService
16588    /// ) -> Result<()> {
16589    ///     let mut list = client.list_locations()
16590    ///         /* set fields */
16591    ///         .by_item();
16592    ///     while let Some(item) = list.next().await.transpose()? {
16593    ///         println!("{:?}", item);
16594    ///     }
16595    ///     Ok(())
16596    /// }
16597    /// ```
16598    pub fn list_locations(&self) -> super::builder::schedule_service::ListLocations {
16599        super::builder::schedule_service::ListLocations::new(self.inner.clone())
16600    }
16601
16602    /// Gets information about a location.
16603    ///
16604    /// # Example
16605    /// ```
16606    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16607    /// use google_cloud_aiplatform_v1::Result;
16608    /// async fn sample(
16609    ///    client: &ScheduleService
16610    /// ) -> Result<()> {
16611    ///     let response = client.get_location()
16612    ///         /* set fields */
16613    ///         .send().await?;
16614    ///     println!("response {:?}", response);
16615    ///     Ok(())
16616    /// }
16617    /// ```
16618    pub fn get_location(&self) -> super::builder::schedule_service::GetLocation {
16619        super::builder::schedule_service::GetLocation::new(self.inner.clone())
16620    }
16621
16622    /// Sets the access control policy on the specified resource. Replaces
16623    /// any existing policy.
16624    ///
16625    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
16626    /// errors.
16627    ///
16628    /// # Example
16629    /// ```
16630    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16631    /// use google_cloud_aiplatform_v1::Result;
16632    /// async fn sample(
16633    ///    client: &ScheduleService
16634    /// ) -> Result<()> {
16635    ///     let response = client.set_iam_policy()
16636    ///         /* set fields */
16637    ///         .send().await?;
16638    ///     println!("response {:?}", response);
16639    ///     Ok(())
16640    /// }
16641    /// ```
16642    pub fn set_iam_policy(&self) -> super::builder::schedule_service::SetIamPolicy {
16643        super::builder::schedule_service::SetIamPolicy::new(self.inner.clone())
16644    }
16645
16646    /// Gets the access control policy for a resource. Returns an empty policy
16647    /// if the resource exists and does not have a policy set.
16648    ///
16649    /// # Example
16650    /// ```
16651    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16652    /// use google_cloud_aiplatform_v1::Result;
16653    /// async fn sample(
16654    ///    client: &ScheduleService
16655    /// ) -> Result<()> {
16656    ///     let response = client.get_iam_policy()
16657    ///         /* set fields */
16658    ///         .send().await?;
16659    ///     println!("response {:?}", response);
16660    ///     Ok(())
16661    /// }
16662    /// ```
16663    pub fn get_iam_policy(&self) -> super::builder::schedule_service::GetIamPolicy {
16664        super::builder::schedule_service::GetIamPolicy::new(self.inner.clone())
16665    }
16666
16667    /// Returns permissions that a caller has on the specified resource. If the
16668    /// resource does not exist, this will return an empty set of
16669    /// permissions, not a `NOT_FOUND` error.
16670    ///
16671    /// Note: This operation is designed to be used for building
16672    /// permission-aware UIs and command-line tools, not for authorization
16673    /// checking. This operation may "fail open" without warning.
16674    ///
16675    /// # Example
16676    /// ```
16677    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16678    /// use google_cloud_aiplatform_v1::Result;
16679    /// async fn sample(
16680    ///    client: &ScheduleService
16681    /// ) -> Result<()> {
16682    ///     let response = client.test_iam_permissions()
16683    ///         /* set fields */
16684    ///         .send().await?;
16685    ///     println!("response {:?}", response);
16686    ///     Ok(())
16687    /// }
16688    /// ```
16689    pub fn test_iam_permissions(&self) -> super::builder::schedule_service::TestIamPermissions {
16690        super::builder::schedule_service::TestIamPermissions::new(self.inner.clone())
16691    }
16692
16693    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
16694    ///
16695    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
16696    ///
16697    /// # Example
16698    /// ```
16699    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16700    /// use google_cloud_gax::paginator::ItemPaginator as _;
16701    /// use google_cloud_aiplatform_v1::Result;
16702    /// async fn sample(
16703    ///    client: &ScheduleService
16704    /// ) -> Result<()> {
16705    ///     let mut list = client.list_operations()
16706    ///         /* set fields */
16707    ///         .by_item();
16708    ///     while let Some(item) = list.next().await.transpose()? {
16709    ///         println!("{:?}", item);
16710    ///     }
16711    ///     Ok(())
16712    /// }
16713    /// ```
16714    pub fn list_operations(&self) -> super::builder::schedule_service::ListOperations {
16715        super::builder::schedule_service::ListOperations::new(self.inner.clone())
16716    }
16717
16718    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
16719    ///
16720    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
16721    ///
16722    /// # Example
16723    /// ```
16724    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16725    /// use google_cloud_aiplatform_v1::Result;
16726    /// async fn sample(
16727    ///    client: &ScheduleService
16728    /// ) -> Result<()> {
16729    ///     let response = client.get_operation()
16730    ///         /* set fields */
16731    ///         .send().await?;
16732    ///     println!("response {:?}", response);
16733    ///     Ok(())
16734    /// }
16735    /// ```
16736    pub fn get_operation(&self) -> super::builder::schedule_service::GetOperation {
16737        super::builder::schedule_service::GetOperation::new(self.inner.clone())
16738    }
16739
16740    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
16741    ///
16742    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
16743    ///
16744    /// # Example
16745    /// ```
16746    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16747    /// use google_cloud_aiplatform_v1::Result;
16748    /// async fn sample(
16749    ///    client: &ScheduleService
16750    /// ) -> Result<()> {
16751    ///     client.delete_operation()
16752    ///         /* set fields */
16753    ///         .send().await?;
16754    ///     Ok(())
16755    /// }
16756    /// ```
16757    pub fn delete_operation(&self) -> super::builder::schedule_service::DeleteOperation {
16758        super::builder::schedule_service::DeleteOperation::new(self.inner.clone())
16759    }
16760
16761    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
16762    ///
16763    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
16764    ///
16765    /// # Example
16766    /// ```
16767    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16768    /// use google_cloud_aiplatform_v1::Result;
16769    /// async fn sample(
16770    ///    client: &ScheduleService
16771    /// ) -> Result<()> {
16772    ///     client.cancel_operation()
16773    ///         /* set fields */
16774    ///         .send().await?;
16775    ///     Ok(())
16776    /// }
16777    /// ```
16778    pub fn cancel_operation(&self) -> super::builder::schedule_service::CancelOperation {
16779        super::builder::schedule_service::CancelOperation::new(self.inner.clone())
16780    }
16781
16782    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
16783    ///
16784    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
16785    ///
16786    /// # Example
16787    /// ```
16788    /// # use google_cloud_aiplatform_v1::client::ScheduleService;
16789    /// use google_cloud_aiplatform_v1::Result;
16790    /// async fn sample(
16791    ///    client: &ScheduleService
16792    /// ) -> Result<()> {
16793    ///     let response = client.wait_operation()
16794    ///         /* set fields */
16795    ///         .send().await?;
16796    ///     println!("response {:?}", response);
16797    ///     Ok(())
16798    /// }
16799    /// ```
16800    pub fn wait_operation(&self) -> super::builder::schedule_service::WaitOperation {
16801        super::builder::schedule_service::WaitOperation::new(self.inner.clone())
16802    }
16803}
16804
16805/// Implements a client for the Vertex AI API.
16806///
16807/// # Example
16808/// ```
16809/// # use google_cloud_aiplatform_v1::client::SessionService;
16810/// use google_cloud_gax::paginator::ItemPaginator as _;
16811/// async fn sample(
16812///    project_id: &str,
16813///    location_id: &str,
16814///    reasoning_engine_id: &str,
16815/// ) -> anyhow::Result<()> {
16816///     let client = SessionService::builder().build().await?;
16817///     let mut list = client.list_sessions()
16818///         .set_parent(format!("projects/{project_id}/locations/{location_id}/reasoningEngines/{reasoning_engine_id}"))
16819///         .by_item();
16820///     while let Some(item) = list.next().await.transpose()? {
16821///         println!("{:?}", item);
16822///     }
16823///     Ok(())
16824/// }
16825/// ```
16826///
16827/// # Service Description
16828///
16829/// The service that manages Vertex Session related resources.
16830///
16831/// # Configuration
16832///
16833/// To configure `SessionService` use the `with_*` methods in the type returned
16834/// by [builder()][SessionService::builder]. The default configuration should
16835/// work for most applications. Common configuration changes include
16836///
16837/// * [with_endpoint()]: by default this client uses the global default endpoint
16838///   (`https://aiplatform.googleapis.com`). Applications using regional
16839///   endpoints or running in restricted networks (e.g. a network configured
16840///   with [Private Google Access with VPC Service Controls]) may want to
16841///   override this default.
16842/// * [with_credentials()]: by default this client uses
16843///   [Application Default Credentials]. Applications using custom
16844///   authentication may need to override this default.
16845///
16846/// [with_endpoint()]: super::builder::session_service::ClientBuilder::with_endpoint
16847/// [with_credentials()]: super::builder::session_service::ClientBuilder::with_credentials
16848/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16849/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16850///
16851/// # Pooling and Cloning
16852///
16853/// `SessionService` holds a connection pool internally, it is advised to
16854/// create one and reuse it. You do not need to wrap `SessionService` in
16855/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16856/// already uses an `Arc` internally.
16857#[cfg(feature = "session-service")]
16858#[cfg_attr(docsrs, doc(cfg(feature = "session-service")))]
16859#[derive(Clone, Debug)]
16860pub struct SessionService {
16861    inner: std::sync::Arc<dyn super::stub::dynamic::SessionService>,
16862}
16863
16864#[cfg(feature = "session-service")]
16865impl SessionService {
16866    /// Returns a builder for [SessionService].
16867    ///
16868    /// ```
16869    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16870    /// # use google_cloud_aiplatform_v1::client::SessionService;
16871    /// let client = SessionService::builder().build().await?;
16872    /// # Ok(()) }
16873    /// ```
16874    pub fn builder() -> super::builder::session_service::ClientBuilder {
16875        crate::new_client_builder(super::builder::session_service::client::Factory)
16876    }
16877
16878    /// Creates a new client from the provided stub.
16879    ///
16880    /// The most common case for calling this function is in tests mocking the
16881    /// client's behavior.
16882    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16883    where
16884        T: super::stub::SessionService + 'static,
16885    {
16886        Self { inner: stub.into() }
16887    }
16888
16889    pub(crate) async fn new(
16890        config: gaxi::options::ClientConfig,
16891    ) -> crate::ClientBuilderResult<Self> {
16892        let inner = Self::build_inner(config).await?;
16893        Ok(Self { inner })
16894    }
16895
16896    async fn build_inner(
16897        conf: gaxi::options::ClientConfig,
16898    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SessionService>> {
16899        if gaxi::options::tracing_enabled(&conf) {
16900            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16901        }
16902        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16903    }
16904
16905    async fn build_transport(
16906        conf: gaxi::options::ClientConfig,
16907    ) -> crate::ClientBuilderResult<impl super::stub::SessionService> {
16908        super::transport::SessionService::new(conf).await
16909    }
16910
16911    async fn build_with_tracing(
16912        conf: gaxi::options::ClientConfig,
16913    ) -> crate::ClientBuilderResult<impl super::stub::SessionService> {
16914        Self::build_transport(conf)
16915            .await
16916            .map(super::tracing::SessionService::new)
16917    }
16918
16919    /// Creates a new [Session][google.cloud.aiplatform.v1.Session].
16920    ///
16921    /// [google.cloud.aiplatform.v1.Session]: crate::model::Session
16922    ///
16923    /// # Long running operations
16924    ///
16925    /// This method is used to start, and/or poll a [long-running Operation].
16926    /// The [Working with long-running operations] chapter in the [user guide]
16927    /// covers these operations in detail.
16928    ///
16929    /// [long-running operation]: https://google.aip.dev/151
16930    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
16931    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
16932    ///
16933    /// # Example
16934    /// ```
16935    /// # use google_cloud_aiplatform_v1::client::SessionService;
16936    /// use google_cloud_lro::Poller;
16937    /// use google_cloud_aiplatform_v1::model::Session;
16938    /// use google_cloud_aiplatform_v1::Result;
16939    /// async fn sample(
16940    ///    client: &SessionService, project_id: &str, location_id: &str, reasoning_engine_id: &str
16941    /// ) -> Result<()> {
16942    ///     let response = client.create_session()
16943    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/reasoningEngines/{reasoning_engine_id}"))
16944    ///         .set_session_id("session_id_value")
16945    ///         .set_session(
16946    ///             Session::new()/* set fields */
16947    ///         )
16948    ///         .poller().until_done().await?;
16949    ///     println!("response {:?}", response);
16950    ///     Ok(())
16951    /// }
16952    /// ```
16953    pub fn create_session(&self) -> super::builder::session_service::CreateSession {
16954        super::builder::session_service::CreateSession::new(self.inner.clone())
16955    }
16956
16957    /// Gets details of the specific [Session][google.cloud.aiplatform.v1.Session].
16958    ///
16959    /// [google.cloud.aiplatform.v1.Session]: crate::model::Session
16960    ///
16961    /// # Example
16962    /// ```
16963    /// # use google_cloud_aiplatform_v1::client::SessionService;
16964    /// use google_cloud_aiplatform_v1::Result;
16965    /// async fn sample(
16966    ///    client: &SessionService, project_id: &str, location_id: &str, reasoning_engine_id: &str, session_id: &str
16967    /// ) -> Result<()> {
16968    ///     let response = client.get_session()
16969    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/reasoningEngines/{reasoning_engine_id}/sessions/{session_id}"))
16970    ///         .send().await?;
16971    ///     println!("response {:?}", response);
16972    ///     Ok(())
16973    /// }
16974    /// ```
16975    pub fn get_session(&self) -> super::builder::session_service::GetSession {
16976        super::builder::session_service::GetSession::new(self.inner.clone())
16977    }
16978
16979    /// Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning
16980    /// engine.
16981    ///
16982    /// [google.cloud.aiplatform.v1.Session]: crate::model::Session
16983    ///
16984    /// # Example
16985    /// ```
16986    /// # use google_cloud_aiplatform_v1::client::SessionService;
16987    /// use google_cloud_gax::paginator::ItemPaginator as _;
16988    /// use google_cloud_aiplatform_v1::Result;
16989    /// async fn sample(
16990    ///    client: &SessionService, project_id: &str, location_id: &str, reasoning_engine_id: &str
16991    /// ) -> Result<()> {
16992    ///     let mut list = client.list_sessions()
16993    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/reasoningEngines/{reasoning_engine_id}"))
16994    ///         .by_item();
16995    ///     while let Some(item) = list.next().await.transpose()? {
16996    ///         println!("{:?}", item);
16997    ///     }
16998    ///     Ok(())
16999    /// }
17000    /// ```
17001    pub fn list_sessions(&self) -> super::builder::session_service::ListSessions {
17002        super::builder::session_service::ListSessions::new(self.inner.clone())
17003    }
17004
17005    /// Updates the specific [Session][google.cloud.aiplatform.v1.Session].
17006    ///
17007    /// [google.cloud.aiplatform.v1.Session]: crate::model::Session
17008    ///
17009    /// # Example
17010    /// ```
17011    /// # use google_cloud_aiplatform_v1::client::SessionService;
17012    /// # extern crate wkt as google_cloud_wkt;
17013    /// use google_cloud_wkt::FieldMask;
17014    /// use google_cloud_aiplatform_v1::model::Session;
17015    /// use google_cloud_aiplatform_v1::Result;
17016    /// async fn sample(
17017    ///    client: &SessionService, project_id: &str, location_id: &str, reasoning_engine_id: &str, session_id: &str
17018    /// ) -> Result<()> {
17019    ///     let response = client.update_session()
17020    ///         .set_session(
17021    ///             Session::new().set_name(format!("projects/{project_id}/locations/{location_id}/reasoningEngines/{reasoning_engine_id}/sessions/{session_id}"))/* set fields */
17022    ///         )
17023    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
17024    ///         .send().await?;
17025    ///     println!("response {:?}", response);
17026    ///     Ok(())
17027    /// }
17028    /// ```
17029    pub fn update_session(&self) -> super::builder::session_service::UpdateSession {
17030        super::builder::session_service::UpdateSession::new(self.inner.clone())
17031    }
17032
17033    /// Deletes details of the specific
17034    /// [Session][google.cloud.aiplatform.v1.Session].
17035    ///
17036    /// [google.cloud.aiplatform.v1.Session]: crate::model::Session
17037    ///
17038    /// # Long running operations
17039    ///
17040    /// This method is used to start, and/or poll a [long-running Operation].
17041    /// The [Working with long-running operations] chapter in the [user guide]
17042    /// covers these operations in detail.
17043    ///
17044    /// [long-running operation]: https://google.aip.dev/151
17045    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
17046    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
17047    ///
17048    /// # Example
17049    /// ```
17050    /// # use google_cloud_aiplatform_v1::client::SessionService;
17051    /// use google_cloud_lro::Poller;
17052    /// use google_cloud_aiplatform_v1::Result;
17053    /// async fn sample(
17054    ///    client: &SessionService, project_id: &str, location_id: &str, reasoning_engine_id: &str, session_id: &str
17055    /// ) -> Result<()> {
17056    ///     client.delete_session()
17057    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/reasoningEngines/{reasoning_engine_id}/sessions/{session_id}"))
17058    ///         .poller().until_done().await?;
17059    ///     Ok(())
17060    /// }
17061    /// ```
17062    pub fn delete_session(&self) -> super::builder::session_service::DeleteSession {
17063        super::builder::session_service::DeleteSession::new(self.inner.clone())
17064    }
17065
17066    /// Lists [Events][google.cloud.aiplatform.v1.Event] in a given session.
17067    ///
17068    /// [google.cloud.aiplatform.v1.Event]: crate::model::Event
17069    ///
17070    /// # Example
17071    /// ```
17072    /// # use google_cloud_aiplatform_v1::client::SessionService;
17073    /// use google_cloud_gax::paginator::ItemPaginator as _;
17074    /// use google_cloud_aiplatform_v1::Result;
17075    /// async fn sample(
17076    ///    client: &SessionService, project_id: &str, location_id: &str, reasoning_engine_id: &str, session_id: &str
17077    /// ) -> Result<()> {
17078    ///     let mut list = client.list_events()
17079    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/reasoningEngines/{reasoning_engine_id}/sessions/{session_id}"))
17080    ///         .by_item();
17081    ///     while let Some(item) = list.next().await.transpose()? {
17082    ///         println!("{:?}", item);
17083    ///     }
17084    ///     Ok(())
17085    /// }
17086    /// ```
17087    pub fn list_events(&self) -> super::builder::session_service::ListEvents {
17088        super::builder::session_service::ListEvents::new(self.inner.clone())
17089    }
17090
17091    /// Appends an event to a given session.
17092    ///
17093    /// # Example
17094    /// ```
17095    /// # use google_cloud_aiplatform_v1::client::SessionService;
17096    /// use google_cloud_aiplatform_v1::Result;
17097    /// async fn sample(
17098    ///    client: &SessionService
17099    /// ) -> Result<()> {
17100    ///     let response = client.append_event()
17101    ///         /* set fields */
17102    ///         .send().await?;
17103    ///     println!("response {:?}", response);
17104    ///     Ok(())
17105    /// }
17106    /// ```
17107    pub fn append_event(&self) -> super::builder::session_service::AppendEvent {
17108        super::builder::session_service::AppendEvent::new(self.inner.clone())
17109    }
17110
17111    /// Lists information about the supported locations for this service.
17112    ///
17113    /// # Example
17114    /// ```
17115    /// # use google_cloud_aiplatform_v1::client::SessionService;
17116    /// use google_cloud_gax::paginator::ItemPaginator as _;
17117    /// use google_cloud_aiplatform_v1::Result;
17118    /// async fn sample(
17119    ///    client: &SessionService
17120    /// ) -> Result<()> {
17121    ///     let mut list = client.list_locations()
17122    ///         /* set fields */
17123    ///         .by_item();
17124    ///     while let Some(item) = list.next().await.transpose()? {
17125    ///         println!("{:?}", item);
17126    ///     }
17127    ///     Ok(())
17128    /// }
17129    /// ```
17130    pub fn list_locations(&self) -> super::builder::session_service::ListLocations {
17131        super::builder::session_service::ListLocations::new(self.inner.clone())
17132    }
17133
17134    /// Gets information about a location.
17135    ///
17136    /// # Example
17137    /// ```
17138    /// # use google_cloud_aiplatform_v1::client::SessionService;
17139    /// use google_cloud_aiplatform_v1::Result;
17140    /// async fn sample(
17141    ///    client: &SessionService
17142    /// ) -> Result<()> {
17143    ///     let response = client.get_location()
17144    ///         /* set fields */
17145    ///         .send().await?;
17146    ///     println!("response {:?}", response);
17147    ///     Ok(())
17148    /// }
17149    /// ```
17150    pub fn get_location(&self) -> super::builder::session_service::GetLocation {
17151        super::builder::session_service::GetLocation::new(self.inner.clone())
17152    }
17153
17154    /// Sets the access control policy on the specified resource. Replaces
17155    /// any existing policy.
17156    ///
17157    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
17158    /// errors.
17159    ///
17160    /// # Example
17161    /// ```
17162    /// # use google_cloud_aiplatform_v1::client::SessionService;
17163    /// use google_cloud_aiplatform_v1::Result;
17164    /// async fn sample(
17165    ///    client: &SessionService
17166    /// ) -> Result<()> {
17167    ///     let response = client.set_iam_policy()
17168    ///         /* set fields */
17169    ///         .send().await?;
17170    ///     println!("response {:?}", response);
17171    ///     Ok(())
17172    /// }
17173    /// ```
17174    pub fn set_iam_policy(&self) -> super::builder::session_service::SetIamPolicy {
17175        super::builder::session_service::SetIamPolicy::new(self.inner.clone())
17176    }
17177
17178    /// Gets the access control policy for a resource. Returns an empty policy
17179    /// if the resource exists and does not have a policy set.
17180    ///
17181    /// # Example
17182    /// ```
17183    /// # use google_cloud_aiplatform_v1::client::SessionService;
17184    /// use google_cloud_aiplatform_v1::Result;
17185    /// async fn sample(
17186    ///    client: &SessionService
17187    /// ) -> Result<()> {
17188    ///     let response = client.get_iam_policy()
17189    ///         /* set fields */
17190    ///         .send().await?;
17191    ///     println!("response {:?}", response);
17192    ///     Ok(())
17193    /// }
17194    /// ```
17195    pub fn get_iam_policy(&self) -> super::builder::session_service::GetIamPolicy {
17196        super::builder::session_service::GetIamPolicy::new(self.inner.clone())
17197    }
17198
17199    /// Returns permissions that a caller has on the specified resource. If the
17200    /// resource does not exist, this will return an empty set of
17201    /// permissions, not a `NOT_FOUND` error.
17202    ///
17203    /// Note: This operation is designed to be used for building
17204    /// permission-aware UIs and command-line tools, not for authorization
17205    /// checking. This operation may "fail open" without warning.
17206    ///
17207    /// # Example
17208    /// ```
17209    /// # use google_cloud_aiplatform_v1::client::SessionService;
17210    /// use google_cloud_aiplatform_v1::Result;
17211    /// async fn sample(
17212    ///    client: &SessionService
17213    /// ) -> Result<()> {
17214    ///     let response = client.test_iam_permissions()
17215    ///         /* set fields */
17216    ///         .send().await?;
17217    ///     println!("response {:?}", response);
17218    ///     Ok(())
17219    /// }
17220    /// ```
17221    pub fn test_iam_permissions(&self) -> super::builder::session_service::TestIamPermissions {
17222        super::builder::session_service::TestIamPermissions::new(self.inner.clone())
17223    }
17224
17225    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
17226    ///
17227    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
17228    ///
17229    /// # Example
17230    /// ```
17231    /// # use google_cloud_aiplatform_v1::client::SessionService;
17232    /// use google_cloud_gax::paginator::ItemPaginator as _;
17233    /// use google_cloud_aiplatform_v1::Result;
17234    /// async fn sample(
17235    ///    client: &SessionService
17236    /// ) -> Result<()> {
17237    ///     let mut list = client.list_operations()
17238    ///         /* set fields */
17239    ///         .by_item();
17240    ///     while let Some(item) = list.next().await.transpose()? {
17241    ///         println!("{:?}", item);
17242    ///     }
17243    ///     Ok(())
17244    /// }
17245    /// ```
17246    pub fn list_operations(&self) -> super::builder::session_service::ListOperations {
17247        super::builder::session_service::ListOperations::new(self.inner.clone())
17248    }
17249
17250    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
17251    ///
17252    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
17253    ///
17254    /// # Example
17255    /// ```
17256    /// # use google_cloud_aiplatform_v1::client::SessionService;
17257    /// use google_cloud_aiplatform_v1::Result;
17258    /// async fn sample(
17259    ///    client: &SessionService
17260    /// ) -> Result<()> {
17261    ///     let response = client.get_operation()
17262    ///         /* set fields */
17263    ///         .send().await?;
17264    ///     println!("response {:?}", response);
17265    ///     Ok(())
17266    /// }
17267    /// ```
17268    pub fn get_operation(&self) -> super::builder::session_service::GetOperation {
17269        super::builder::session_service::GetOperation::new(self.inner.clone())
17270    }
17271
17272    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
17273    ///
17274    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
17275    ///
17276    /// # Example
17277    /// ```
17278    /// # use google_cloud_aiplatform_v1::client::SessionService;
17279    /// use google_cloud_aiplatform_v1::Result;
17280    /// async fn sample(
17281    ///    client: &SessionService
17282    /// ) -> Result<()> {
17283    ///     client.delete_operation()
17284    ///         /* set fields */
17285    ///         .send().await?;
17286    ///     Ok(())
17287    /// }
17288    /// ```
17289    pub fn delete_operation(&self) -> super::builder::session_service::DeleteOperation {
17290        super::builder::session_service::DeleteOperation::new(self.inner.clone())
17291    }
17292
17293    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
17294    ///
17295    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
17296    ///
17297    /// # Example
17298    /// ```
17299    /// # use google_cloud_aiplatform_v1::client::SessionService;
17300    /// use google_cloud_aiplatform_v1::Result;
17301    /// async fn sample(
17302    ///    client: &SessionService
17303    /// ) -> Result<()> {
17304    ///     client.cancel_operation()
17305    ///         /* set fields */
17306    ///         .send().await?;
17307    ///     Ok(())
17308    /// }
17309    /// ```
17310    pub fn cancel_operation(&self) -> super::builder::session_service::CancelOperation {
17311        super::builder::session_service::CancelOperation::new(self.inner.clone())
17312    }
17313
17314    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
17315    ///
17316    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
17317    ///
17318    /// # Example
17319    /// ```
17320    /// # use google_cloud_aiplatform_v1::client::SessionService;
17321    /// use google_cloud_aiplatform_v1::Result;
17322    /// async fn sample(
17323    ///    client: &SessionService
17324    /// ) -> Result<()> {
17325    ///     let response = client.wait_operation()
17326    ///         /* set fields */
17327    ///         .send().await?;
17328    ///     println!("response {:?}", response);
17329    ///     Ok(())
17330    /// }
17331    /// ```
17332    pub fn wait_operation(&self) -> super::builder::session_service::WaitOperation {
17333        super::builder::session_service::WaitOperation::new(self.inner.clone())
17334    }
17335}
17336
17337/// Implements a client for the Vertex AI API.
17338///
17339/// # Example
17340/// ```
17341/// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17342/// use google_cloud_gax::paginator::ItemPaginator as _;
17343/// async fn sample(
17344///    parent: &str,
17345/// ) -> anyhow::Result<()> {
17346///     let client = SpecialistPoolService::builder().build().await?;
17347///     let mut list = client.list_specialist_pools()
17348///         .set_parent(parent)
17349///         .by_item();
17350///     while let Some(item) = list.next().await.transpose()? {
17351///         println!("{:?}", item);
17352///     }
17353///     Ok(())
17354/// }
17355/// ```
17356///
17357/// # Service Description
17358///
17359/// A service for creating and managing Customer SpecialistPools.
17360/// When customers start Data Labeling jobs, they can reuse/create Specialist
17361/// Pools to bring their own Specialists to label the data.
17362/// Customers can add/remove Managers for the Specialist Pool on Cloud console,
17363/// then Managers will get email notifications to manage Specialists and tasks on
17364/// CrowdCompute console.
17365///
17366/// # Configuration
17367///
17368/// To configure `SpecialistPoolService` use the `with_*` methods in the type returned
17369/// by [builder()][SpecialistPoolService::builder]. The default configuration should
17370/// work for most applications. Common configuration changes include
17371///
17372/// * [with_endpoint()]: by default this client uses the global default endpoint
17373///   (`https://aiplatform.googleapis.com`). Applications using regional
17374///   endpoints or running in restricted networks (e.g. a network configured
17375///   with [Private Google Access with VPC Service Controls]) may want to
17376///   override this default.
17377/// * [with_credentials()]: by default this client uses
17378///   [Application Default Credentials]. Applications using custom
17379///   authentication may need to override this default.
17380///
17381/// [with_endpoint()]: super::builder::specialist_pool_service::ClientBuilder::with_endpoint
17382/// [with_credentials()]: super::builder::specialist_pool_service::ClientBuilder::with_credentials
17383/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17384/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17385///
17386/// # Pooling and Cloning
17387///
17388/// `SpecialistPoolService` holds a connection pool internally, it is advised to
17389/// create one and reuse it. You do not need to wrap `SpecialistPoolService` in
17390/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17391/// already uses an `Arc` internally.
17392#[cfg(feature = "specialist-pool-service")]
17393#[cfg_attr(docsrs, doc(cfg(feature = "specialist-pool-service")))]
17394#[derive(Clone, Debug)]
17395pub struct SpecialistPoolService {
17396    inner: std::sync::Arc<dyn super::stub::dynamic::SpecialistPoolService>,
17397}
17398
17399#[cfg(feature = "specialist-pool-service")]
17400impl SpecialistPoolService {
17401    /// Returns a builder for [SpecialistPoolService].
17402    ///
17403    /// ```
17404    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17405    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17406    /// let client = SpecialistPoolService::builder().build().await?;
17407    /// # Ok(()) }
17408    /// ```
17409    pub fn builder() -> super::builder::specialist_pool_service::ClientBuilder {
17410        crate::new_client_builder(super::builder::specialist_pool_service::client::Factory)
17411    }
17412
17413    /// Creates a new client from the provided stub.
17414    ///
17415    /// The most common case for calling this function is in tests mocking the
17416    /// client's behavior.
17417    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17418    where
17419        T: super::stub::SpecialistPoolService + 'static,
17420    {
17421        Self { inner: stub.into() }
17422    }
17423
17424    pub(crate) async fn new(
17425        config: gaxi::options::ClientConfig,
17426    ) -> crate::ClientBuilderResult<Self> {
17427        let inner = Self::build_inner(config).await?;
17428        Ok(Self { inner })
17429    }
17430
17431    async fn build_inner(
17432        conf: gaxi::options::ClientConfig,
17433    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SpecialistPoolService>>
17434    {
17435        if gaxi::options::tracing_enabled(&conf) {
17436            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17437        }
17438        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17439    }
17440
17441    async fn build_transport(
17442        conf: gaxi::options::ClientConfig,
17443    ) -> crate::ClientBuilderResult<impl super::stub::SpecialistPoolService> {
17444        super::transport::SpecialistPoolService::new(conf).await
17445    }
17446
17447    async fn build_with_tracing(
17448        conf: gaxi::options::ClientConfig,
17449    ) -> crate::ClientBuilderResult<impl super::stub::SpecialistPoolService> {
17450        Self::build_transport(conf)
17451            .await
17452            .map(super::tracing::SpecialistPoolService::new)
17453    }
17454
17455    /// Creates a SpecialistPool.
17456    ///
17457    /// # Long running operations
17458    ///
17459    /// This method is used to start, and/or poll a [long-running Operation].
17460    /// The [Working with long-running operations] chapter in the [user guide]
17461    /// covers these operations in detail.
17462    ///
17463    /// [long-running operation]: https://google.aip.dev/151
17464    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
17465    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
17466    ///
17467    /// # Example
17468    /// ```
17469    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17470    /// use google_cloud_lro::Poller;
17471    /// use google_cloud_aiplatform_v1::model::SpecialistPool;
17472    /// use google_cloud_aiplatform_v1::Result;
17473    /// async fn sample(
17474    ///    client: &SpecialistPoolService, parent: &str
17475    /// ) -> Result<()> {
17476    ///     let response = client.create_specialist_pool()
17477    ///         .set_parent(parent)
17478    ///         .set_specialist_pool(
17479    ///             SpecialistPool::new()/* set fields */
17480    ///         )
17481    ///         .poller().until_done().await?;
17482    ///     println!("response {:?}", response);
17483    ///     Ok(())
17484    /// }
17485    /// ```
17486    pub fn create_specialist_pool(
17487        &self,
17488    ) -> super::builder::specialist_pool_service::CreateSpecialistPool {
17489        super::builder::specialist_pool_service::CreateSpecialistPool::new(self.inner.clone())
17490    }
17491
17492    /// Gets a SpecialistPool.
17493    ///
17494    /// # Example
17495    /// ```
17496    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17497    /// use google_cloud_aiplatform_v1::Result;
17498    /// async fn sample(
17499    ///    client: &SpecialistPoolService, project_id: &str, location_id: &str, specialist_pool_id: &str
17500    /// ) -> Result<()> {
17501    ///     let response = client.get_specialist_pool()
17502    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/specialistPools/{specialist_pool_id}"))
17503    ///         .send().await?;
17504    ///     println!("response {:?}", response);
17505    ///     Ok(())
17506    /// }
17507    /// ```
17508    pub fn get_specialist_pool(
17509        &self,
17510    ) -> super::builder::specialist_pool_service::GetSpecialistPool {
17511        super::builder::specialist_pool_service::GetSpecialistPool::new(self.inner.clone())
17512    }
17513
17514    /// Lists SpecialistPools in a Location.
17515    ///
17516    /// # Example
17517    /// ```
17518    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17519    /// use google_cloud_gax::paginator::ItemPaginator as _;
17520    /// use google_cloud_aiplatform_v1::Result;
17521    /// async fn sample(
17522    ///    client: &SpecialistPoolService, parent: &str
17523    /// ) -> Result<()> {
17524    ///     let mut list = client.list_specialist_pools()
17525    ///         .set_parent(parent)
17526    ///         .by_item();
17527    ///     while let Some(item) = list.next().await.transpose()? {
17528    ///         println!("{:?}", item);
17529    ///     }
17530    ///     Ok(())
17531    /// }
17532    /// ```
17533    pub fn list_specialist_pools(
17534        &self,
17535    ) -> super::builder::specialist_pool_service::ListSpecialistPools {
17536        super::builder::specialist_pool_service::ListSpecialistPools::new(self.inner.clone())
17537    }
17538
17539    /// Deletes a SpecialistPool as well as all Specialists in the pool.
17540    ///
17541    /// # Long running operations
17542    ///
17543    /// This method is used to start, and/or poll a [long-running Operation].
17544    /// The [Working with long-running operations] chapter in the [user guide]
17545    /// covers these operations in detail.
17546    ///
17547    /// [long-running operation]: https://google.aip.dev/151
17548    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
17549    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
17550    ///
17551    /// # Example
17552    /// ```
17553    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17554    /// use google_cloud_lro::Poller;
17555    /// use google_cloud_aiplatform_v1::Result;
17556    /// async fn sample(
17557    ///    client: &SpecialistPoolService, project_id: &str, location_id: &str, specialist_pool_id: &str
17558    /// ) -> Result<()> {
17559    ///     client.delete_specialist_pool()
17560    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/specialistPools/{specialist_pool_id}"))
17561    ///         .poller().until_done().await?;
17562    ///     Ok(())
17563    /// }
17564    /// ```
17565    pub fn delete_specialist_pool(
17566        &self,
17567    ) -> super::builder::specialist_pool_service::DeleteSpecialistPool {
17568        super::builder::specialist_pool_service::DeleteSpecialistPool::new(self.inner.clone())
17569    }
17570
17571    /// Updates a SpecialistPool.
17572    ///
17573    /// # Long running operations
17574    ///
17575    /// This method is used to start, and/or poll a [long-running Operation].
17576    /// The [Working with long-running operations] chapter in the [user guide]
17577    /// covers these operations in detail.
17578    ///
17579    /// [long-running operation]: https://google.aip.dev/151
17580    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
17581    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
17582    ///
17583    /// # Example
17584    /// ```
17585    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17586    /// use google_cloud_lro::Poller;
17587    /// # extern crate wkt as google_cloud_wkt;
17588    /// use google_cloud_wkt::FieldMask;
17589    /// use google_cloud_aiplatform_v1::model::SpecialistPool;
17590    /// use google_cloud_aiplatform_v1::Result;
17591    /// async fn sample(
17592    ///    client: &SpecialistPoolService, project_id: &str, location_id: &str, specialist_pool_id: &str
17593    /// ) -> Result<()> {
17594    ///     let response = client.update_specialist_pool()
17595    ///         .set_specialist_pool(
17596    ///             SpecialistPool::new().set_name(format!("projects/{project_id}/locations/{location_id}/specialistPools/{specialist_pool_id}"))/* set fields */
17597    ///         )
17598    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
17599    ///         .poller().until_done().await?;
17600    ///     println!("response {:?}", response);
17601    ///     Ok(())
17602    /// }
17603    /// ```
17604    pub fn update_specialist_pool(
17605        &self,
17606    ) -> super::builder::specialist_pool_service::UpdateSpecialistPool {
17607        super::builder::specialist_pool_service::UpdateSpecialistPool::new(self.inner.clone())
17608    }
17609
17610    /// Lists information about the supported locations for this service.
17611    ///
17612    /// # Example
17613    /// ```
17614    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17615    /// use google_cloud_gax::paginator::ItemPaginator as _;
17616    /// use google_cloud_aiplatform_v1::Result;
17617    /// async fn sample(
17618    ///    client: &SpecialistPoolService
17619    /// ) -> Result<()> {
17620    ///     let mut list = client.list_locations()
17621    ///         /* set fields */
17622    ///         .by_item();
17623    ///     while let Some(item) = list.next().await.transpose()? {
17624    ///         println!("{:?}", item);
17625    ///     }
17626    ///     Ok(())
17627    /// }
17628    /// ```
17629    pub fn list_locations(&self) -> super::builder::specialist_pool_service::ListLocations {
17630        super::builder::specialist_pool_service::ListLocations::new(self.inner.clone())
17631    }
17632
17633    /// Gets information about a location.
17634    ///
17635    /// # Example
17636    /// ```
17637    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17638    /// use google_cloud_aiplatform_v1::Result;
17639    /// async fn sample(
17640    ///    client: &SpecialistPoolService
17641    /// ) -> Result<()> {
17642    ///     let response = client.get_location()
17643    ///         /* set fields */
17644    ///         .send().await?;
17645    ///     println!("response {:?}", response);
17646    ///     Ok(())
17647    /// }
17648    /// ```
17649    pub fn get_location(&self) -> super::builder::specialist_pool_service::GetLocation {
17650        super::builder::specialist_pool_service::GetLocation::new(self.inner.clone())
17651    }
17652
17653    /// Sets the access control policy on the specified resource. Replaces
17654    /// any existing policy.
17655    ///
17656    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
17657    /// errors.
17658    ///
17659    /// # Example
17660    /// ```
17661    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17662    /// use google_cloud_aiplatform_v1::Result;
17663    /// async fn sample(
17664    ///    client: &SpecialistPoolService
17665    /// ) -> Result<()> {
17666    ///     let response = client.set_iam_policy()
17667    ///         /* set fields */
17668    ///         .send().await?;
17669    ///     println!("response {:?}", response);
17670    ///     Ok(())
17671    /// }
17672    /// ```
17673    pub fn set_iam_policy(&self) -> super::builder::specialist_pool_service::SetIamPolicy {
17674        super::builder::specialist_pool_service::SetIamPolicy::new(self.inner.clone())
17675    }
17676
17677    /// Gets the access control policy for a resource. Returns an empty policy
17678    /// if the resource exists and does not have a policy set.
17679    ///
17680    /// # Example
17681    /// ```
17682    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17683    /// use google_cloud_aiplatform_v1::Result;
17684    /// async fn sample(
17685    ///    client: &SpecialistPoolService
17686    /// ) -> Result<()> {
17687    ///     let response = client.get_iam_policy()
17688    ///         /* set fields */
17689    ///         .send().await?;
17690    ///     println!("response {:?}", response);
17691    ///     Ok(())
17692    /// }
17693    /// ```
17694    pub fn get_iam_policy(&self) -> super::builder::specialist_pool_service::GetIamPolicy {
17695        super::builder::specialist_pool_service::GetIamPolicy::new(self.inner.clone())
17696    }
17697
17698    /// Returns permissions that a caller has on the specified resource. If the
17699    /// resource does not exist, this will return an empty set of
17700    /// permissions, not a `NOT_FOUND` error.
17701    ///
17702    /// Note: This operation is designed to be used for building
17703    /// permission-aware UIs and command-line tools, not for authorization
17704    /// checking. This operation may "fail open" without warning.
17705    ///
17706    /// # Example
17707    /// ```
17708    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17709    /// use google_cloud_aiplatform_v1::Result;
17710    /// async fn sample(
17711    ///    client: &SpecialistPoolService
17712    /// ) -> Result<()> {
17713    ///     let response = client.test_iam_permissions()
17714    ///         /* set fields */
17715    ///         .send().await?;
17716    ///     println!("response {:?}", response);
17717    ///     Ok(())
17718    /// }
17719    /// ```
17720    pub fn test_iam_permissions(
17721        &self,
17722    ) -> super::builder::specialist_pool_service::TestIamPermissions {
17723        super::builder::specialist_pool_service::TestIamPermissions::new(self.inner.clone())
17724    }
17725
17726    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
17727    ///
17728    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
17729    ///
17730    /// # Example
17731    /// ```
17732    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17733    /// use google_cloud_gax::paginator::ItemPaginator as _;
17734    /// use google_cloud_aiplatform_v1::Result;
17735    /// async fn sample(
17736    ///    client: &SpecialistPoolService
17737    /// ) -> Result<()> {
17738    ///     let mut list = client.list_operations()
17739    ///         /* set fields */
17740    ///         .by_item();
17741    ///     while let Some(item) = list.next().await.transpose()? {
17742    ///         println!("{:?}", item);
17743    ///     }
17744    ///     Ok(())
17745    /// }
17746    /// ```
17747    pub fn list_operations(&self) -> super::builder::specialist_pool_service::ListOperations {
17748        super::builder::specialist_pool_service::ListOperations::new(self.inner.clone())
17749    }
17750
17751    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
17752    ///
17753    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
17754    ///
17755    /// # Example
17756    /// ```
17757    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17758    /// use google_cloud_aiplatform_v1::Result;
17759    /// async fn sample(
17760    ///    client: &SpecialistPoolService
17761    /// ) -> Result<()> {
17762    ///     let response = client.get_operation()
17763    ///         /* set fields */
17764    ///         .send().await?;
17765    ///     println!("response {:?}", response);
17766    ///     Ok(())
17767    /// }
17768    /// ```
17769    pub fn get_operation(&self) -> super::builder::specialist_pool_service::GetOperation {
17770        super::builder::specialist_pool_service::GetOperation::new(self.inner.clone())
17771    }
17772
17773    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
17774    ///
17775    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
17776    ///
17777    /// # Example
17778    /// ```
17779    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17780    /// use google_cloud_aiplatform_v1::Result;
17781    /// async fn sample(
17782    ///    client: &SpecialistPoolService
17783    /// ) -> Result<()> {
17784    ///     client.delete_operation()
17785    ///         /* set fields */
17786    ///         .send().await?;
17787    ///     Ok(())
17788    /// }
17789    /// ```
17790    pub fn delete_operation(&self) -> super::builder::specialist_pool_service::DeleteOperation {
17791        super::builder::specialist_pool_service::DeleteOperation::new(self.inner.clone())
17792    }
17793
17794    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
17795    ///
17796    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
17797    ///
17798    /// # Example
17799    /// ```
17800    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17801    /// use google_cloud_aiplatform_v1::Result;
17802    /// async fn sample(
17803    ///    client: &SpecialistPoolService
17804    /// ) -> Result<()> {
17805    ///     client.cancel_operation()
17806    ///         /* set fields */
17807    ///         .send().await?;
17808    ///     Ok(())
17809    /// }
17810    /// ```
17811    pub fn cancel_operation(&self) -> super::builder::specialist_pool_service::CancelOperation {
17812        super::builder::specialist_pool_service::CancelOperation::new(self.inner.clone())
17813    }
17814
17815    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
17816    ///
17817    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
17818    ///
17819    /// # Example
17820    /// ```
17821    /// # use google_cloud_aiplatform_v1::client::SpecialistPoolService;
17822    /// use google_cloud_aiplatform_v1::Result;
17823    /// async fn sample(
17824    ///    client: &SpecialistPoolService
17825    /// ) -> Result<()> {
17826    ///     let response = client.wait_operation()
17827    ///         /* set fields */
17828    ///         .send().await?;
17829    ///     println!("response {:?}", response);
17830    ///     Ok(())
17831    /// }
17832    /// ```
17833    pub fn wait_operation(&self) -> super::builder::specialist_pool_service::WaitOperation {
17834        super::builder::specialist_pool_service::WaitOperation::new(self.inner.clone())
17835    }
17836}
17837
17838/// Implements a client for the Vertex AI API.
17839///
17840/// # Example
17841/// ```
17842/// # use google_cloud_aiplatform_v1::client::TensorboardService;
17843/// use google_cloud_gax::paginator::ItemPaginator as _;
17844/// async fn sample(
17845///    project_id: &str,
17846///    location_id: &str,
17847/// ) -> anyhow::Result<()> {
17848///     let client = TensorboardService::builder().build().await?;
17849///     let mut list = client.list_tensorboards()
17850///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
17851///         .by_item();
17852///     while let Some(item) = list.next().await.transpose()? {
17853///         println!("{:?}", item);
17854///     }
17855///     Ok(())
17856/// }
17857/// ```
17858///
17859/// # Service Description
17860///
17861/// TensorboardService
17862///
17863/// # Configuration
17864///
17865/// To configure `TensorboardService` use the `with_*` methods in the type returned
17866/// by [builder()][TensorboardService::builder]. The default configuration should
17867/// work for most applications. Common configuration changes include
17868///
17869/// * [with_endpoint()]: by default this client uses the global default endpoint
17870///   (`https://aiplatform.googleapis.com`). Applications using regional
17871///   endpoints or running in restricted networks (e.g. a network configured
17872///   with [Private Google Access with VPC Service Controls]) may want to
17873///   override this default.
17874/// * [with_credentials()]: by default this client uses
17875///   [Application Default Credentials]. Applications using custom
17876///   authentication may need to override this default.
17877///
17878/// [with_endpoint()]: super::builder::tensorboard_service::ClientBuilder::with_endpoint
17879/// [with_credentials()]: super::builder::tensorboard_service::ClientBuilder::with_credentials
17880/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17881/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17882///
17883/// # Pooling and Cloning
17884///
17885/// `TensorboardService` holds a connection pool internally, it is advised to
17886/// create one and reuse it. You do not need to wrap `TensorboardService` in
17887/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17888/// already uses an `Arc` internally.
17889#[cfg(feature = "tensorboard-service")]
17890#[cfg_attr(docsrs, doc(cfg(feature = "tensorboard-service")))]
17891#[derive(Clone, Debug)]
17892pub struct TensorboardService {
17893    inner: std::sync::Arc<dyn super::stub::dynamic::TensorboardService>,
17894}
17895
17896#[cfg(feature = "tensorboard-service")]
17897impl TensorboardService {
17898    /// Returns a builder for [TensorboardService].
17899    ///
17900    /// ```
17901    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17902    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
17903    /// let client = TensorboardService::builder().build().await?;
17904    /// # Ok(()) }
17905    /// ```
17906    pub fn builder() -> super::builder::tensorboard_service::ClientBuilder {
17907        crate::new_client_builder(super::builder::tensorboard_service::client::Factory)
17908    }
17909
17910    /// Creates a new client from the provided stub.
17911    ///
17912    /// The most common case for calling this function is in tests mocking the
17913    /// client's behavior.
17914    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17915    where
17916        T: super::stub::TensorboardService + 'static,
17917    {
17918        Self { inner: stub.into() }
17919    }
17920
17921    pub(crate) async fn new(
17922        config: gaxi::options::ClientConfig,
17923    ) -> crate::ClientBuilderResult<Self> {
17924        let inner = Self::build_inner(config).await?;
17925        Ok(Self { inner })
17926    }
17927
17928    async fn build_inner(
17929        conf: gaxi::options::ClientConfig,
17930    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TensorboardService>>
17931    {
17932        if gaxi::options::tracing_enabled(&conf) {
17933            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17934        }
17935        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17936    }
17937
17938    async fn build_transport(
17939        conf: gaxi::options::ClientConfig,
17940    ) -> crate::ClientBuilderResult<impl super::stub::TensorboardService> {
17941        super::transport::TensorboardService::new(conf).await
17942    }
17943
17944    async fn build_with_tracing(
17945        conf: gaxi::options::ClientConfig,
17946    ) -> crate::ClientBuilderResult<impl super::stub::TensorboardService> {
17947        Self::build_transport(conf)
17948            .await
17949            .map(super::tracing::TensorboardService::new)
17950    }
17951
17952    /// Creates a Tensorboard.
17953    ///
17954    /// # Long running operations
17955    ///
17956    /// This method is used to start, and/or poll a [long-running Operation].
17957    /// The [Working with long-running operations] chapter in the [user guide]
17958    /// covers these operations in detail.
17959    ///
17960    /// [long-running operation]: https://google.aip.dev/151
17961    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
17962    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
17963    ///
17964    /// # Example
17965    /// ```
17966    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
17967    /// use google_cloud_lro::Poller;
17968    /// use google_cloud_aiplatform_v1::model::Tensorboard;
17969    /// use google_cloud_aiplatform_v1::Result;
17970    /// async fn sample(
17971    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str
17972    /// ) -> Result<()> {
17973    ///     let response = client.create_tensorboard()
17974    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}"))
17975    ///         .set_tensorboard(
17976    ///             Tensorboard::new()/* set fields */
17977    ///         )
17978    ///         .poller().until_done().await?;
17979    ///     println!("response {:?}", response);
17980    ///     Ok(())
17981    /// }
17982    /// ```
17983    pub fn create_tensorboard(&self) -> super::builder::tensorboard_service::CreateTensorboard {
17984        super::builder::tensorboard_service::CreateTensorboard::new(self.inner.clone())
17985    }
17986
17987    /// Gets a Tensorboard.
17988    ///
17989    /// # Example
17990    /// ```
17991    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
17992    /// use google_cloud_aiplatform_v1::Result;
17993    /// async fn sample(
17994    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str
17995    /// ) -> Result<()> {
17996    ///     let response = client.get_tensorboard()
17997    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}"))
17998    ///         .send().await?;
17999    ///     println!("response {:?}", response);
18000    ///     Ok(())
18001    /// }
18002    /// ```
18003    pub fn get_tensorboard(&self) -> super::builder::tensorboard_service::GetTensorboard {
18004        super::builder::tensorboard_service::GetTensorboard::new(self.inner.clone())
18005    }
18006
18007    /// Updates a Tensorboard.
18008    ///
18009    /// # Long running operations
18010    ///
18011    /// This method is used to start, and/or poll a [long-running Operation].
18012    /// The [Working with long-running operations] chapter in the [user guide]
18013    /// covers these operations in detail.
18014    ///
18015    /// [long-running operation]: https://google.aip.dev/151
18016    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
18017    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
18018    ///
18019    /// # Example
18020    /// ```
18021    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18022    /// use google_cloud_lro::Poller;
18023    /// # extern crate wkt as google_cloud_wkt;
18024    /// use google_cloud_wkt::FieldMask;
18025    /// use google_cloud_aiplatform_v1::model::Tensorboard;
18026    /// use google_cloud_aiplatform_v1::Result;
18027    /// async fn sample(
18028    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str
18029    /// ) -> Result<()> {
18030    ///     let response = client.update_tensorboard()
18031    ///         .set_tensorboard(
18032    ///             Tensorboard::new().set_name(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}"))/* set fields */
18033    ///         )
18034    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
18035    ///         .poller().until_done().await?;
18036    ///     println!("response {:?}", response);
18037    ///     Ok(())
18038    /// }
18039    /// ```
18040    pub fn update_tensorboard(&self) -> super::builder::tensorboard_service::UpdateTensorboard {
18041        super::builder::tensorboard_service::UpdateTensorboard::new(self.inner.clone())
18042    }
18043
18044    /// Lists Tensorboards in a Location.
18045    ///
18046    /// # Example
18047    /// ```
18048    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18049    /// use google_cloud_gax::paginator::ItemPaginator as _;
18050    /// use google_cloud_aiplatform_v1::Result;
18051    /// async fn sample(
18052    ///    client: &TensorboardService, project_id: &str, location_id: &str
18053    /// ) -> Result<()> {
18054    ///     let mut list = client.list_tensorboards()
18055    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
18056    ///         .by_item();
18057    ///     while let Some(item) = list.next().await.transpose()? {
18058    ///         println!("{:?}", item);
18059    ///     }
18060    ///     Ok(())
18061    /// }
18062    /// ```
18063    pub fn list_tensorboards(&self) -> super::builder::tensorboard_service::ListTensorboards {
18064        super::builder::tensorboard_service::ListTensorboards::new(self.inner.clone())
18065    }
18066
18067    /// Deletes a Tensorboard.
18068    ///
18069    /// # Long running operations
18070    ///
18071    /// This method is used to start, and/or poll a [long-running Operation].
18072    /// The [Working with long-running operations] chapter in the [user guide]
18073    /// covers these operations in detail.
18074    ///
18075    /// [long-running operation]: https://google.aip.dev/151
18076    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
18077    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
18078    ///
18079    /// # Example
18080    /// ```
18081    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18082    /// use google_cloud_lro::Poller;
18083    /// use google_cloud_aiplatform_v1::Result;
18084    /// async fn sample(
18085    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str
18086    /// ) -> Result<()> {
18087    ///     client.delete_tensorboard()
18088    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}"))
18089    ///         .poller().until_done().await?;
18090    ///     Ok(())
18091    /// }
18092    /// ```
18093    pub fn delete_tensorboard(&self) -> super::builder::tensorboard_service::DeleteTensorboard {
18094        super::builder::tensorboard_service::DeleteTensorboard::new(self.inner.clone())
18095    }
18096
18097    /// Returns a list of monthly active users for a given TensorBoard instance.
18098    ///
18099    /// # Example
18100    /// ```
18101    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18102    /// use google_cloud_aiplatform_v1::Result;
18103    /// async fn sample(
18104    ///    client: &TensorboardService
18105    /// ) -> Result<()> {
18106    ///     let response = client.read_tensorboard_usage()
18107    ///         /* set fields */
18108    ///         .send().await?;
18109    ///     println!("response {:?}", response);
18110    ///     Ok(())
18111    /// }
18112    /// ```
18113    pub fn read_tensorboard_usage(
18114        &self,
18115    ) -> super::builder::tensorboard_service::ReadTensorboardUsage {
18116        super::builder::tensorboard_service::ReadTensorboardUsage::new(self.inner.clone())
18117    }
18118
18119    /// Returns the storage size for a given TensorBoard instance.
18120    ///
18121    /// # Example
18122    /// ```
18123    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18124    /// use google_cloud_aiplatform_v1::Result;
18125    /// async fn sample(
18126    ///    client: &TensorboardService
18127    /// ) -> Result<()> {
18128    ///     let response = client.read_tensorboard_size()
18129    ///         /* set fields */
18130    ///         .send().await?;
18131    ///     println!("response {:?}", response);
18132    ///     Ok(())
18133    /// }
18134    /// ```
18135    pub fn read_tensorboard_size(
18136        &self,
18137    ) -> super::builder::tensorboard_service::ReadTensorboardSize {
18138        super::builder::tensorboard_service::ReadTensorboardSize::new(self.inner.clone())
18139    }
18140
18141    /// Creates a TensorboardExperiment.
18142    ///
18143    /// # Example
18144    /// ```
18145    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18146    /// use google_cloud_aiplatform_v1::model::TensorboardExperiment;
18147    /// use google_cloud_aiplatform_v1::Result;
18148    /// async fn sample(
18149    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str
18150    /// ) -> Result<()> {
18151    ///     let response = client.create_tensorboard_experiment()
18152    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}"))
18153    ///         .set_tensorboard_experiment(
18154    ///             TensorboardExperiment::new()/* set fields */
18155    ///         )
18156    ///         .send().await?;
18157    ///     println!("response {:?}", response);
18158    ///     Ok(())
18159    /// }
18160    /// ```
18161    pub fn create_tensorboard_experiment(
18162        &self,
18163    ) -> super::builder::tensorboard_service::CreateTensorboardExperiment {
18164        super::builder::tensorboard_service::CreateTensorboardExperiment::new(self.inner.clone())
18165    }
18166
18167    /// Gets a TensorboardExperiment.
18168    ///
18169    /// # Example
18170    /// ```
18171    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18172    /// use google_cloud_aiplatform_v1::Result;
18173    /// async fn sample(
18174    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str
18175    /// ) -> Result<()> {
18176    ///     let response = client.get_tensorboard_experiment()
18177    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}"))
18178    ///         .send().await?;
18179    ///     println!("response {:?}", response);
18180    ///     Ok(())
18181    /// }
18182    /// ```
18183    pub fn get_tensorboard_experiment(
18184        &self,
18185    ) -> super::builder::tensorboard_service::GetTensorboardExperiment {
18186        super::builder::tensorboard_service::GetTensorboardExperiment::new(self.inner.clone())
18187    }
18188
18189    /// Updates a TensorboardExperiment.
18190    ///
18191    /// # Example
18192    /// ```
18193    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18194    /// # extern crate wkt as google_cloud_wkt;
18195    /// use google_cloud_wkt::FieldMask;
18196    /// use google_cloud_aiplatform_v1::model::TensorboardExperiment;
18197    /// use google_cloud_aiplatform_v1::Result;
18198    /// async fn sample(
18199    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str
18200    /// ) -> Result<()> {
18201    ///     let response = client.update_tensorboard_experiment()
18202    ///         .set_tensorboard_experiment(
18203    ///             TensorboardExperiment::new().set_name(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}"))/* set fields */
18204    ///         )
18205    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
18206    ///         .send().await?;
18207    ///     println!("response {:?}", response);
18208    ///     Ok(())
18209    /// }
18210    /// ```
18211    pub fn update_tensorboard_experiment(
18212        &self,
18213    ) -> super::builder::tensorboard_service::UpdateTensorboardExperiment {
18214        super::builder::tensorboard_service::UpdateTensorboardExperiment::new(self.inner.clone())
18215    }
18216
18217    /// Lists TensorboardExperiments in a Location.
18218    ///
18219    /// # Example
18220    /// ```
18221    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18222    /// use google_cloud_gax::paginator::ItemPaginator as _;
18223    /// use google_cloud_aiplatform_v1::Result;
18224    /// async fn sample(
18225    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str
18226    /// ) -> Result<()> {
18227    ///     let mut list = client.list_tensorboard_experiments()
18228    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}"))
18229    ///         .by_item();
18230    ///     while let Some(item) = list.next().await.transpose()? {
18231    ///         println!("{:?}", item);
18232    ///     }
18233    ///     Ok(())
18234    /// }
18235    /// ```
18236    pub fn list_tensorboard_experiments(
18237        &self,
18238    ) -> super::builder::tensorboard_service::ListTensorboardExperiments {
18239        super::builder::tensorboard_service::ListTensorboardExperiments::new(self.inner.clone())
18240    }
18241
18242    /// Deletes a TensorboardExperiment.
18243    ///
18244    /// # Long running operations
18245    ///
18246    /// This method is used to start, and/or poll a [long-running Operation].
18247    /// The [Working with long-running operations] chapter in the [user guide]
18248    /// covers these operations in detail.
18249    ///
18250    /// [long-running operation]: https://google.aip.dev/151
18251    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
18252    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
18253    ///
18254    /// # Example
18255    /// ```
18256    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18257    /// use google_cloud_lro::Poller;
18258    /// use google_cloud_aiplatform_v1::Result;
18259    /// async fn sample(
18260    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str
18261    /// ) -> Result<()> {
18262    ///     client.delete_tensorboard_experiment()
18263    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}"))
18264    ///         .poller().until_done().await?;
18265    ///     Ok(())
18266    /// }
18267    /// ```
18268    pub fn delete_tensorboard_experiment(
18269        &self,
18270    ) -> super::builder::tensorboard_service::DeleteTensorboardExperiment {
18271        super::builder::tensorboard_service::DeleteTensorboardExperiment::new(self.inner.clone())
18272    }
18273
18274    /// Creates a TensorboardRun.
18275    ///
18276    /// # Example
18277    /// ```
18278    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18279    /// use google_cloud_aiplatform_v1::model::TensorboardRun;
18280    /// use google_cloud_aiplatform_v1::Result;
18281    /// async fn sample(
18282    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str, run_id: &str
18283    /// ) -> Result<()> {
18284    ///     let response = client.create_tensorboard_run()
18285    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}/runs/{run_id}"))
18286    ///         .set_tensorboard_run(
18287    ///             TensorboardRun::new()/* set fields */
18288    ///         )
18289    ///         .send().await?;
18290    ///     println!("response {:?}", response);
18291    ///     Ok(())
18292    /// }
18293    /// ```
18294    pub fn create_tensorboard_run(
18295        &self,
18296    ) -> super::builder::tensorboard_service::CreateTensorboardRun {
18297        super::builder::tensorboard_service::CreateTensorboardRun::new(self.inner.clone())
18298    }
18299
18300    /// Batch create TensorboardRuns.
18301    ///
18302    /// # Example
18303    /// ```
18304    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18305    /// use google_cloud_aiplatform_v1::Result;
18306    /// async fn sample(
18307    ///    client: &TensorboardService
18308    /// ) -> Result<()> {
18309    ///     let response = client.batch_create_tensorboard_runs()
18310    ///         /* set fields */
18311    ///         .send().await?;
18312    ///     println!("response {:?}", response);
18313    ///     Ok(())
18314    /// }
18315    /// ```
18316    pub fn batch_create_tensorboard_runs(
18317        &self,
18318    ) -> super::builder::tensorboard_service::BatchCreateTensorboardRuns {
18319        super::builder::tensorboard_service::BatchCreateTensorboardRuns::new(self.inner.clone())
18320    }
18321
18322    /// Gets a TensorboardRun.
18323    ///
18324    /// # Example
18325    /// ```
18326    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18327    /// use google_cloud_aiplatform_v1::Result;
18328    /// async fn sample(
18329    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str, run_id: &str
18330    /// ) -> Result<()> {
18331    ///     let response = client.get_tensorboard_run()
18332    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}/runs/{run_id}"))
18333    ///         .send().await?;
18334    ///     println!("response {:?}", response);
18335    ///     Ok(())
18336    /// }
18337    /// ```
18338    pub fn get_tensorboard_run(&self) -> super::builder::tensorboard_service::GetTensorboardRun {
18339        super::builder::tensorboard_service::GetTensorboardRun::new(self.inner.clone())
18340    }
18341
18342    /// Updates a TensorboardRun.
18343    ///
18344    /// # Example
18345    /// ```
18346    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18347    /// # extern crate wkt as google_cloud_wkt;
18348    /// use google_cloud_wkt::FieldMask;
18349    /// use google_cloud_aiplatform_v1::model::TensorboardRun;
18350    /// use google_cloud_aiplatform_v1::Result;
18351    /// async fn sample(
18352    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str, run_id: &str
18353    /// ) -> Result<()> {
18354    ///     let response = client.update_tensorboard_run()
18355    ///         .set_tensorboard_run(
18356    ///             TensorboardRun::new().set_name(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}/runs/{run_id}"))/* set fields */
18357    ///         )
18358    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
18359    ///         .send().await?;
18360    ///     println!("response {:?}", response);
18361    ///     Ok(())
18362    /// }
18363    /// ```
18364    pub fn update_tensorboard_run(
18365        &self,
18366    ) -> super::builder::tensorboard_service::UpdateTensorboardRun {
18367        super::builder::tensorboard_service::UpdateTensorboardRun::new(self.inner.clone())
18368    }
18369
18370    /// Lists TensorboardRuns in a Location.
18371    ///
18372    /// # Example
18373    /// ```
18374    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18375    /// use google_cloud_gax::paginator::ItemPaginator as _;
18376    /// use google_cloud_aiplatform_v1::Result;
18377    /// async fn sample(
18378    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str
18379    /// ) -> Result<()> {
18380    ///     let mut list = client.list_tensorboard_runs()
18381    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}"))
18382    ///         .by_item();
18383    ///     while let Some(item) = list.next().await.transpose()? {
18384    ///         println!("{:?}", item);
18385    ///     }
18386    ///     Ok(())
18387    /// }
18388    /// ```
18389    pub fn list_tensorboard_runs(
18390        &self,
18391    ) -> super::builder::tensorboard_service::ListTensorboardRuns {
18392        super::builder::tensorboard_service::ListTensorboardRuns::new(self.inner.clone())
18393    }
18394
18395    /// Deletes a TensorboardRun.
18396    ///
18397    /// # Long running operations
18398    ///
18399    /// This method is used to start, and/or poll a [long-running Operation].
18400    /// The [Working with long-running operations] chapter in the [user guide]
18401    /// covers these operations in detail.
18402    ///
18403    /// [long-running operation]: https://google.aip.dev/151
18404    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
18405    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
18406    ///
18407    /// # Example
18408    /// ```
18409    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18410    /// use google_cloud_lro::Poller;
18411    /// use google_cloud_aiplatform_v1::Result;
18412    /// async fn sample(
18413    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str, run_id: &str
18414    /// ) -> Result<()> {
18415    ///     client.delete_tensorboard_run()
18416    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}/runs/{run_id}"))
18417    ///         .poller().until_done().await?;
18418    ///     Ok(())
18419    /// }
18420    /// ```
18421    pub fn delete_tensorboard_run(
18422        &self,
18423    ) -> super::builder::tensorboard_service::DeleteTensorboardRun {
18424        super::builder::tensorboard_service::DeleteTensorboardRun::new(self.inner.clone())
18425    }
18426
18427    /// Batch create TensorboardTimeSeries that belong to a TensorboardExperiment.
18428    ///
18429    /// # Example
18430    /// ```
18431    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18432    /// use google_cloud_aiplatform_v1::Result;
18433    /// async fn sample(
18434    ///    client: &TensorboardService
18435    /// ) -> Result<()> {
18436    ///     let response = client.batch_create_tensorboard_time_series()
18437    ///         /* set fields */
18438    ///         .send().await?;
18439    ///     println!("response {:?}", response);
18440    ///     Ok(())
18441    /// }
18442    /// ```
18443    pub fn batch_create_tensorboard_time_series(
18444        &self,
18445    ) -> super::builder::tensorboard_service::BatchCreateTensorboardTimeSeries {
18446        super::builder::tensorboard_service::BatchCreateTensorboardTimeSeries::new(
18447            self.inner.clone(),
18448        )
18449    }
18450
18451    /// Creates a TensorboardTimeSeries.
18452    ///
18453    /// # Example
18454    /// ```
18455    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18456    /// use google_cloud_aiplatform_v1::model::TensorboardTimeSeries;
18457    /// use google_cloud_aiplatform_v1::Result;
18458    /// async fn sample(
18459    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str, run_id: &str, time_series_id: &str
18460    /// ) -> Result<()> {
18461    ///     let response = client.create_tensorboard_time_series()
18462    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}/runs/{run_id}/timeSeries/{time_series_id}"))
18463    ///         .set_tensorboard_time_series(
18464    ///             TensorboardTimeSeries::new()/* set fields */
18465    ///         )
18466    ///         .send().await?;
18467    ///     println!("response {:?}", response);
18468    ///     Ok(())
18469    /// }
18470    /// ```
18471    pub fn create_tensorboard_time_series(
18472        &self,
18473    ) -> super::builder::tensorboard_service::CreateTensorboardTimeSeries {
18474        super::builder::tensorboard_service::CreateTensorboardTimeSeries::new(self.inner.clone())
18475    }
18476
18477    /// Gets a TensorboardTimeSeries.
18478    ///
18479    /// # Example
18480    /// ```
18481    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18482    /// use google_cloud_aiplatform_v1::Result;
18483    /// async fn sample(
18484    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str, run_id: &str, time_series_id: &str
18485    /// ) -> Result<()> {
18486    ///     let response = client.get_tensorboard_time_series()
18487    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}/runs/{run_id}/timeSeries/{time_series_id}"))
18488    ///         .send().await?;
18489    ///     println!("response {:?}", response);
18490    ///     Ok(())
18491    /// }
18492    /// ```
18493    pub fn get_tensorboard_time_series(
18494        &self,
18495    ) -> super::builder::tensorboard_service::GetTensorboardTimeSeries {
18496        super::builder::tensorboard_service::GetTensorboardTimeSeries::new(self.inner.clone())
18497    }
18498
18499    /// Updates a TensorboardTimeSeries.
18500    ///
18501    /// # Example
18502    /// ```
18503    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18504    /// # extern crate wkt as google_cloud_wkt;
18505    /// use google_cloud_wkt::FieldMask;
18506    /// use google_cloud_aiplatform_v1::model::TensorboardTimeSeries;
18507    /// use google_cloud_aiplatform_v1::Result;
18508    /// async fn sample(
18509    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str, run_id: &str, time_series_id: &str
18510    /// ) -> Result<()> {
18511    ///     let response = client.update_tensorboard_time_series()
18512    ///         .set_tensorboard_time_series(
18513    ///             TensorboardTimeSeries::new().set_name(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}/runs/{run_id}/timeSeries/{time_series_id}"))/* set fields */
18514    ///         )
18515    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
18516    ///         .send().await?;
18517    ///     println!("response {:?}", response);
18518    ///     Ok(())
18519    /// }
18520    /// ```
18521    pub fn update_tensorboard_time_series(
18522        &self,
18523    ) -> super::builder::tensorboard_service::UpdateTensorboardTimeSeries {
18524        super::builder::tensorboard_service::UpdateTensorboardTimeSeries::new(self.inner.clone())
18525    }
18526
18527    /// Lists TensorboardTimeSeries in a Location.
18528    ///
18529    /// # Example
18530    /// ```
18531    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18532    /// use google_cloud_gax::paginator::ItemPaginator as _;
18533    /// use google_cloud_aiplatform_v1::Result;
18534    /// async fn sample(
18535    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str, run_id: &str
18536    /// ) -> Result<()> {
18537    ///     let mut list = client.list_tensorboard_time_series()
18538    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}/runs/{run_id}"))
18539    ///         .by_item();
18540    ///     while let Some(item) = list.next().await.transpose()? {
18541    ///         println!("{:?}", item);
18542    ///     }
18543    ///     Ok(())
18544    /// }
18545    /// ```
18546    pub fn list_tensorboard_time_series(
18547        &self,
18548    ) -> super::builder::tensorboard_service::ListTensorboardTimeSeries {
18549        super::builder::tensorboard_service::ListTensorboardTimeSeries::new(self.inner.clone())
18550    }
18551
18552    /// Deletes a TensorboardTimeSeries.
18553    ///
18554    /// # Long running operations
18555    ///
18556    /// This method is used to start, and/or poll a [long-running Operation].
18557    /// The [Working with long-running operations] chapter in the [user guide]
18558    /// covers these operations in detail.
18559    ///
18560    /// [long-running operation]: https://google.aip.dev/151
18561    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
18562    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
18563    ///
18564    /// # Example
18565    /// ```
18566    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18567    /// use google_cloud_lro::Poller;
18568    /// use google_cloud_aiplatform_v1::Result;
18569    /// async fn sample(
18570    ///    client: &TensorboardService, project_id: &str, location_id: &str, tensorboard_id: &str, experiment_id: &str, run_id: &str, time_series_id: &str
18571    /// ) -> Result<()> {
18572    ///     client.delete_tensorboard_time_series()
18573    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/tensorboards/{tensorboard_id}/experiments/{experiment_id}/runs/{run_id}/timeSeries/{time_series_id}"))
18574    ///         .poller().until_done().await?;
18575    ///     Ok(())
18576    /// }
18577    /// ```
18578    pub fn delete_tensorboard_time_series(
18579        &self,
18580    ) -> super::builder::tensorboard_service::DeleteTensorboardTimeSeries {
18581        super::builder::tensorboard_service::DeleteTensorboardTimeSeries::new(self.inner.clone())
18582    }
18583
18584    /// Reads multiple TensorboardTimeSeries' data. The data point number limit is
18585    /// 1000 for scalars, 100 for tensors and blob references. If the number of
18586    /// data points stored is less than the limit, all data is returned.
18587    /// Otherwise, the number limit of data points is randomly selected from
18588    /// this time series and returned.
18589    ///
18590    /// # Example
18591    /// ```
18592    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18593    /// use google_cloud_aiplatform_v1::Result;
18594    /// async fn sample(
18595    ///    client: &TensorboardService
18596    /// ) -> Result<()> {
18597    ///     let response = client.batch_read_tensorboard_time_series_data()
18598    ///         /* set fields */
18599    ///         .send().await?;
18600    ///     println!("response {:?}", response);
18601    ///     Ok(())
18602    /// }
18603    /// ```
18604    pub fn batch_read_tensorboard_time_series_data(
18605        &self,
18606    ) -> super::builder::tensorboard_service::BatchReadTensorboardTimeSeriesData {
18607        super::builder::tensorboard_service::BatchReadTensorboardTimeSeriesData::new(
18608            self.inner.clone(),
18609        )
18610    }
18611
18612    /// Reads a TensorboardTimeSeries' data. By default, if the number of data
18613    /// points stored is less than 1000, all data is returned. Otherwise, 1000
18614    /// data points is randomly selected from this time series and returned.
18615    /// This value can be changed by changing max_data_points, which can't be
18616    /// greater than 10k.
18617    ///
18618    /// # Example
18619    /// ```
18620    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18621    /// use google_cloud_aiplatform_v1::Result;
18622    /// async fn sample(
18623    ///    client: &TensorboardService
18624    /// ) -> Result<()> {
18625    ///     let response = client.read_tensorboard_time_series_data()
18626    ///         /* set fields */
18627    ///         .send().await?;
18628    ///     println!("response {:?}", response);
18629    ///     Ok(())
18630    /// }
18631    /// ```
18632    pub fn read_tensorboard_time_series_data(
18633        &self,
18634    ) -> super::builder::tensorboard_service::ReadTensorboardTimeSeriesData {
18635        super::builder::tensorboard_service::ReadTensorboardTimeSeriesData::new(self.inner.clone())
18636    }
18637
18638    /// Write time series data points of multiple TensorboardTimeSeries in multiple
18639    /// TensorboardRun's. If any data fail to be ingested, an error is returned.
18640    ///
18641    /// # Example
18642    /// ```
18643    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18644    /// use google_cloud_aiplatform_v1::Result;
18645    /// async fn sample(
18646    ///    client: &TensorboardService
18647    /// ) -> Result<()> {
18648    ///     let response = client.write_tensorboard_experiment_data()
18649    ///         /* set fields */
18650    ///         .send().await?;
18651    ///     println!("response {:?}", response);
18652    ///     Ok(())
18653    /// }
18654    /// ```
18655    pub fn write_tensorboard_experiment_data(
18656        &self,
18657    ) -> super::builder::tensorboard_service::WriteTensorboardExperimentData {
18658        super::builder::tensorboard_service::WriteTensorboardExperimentData::new(self.inner.clone())
18659    }
18660
18661    /// Write time series data points into multiple TensorboardTimeSeries under
18662    /// a TensorboardRun. If any data fail to be ingested, an error is returned.
18663    ///
18664    /// # Example
18665    /// ```
18666    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18667    /// use google_cloud_aiplatform_v1::Result;
18668    /// async fn sample(
18669    ///    client: &TensorboardService
18670    /// ) -> Result<()> {
18671    ///     let response = client.write_tensorboard_run_data()
18672    ///         /* set fields */
18673    ///         .send().await?;
18674    ///     println!("response {:?}", response);
18675    ///     Ok(())
18676    /// }
18677    /// ```
18678    pub fn write_tensorboard_run_data(
18679        &self,
18680    ) -> super::builder::tensorboard_service::WriteTensorboardRunData {
18681        super::builder::tensorboard_service::WriteTensorboardRunData::new(self.inner.clone())
18682    }
18683
18684    /// Exports a TensorboardTimeSeries' data. Data is returned in paginated
18685    /// responses.
18686    ///
18687    /// # Example
18688    /// ```
18689    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18690    /// use google_cloud_gax::paginator::ItemPaginator as _;
18691    /// use google_cloud_aiplatform_v1::Result;
18692    /// async fn sample(
18693    ///    client: &TensorboardService
18694    /// ) -> Result<()> {
18695    ///     let mut list = client.export_tensorboard_time_series_data()
18696    ///         /* set fields */
18697    ///         .by_item();
18698    ///     while let Some(item) = list.next().await.transpose()? {
18699    ///         println!("{:?}", item);
18700    ///     }
18701    ///     Ok(())
18702    /// }
18703    /// ```
18704    pub fn export_tensorboard_time_series_data(
18705        &self,
18706    ) -> super::builder::tensorboard_service::ExportTensorboardTimeSeriesData {
18707        super::builder::tensorboard_service::ExportTensorboardTimeSeriesData::new(
18708            self.inner.clone(),
18709        )
18710    }
18711
18712    /// Lists information about the supported locations for this service.
18713    ///
18714    /// # Example
18715    /// ```
18716    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18717    /// use google_cloud_gax::paginator::ItemPaginator as _;
18718    /// use google_cloud_aiplatform_v1::Result;
18719    /// async fn sample(
18720    ///    client: &TensorboardService
18721    /// ) -> Result<()> {
18722    ///     let mut list = client.list_locations()
18723    ///         /* set fields */
18724    ///         .by_item();
18725    ///     while let Some(item) = list.next().await.transpose()? {
18726    ///         println!("{:?}", item);
18727    ///     }
18728    ///     Ok(())
18729    /// }
18730    /// ```
18731    pub fn list_locations(&self) -> super::builder::tensorboard_service::ListLocations {
18732        super::builder::tensorboard_service::ListLocations::new(self.inner.clone())
18733    }
18734
18735    /// Gets information about a location.
18736    ///
18737    /// # Example
18738    /// ```
18739    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18740    /// use google_cloud_aiplatform_v1::Result;
18741    /// async fn sample(
18742    ///    client: &TensorboardService
18743    /// ) -> Result<()> {
18744    ///     let response = client.get_location()
18745    ///         /* set fields */
18746    ///         .send().await?;
18747    ///     println!("response {:?}", response);
18748    ///     Ok(())
18749    /// }
18750    /// ```
18751    pub fn get_location(&self) -> super::builder::tensorboard_service::GetLocation {
18752        super::builder::tensorboard_service::GetLocation::new(self.inner.clone())
18753    }
18754
18755    /// Sets the access control policy on the specified resource. Replaces
18756    /// any existing policy.
18757    ///
18758    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
18759    /// errors.
18760    ///
18761    /// # Example
18762    /// ```
18763    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18764    /// use google_cloud_aiplatform_v1::Result;
18765    /// async fn sample(
18766    ///    client: &TensorboardService
18767    /// ) -> Result<()> {
18768    ///     let response = client.set_iam_policy()
18769    ///         /* set fields */
18770    ///         .send().await?;
18771    ///     println!("response {:?}", response);
18772    ///     Ok(())
18773    /// }
18774    /// ```
18775    pub fn set_iam_policy(&self) -> super::builder::tensorboard_service::SetIamPolicy {
18776        super::builder::tensorboard_service::SetIamPolicy::new(self.inner.clone())
18777    }
18778
18779    /// Gets the access control policy for a resource. Returns an empty policy
18780    /// if the resource exists and does not have a policy set.
18781    ///
18782    /// # Example
18783    /// ```
18784    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18785    /// use google_cloud_aiplatform_v1::Result;
18786    /// async fn sample(
18787    ///    client: &TensorboardService
18788    /// ) -> Result<()> {
18789    ///     let response = client.get_iam_policy()
18790    ///         /* set fields */
18791    ///         .send().await?;
18792    ///     println!("response {:?}", response);
18793    ///     Ok(())
18794    /// }
18795    /// ```
18796    pub fn get_iam_policy(&self) -> super::builder::tensorboard_service::GetIamPolicy {
18797        super::builder::tensorboard_service::GetIamPolicy::new(self.inner.clone())
18798    }
18799
18800    /// Returns permissions that a caller has on the specified resource. If the
18801    /// resource does not exist, this will return an empty set of
18802    /// permissions, not a `NOT_FOUND` error.
18803    ///
18804    /// Note: This operation is designed to be used for building
18805    /// permission-aware UIs and command-line tools, not for authorization
18806    /// checking. This operation may "fail open" without warning.
18807    ///
18808    /// # Example
18809    /// ```
18810    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18811    /// use google_cloud_aiplatform_v1::Result;
18812    /// async fn sample(
18813    ///    client: &TensorboardService
18814    /// ) -> Result<()> {
18815    ///     let response = client.test_iam_permissions()
18816    ///         /* set fields */
18817    ///         .send().await?;
18818    ///     println!("response {:?}", response);
18819    ///     Ok(())
18820    /// }
18821    /// ```
18822    pub fn test_iam_permissions(&self) -> super::builder::tensorboard_service::TestIamPermissions {
18823        super::builder::tensorboard_service::TestIamPermissions::new(self.inner.clone())
18824    }
18825
18826    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
18827    ///
18828    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
18829    ///
18830    /// # Example
18831    /// ```
18832    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18833    /// use google_cloud_gax::paginator::ItemPaginator as _;
18834    /// use google_cloud_aiplatform_v1::Result;
18835    /// async fn sample(
18836    ///    client: &TensorboardService
18837    /// ) -> Result<()> {
18838    ///     let mut list = client.list_operations()
18839    ///         /* set fields */
18840    ///         .by_item();
18841    ///     while let Some(item) = list.next().await.transpose()? {
18842    ///         println!("{:?}", item);
18843    ///     }
18844    ///     Ok(())
18845    /// }
18846    /// ```
18847    pub fn list_operations(&self) -> super::builder::tensorboard_service::ListOperations {
18848        super::builder::tensorboard_service::ListOperations::new(self.inner.clone())
18849    }
18850
18851    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
18852    ///
18853    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
18854    ///
18855    /// # Example
18856    /// ```
18857    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18858    /// use google_cloud_aiplatform_v1::Result;
18859    /// async fn sample(
18860    ///    client: &TensorboardService
18861    /// ) -> Result<()> {
18862    ///     let response = client.get_operation()
18863    ///         /* set fields */
18864    ///         .send().await?;
18865    ///     println!("response {:?}", response);
18866    ///     Ok(())
18867    /// }
18868    /// ```
18869    pub fn get_operation(&self) -> super::builder::tensorboard_service::GetOperation {
18870        super::builder::tensorboard_service::GetOperation::new(self.inner.clone())
18871    }
18872
18873    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
18874    ///
18875    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
18876    ///
18877    /// # Example
18878    /// ```
18879    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18880    /// use google_cloud_aiplatform_v1::Result;
18881    /// async fn sample(
18882    ///    client: &TensorboardService
18883    /// ) -> Result<()> {
18884    ///     client.delete_operation()
18885    ///         /* set fields */
18886    ///         .send().await?;
18887    ///     Ok(())
18888    /// }
18889    /// ```
18890    pub fn delete_operation(&self) -> super::builder::tensorboard_service::DeleteOperation {
18891        super::builder::tensorboard_service::DeleteOperation::new(self.inner.clone())
18892    }
18893
18894    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
18895    ///
18896    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
18897    ///
18898    /// # Example
18899    /// ```
18900    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18901    /// use google_cloud_aiplatform_v1::Result;
18902    /// async fn sample(
18903    ///    client: &TensorboardService
18904    /// ) -> Result<()> {
18905    ///     client.cancel_operation()
18906    ///         /* set fields */
18907    ///         .send().await?;
18908    ///     Ok(())
18909    /// }
18910    /// ```
18911    pub fn cancel_operation(&self) -> super::builder::tensorboard_service::CancelOperation {
18912        super::builder::tensorboard_service::CancelOperation::new(self.inner.clone())
18913    }
18914
18915    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
18916    ///
18917    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
18918    ///
18919    /// # Example
18920    /// ```
18921    /// # use google_cloud_aiplatform_v1::client::TensorboardService;
18922    /// use google_cloud_aiplatform_v1::Result;
18923    /// async fn sample(
18924    ///    client: &TensorboardService
18925    /// ) -> Result<()> {
18926    ///     let response = client.wait_operation()
18927    ///         /* set fields */
18928    ///         .send().await?;
18929    ///     println!("response {:?}", response);
18930    ///     Ok(())
18931    /// }
18932    /// ```
18933    pub fn wait_operation(&self) -> super::builder::tensorboard_service::WaitOperation {
18934        super::builder::tensorboard_service::WaitOperation::new(self.inner.clone())
18935    }
18936}
18937
18938/// Implements a client for the Vertex AI API.
18939///
18940/// # Example
18941/// ```
18942/// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
18943/// use google_cloud_gax::paginator::ItemPaginator as _;
18944/// async fn sample(
18945///    parent: &str,
18946/// ) -> anyhow::Result<()> {
18947///     let client = VertexRagDataService::builder().build().await?;
18948///     let mut list = client.list_rag_corpora()
18949///         .set_parent(parent)
18950///         .by_item();
18951///     while let Some(item) = list.next().await.transpose()? {
18952///         println!("{:?}", item);
18953///     }
18954///     Ok(())
18955/// }
18956/// ```
18957///
18958/// # Service Description
18959///
18960/// A service for managing user data for RAG.
18961///
18962/// # Configuration
18963///
18964/// To configure `VertexRagDataService` use the `with_*` methods in the type returned
18965/// by [builder()][VertexRagDataService::builder]. The default configuration should
18966/// work for most applications. Common configuration changes include
18967///
18968/// * [with_endpoint()]: by default this client uses the global default endpoint
18969///   (`https://aiplatform.googleapis.com`). Applications using regional
18970///   endpoints or running in restricted networks (e.g. a network configured
18971///   with [Private Google Access with VPC Service Controls]) may want to
18972///   override this default.
18973/// * [with_credentials()]: by default this client uses
18974///   [Application Default Credentials]. Applications using custom
18975///   authentication may need to override this default.
18976///
18977/// [with_endpoint()]: super::builder::vertex_rag_data_service::ClientBuilder::with_endpoint
18978/// [with_credentials()]: super::builder::vertex_rag_data_service::ClientBuilder::with_credentials
18979/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18980/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18981///
18982/// # Pooling and Cloning
18983///
18984/// `VertexRagDataService` holds a connection pool internally, it is advised to
18985/// create one and reuse it. You do not need to wrap `VertexRagDataService` in
18986/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18987/// already uses an `Arc` internally.
18988#[cfg(feature = "vertex-rag-data-service")]
18989#[cfg_attr(docsrs, doc(cfg(feature = "vertex-rag-data-service")))]
18990#[derive(Clone, Debug)]
18991pub struct VertexRagDataService {
18992    inner: std::sync::Arc<dyn super::stub::dynamic::VertexRagDataService>,
18993}
18994
18995#[cfg(feature = "vertex-rag-data-service")]
18996impl VertexRagDataService {
18997    /// Returns a builder for [VertexRagDataService].
18998    ///
18999    /// ```
19000    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19001    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19002    /// let client = VertexRagDataService::builder().build().await?;
19003    /// # Ok(()) }
19004    /// ```
19005    pub fn builder() -> super::builder::vertex_rag_data_service::ClientBuilder {
19006        crate::new_client_builder(super::builder::vertex_rag_data_service::client::Factory)
19007    }
19008
19009    /// Creates a new client from the provided stub.
19010    ///
19011    /// The most common case for calling this function is in tests mocking the
19012    /// client's behavior.
19013    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19014    where
19015        T: super::stub::VertexRagDataService + 'static,
19016    {
19017        Self { inner: stub.into() }
19018    }
19019
19020    pub(crate) async fn new(
19021        config: gaxi::options::ClientConfig,
19022    ) -> crate::ClientBuilderResult<Self> {
19023        let inner = Self::build_inner(config).await?;
19024        Ok(Self { inner })
19025    }
19026
19027    async fn build_inner(
19028        conf: gaxi::options::ClientConfig,
19029    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VertexRagDataService>>
19030    {
19031        if gaxi::options::tracing_enabled(&conf) {
19032            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19033        }
19034        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19035    }
19036
19037    async fn build_transport(
19038        conf: gaxi::options::ClientConfig,
19039    ) -> crate::ClientBuilderResult<impl super::stub::VertexRagDataService> {
19040        super::transport::VertexRagDataService::new(conf).await
19041    }
19042
19043    async fn build_with_tracing(
19044        conf: gaxi::options::ClientConfig,
19045    ) -> crate::ClientBuilderResult<impl super::stub::VertexRagDataService> {
19046        Self::build_transport(conf)
19047            .await
19048            .map(super::tracing::VertexRagDataService::new)
19049    }
19050
19051    /// Creates a RagCorpus.
19052    ///
19053    /// # Long running operations
19054    ///
19055    /// This method is used to start, and/or poll a [long-running Operation].
19056    /// The [Working with long-running operations] chapter in the [user guide]
19057    /// covers these operations in detail.
19058    ///
19059    /// [long-running operation]: https://google.aip.dev/151
19060    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
19061    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
19062    ///
19063    /// # Example
19064    /// ```
19065    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19066    /// use google_cloud_lro::Poller;
19067    /// use google_cloud_aiplatform_v1::model::RagCorpus;
19068    /// use google_cloud_aiplatform_v1::Result;
19069    /// async fn sample(
19070    ///    client: &VertexRagDataService, parent: &str
19071    /// ) -> Result<()> {
19072    ///     let response = client.create_rag_corpus()
19073    ///         .set_parent(parent)
19074    ///         .set_rag_corpus(
19075    ///             RagCorpus::new()/* set fields */
19076    ///         )
19077    ///         .poller().until_done().await?;
19078    ///     println!("response {:?}", response);
19079    ///     Ok(())
19080    /// }
19081    /// ```
19082    pub fn create_rag_corpus(&self) -> super::builder::vertex_rag_data_service::CreateRagCorpus {
19083        super::builder::vertex_rag_data_service::CreateRagCorpus::new(self.inner.clone())
19084    }
19085
19086    /// Updates a RagCorpus.
19087    ///
19088    /// # Long running operations
19089    ///
19090    /// This method is used to start, and/or poll a [long-running Operation].
19091    /// The [Working with long-running operations] chapter in the [user guide]
19092    /// covers these operations in detail.
19093    ///
19094    /// [long-running operation]: https://google.aip.dev/151
19095    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
19096    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
19097    ///
19098    /// # Example
19099    /// ```
19100    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19101    /// use google_cloud_lro::Poller;
19102    /// use google_cloud_aiplatform_v1::model::RagCorpus;
19103    /// use google_cloud_aiplatform_v1::Result;
19104    /// async fn sample(
19105    ///    client: &VertexRagDataService, project_id: &str, location_id: &str, rag_corpus_id: &str
19106    /// ) -> Result<()> {
19107    ///     let response = client.update_rag_corpus()
19108    ///         .set_rag_corpus(
19109    ///             RagCorpus::new().set_name(format!("projects/{project_id}/locations/{location_id}/ragCorpora/{rag_corpus_id}"))/* set fields */
19110    ///         )
19111    ///         .poller().until_done().await?;
19112    ///     println!("response {:?}", response);
19113    ///     Ok(())
19114    /// }
19115    /// ```
19116    pub fn update_rag_corpus(&self) -> super::builder::vertex_rag_data_service::UpdateRagCorpus {
19117        super::builder::vertex_rag_data_service::UpdateRagCorpus::new(self.inner.clone())
19118    }
19119
19120    /// Gets a RagCorpus.
19121    ///
19122    /// # Example
19123    /// ```
19124    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19125    /// use google_cloud_aiplatform_v1::Result;
19126    /// async fn sample(
19127    ///    client: &VertexRagDataService, project_id: &str, location_id: &str, rag_corpus_id: &str
19128    /// ) -> Result<()> {
19129    ///     let response = client.get_rag_corpus()
19130    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/ragCorpora/{rag_corpus_id}"))
19131    ///         .send().await?;
19132    ///     println!("response {:?}", response);
19133    ///     Ok(())
19134    /// }
19135    /// ```
19136    pub fn get_rag_corpus(&self) -> super::builder::vertex_rag_data_service::GetRagCorpus {
19137        super::builder::vertex_rag_data_service::GetRagCorpus::new(self.inner.clone())
19138    }
19139
19140    /// Lists RagCorpora in a Location.
19141    ///
19142    /// # Example
19143    /// ```
19144    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19145    /// use google_cloud_gax::paginator::ItemPaginator as _;
19146    /// use google_cloud_aiplatform_v1::Result;
19147    /// async fn sample(
19148    ///    client: &VertexRagDataService, parent: &str
19149    /// ) -> Result<()> {
19150    ///     let mut list = client.list_rag_corpora()
19151    ///         .set_parent(parent)
19152    ///         .by_item();
19153    ///     while let Some(item) = list.next().await.transpose()? {
19154    ///         println!("{:?}", item);
19155    ///     }
19156    ///     Ok(())
19157    /// }
19158    /// ```
19159    pub fn list_rag_corpora(&self) -> super::builder::vertex_rag_data_service::ListRagCorpora {
19160        super::builder::vertex_rag_data_service::ListRagCorpora::new(self.inner.clone())
19161    }
19162
19163    /// Deletes a RagCorpus.
19164    ///
19165    /// # Long running operations
19166    ///
19167    /// This method is used to start, and/or poll a [long-running Operation].
19168    /// The [Working with long-running operations] chapter in the [user guide]
19169    /// covers these operations in detail.
19170    ///
19171    /// [long-running operation]: https://google.aip.dev/151
19172    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
19173    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
19174    ///
19175    /// # Example
19176    /// ```
19177    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19178    /// use google_cloud_lro::Poller;
19179    /// use google_cloud_aiplatform_v1::Result;
19180    /// async fn sample(
19181    ///    client: &VertexRagDataService, project_id: &str, location_id: &str, rag_corpus_id: &str
19182    /// ) -> Result<()> {
19183    ///     client.delete_rag_corpus()
19184    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/ragCorpora/{rag_corpus_id}"))
19185    ///         .poller().until_done().await?;
19186    ///     Ok(())
19187    /// }
19188    /// ```
19189    pub fn delete_rag_corpus(&self) -> super::builder::vertex_rag_data_service::DeleteRagCorpus {
19190        super::builder::vertex_rag_data_service::DeleteRagCorpus::new(self.inner.clone())
19191    }
19192
19193    /// Upload a file into a RagCorpus.
19194    ///
19195    /// # Example
19196    /// ```
19197    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19198    /// use google_cloud_aiplatform_v1::Result;
19199    /// async fn sample(
19200    ///    client: &VertexRagDataService
19201    /// ) -> Result<()> {
19202    ///     let response = client.upload_rag_file()
19203    ///         /* set fields */
19204    ///         .send().await?;
19205    ///     println!("response {:?}", response);
19206    ///     Ok(())
19207    /// }
19208    /// ```
19209    pub fn upload_rag_file(&self) -> super::builder::vertex_rag_data_service::UploadRagFile {
19210        super::builder::vertex_rag_data_service::UploadRagFile::new(self.inner.clone())
19211    }
19212
19213    /// Import files from Google Cloud Storage or Google Drive into a RagCorpus.
19214    ///
19215    /// # Long running operations
19216    ///
19217    /// This method is used to start, and/or poll a [long-running Operation].
19218    /// The [Working with long-running operations] chapter in the [user guide]
19219    /// covers these operations in detail.
19220    ///
19221    /// [long-running operation]: https://google.aip.dev/151
19222    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
19223    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
19224    ///
19225    /// # Example
19226    /// ```
19227    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19228    /// use google_cloud_lro::Poller;
19229    /// use google_cloud_aiplatform_v1::Result;
19230    /// async fn sample(
19231    ///    client: &VertexRagDataService
19232    /// ) -> Result<()> {
19233    ///     let response = client.import_rag_files()
19234    ///         /* set fields */
19235    ///         .poller().until_done().await?;
19236    ///     println!("response {:?}", response);
19237    ///     Ok(())
19238    /// }
19239    /// ```
19240    pub fn import_rag_files(&self) -> super::builder::vertex_rag_data_service::ImportRagFiles {
19241        super::builder::vertex_rag_data_service::ImportRagFiles::new(self.inner.clone())
19242    }
19243
19244    /// Gets a RagFile.
19245    ///
19246    /// # Example
19247    /// ```
19248    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19249    /// use google_cloud_aiplatform_v1::Result;
19250    /// async fn sample(
19251    ///    client: &VertexRagDataService, project_id: &str, location_id: &str, rag_corpus_id: &str, rag_file_id: &str
19252    /// ) -> Result<()> {
19253    ///     let response = client.get_rag_file()
19254    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/ragCorpora/{rag_corpus_id}/ragFiles/{rag_file_id}"))
19255    ///         .send().await?;
19256    ///     println!("response {:?}", response);
19257    ///     Ok(())
19258    /// }
19259    /// ```
19260    pub fn get_rag_file(&self) -> super::builder::vertex_rag_data_service::GetRagFile {
19261        super::builder::vertex_rag_data_service::GetRagFile::new(self.inner.clone())
19262    }
19263
19264    /// Lists RagFiles in a RagCorpus.
19265    ///
19266    /// # Example
19267    /// ```
19268    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19269    /// use google_cloud_gax::paginator::ItemPaginator as _;
19270    /// use google_cloud_aiplatform_v1::Result;
19271    /// async fn sample(
19272    ///    client: &VertexRagDataService, project_id: &str, location_id: &str, rag_corpus_id: &str
19273    /// ) -> Result<()> {
19274    ///     let mut list = client.list_rag_files()
19275    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/ragCorpora/{rag_corpus_id}"))
19276    ///         .by_item();
19277    ///     while let Some(item) = list.next().await.transpose()? {
19278    ///         println!("{:?}", item);
19279    ///     }
19280    ///     Ok(())
19281    /// }
19282    /// ```
19283    pub fn list_rag_files(&self) -> super::builder::vertex_rag_data_service::ListRagFiles {
19284        super::builder::vertex_rag_data_service::ListRagFiles::new(self.inner.clone())
19285    }
19286
19287    /// Deletes a RagFile.
19288    ///
19289    /// # Long running operations
19290    ///
19291    /// This method is used to start, and/or poll a [long-running Operation].
19292    /// The [Working with long-running operations] chapter in the [user guide]
19293    /// covers these operations in detail.
19294    ///
19295    /// [long-running operation]: https://google.aip.dev/151
19296    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
19297    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
19298    ///
19299    /// # Example
19300    /// ```
19301    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19302    /// use google_cloud_lro::Poller;
19303    /// use google_cloud_aiplatform_v1::Result;
19304    /// async fn sample(
19305    ///    client: &VertexRagDataService, project_id: &str, location_id: &str, rag_corpus_id: &str, rag_file_id: &str
19306    /// ) -> Result<()> {
19307    ///     client.delete_rag_file()
19308    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/ragCorpora/{rag_corpus_id}/ragFiles/{rag_file_id}"))
19309    ///         .poller().until_done().await?;
19310    ///     Ok(())
19311    /// }
19312    /// ```
19313    pub fn delete_rag_file(&self) -> super::builder::vertex_rag_data_service::DeleteRagFile {
19314        super::builder::vertex_rag_data_service::DeleteRagFile::new(self.inner.clone())
19315    }
19316
19317    /// Updates a RagEngineConfig.
19318    ///
19319    /// # Long running operations
19320    ///
19321    /// This method is used to start, and/or poll a [long-running Operation].
19322    /// The [Working with long-running operations] chapter in the [user guide]
19323    /// covers these operations in detail.
19324    ///
19325    /// [long-running operation]: https://google.aip.dev/151
19326    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
19327    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
19328    ///
19329    /// # Example
19330    /// ```
19331    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19332    /// use google_cloud_lro::Poller;
19333    /// use google_cloud_aiplatform_v1::model::RagEngineConfig;
19334    /// use google_cloud_aiplatform_v1::Result;
19335    /// async fn sample(
19336    ///    client: &VertexRagDataService, project_id: &str, location_id: &str
19337    /// ) -> Result<()> {
19338    ///     let response = client.update_rag_engine_config()
19339    ///         .set_rag_engine_config(
19340    ///             RagEngineConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/ragEngineConfig"))/* set fields */
19341    ///         )
19342    ///         .poller().until_done().await?;
19343    ///     println!("response {:?}", response);
19344    ///     Ok(())
19345    /// }
19346    /// ```
19347    pub fn update_rag_engine_config(
19348        &self,
19349    ) -> super::builder::vertex_rag_data_service::UpdateRagEngineConfig {
19350        super::builder::vertex_rag_data_service::UpdateRagEngineConfig::new(self.inner.clone())
19351    }
19352
19353    /// Gets a RagEngineConfig.
19354    ///
19355    /// # Example
19356    /// ```
19357    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19358    /// use google_cloud_aiplatform_v1::Result;
19359    /// async fn sample(
19360    ///    client: &VertexRagDataService, project_id: &str, location_id: &str
19361    /// ) -> Result<()> {
19362    ///     let response = client.get_rag_engine_config()
19363    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/ragEngineConfig"))
19364    ///         .send().await?;
19365    ///     println!("response {:?}", response);
19366    ///     Ok(())
19367    /// }
19368    /// ```
19369    pub fn get_rag_engine_config(
19370        &self,
19371    ) -> super::builder::vertex_rag_data_service::GetRagEngineConfig {
19372        super::builder::vertex_rag_data_service::GetRagEngineConfig::new(self.inner.clone())
19373    }
19374
19375    /// Lists information about the supported locations for this service.
19376    ///
19377    /// # Example
19378    /// ```
19379    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19380    /// use google_cloud_gax::paginator::ItemPaginator as _;
19381    /// use google_cloud_aiplatform_v1::Result;
19382    /// async fn sample(
19383    ///    client: &VertexRagDataService
19384    /// ) -> Result<()> {
19385    ///     let mut list = client.list_locations()
19386    ///         /* set fields */
19387    ///         .by_item();
19388    ///     while let Some(item) = list.next().await.transpose()? {
19389    ///         println!("{:?}", item);
19390    ///     }
19391    ///     Ok(())
19392    /// }
19393    /// ```
19394    pub fn list_locations(&self) -> super::builder::vertex_rag_data_service::ListLocations {
19395        super::builder::vertex_rag_data_service::ListLocations::new(self.inner.clone())
19396    }
19397
19398    /// Gets information about a location.
19399    ///
19400    /// # Example
19401    /// ```
19402    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19403    /// use google_cloud_aiplatform_v1::Result;
19404    /// async fn sample(
19405    ///    client: &VertexRagDataService
19406    /// ) -> Result<()> {
19407    ///     let response = client.get_location()
19408    ///         /* set fields */
19409    ///         .send().await?;
19410    ///     println!("response {:?}", response);
19411    ///     Ok(())
19412    /// }
19413    /// ```
19414    pub fn get_location(&self) -> super::builder::vertex_rag_data_service::GetLocation {
19415        super::builder::vertex_rag_data_service::GetLocation::new(self.inner.clone())
19416    }
19417
19418    /// Sets the access control policy on the specified resource. Replaces
19419    /// any existing policy.
19420    ///
19421    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
19422    /// errors.
19423    ///
19424    /// # Example
19425    /// ```
19426    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19427    /// use google_cloud_aiplatform_v1::Result;
19428    /// async fn sample(
19429    ///    client: &VertexRagDataService
19430    /// ) -> Result<()> {
19431    ///     let response = client.set_iam_policy()
19432    ///         /* set fields */
19433    ///         .send().await?;
19434    ///     println!("response {:?}", response);
19435    ///     Ok(())
19436    /// }
19437    /// ```
19438    pub fn set_iam_policy(&self) -> super::builder::vertex_rag_data_service::SetIamPolicy {
19439        super::builder::vertex_rag_data_service::SetIamPolicy::new(self.inner.clone())
19440    }
19441
19442    /// Gets the access control policy for a resource. Returns an empty policy
19443    /// if the resource exists and does not have a policy set.
19444    ///
19445    /// # Example
19446    /// ```
19447    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19448    /// use google_cloud_aiplatform_v1::Result;
19449    /// async fn sample(
19450    ///    client: &VertexRagDataService
19451    /// ) -> Result<()> {
19452    ///     let response = client.get_iam_policy()
19453    ///         /* set fields */
19454    ///         .send().await?;
19455    ///     println!("response {:?}", response);
19456    ///     Ok(())
19457    /// }
19458    /// ```
19459    pub fn get_iam_policy(&self) -> super::builder::vertex_rag_data_service::GetIamPolicy {
19460        super::builder::vertex_rag_data_service::GetIamPolicy::new(self.inner.clone())
19461    }
19462
19463    /// Returns permissions that a caller has on the specified resource. If the
19464    /// resource does not exist, this will return an empty set of
19465    /// permissions, not a `NOT_FOUND` error.
19466    ///
19467    /// Note: This operation is designed to be used for building
19468    /// permission-aware UIs and command-line tools, not for authorization
19469    /// checking. This operation may "fail open" without warning.
19470    ///
19471    /// # Example
19472    /// ```
19473    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19474    /// use google_cloud_aiplatform_v1::Result;
19475    /// async fn sample(
19476    ///    client: &VertexRagDataService
19477    /// ) -> Result<()> {
19478    ///     let response = client.test_iam_permissions()
19479    ///         /* set fields */
19480    ///         .send().await?;
19481    ///     println!("response {:?}", response);
19482    ///     Ok(())
19483    /// }
19484    /// ```
19485    pub fn test_iam_permissions(
19486        &self,
19487    ) -> super::builder::vertex_rag_data_service::TestIamPermissions {
19488        super::builder::vertex_rag_data_service::TestIamPermissions::new(self.inner.clone())
19489    }
19490
19491    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
19492    ///
19493    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
19494    ///
19495    /// # Example
19496    /// ```
19497    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19498    /// use google_cloud_gax::paginator::ItemPaginator as _;
19499    /// use google_cloud_aiplatform_v1::Result;
19500    /// async fn sample(
19501    ///    client: &VertexRagDataService
19502    /// ) -> Result<()> {
19503    ///     let mut list = client.list_operations()
19504    ///         /* set fields */
19505    ///         .by_item();
19506    ///     while let Some(item) = list.next().await.transpose()? {
19507    ///         println!("{:?}", item);
19508    ///     }
19509    ///     Ok(())
19510    /// }
19511    /// ```
19512    pub fn list_operations(&self) -> super::builder::vertex_rag_data_service::ListOperations {
19513        super::builder::vertex_rag_data_service::ListOperations::new(self.inner.clone())
19514    }
19515
19516    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
19517    ///
19518    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
19519    ///
19520    /// # Example
19521    /// ```
19522    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19523    /// use google_cloud_aiplatform_v1::Result;
19524    /// async fn sample(
19525    ///    client: &VertexRagDataService
19526    /// ) -> Result<()> {
19527    ///     let response = client.get_operation()
19528    ///         /* set fields */
19529    ///         .send().await?;
19530    ///     println!("response {:?}", response);
19531    ///     Ok(())
19532    /// }
19533    /// ```
19534    pub fn get_operation(&self) -> super::builder::vertex_rag_data_service::GetOperation {
19535        super::builder::vertex_rag_data_service::GetOperation::new(self.inner.clone())
19536    }
19537
19538    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
19539    ///
19540    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
19541    ///
19542    /// # Example
19543    /// ```
19544    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19545    /// use google_cloud_aiplatform_v1::Result;
19546    /// async fn sample(
19547    ///    client: &VertexRagDataService
19548    /// ) -> Result<()> {
19549    ///     client.delete_operation()
19550    ///         /* set fields */
19551    ///         .send().await?;
19552    ///     Ok(())
19553    /// }
19554    /// ```
19555    pub fn delete_operation(&self) -> super::builder::vertex_rag_data_service::DeleteOperation {
19556        super::builder::vertex_rag_data_service::DeleteOperation::new(self.inner.clone())
19557    }
19558
19559    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
19560    ///
19561    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
19562    ///
19563    /// # Example
19564    /// ```
19565    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19566    /// use google_cloud_aiplatform_v1::Result;
19567    /// async fn sample(
19568    ///    client: &VertexRagDataService
19569    /// ) -> Result<()> {
19570    ///     client.cancel_operation()
19571    ///         /* set fields */
19572    ///         .send().await?;
19573    ///     Ok(())
19574    /// }
19575    /// ```
19576    pub fn cancel_operation(&self) -> super::builder::vertex_rag_data_service::CancelOperation {
19577        super::builder::vertex_rag_data_service::CancelOperation::new(self.inner.clone())
19578    }
19579
19580    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
19581    ///
19582    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
19583    ///
19584    /// # Example
19585    /// ```
19586    /// # use google_cloud_aiplatform_v1::client::VertexRagDataService;
19587    /// use google_cloud_aiplatform_v1::Result;
19588    /// async fn sample(
19589    ///    client: &VertexRagDataService
19590    /// ) -> Result<()> {
19591    ///     let response = client.wait_operation()
19592    ///         /* set fields */
19593    ///         .send().await?;
19594    ///     println!("response {:?}", response);
19595    ///     Ok(())
19596    /// }
19597    /// ```
19598    pub fn wait_operation(&self) -> super::builder::vertex_rag_data_service::WaitOperation {
19599        super::builder::vertex_rag_data_service::WaitOperation::new(self.inner.clone())
19600    }
19601}
19602
19603/// Implements a client for the Vertex AI API.
19604///
19605/// # Example
19606/// ```
19607/// # use google_cloud_aiplatform_v1::client::VertexRagService;
19608/// async fn sample(
19609/// ) -> anyhow::Result<()> {
19610///     let client = VertexRagService::builder().build().await?;
19611///     let response = client.retrieve_contexts()
19612///         /* set fields */
19613///         .send().await?;
19614///     println!("response {:?}", response);
19615///     Ok(())
19616/// }
19617/// ```
19618///
19619/// # Service Description
19620///
19621/// A service for retrieving relevant contexts.
19622///
19623/// # Configuration
19624///
19625/// To configure `VertexRagService` use the `with_*` methods in the type returned
19626/// by [builder()][VertexRagService::builder]. The default configuration should
19627/// work for most applications. Common configuration changes include
19628///
19629/// * [with_endpoint()]: by default this client uses the global default endpoint
19630///   (`https://aiplatform.googleapis.com`). Applications using regional
19631///   endpoints or running in restricted networks (e.g. a network configured
19632///   with [Private Google Access with VPC Service Controls]) may want to
19633///   override this default.
19634/// * [with_credentials()]: by default this client uses
19635///   [Application Default Credentials]. Applications using custom
19636///   authentication may need to override this default.
19637///
19638/// [with_endpoint()]: super::builder::vertex_rag_service::ClientBuilder::with_endpoint
19639/// [with_credentials()]: super::builder::vertex_rag_service::ClientBuilder::with_credentials
19640/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19641/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19642///
19643/// # Pooling and Cloning
19644///
19645/// `VertexRagService` holds a connection pool internally, it is advised to
19646/// create one and reuse it. You do not need to wrap `VertexRagService` in
19647/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19648/// already uses an `Arc` internally.
19649#[cfg(feature = "vertex-rag-service")]
19650#[cfg_attr(docsrs, doc(cfg(feature = "vertex-rag-service")))]
19651#[derive(Clone, Debug)]
19652pub struct VertexRagService {
19653    inner: std::sync::Arc<dyn super::stub::dynamic::VertexRagService>,
19654}
19655
19656#[cfg(feature = "vertex-rag-service")]
19657impl VertexRagService {
19658    /// Returns a builder for [VertexRagService].
19659    ///
19660    /// ```
19661    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19662    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19663    /// let client = VertexRagService::builder().build().await?;
19664    /// # Ok(()) }
19665    /// ```
19666    pub fn builder() -> super::builder::vertex_rag_service::ClientBuilder {
19667        crate::new_client_builder(super::builder::vertex_rag_service::client::Factory)
19668    }
19669
19670    /// Creates a new client from the provided stub.
19671    ///
19672    /// The most common case for calling this function is in tests mocking the
19673    /// client's behavior.
19674    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19675    where
19676        T: super::stub::VertexRagService + 'static,
19677    {
19678        Self { inner: stub.into() }
19679    }
19680
19681    pub(crate) async fn new(
19682        config: gaxi::options::ClientConfig,
19683    ) -> crate::ClientBuilderResult<Self> {
19684        let inner = Self::build_inner(config).await?;
19685        Ok(Self { inner })
19686    }
19687
19688    async fn build_inner(
19689        conf: gaxi::options::ClientConfig,
19690    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VertexRagService>>
19691    {
19692        if gaxi::options::tracing_enabled(&conf) {
19693            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19694        }
19695        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19696    }
19697
19698    async fn build_transport(
19699        conf: gaxi::options::ClientConfig,
19700    ) -> crate::ClientBuilderResult<impl super::stub::VertexRagService> {
19701        super::transport::VertexRagService::new(conf).await
19702    }
19703
19704    async fn build_with_tracing(
19705        conf: gaxi::options::ClientConfig,
19706    ) -> crate::ClientBuilderResult<impl super::stub::VertexRagService> {
19707        Self::build_transport(conf)
19708            .await
19709            .map(super::tracing::VertexRagService::new)
19710    }
19711
19712    /// Retrieves relevant contexts for a query.
19713    ///
19714    /// # Example
19715    /// ```
19716    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19717    /// use google_cloud_aiplatform_v1::Result;
19718    /// async fn sample(
19719    ///    client: &VertexRagService
19720    /// ) -> Result<()> {
19721    ///     let response = client.retrieve_contexts()
19722    ///         /* set fields */
19723    ///         .send().await?;
19724    ///     println!("response {:?}", response);
19725    ///     Ok(())
19726    /// }
19727    /// ```
19728    pub fn retrieve_contexts(&self) -> super::builder::vertex_rag_service::RetrieveContexts {
19729        super::builder::vertex_rag_service::RetrieveContexts::new(self.inner.clone())
19730    }
19731
19732    /// Given an input prompt, it returns augmented prompt from vertex rag store
19733    /// to guide LLM towards generating grounded responses.
19734    ///
19735    /// # Example
19736    /// ```
19737    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19738    /// use google_cloud_aiplatform_v1::Result;
19739    /// async fn sample(
19740    ///    client: &VertexRagService
19741    /// ) -> Result<()> {
19742    ///     let response = client.augment_prompt()
19743    ///         /* set fields */
19744    ///         .send().await?;
19745    ///     println!("response {:?}", response);
19746    ///     Ok(())
19747    /// }
19748    /// ```
19749    pub fn augment_prompt(&self) -> super::builder::vertex_rag_service::AugmentPrompt {
19750        super::builder::vertex_rag_service::AugmentPrompt::new(self.inner.clone())
19751    }
19752
19753    /// Given an input text, it returns a score that evaluates the factuality of
19754    /// the text. It also extracts and returns claims from the text and provides
19755    /// supporting facts.
19756    ///
19757    /// # Example
19758    /// ```
19759    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19760    /// use google_cloud_aiplatform_v1::Result;
19761    /// async fn sample(
19762    ///    client: &VertexRagService
19763    /// ) -> Result<()> {
19764    ///     let response = client.corroborate_content()
19765    ///         /* set fields */
19766    ///         .send().await?;
19767    ///     println!("response {:?}", response);
19768    ///     Ok(())
19769    /// }
19770    /// ```
19771    pub fn corroborate_content(&self) -> super::builder::vertex_rag_service::CorroborateContent {
19772        super::builder::vertex_rag_service::CorroborateContent::new(self.inner.clone())
19773    }
19774
19775    /// Agentic Retrieval Ask API for RAG.
19776    ///
19777    /// # Example
19778    /// ```
19779    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19780    /// use google_cloud_aiplatform_v1::Result;
19781    /// async fn sample(
19782    ///    client: &VertexRagService
19783    /// ) -> Result<()> {
19784    ///     let response = client.ask_contexts()
19785    ///         /* set fields */
19786    ///         .send().await?;
19787    ///     println!("response {:?}", response);
19788    ///     Ok(())
19789    /// }
19790    /// ```
19791    pub fn ask_contexts(&self) -> super::builder::vertex_rag_service::AskContexts {
19792        super::builder::vertex_rag_service::AskContexts::new(self.inner.clone())
19793    }
19794
19795    /// Asynchronous API to retrieves relevant contexts for a query.
19796    ///
19797    /// # Long running operations
19798    ///
19799    /// This method is used to start, and/or poll a [long-running Operation].
19800    /// The [Working with long-running operations] chapter in the [user guide]
19801    /// covers these operations in detail.
19802    ///
19803    /// [long-running operation]: https://google.aip.dev/151
19804    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
19805    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
19806    ///
19807    /// # Example
19808    /// ```
19809    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19810    /// use google_cloud_lro::Poller;
19811    /// use google_cloud_aiplatform_v1::Result;
19812    /// async fn sample(
19813    ///    client: &VertexRagService
19814    /// ) -> Result<()> {
19815    ///     let response = client.async_retrieve_contexts()
19816    ///         /* set fields */
19817    ///         .poller().until_done().await?;
19818    ///     println!("response {:?}", response);
19819    ///     Ok(())
19820    /// }
19821    /// ```
19822    pub fn async_retrieve_contexts(
19823        &self,
19824    ) -> super::builder::vertex_rag_service::AsyncRetrieveContexts {
19825        super::builder::vertex_rag_service::AsyncRetrieveContexts::new(self.inner.clone())
19826    }
19827
19828    /// Lists information about the supported locations for this service.
19829    ///
19830    /// # Example
19831    /// ```
19832    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19833    /// use google_cloud_gax::paginator::ItemPaginator as _;
19834    /// use google_cloud_aiplatform_v1::Result;
19835    /// async fn sample(
19836    ///    client: &VertexRagService
19837    /// ) -> Result<()> {
19838    ///     let mut list = client.list_locations()
19839    ///         /* set fields */
19840    ///         .by_item();
19841    ///     while let Some(item) = list.next().await.transpose()? {
19842    ///         println!("{:?}", item);
19843    ///     }
19844    ///     Ok(())
19845    /// }
19846    /// ```
19847    pub fn list_locations(&self) -> super::builder::vertex_rag_service::ListLocations {
19848        super::builder::vertex_rag_service::ListLocations::new(self.inner.clone())
19849    }
19850
19851    /// Gets information about a location.
19852    ///
19853    /// # Example
19854    /// ```
19855    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19856    /// use google_cloud_aiplatform_v1::Result;
19857    /// async fn sample(
19858    ///    client: &VertexRagService
19859    /// ) -> Result<()> {
19860    ///     let response = client.get_location()
19861    ///         /* set fields */
19862    ///         .send().await?;
19863    ///     println!("response {:?}", response);
19864    ///     Ok(())
19865    /// }
19866    /// ```
19867    pub fn get_location(&self) -> super::builder::vertex_rag_service::GetLocation {
19868        super::builder::vertex_rag_service::GetLocation::new(self.inner.clone())
19869    }
19870
19871    /// Sets the access control policy on the specified resource. Replaces
19872    /// any existing policy.
19873    ///
19874    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
19875    /// errors.
19876    ///
19877    /// # Example
19878    /// ```
19879    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19880    /// use google_cloud_aiplatform_v1::Result;
19881    /// async fn sample(
19882    ///    client: &VertexRagService
19883    /// ) -> Result<()> {
19884    ///     let response = client.set_iam_policy()
19885    ///         /* set fields */
19886    ///         .send().await?;
19887    ///     println!("response {:?}", response);
19888    ///     Ok(())
19889    /// }
19890    /// ```
19891    pub fn set_iam_policy(&self) -> super::builder::vertex_rag_service::SetIamPolicy {
19892        super::builder::vertex_rag_service::SetIamPolicy::new(self.inner.clone())
19893    }
19894
19895    /// Gets the access control policy for a resource. Returns an empty policy
19896    /// if the resource exists and does not have a policy set.
19897    ///
19898    /// # Example
19899    /// ```
19900    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19901    /// use google_cloud_aiplatform_v1::Result;
19902    /// async fn sample(
19903    ///    client: &VertexRagService
19904    /// ) -> Result<()> {
19905    ///     let response = client.get_iam_policy()
19906    ///         /* set fields */
19907    ///         .send().await?;
19908    ///     println!("response {:?}", response);
19909    ///     Ok(())
19910    /// }
19911    /// ```
19912    pub fn get_iam_policy(&self) -> super::builder::vertex_rag_service::GetIamPolicy {
19913        super::builder::vertex_rag_service::GetIamPolicy::new(self.inner.clone())
19914    }
19915
19916    /// Returns permissions that a caller has on the specified resource. If the
19917    /// resource does not exist, this will return an empty set of
19918    /// permissions, not a `NOT_FOUND` error.
19919    ///
19920    /// Note: This operation is designed to be used for building
19921    /// permission-aware UIs and command-line tools, not for authorization
19922    /// checking. This operation may "fail open" without warning.
19923    ///
19924    /// # Example
19925    /// ```
19926    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19927    /// use google_cloud_aiplatform_v1::Result;
19928    /// async fn sample(
19929    ///    client: &VertexRagService
19930    /// ) -> Result<()> {
19931    ///     let response = client.test_iam_permissions()
19932    ///         /* set fields */
19933    ///         .send().await?;
19934    ///     println!("response {:?}", response);
19935    ///     Ok(())
19936    /// }
19937    /// ```
19938    pub fn test_iam_permissions(&self) -> super::builder::vertex_rag_service::TestIamPermissions {
19939        super::builder::vertex_rag_service::TestIamPermissions::new(self.inner.clone())
19940    }
19941
19942    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
19943    ///
19944    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
19945    ///
19946    /// # Example
19947    /// ```
19948    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19949    /// use google_cloud_gax::paginator::ItemPaginator as _;
19950    /// use google_cloud_aiplatform_v1::Result;
19951    /// async fn sample(
19952    ///    client: &VertexRagService
19953    /// ) -> Result<()> {
19954    ///     let mut list = client.list_operations()
19955    ///         /* set fields */
19956    ///         .by_item();
19957    ///     while let Some(item) = list.next().await.transpose()? {
19958    ///         println!("{:?}", item);
19959    ///     }
19960    ///     Ok(())
19961    /// }
19962    /// ```
19963    pub fn list_operations(&self) -> super::builder::vertex_rag_service::ListOperations {
19964        super::builder::vertex_rag_service::ListOperations::new(self.inner.clone())
19965    }
19966
19967    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
19968    ///
19969    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
19970    ///
19971    /// # Example
19972    /// ```
19973    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19974    /// use google_cloud_aiplatform_v1::Result;
19975    /// async fn sample(
19976    ///    client: &VertexRagService
19977    /// ) -> Result<()> {
19978    ///     let response = client.get_operation()
19979    ///         /* set fields */
19980    ///         .send().await?;
19981    ///     println!("response {:?}", response);
19982    ///     Ok(())
19983    /// }
19984    /// ```
19985    pub fn get_operation(&self) -> super::builder::vertex_rag_service::GetOperation {
19986        super::builder::vertex_rag_service::GetOperation::new(self.inner.clone())
19987    }
19988
19989    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
19990    ///
19991    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
19992    ///
19993    /// # Example
19994    /// ```
19995    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
19996    /// use google_cloud_aiplatform_v1::Result;
19997    /// async fn sample(
19998    ///    client: &VertexRagService
19999    /// ) -> Result<()> {
20000    ///     client.delete_operation()
20001    ///         /* set fields */
20002    ///         .send().await?;
20003    ///     Ok(())
20004    /// }
20005    /// ```
20006    pub fn delete_operation(&self) -> super::builder::vertex_rag_service::DeleteOperation {
20007        super::builder::vertex_rag_service::DeleteOperation::new(self.inner.clone())
20008    }
20009
20010    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
20011    ///
20012    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
20013    ///
20014    /// # Example
20015    /// ```
20016    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
20017    /// use google_cloud_aiplatform_v1::Result;
20018    /// async fn sample(
20019    ///    client: &VertexRagService
20020    /// ) -> Result<()> {
20021    ///     client.cancel_operation()
20022    ///         /* set fields */
20023    ///         .send().await?;
20024    ///     Ok(())
20025    /// }
20026    /// ```
20027    pub fn cancel_operation(&self) -> super::builder::vertex_rag_service::CancelOperation {
20028        super::builder::vertex_rag_service::CancelOperation::new(self.inner.clone())
20029    }
20030
20031    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
20032    ///
20033    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
20034    ///
20035    /// # Example
20036    /// ```
20037    /// # use google_cloud_aiplatform_v1::client::VertexRagService;
20038    /// use google_cloud_aiplatform_v1::Result;
20039    /// async fn sample(
20040    ///    client: &VertexRagService
20041    /// ) -> Result<()> {
20042    ///     let response = client.wait_operation()
20043    ///         /* set fields */
20044    ///         .send().await?;
20045    ///     println!("response {:?}", response);
20046    ///     Ok(())
20047    /// }
20048    /// ```
20049    pub fn wait_operation(&self) -> super::builder::vertex_rag_service::WaitOperation {
20050        super::builder::vertex_rag_service::WaitOperation::new(self.inner.clone())
20051    }
20052}
20053
20054/// Implements a client for the Vertex AI API.
20055///
20056/// # Example
20057/// ```
20058/// # use google_cloud_aiplatform_v1::client::VizierService;
20059/// use google_cloud_gax::paginator::ItemPaginator as _;
20060/// async fn sample(
20061///    parent: &str,
20062/// ) -> anyhow::Result<()> {
20063///     let client = VizierService::builder().build().await?;
20064///     let mut list = client.list_studies()
20065///         .set_parent(parent)
20066///         .by_item();
20067///     while let Some(item) = list.next().await.transpose()? {
20068///         println!("{:?}", item);
20069///     }
20070///     Ok(())
20071/// }
20072/// ```
20073///
20074/// # Service Description
20075///
20076/// Vertex AI Vizier API.
20077///
20078/// Vertex AI Vizier is a service to solve blackbox optimization problems,
20079/// such as tuning machine learning hyperparameters and searching over deep
20080/// learning architectures.
20081///
20082/// # Configuration
20083///
20084/// To configure `VizierService` use the `with_*` methods in the type returned
20085/// by [builder()][VizierService::builder]. The default configuration should
20086/// work for most applications. Common configuration changes include
20087///
20088/// * [with_endpoint()]: by default this client uses the global default endpoint
20089///   (`https://aiplatform.googleapis.com`). Applications using regional
20090///   endpoints or running in restricted networks (e.g. a network configured
20091///   with [Private Google Access with VPC Service Controls]) may want to
20092///   override this default.
20093/// * [with_credentials()]: by default this client uses
20094///   [Application Default Credentials]. Applications using custom
20095///   authentication may need to override this default.
20096///
20097/// [with_endpoint()]: super::builder::vizier_service::ClientBuilder::with_endpoint
20098/// [with_credentials()]: super::builder::vizier_service::ClientBuilder::with_credentials
20099/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20100/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20101///
20102/// # Pooling and Cloning
20103///
20104/// `VizierService` holds a connection pool internally, it is advised to
20105/// create one and reuse it. You do not need to wrap `VizierService` in
20106/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20107/// already uses an `Arc` internally.
20108#[cfg(feature = "vizier-service")]
20109#[cfg_attr(docsrs, doc(cfg(feature = "vizier-service")))]
20110#[derive(Clone, Debug)]
20111pub struct VizierService {
20112    inner: std::sync::Arc<dyn super::stub::dynamic::VizierService>,
20113}
20114
20115#[cfg(feature = "vizier-service")]
20116impl VizierService {
20117    /// Returns a builder for [VizierService].
20118    ///
20119    /// ```
20120    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20121    /// # use google_cloud_aiplatform_v1::client::VizierService;
20122    /// let client = VizierService::builder().build().await?;
20123    /// # Ok(()) }
20124    /// ```
20125    pub fn builder() -> super::builder::vizier_service::ClientBuilder {
20126        crate::new_client_builder(super::builder::vizier_service::client::Factory)
20127    }
20128
20129    /// Creates a new client from the provided stub.
20130    ///
20131    /// The most common case for calling this function is in tests mocking the
20132    /// client's behavior.
20133    pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20134    where
20135        T: super::stub::VizierService + 'static,
20136    {
20137        Self { inner: stub.into() }
20138    }
20139
20140    pub(crate) async fn new(
20141        config: gaxi::options::ClientConfig,
20142    ) -> crate::ClientBuilderResult<Self> {
20143        let inner = Self::build_inner(config).await?;
20144        Ok(Self { inner })
20145    }
20146
20147    async fn build_inner(
20148        conf: gaxi::options::ClientConfig,
20149    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VizierService>> {
20150        if gaxi::options::tracing_enabled(&conf) {
20151            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20152        }
20153        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20154    }
20155
20156    async fn build_transport(
20157        conf: gaxi::options::ClientConfig,
20158    ) -> crate::ClientBuilderResult<impl super::stub::VizierService> {
20159        super::transport::VizierService::new(conf).await
20160    }
20161
20162    async fn build_with_tracing(
20163        conf: gaxi::options::ClientConfig,
20164    ) -> crate::ClientBuilderResult<impl super::stub::VizierService> {
20165        Self::build_transport(conf)
20166            .await
20167            .map(super::tracing::VizierService::new)
20168    }
20169
20170    /// Creates a Study. A resource name will be generated after creation of the
20171    /// Study.
20172    ///
20173    /// # Example
20174    /// ```
20175    /// # use google_cloud_aiplatform_v1::client::VizierService;
20176    /// use google_cloud_aiplatform_v1::model::Study;
20177    /// use google_cloud_aiplatform_v1::Result;
20178    /// async fn sample(
20179    ///    client: &VizierService, parent: &str
20180    /// ) -> Result<()> {
20181    ///     let response = client.create_study()
20182    ///         .set_parent(parent)
20183    ///         .set_study(
20184    ///             Study::new()/* set fields */
20185    ///         )
20186    ///         .send().await?;
20187    ///     println!("response {:?}", response);
20188    ///     Ok(())
20189    /// }
20190    /// ```
20191    pub fn create_study(&self) -> super::builder::vizier_service::CreateStudy {
20192        super::builder::vizier_service::CreateStudy::new(self.inner.clone())
20193    }
20194
20195    /// Gets a Study by name.
20196    ///
20197    /// # Example
20198    /// ```
20199    /// # use google_cloud_aiplatform_v1::client::VizierService;
20200    /// use google_cloud_aiplatform_v1::Result;
20201    /// async fn sample(
20202    ///    client: &VizierService, project_id: &str, location_id: &str, study_id: &str
20203    /// ) -> Result<()> {
20204    ///     let response = client.get_study()
20205    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/studies/{study_id}"))
20206    ///         .send().await?;
20207    ///     println!("response {:?}", response);
20208    ///     Ok(())
20209    /// }
20210    /// ```
20211    pub fn get_study(&self) -> super::builder::vizier_service::GetStudy {
20212        super::builder::vizier_service::GetStudy::new(self.inner.clone())
20213    }
20214
20215    /// Lists all the studies in a region for an associated project.
20216    ///
20217    /// # Example
20218    /// ```
20219    /// # use google_cloud_aiplatform_v1::client::VizierService;
20220    /// use google_cloud_gax::paginator::ItemPaginator as _;
20221    /// use google_cloud_aiplatform_v1::Result;
20222    /// async fn sample(
20223    ///    client: &VizierService, parent: &str
20224    /// ) -> Result<()> {
20225    ///     let mut list = client.list_studies()
20226    ///         .set_parent(parent)
20227    ///         .by_item();
20228    ///     while let Some(item) = list.next().await.transpose()? {
20229    ///         println!("{:?}", item);
20230    ///     }
20231    ///     Ok(())
20232    /// }
20233    /// ```
20234    pub fn list_studies(&self) -> super::builder::vizier_service::ListStudies {
20235        super::builder::vizier_service::ListStudies::new(self.inner.clone())
20236    }
20237
20238    /// Deletes a Study.
20239    ///
20240    /// # Example
20241    /// ```
20242    /// # use google_cloud_aiplatform_v1::client::VizierService;
20243    /// use google_cloud_aiplatform_v1::Result;
20244    /// async fn sample(
20245    ///    client: &VizierService, project_id: &str, location_id: &str, study_id: &str
20246    /// ) -> Result<()> {
20247    ///     client.delete_study()
20248    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/studies/{study_id}"))
20249    ///         .send().await?;
20250    ///     Ok(())
20251    /// }
20252    /// ```
20253    pub fn delete_study(&self) -> super::builder::vizier_service::DeleteStudy {
20254        super::builder::vizier_service::DeleteStudy::new(self.inner.clone())
20255    }
20256
20257    /// Looks a study up using the user-defined display_name field instead of the
20258    /// fully qualified resource name.
20259    ///
20260    /// # Example
20261    /// ```
20262    /// # use google_cloud_aiplatform_v1::client::VizierService;
20263    /// use google_cloud_aiplatform_v1::Result;
20264    /// async fn sample(
20265    ///    client: &VizierService
20266    /// ) -> Result<()> {
20267    ///     let response = client.lookup_study()
20268    ///         /* set fields */
20269    ///         .send().await?;
20270    ///     println!("response {:?}", response);
20271    ///     Ok(())
20272    /// }
20273    /// ```
20274    pub fn lookup_study(&self) -> super::builder::vizier_service::LookupStudy {
20275        super::builder::vizier_service::LookupStudy::new(self.inner.clone())
20276    }
20277
20278    /// Adds one or more Trials to a Study, with parameter values
20279    /// suggested by Vertex AI Vizier. Returns a long-running
20280    /// operation associated with the generation of Trial suggestions.
20281    /// When this long-running operation succeeds, it will contain
20282    /// a
20283    /// [SuggestTrialsResponse][google.cloud.aiplatform.v1.SuggestTrialsResponse].
20284    ///
20285    /// [google.cloud.aiplatform.v1.SuggestTrialsResponse]: crate::model::SuggestTrialsResponse
20286    ///
20287    /// # Long running operations
20288    ///
20289    /// This method is used to start, and/or poll a [long-running Operation].
20290    /// The [Working with long-running operations] chapter in the [user guide]
20291    /// covers these operations in detail.
20292    ///
20293    /// [long-running operation]: https://google.aip.dev/151
20294    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
20295    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
20296    ///
20297    /// # Example
20298    /// ```
20299    /// # use google_cloud_aiplatform_v1::client::VizierService;
20300    /// use google_cloud_lro::Poller;
20301    /// use google_cloud_aiplatform_v1::Result;
20302    /// async fn sample(
20303    ///    client: &VizierService
20304    /// ) -> Result<()> {
20305    ///     let response = client.suggest_trials()
20306    ///         /* set fields */
20307    ///         .poller().until_done().await?;
20308    ///     println!("response {:?}", response);
20309    ///     Ok(())
20310    /// }
20311    /// ```
20312    pub fn suggest_trials(&self) -> super::builder::vizier_service::SuggestTrials {
20313        super::builder::vizier_service::SuggestTrials::new(self.inner.clone())
20314    }
20315
20316    /// Adds a user provided Trial to a Study.
20317    ///
20318    /// # Example
20319    /// ```
20320    /// # use google_cloud_aiplatform_v1::client::VizierService;
20321    /// use google_cloud_aiplatform_v1::model::Trial;
20322    /// use google_cloud_aiplatform_v1::Result;
20323    /// async fn sample(
20324    ///    client: &VizierService, project_id: &str, location_id: &str, study_id: &str
20325    /// ) -> Result<()> {
20326    ///     let response = client.create_trial()
20327    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/studies/{study_id}"))
20328    ///         .set_trial(
20329    ///             Trial::new()/* set fields */
20330    ///         )
20331    ///         .send().await?;
20332    ///     println!("response {:?}", response);
20333    ///     Ok(())
20334    /// }
20335    /// ```
20336    pub fn create_trial(&self) -> super::builder::vizier_service::CreateTrial {
20337        super::builder::vizier_service::CreateTrial::new(self.inner.clone())
20338    }
20339
20340    /// Gets a Trial.
20341    ///
20342    /// # Example
20343    /// ```
20344    /// # use google_cloud_aiplatform_v1::client::VizierService;
20345    /// use google_cloud_aiplatform_v1::Result;
20346    /// async fn sample(
20347    ///    client: &VizierService, project_id: &str, location_id: &str, study_id: &str, trial_id: &str
20348    /// ) -> Result<()> {
20349    ///     let response = client.get_trial()
20350    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/studies/{study_id}/trials/{trial_id}"))
20351    ///         .send().await?;
20352    ///     println!("response {:?}", response);
20353    ///     Ok(())
20354    /// }
20355    /// ```
20356    pub fn get_trial(&self) -> super::builder::vizier_service::GetTrial {
20357        super::builder::vizier_service::GetTrial::new(self.inner.clone())
20358    }
20359
20360    /// Lists the Trials associated with a Study.
20361    ///
20362    /// # Example
20363    /// ```
20364    /// # use google_cloud_aiplatform_v1::client::VizierService;
20365    /// use google_cloud_gax::paginator::ItemPaginator as _;
20366    /// use google_cloud_aiplatform_v1::Result;
20367    /// async fn sample(
20368    ///    client: &VizierService, project_id: &str, location_id: &str, study_id: &str
20369    /// ) -> Result<()> {
20370    ///     let mut list = client.list_trials()
20371    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}/studies/{study_id}"))
20372    ///         .by_item();
20373    ///     while let Some(item) = list.next().await.transpose()? {
20374    ///         println!("{:?}", item);
20375    ///     }
20376    ///     Ok(())
20377    /// }
20378    /// ```
20379    pub fn list_trials(&self) -> super::builder::vizier_service::ListTrials {
20380        super::builder::vizier_service::ListTrials::new(self.inner.clone())
20381    }
20382
20383    /// Adds a measurement of the objective metrics to a Trial. This measurement
20384    /// is assumed to have been taken before the Trial is complete.
20385    ///
20386    /// # Example
20387    /// ```
20388    /// # use google_cloud_aiplatform_v1::client::VizierService;
20389    /// use google_cloud_aiplatform_v1::Result;
20390    /// async fn sample(
20391    ///    client: &VizierService
20392    /// ) -> Result<()> {
20393    ///     let response = client.add_trial_measurement()
20394    ///         /* set fields */
20395    ///         .send().await?;
20396    ///     println!("response {:?}", response);
20397    ///     Ok(())
20398    /// }
20399    /// ```
20400    pub fn add_trial_measurement(&self) -> super::builder::vizier_service::AddTrialMeasurement {
20401        super::builder::vizier_service::AddTrialMeasurement::new(self.inner.clone())
20402    }
20403
20404    /// Marks a Trial as complete.
20405    ///
20406    /// # Example
20407    /// ```
20408    /// # use google_cloud_aiplatform_v1::client::VizierService;
20409    /// use google_cloud_aiplatform_v1::Result;
20410    /// async fn sample(
20411    ///    client: &VizierService
20412    /// ) -> Result<()> {
20413    ///     let response = client.complete_trial()
20414    ///         /* set fields */
20415    ///         .send().await?;
20416    ///     println!("response {:?}", response);
20417    ///     Ok(())
20418    /// }
20419    /// ```
20420    pub fn complete_trial(&self) -> super::builder::vizier_service::CompleteTrial {
20421        super::builder::vizier_service::CompleteTrial::new(self.inner.clone())
20422    }
20423
20424    /// Deletes a Trial.
20425    ///
20426    /// # Example
20427    /// ```
20428    /// # use google_cloud_aiplatform_v1::client::VizierService;
20429    /// use google_cloud_aiplatform_v1::Result;
20430    /// async fn sample(
20431    ///    client: &VizierService, project_id: &str, location_id: &str, study_id: &str, trial_id: &str
20432    /// ) -> Result<()> {
20433    ///     client.delete_trial()
20434    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/studies/{study_id}/trials/{trial_id}"))
20435    ///         .send().await?;
20436    ///     Ok(())
20437    /// }
20438    /// ```
20439    pub fn delete_trial(&self) -> super::builder::vizier_service::DeleteTrial {
20440        super::builder::vizier_service::DeleteTrial::new(self.inner.clone())
20441    }
20442
20443    /// Checks  whether a Trial should stop or not. Returns a
20444    /// long-running operation. When the operation is successful,
20445    /// it will contain a
20446    /// [CheckTrialEarlyStoppingStateResponse][google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateResponse].
20447    ///
20448    /// [google.cloud.aiplatform.v1.CheckTrialEarlyStoppingStateResponse]: crate::model::CheckTrialEarlyStoppingStateResponse
20449    ///
20450    /// # Long running operations
20451    ///
20452    /// This method is used to start, and/or poll a [long-running Operation].
20453    /// The [Working with long-running operations] chapter in the [user guide]
20454    /// covers these operations in detail.
20455    ///
20456    /// [long-running operation]: https://google.aip.dev/151
20457    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
20458    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
20459    ///
20460    /// # Example
20461    /// ```
20462    /// # use google_cloud_aiplatform_v1::client::VizierService;
20463    /// use google_cloud_lro::Poller;
20464    /// use google_cloud_aiplatform_v1::Result;
20465    /// async fn sample(
20466    ///    client: &VizierService
20467    /// ) -> Result<()> {
20468    ///     let response = client.check_trial_early_stopping_state()
20469    ///         /* set fields */
20470    ///         .poller().until_done().await?;
20471    ///     println!("response {:?}", response);
20472    ///     Ok(())
20473    /// }
20474    /// ```
20475    pub fn check_trial_early_stopping_state(
20476        &self,
20477    ) -> super::builder::vizier_service::CheckTrialEarlyStoppingState {
20478        super::builder::vizier_service::CheckTrialEarlyStoppingState::new(self.inner.clone())
20479    }
20480
20481    /// Stops a Trial.
20482    ///
20483    /// # Example
20484    /// ```
20485    /// # use google_cloud_aiplatform_v1::client::VizierService;
20486    /// use google_cloud_aiplatform_v1::Result;
20487    /// async fn sample(
20488    ///    client: &VizierService
20489    /// ) -> Result<()> {
20490    ///     let response = client.stop_trial()
20491    ///         /* set fields */
20492    ///         .send().await?;
20493    ///     println!("response {:?}", response);
20494    ///     Ok(())
20495    /// }
20496    /// ```
20497    pub fn stop_trial(&self) -> super::builder::vizier_service::StopTrial {
20498        super::builder::vizier_service::StopTrial::new(self.inner.clone())
20499    }
20500
20501    /// Lists the pareto-optimal Trials for multi-objective Study or the
20502    /// optimal Trials for single-objective Study. The definition of
20503    /// pareto-optimal can be checked in wiki page.
20504    /// <https://en.wikipedia.org/wiki/Pareto_efficiency>
20505    ///
20506    /// # Example
20507    /// ```
20508    /// # use google_cloud_aiplatform_v1::client::VizierService;
20509    /// use google_cloud_aiplatform_v1::Result;
20510    /// async fn sample(
20511    ///    client: &VizierService
20512    /// ) -> Result<()> {
20513    ///     let response = client.list_optimal_trials()
20514    ///         /* set fields */
20515    ///         .send().await?;
20516    ///     println!("response {:?}", response);
20517    ///     Ok(())
20518    /// }
20519    /// ```
20520    pub fn list_optimal_trials(&self) -> super::builder::vizier_service::ListOptimalTrials {
20521        super::builder::vizier_service::ListOptimalTrials::new(self.inner.clone())
20522    }
20523
20524    /// Lists information about the supported locations for this service.
20525    ///
20526    /// # Example
20527    /// ```
20528    /// # use google_cloud_aiplatform_v1::client::VizierService;
20529    /// use google_cloud_gax::paginator::ItemPaginator as _;
20530    /// use google_cloud_aiplatform_v1::Result;
20531    /// async fn sample(
20532    ///    client: &VizierService
20533    /// ) -> Result<()> {
20534    ///     let mut list = client.list_locations()
20535    ///         /* set fields */
20536    ///         .by_item();
20537    ///     while let Some(item) = list.next().await.transpose()? {
20538    ///         println!("{:?}", item);
20539    ///     }
20540    ///     Ok(())
20541    /// }
20542    /// ```
20543    pub fn list_locations(&self) -> super::builder::vizier_service::ListLocations {
20544        super::builder::vizier_service::ListLocations::new(self.inner.clone())
20545    }
20546
20547    /// Gets information about a location.
20548    ///
20549    /// # Example
20550    /// ```
20551    /// # use google_cloud_aiplatform_v1::client::VizierService;
20552    /// use google_cloud_aiplatform_v1::Result;
20553    /// async fn sample(
20554    ///    client: &VizierService
20555    /// ) -> Result<()> {
20556    ///     let response = client.get_location()
20557    ///         /* set fields */
20558    ///         .send().await?;
20559    ///     println!("response {:?}", response);
20560    ///     Ok(())
20561    /// }
20562    /// ```
20563    pub fn get_location(&self) -> super::builder::vizier_service::GetLocation {
20564        super::builder::vizier_service::GetLocation::new(self.inner.clone())
20565    }
20566
20567    /// Sets the access control policy on the specified resource. Replaces
20568    /// any existing policy.
20569    ///
20570    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
20571    /// errors.
20572    ///
20573    /// # Example
20574    /// ```
20575    /// # use google_cloud_aiplatform_v1::client::VizierService;
20576    /// use google_cloud_aiplatform_v1::Result;
20577    /// async fn sample(
20578    ///    client: &VizierService
20579    /// ) -> Result<()> {
20580    ///     let response = client.set_iam_policy()
20581    ///         /* set fields */
20582    ///         .send().await?;
20583    ///     println!("response {:?}", response);
20584    ///     Ok(())
20585    /// }
20586    /// ```
20587    pub fn set_iam_policy(&self) -> super::builder::vizier_service::SetIamPolicy {
20588        super::builder::vizier_service::SetIamPolicy::new(self.inner.clone())
20589    }
20590
20591    /// Gets the access control policy for a resource. Returns an empty policy
20592    /// if the resource exists and does not have a policy set.
20593    ///
20594    /// # Example
20595    /// ```
20596    /// # use google_cloud_aiplatform_v1::client::VizierService;
20597    /// use google_cloud_aiplatform_v1::Result;
20598    /// async fn sample(
20599    ///    client: &VizierService
20600    /// ) -> Result<()> {
20601    ///     let response = client.get_iam_policy()
20602    ///         /* set fields */
20603    ///         .send().await?;
20604    ///     println!("response {:?}", response);
20605    ///     Ok(())
20606    /// }
20607    /// ```
20608    pub fn get_iam_policy(&self) -> super::builder::vizier_service::GetIamPolicy {
20609        super::builder::vizier_service::GetIamPolicy::new(self.inner.clone())
20610    }
20611
20612    /// Returns permissions that a caller has on the specified resource. If the
20613    /// resource does not exist, this will return an empty set of
20614    /// permissions, not a `NOT_FOUND` error.
20615    ///
20616    /// Note: This operation is designed to be used for building
20617    /// permission-aware UIs and command-line tools, not for authorization
20618    /// checking. This operation may "fail open" without warning.
20619    ///
20620    /// # Example
20621    /// ```
20622    /// # use google_cloud_aiplatform_v1::client::VizierService;
20623    /// use google_cloud_aiplatform_v1::Result;
20624    /// async fn sample(
20625    ///    client: &VizierService
20626    /// ) -> Result<()> {
20627    ///     let response = client.test_iam_permissions()
20628    ///         /* set fields */
20629    ///         .send().await?;
20630    ///     println!("response {:?}", response);
20631    ///     Ok(())
20632    /// }
20633    /// ```
20634    pub fn test_iam_permissions(&self) -> super::builder::vizier_service::TestIamPermissions {
20635        super::builder::vizier_service::TestIamPermissions::new(self.inner.clone())
20636    }
20637
20638    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
20639    ///
20640    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
20641    ///
20642    /// # Example
20643    /// ```
20644    /// # use google_cloud_aiplatform_v1::client::VizierService;
20645    /// use google_cloud_gax::paginator::ItemPaginator as _;
20646    /// use google_cloud_aiplatform_v1::Result;
20647    /// async fn sample(
20648    ///    client: &VizierService
20649    /// ) -> Result<()> {
20650    ///     let mut list = client.list_operations()
20651    ///         /* set fields */
20652    ///         .by_item();
20653    ///     while let Some(item) = list.next().await.transpose()? {
20654    ///         println!("{:?}", item);
20655    ///     }
20656    ///     Ok(())
20657    /// }
20658    /// ```
20659    pub fn list_operations(&self) -> super::builder::vizier_service::ListOperations {
20660        super::builder::vizier_service::ListOperations::new(self.inner.clone())
20661    }
20662
20663    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
20664    ///
20665    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
20666    ///
20667    /// # Example
20668    /// ```
20669    /// # use google_cloud_aiplatform_v1::client::VizierService;
20670    /// use google_cloud_aiplatform_v1::Result;
20671    /// async fn sample(
20672    ///    client: &VizierService
20673    /// ) -> Result<()> {
20674    ///     let response = client.get_operation()
20675    ///         /* set fields */
20676    ///         .send().await?;
20677    ///     println!("response {:?}", response);
20678    ///     Ok(())
20679    /// }
20680    /// ```
20681    pub fn get_operation(&self) -> super::builder::vizier_service::GetOperation {
20682        super::builder::vizier_service::GetOperation::new(self.inner.clone())
20683    }
20684
20685    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
20686    ///
20687    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
20688    ///
20689    /// # Example
20690    /// ```
20691    /// # use google_cloud_aiplatform_v1::client::VizierService;
20692    /// use google_cloud_aiplatform_v1::Result;
20693    /// async fn sample(
20694    ///    client: &VizierService
20695    /// ) -> Result<()> {
20696    ///     client.delete_operation()
20697    ///         /* set fields */
20698    ///         .send().await?;
20699    ///     Ok(())
20700    /// }
20701    /// ```
20702    pub fn delete_operation(&self) -> super::builder::vizier_service::DeleteOperation {
20703        super::builder::vizier_service::DeleteOperation::new(self.inner.clone())
20704    }
20705
20706    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
20707    ///
20708    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
20709    ///
20710    /// # Example
20711    /// ```
20712    /// # use google_cloud_aiplatform_v1::client::VizierService;
20713    /// use google_cloud_aiplatform_v1::Result;
20714    /// async fn sample(
20715    ///    client: &VizierService
20716    /// ) -> Result<()> {
20717    ///     client.cancel_operation()
20718    ///         /* set fields */
20719    ///         .send().await?;
20720    ///     Ok(())
20721    /// }
20722    /// ```
20723    pub fn cancel_operation(&self) -> super::builder::vizier_service::CancelOperation {
20724        super::builder::vizier_service::CancelOperation::new(self.inner.clone())
20725    }
20726
20727    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
20728    ///
20729    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
20730    ///
20731    /// # Example
20732    /// ```
20733    /// # use google_cloud_aiplatform_v1::client::VizierService;
20734    /// use google_cloud_aiplatform_v1::Result;
20735    /// async fn sample(
20736    ///    client: &VizierService
20737    /// ) -> Result<()> {
20738    ///     let response = client.wait_operation()
20739    ///         /* set fields */
20740    ///         .send().await?;
20741    ///     println!("response {:?}", response);
20742    ///     Ok(())
20743    /// }
20744    /// ```
20745    pub fn wait_operation(&self) -> super::builder::vizier_service::WaitOperation {
20746        super::builder::vizier_service::WaitOperation::new(self.inner.clone())
20747    }
20748}