google_cloud_netapp_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::bare_urls)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::invalid_html_tags)]
19#![allow(rustdoc::redundant_explicit_links)]
20
21/// Implements a client for the NetApp API.
22///
23/// # Example
24/// ```
25/// # use google_cloud_netapp_v1::client::NetApp;
26/// use google_cloud_gax::paginator::ItemPaginator as _;
27/// async fn sample(
28/// project_id: &str,
29/// location_id: &str,
30/// ) -> anyhow::Result<()> {
31/// let client = NetApp::builder().build().await?;
32/// let mut list = client.list_storage_pools()
33/// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
34/// .by_item();
35/// while let Some(item) = list.next().await.transpose()? {
36/// println!("{:?}", item);
37/// }
38/// Ok(())
39/// }
40/// ```
41///
42/// # Service Description
43///
44/// NetApp Files Google Cloud Service
45///
46/// # Configuration
47///
48/// To configure `NetApp` use the `with_*` methods in the type returned
49/// by [builder()][NetApp::builder]. The default configuration should
50/// work for most applications. Common configuration changes include
51///
52/// * [with_endpoint()]: by default this client uses the global default endpoint
53/// (`https://netapp.googleapis.com`). Applications using regional
54/// endpoints or running in restricted networks (e.g. a network configured
55/// with [Private Google Access with VPC Service Controls]) may want to
56/// override this default.
57/// * [with_credentials()]: by default this client uses
58/// [Application Default Credentials]. Applications using custom
59/// authentication may need to override this default.
60///
61/// [with_endpoint()]: super::builder::net_app::ClientBuilder::with_endpoint
62/// [with_credentials()]: super::builder::net_app::ClientBuilder::with_credentials
63/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
64/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
65///
66/// # Pooling and Cloning
67///
68/// `NetApp` holds a connection pool internally, it is advised to
69/// create one and reuse it. You do not need to wrap `NetApp` in
70/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
71/// already uses an `Arc` internally.
72#[derive(Clone, Debug)]
73pub struct NetApp {
74 inner: std::sync::Arc<dyn super::stub::dynamic::NetApp>,
75}
76
77impl NetApp {
78 /// Returns a builder for [NetApp].
79 ///
80 /// ```
81 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
82 /// # use google_cloud_netapp_v1::client::NetApp;
83 /// let client = NetApp::builder().build().await?;
84 /// # Ok(()) }
85 /// ```
86 pub fn builder() -> super::builder::net_app::ClientBuilder {
87 crate::new_client_builder(super::builder::net_app::client::Factory)
88 }
89
90 /// Creates a new client from the provided stub.
91 ///
92 /// The most common case for calling this function is in tests mocking the
93 /// client's behavior.
94 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
95 where
96 T: super::stub::NetApp + 'static,
97 {
98 Self { inner: stub.into() }
99 }
100
101 pub(crate) async fn new(
102 config: gaxi::options::ClientConfig,
103 ) -> crate::ClientBuilderResult<Self> {
104 let inner = Self::build_inner(config).await?;
105 Ok(Self { inner })
106 }
107
108 async fn build_inner(
109 conf: gaxi::options::ClientConfig,
110 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetApp>> {
111 if gaxi::options::tracing_enabled(&conf) {
112 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
113 }
114 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
115 }
116
117 async fn build_transport(
118 conf: gaxi::options::ClientConfig,
119 ) -> crate::ClientBuilderResult<impl super::stub::NetApp> {
120 super::transport::NetApp::new(conf).await
121 }
122
123 async fn build_with_tracing(
124 conf: gaxi::options::ClientConfig,
125 ) -> crate::ClientBuilderResult<impl super::stub::NetApp> {
126 Self::build_transport(conf)
127 .await
128 .map(super::tracing::NetApp::new)
129 }
130
131 /// Returns descriptions of all storage pools owned by the caller.
132 ///
133 /// # Example
134 /// ```
135 /// # use google_cloud_netapp_v1::client::NetApp;
136 /// use google_cloud_gax::paginator::ItemPaginator as _;
137 /// use google_cloud_netapp_v1::Result;
138 /// async fn sample(
139 /// client: &NetApp, project_id: &str, location_id: &str
140 /// ) -> Result<()> {
141 /// let mut list = client.list_storage_pools()
142 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
143 /// .by_item();
144 /// while let Some(item) = list.next().await.transpose()? {
145 /// println!("{:?}", item);
146 /// }
147 /// Ok(())
148 /// }
149 /// ```
150 pub fn list_storage_pools(&self) -> super::builder::net_app::ListStoragePools {
151 super::builder::net_app::ListStoragePools::new(self.inner.clone())
152 }
153
154 /// Creates a new storage pool.
155 ///
156 /// # Long running operations
157 ///
158 /// This method is used to start, and/or poll a [long-running Operation].
159 /// The [Working with long-running operations] chapter in the [user guide]
160 /// covers these operations in detail.
161 ///
162 /// [long-running operation]: https://google.aip.dev/151
163 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
164 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
165 ///
166 /// # Example
167 /// ```
168 /// # use google_cloud_netapp_v1::client::NetApp;
169 /// use google_cloud_lro::Poller;
170 /// use google_cloud_netapp_v1::model::StoragePool;
171 /// use google_cloud_netapp_v1::Result;
172 /// async fn sample(
173 /// client: &NetApp, project_id: &str, location_id: &str
174 /// ) -> Result<()> {
175 /// let response = client.create_storage_pool()
176 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
177 /// .set_storage_pool(
178 /// StoragePool::new()/* set fields */
179 /// )
180 /// .poller().until_done().await?;
181 /// println!("response {:?}", response);
182 /// Ok(())
183 /// }
184 /// ```
185 pub fn create_storage_pool(&self) -> super::builder::net_app::CreateStoragePool {
186 super::builder::net_app::CreateStoragePool::new(self.inner.clone())
187 }
188
189 /// Returns the description of the specified storage pool by poolId.
190 ///
191 /// # Example
192 /// ```
193 /// # use google_cloud_netapp_v1::client::NetApp;
194 /// use google_cloud_netapp_v1::Result;
195 /// async fn sample(
196 /// client: &NetApp, project_id: &str, location_id: &str, storage_pool_id: &str
197 /// ) -> Result<()> {
198 /// let response = client.get_storage_pool()
199 /// .set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"))
200 /// .send().await?;
201 /// println!("response {:?}", response);
202 /// Ok(())
203 /// }
204 /// ```
205 pub fn get_storage_pool(&self) -> super::builder::net_app::GetStoragePool {
206 super::builder::net_app::GetStoragePool::new(self.inner.clone())
207 }
208
209 /// Updates the storage pool properties with the full spec
210 ///
211 /// # Long running operations
212 ///
213 /// This method is used to start, and/or poll a [long-running Operation].
214 /// The [Working with long-running operations] chapter in the [user guide]
215 /// covers these operations in detail.
216 ///
217 /// [long-running operation]: https://google.aip.dev/151
218 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
219 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
220 ///
221 /// # Example
222 /// ```
223 /// # use google_cloud_netapp_v1::client::NetApp;
224 /// use google_cloud_lro::Poller;
225 /// # extern crate wkt as google_cloud_wkt;
226 /// use google_cloud_wkt::FieldMask;
227 /// use google_cloud_netapp_v1::model::StoragePool;
228 /// use google_cloud_netapp_v1::Result;
229 /// async fn sample(
230 /// client: &NetApp, project_id: &str, location_id: &str, storage_pool_id: &str
231 /// ) -> Result<()> {
232 /// let response = client.update_storage_pool()
233 /// .set_storage_pool(
234 /// StoragePool::new().set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"))/* set fields */
235 /// )
236 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
237 /// .poller().until_done().await?;
238 /// println!("response {:?}", response);
239 /// Ok(())
240 /// }
241 /// ```
242 pub fn update_storage_pool(&self) -> super::builder::net_app::UpdateStoragePool {
243 super::builder::net_app::UpdateStoragePool::new(self.inner.clone())
244 }
245
246 /// Warning! This operation will permanently delete the storage pool.
247 ///
248 /// # Long running operations
249 ///
250 /// This method is used to start, and/or poll a [long-running Operation].
251 /// The [Working with long-running operations] chapter in the [user guide]
252 /// covers these operations in detail.
253 ///
254 /// [long-running operation]: https://google.aip.dev/151
255 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
256 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
257 ///
258 /// # Example
259 /// ```
260 /// # use google_cloud_netapp_v1::client::NetApp;
261 /// use google_cloud_lro::Poller;
262 /// use google_cloud_netapp_v1::Result;
263 /// async fn sample(
264 /// client: &NetApp, project_id: &str, location_id: &str, storage_pool_id: &str
265 /// ) -> Result<()> {
266 /// client.delete_storage_pool()
267 /// .set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"))
268 /// .poller().until_done().await?;
269 /// Ok(())
270 /// }
271 /// ```
272 pub fn delete_storage_pool(&self) -> super::builder::net_app::DeleteStoragePool {
273 super::builder::net_app::DeleteStoragePool::new(self.inner.clone())
274 }
275
276 /// ValidateDirectoryService does a connectivity check for a directory service
277 /// policy attached to the storage pool.
278 ///
279 /// # Long running operations
280 ///
281 /// This method is used to start, and/or poll a [long-running Operation].
282 /// The [Working with long-running operations] chapter in the [user guide]
283 /// covers these operations in detail.
284 ///
285 /// [long-running operation]: https://google.aip.dev/151
286 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
287 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
288 ///
289 /// # Example
290 /// ```
291 /// # use google_cloud_netapp_v1::client::NetApp;
292 /// use google_cloud_lro::Poller;
293 /// use google_cloud_netapp_v1::Result;
294 /// async fn sample(
295 /// client: &NetApp
296 /// ) -> Result<()> {
297 /// client.validate_directory_service()
298 /// /* set fields */
299 /// .poller().until_done().await?;
300 /// Ok(())
301 /// }
302 /// ```
303 pub fn validate_directory_service(&self) -> super::builder::net_app::ValidateDirectoryService {
304 super::builder::net_app::ValidateDirectoryService::new(self.inner.clone())
305 }
306
307 /// This operation will switch the active/replica zone for a regional
308 /// storagePool.
309 ///
310 /// # Long running operations
311 ///
312 /// This method is used to start, and/or poll a [long-running Operation].
313 /// The [Working with long-running operations] chapter in the [user guide]
314 /// covers these operations in detail.
315 ///
316 /// [long-running operation]: https://google.aip.dev/151
317 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
318 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
319 ///
320 /// # Example
321 /// ```
322 /// # use google_cloud_netapp_v1::client::NetApp;
323 /// use google_cloud_lro::Poller;
324 /// use google_cloud_netapp_v1::Result;
325 /// async fn sample(
326 /// client: &NetApp
327 /// ) -> Result<()> {
328 /// let response = client.switch_active_replica_zone()
329 /// /* set fields */
330 /// .poller().until_done().await?;
331 /// println!("response {:?}", response);
332 /// Ok(())
333 /// }
334 /// ```
335 pub fn switch_active_replica_zone(&self) -> super::builder::net_app::SwitchActiveReplicaZone {
336 super::builder::net_app::SwitchActiveReplicaZone::new(self.inner.clone())
337 }
338
339 /// Lists Volumes in a given project.
340 ///
341 /// # Example
342 /// ```
343 /// # use google_cloud_netapp_v1::client::NetApp;
344 /// use google_cloud_gax::paginator::ItemPaginator as _;
345 /// use google_cloud_netapp_v1::Result;
346 /// async fn sample(
347 /// client: &NetApp, project_id: &str, location_id: &str
348 /// ) -> Result<()> {
349 /// let mut list = client.list_volumes()
350 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
351 /// .by_item();
352 /// while let Some(item) = list.next().await.transpose()? {
353 /// println!("{:?}", item);
354 /// }
355 /// Ok(())
356 /// }
357 /// ```
358 pub fn list_volumes(&self) -> super::builder::net_app::ListVolumes {
359 super::builder::net_app::ListVolumes::new(self.inner.clone())
360 }
361
362 /// Gets details of a single Volume.
363 ///
364 /// # Example
365 /// ```
366 /// # use google_cloud_netapp_v1::client::NetApp;
367 /// use google_cloud_netapp_v1::Result;
368 /// async fn sample(
369 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str
370 /// ) -> Result<()> {
371 /// let response = client.get_volume()
372 /// .set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))
373 /// .send().await?;
374 /// println!("response {:?}", response);
375 /// Ok(())
376 /// }
377 /// ```
378 pub fn get_volume(&self) -> super::builder::net_app::GetVolume {
379 super::builder::net_app::GetVolume::new(self.inner.clone())
380 }
381
382 /// Creates a new Volume in a given project and location.
383 ///
384 /// # Long running operations
385 ///
386 /// This method is used to start, and/or poll a [long-running Operation].
387 /// The [Working with long-running operations] chapter in the [user guide]
388 /// covers these operations in detail.
389 ///
390 /// [long-running operation]: https://google.aip.dev/151
391 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
392 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
393 ///
394 /// # Example
395 /// ```
396 /// # use google_cloud_netapp_v1::client::NetApp;
397 /// use google_cloud_lro::Poller;
398 /// use google_cloud_netapp_v1::model::Volume;
399 /// use google_cloud_netapp_v1::Result;
400 /// async fn sample(
401 /// client: &NetApp, project_id: &str, location_id: &str
402 /// ) -> Result<()> {
403 /// let response = client.create_volume()
404 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
405 /// .set_volume_id("volume_id_value")
406 /// .set_volume(
407 /// Volume::new()/* set fields */
408 /// )
409 /// .poller().until_done().await?;
410 /// println!("response {:?}", response);
411 /// Ok(())
412 /// }
413 /// ```
414 pub fn create_volume(&self) -> super::builder::net_app::CreateVolume {
415 super::builder::net_app::CreateVolume::new(self.inner.clone())
416 }
417
418 /// Updates the parameters of a single Volume.
419 ///
420 /// # Long running operations
421 ///
422 /// This method is used to start, and/or poll a [long-running Operation].
423 /// The [Working with long-running operations] chapter in the [user guide]
424 /// covers these operations in detail.
425 ///
426 /// [long-running operation]: https://google.aip.dev/151
427 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
428 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
429 ///
430 /// # Example
431 /// ```
432 /// # use google_cloud_netapp_v1::client::NetApp;
433 /// use google_cloud_lro::Poller;
434 /// # extern crate wkt as google_cloud_wkt;
435 /// use google_cloud_wkt::FieldMask;
436 /// use google_cloud_netapp_v1::model::Volume;
437 /// use google_cloud_netapp_v1::Result;
438 /// async fn sample(
439 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str
440 /// ) -> Result<()> {
441 /// let response = client.update_volume()
442 /// .set_volume(
443 /// Volume::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))/* set fields */
444 /// )
445 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
446 /// .poller().until_done().await?;
447 /// println!("response {:?}", response);
448 /// Ok(())
449 /// }
450 /// ```
451 pub fn update_volume(&self) -> super::builder::net_app::UpdateVolume {
452 super::builder::net_app::UpdateVolume::new(self.inner.clone())
453 }
454
455 /// Deletes a single Volume.
456 ///
457 /// # Long running operations
458 ///
459 /// This method is used to start, and/or poll a [long-running Operation].
460 /// The [Working with long-running operations] chapter in the [user guide]
461 /// covers these operations in detail.
462 ///
463 /// [long-running operation]: https://google.aip.dev/151
464 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
465 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
466 ///
467 /// # Example
468 /// ```
469 /// # use google_cloud_netapp_v1::client::NetApp;
470 /// use google_cloud_lro::Poller;
471 /// use google_cloud_netapp_v1::Result;
472 /// async fn sample(
473 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str
474 /// ) -> Result<()> {
475 /// client.delete_volume()
476 /// .set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))
477 /// .poller().until_done().await?;
478 /// Ok(())
479 /// }
480 /// ```
481 pub fn delete_volume(&self) -> super::builder::net_app::DeleteVolume {
482 super::builder::net_app::DeleteVolume::new(self.inner.clone())
483 }
484
485 /// Revert an existing volume to a specified snapshot.
486 /// Warning! This operation will permanently revert all changes made after the
487 /// snapshot was created.
488 ///
489 /// # Long running operations
490 ///
491 /// This method is used to start, and/or poll a [long-running Operation].
492 /// The [Working with long-running operations] chapter in the [user guide]
493 /// covers these operations in detail.
494 ///
495 /// [long-running operation]: https://google.aip.dev/151
496 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
497 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
498 ///
499 /// # Example
500 /// ```
501 /// # use google_cloud_netapp_v1::client::NetApp;
502 /// use google_cloud_lro::Poller;
503 /// use google_cloud_netapp_v1::Result;
504 /// async fn sample(
505 /// client: &NetApp
506 /// ) -> Result<()> {
507 /// let response = client.revert_volume()
508 /// /* set fields */
509 /// .poller().until_done().await?;
510 /// println!("response {:?}", response);
511 /// Ok(())
512 /// }
513 /// ```
514 pub fn revert_volume(&self) -> super::builder::net_app::RevertVolume {
515 super::builder::net_app::RevertVolume::new(self.inner.clone())
516 }
517
518 /// Establish volume peering. This is used to establish cluster and svm
519 /// peerings between the GCNV and OnPrem clusters.
520 ///
521 /// # Long running operations
522 ///
523 /// This method is used to start, and/or poll a [long-running Operation].
524 /// The [Working with long-running operations] chapter in the [user guide]
525 /// covers these operations in detail.
526 ///
527 /// [long-running operation]: https://google.aip.dev/151
528 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
529 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
530 ///
531 /// # Example
532 /// ```
533 /// # use google_cloud_netapp_v1::client::NetApp;
534 /// use google_cloud_lro::Poller;
535 /// use google_cloud_netapp_v1::Result;
536 /// async fn sample(
537 /// client: &NetApp
538 /// ) -> Result<()> {
539 /// let response = client.establish_volume_peering()
540 /// /* set fields */
541 /// .poller().until_done().await?;
542 /// println!("response {:?}", response);
543 /// Ok(())
544 /// }
545 /// ```
546 pub fn establish_volume_peering(&self) -> super::builder::net_app::EstablishVolumePeering {
547 super::builder::net_app::EstablishVolumePeering::new(self.inner.clone())
548 }
549
550 /// Returns descriptions of all snapshots for a volume.
551 ///
552 /// # Example
553 /// ```
554 /// # use google_cloud_netapp_v1::client::NetApp;
555 /// use google_cloud_gax::paginator::ItemPaginator as _;
556 /// use google_cloud_netapp_v1::Result;
557 /// async fn sample(
558 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str
559 /// ) -> Result<()> {
560 /// let mut list = client.list_snapshots()
561 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))
562 /// .by_item();
563 /// while let Some(item) = list.next().await.transpose()? {
564 /// println!("{:?}", item);
565 /// }
566 /// Ok(())
567 /// }
568 /// ```
569 pub fn list_snapshots(&self) -> super::builder::net_app::ListSnapshots {
570 super::builder::net_app::ListSnapshots::new(self.inner.clone())
571 }
572
573 /// Describe a snapshot for a volume.
574 ///
575 /// # Example
576 /// ```
577 /// # use google_cloud_netapp_v1::client::NetApp;
578 /// use google_cloud_netapp_v1::Result;
579 /// async fn sample(
580 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str, snapshot_id: &str
581 /// ) -> Result<()> {
582 /// let response = client.get_snapshot()
583 /// .set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"))
584 /// .send().await?;
585 /// println!("response {:?}", response);
586 /// Ok(())
587 /// }
588 /// ```
589 pub fn get_snapshot(&self) -> super::builder::net_app::GetSnapshot {
590 super::builder::net_app::GetSnapshot::new(self.inner.clone())
591 }
592
593 /// Create a new snapshot for a volume.
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_netapp_v1::client::NetApp;
608 /// use google_cloud_lro::Poller;
609 /// use google_cloud_netapp_v1::model::Snapshot;
610 /// use google_cloud_netapp_v1::Result;
611 /// async fn sample(
612 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str
613 /// ) -> Result<()> {
614 /// let response = client.create_snapshot()
615 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))
616 /// .set_snapshot_id("snapshot_id_value")
617 /// .set_snapshot(
618 /// Snapshot::new()/* set fields */
619 /// )
620 /// .poller().until_done().await?;
621 /// println!("response {:?}", response);
622 /// Ok(())
623 /// }
624 /// ```
625 pub fn create_snapshot(&self) -> super::builder::net_app::CreateSnapshot {
626 super::builder::net_app::CreateSnapshot::new(self.inner.clone())
627 }
628
629 /// Deletes a snapshot.
630 ///
631 /// # Long running operations
632 ///
633 /// This method is used to start, and/or poll a [long-running Operation].
634 /// The [Working with long-running operations] chapter in the [user guide]
635 /// covers these operations in detail.
636 ///
637 /// [long-running operation]: https://google.aip.dev/151
638 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
639 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
640 ///
641 /// # Example
642 /// ```
643 /// # use google_cloud_netapp_v1::client::NetApp;
644 /// use google_cloud_lro::Poller;
645 /// use google_cloud_netapp_v1::Result;
646 /// async fn sample(
647 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str, snapshot_id: &str
648 /// ) -> Result<()> {
649 /// client.delete_snapshot()
650 /// .set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"))
651 /// .poller().until_done().await?;
652 /// Ok(())
653 /// }
654 /// ```
655 pub fn delete_snapshot(&self) -> super::builder::net_app::DeleteSnapshot {
656 super::builder::net_app::DeleteSnapshot::new(self.inner.clone())
657 }
658
659 /// Updates the settings of a specific snapshot.
660 ///
661 /// # Long running operations
662 ///
663 /// This method is used to start, and/or poll a [long-running Operation].
664 /// The [Working with long-running operations] chapter in the [user guide]
665 /// covers these operations in detail.
666 ///
667 /// [long-running operation]: https://google.aip.dev/151
668 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
669 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
670 ///
671 /// # Example
672 /// ```
673 /// # use google_cloud_netapp_v1::client::NetApp;
674 /// use google_cloud_lro::Poller;
675 /// # extern crate wkt as google_cloud_wkt;
676 /// use google_cloud_wkt::FieldMask;
677 /// use google_cloud_netapp_v1::model::Snapshot;
678 /// use google_cloud_netapp_v1::Result;
679 /// async fn sample(
680 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str, snapshot_id: &str
681 /// ) -> Result<()> {
682 /// let response = client.update_snapshot()
683 /// .set_snapshot(
684 /// Snapshot::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"))/* set fields */
685 /// )
686 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
687 /// .poller().until_done().await?;
688 /// println!("response {:?}", response);
689 /// Ok(())
690 /// }
691 /// ```
692 pub fn update_snapshot(&self) -> super::builder::net_app::UpdateSnapshot {
693 super::builder::net_app::UpdateSnapshot::new(self.inner.clone())
694 }
695
696 /// Lists active directories.
697 ///
698 /// # Example
699 /// ```
700 /// # use google_cloud_netapp_v1::client::NetApp;
701 /// use google_cloud_gax::paginator::ItemPaginator as _;
702 /// use google_cloud_netapp_v1::Result;
703 /// async fn sample(
704 /// client: &NetApp, project_id: &str, location_id: &str
705 /// ) -> Result<()> {
706 /// let mut list = client.list_active_directories()
707 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
708 /// .by_item();
709 /// while let Some(item) = list.next().await.transpose()? {
710 /// println!("{:?}", item);
711 /// }
712 /// Ok(())
713 /// }
714 /// ```
715 pub fn list_active_directories(&self) -> super::builder::net_app::ListActiveDirectories {
716 super::builder::net_app::ListActiveDirectories::new(self.inner.clone())
717 }
718
719 /// Describes a specified active directory.
720 ///
721 /// # Example
722 /// ```
723 /// # use google_cloud_netapp_v1::client::NetApp;
724 /// use google_cloud_netapp_v1::Result;
725 /// async fn sample(
726 /// client: &NetApp, project_id: &str, location_id: &str, active_directory_id: &str
727 /// ) -> Result<()> {
728 /// let response = client.get_active_directory()
729 /// .set_name(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"))
730 /// .send().await?;
731 /// println!("response {:?}", response);
732 /// Ok(())
733 /// }
734 /// ```
735 pub fn get_active_directory(&self) -> super::builder::net_app::GetActiveDirectory {
736 super::builder::net_app::GetActiveDirectory::new(self.inner.clone())
737 }
738
739 /// CreateActiveDirectory
740 /// Creates the active directory specified in the request.
741 ///
742 /// # Long running operations
743 ///
744 /// This method is used to start, and/or poll a [long-running Operation].
745 /// The [Working with long-running operations] chapter in the [user guide]
746 /// covers these operations in detail.
747 ///
748 /// [long-running operation]: https://google.aip.dev/151
749 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
750 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
751 ///
752 /// # Example
753 /// ```
754 /// # use google_cloud_netapp_v1::client::NetApp;
755 /// use google_cloud_lro::Poller;
756 /// use google_cloud_netapp_v1::model::ActiveDirectory;
757 /// use google_cloud_netapp_v1::Result;
758 /// async fn sample(
759 /// client: &NetApp, project_id: &str, location_id: &str
760 /// ) -> Result<()> {
761 /// let response = client.create_active_directory()
762 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
763 /// .set_active_directory(
764 /// ActiveDirectory::new()/* set fields */
765 /// )
766 /// .poller().until_done().await?;
767 /// println!("response {:?}", response);
768 /// Ok(())
769 /// }
770 /// ```
771 pub fn create_active_directory(&self) -> super::builder::net_app::CreateActiveDirectory {
772 super::builder::net_app::CreateActiveDirectory::new(self.inner.clone())
773 }
774
775 /// Update the parameters of an active directories.
776 ///
777 /// # Long running operations
778 ///
779 /// This method is used to start, and/or poll a [long-running Operation].
780 /// The [Working with long-running operations] chapter in the [user guide]
781 /// covers these operations in detail.
782 ///
783 /// [long-running operation]: https://google.aip.dev/151
784 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
785 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
786 ///
787 /// # Example
788 /// ```
789 /// # use google_cloud_netapp_v1::client::NetApp;
790 /// use google_cloud_lro::Poller;
791 /// # extern crate wkt as google_cloud_wkt;
792 /// use google_cloud_wkt::FieldMask;
793 /// use google_cloud_netapp_v1::model::ActiveDirectory;
794 /// use google_cloud_netapp_v1::Result;
795 /// async fn sample(
796 /// client: &NetApp, project_id: &str, location_id: &str, active_directory_id: &str
797 /// ) -> Result<()> {
798 /// let response = client.update_active_directory()
799 /// .set_active_directory(
800 /// ActiveDirectory::new().set_name(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"))/* set fields */
801 /// )
802 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
803 /// .poller().until_done().await?;
804 /// println!("response {:?}", response);
805 /// Ok(())
806 /// }
807 /// ```
808 pub fn update_active_directory(&self) -> super::builder::net_app::UpdateActiveDirectory {
809 super::builder::net_app::UpdateActiveDirectory::new(self.inner.clone())
810 }
811
812 /// Delete the active directory specified in the request.
813 ///
814 /// # Long running operations
815 ///
816 /// This method is used to start, and/or poll a [long-running Operation].
817 /// The [Working with long-running operations] chapter in the [user guide]
818 /// covers these operations in detail.
819 ///
820 /// [long-running operation]: https://google.aip.dev/151
821 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
822 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
823 ///
824 /// # Example
825 /// ```
826 /// # use google_cloud_netapp_v1::client::NetApp;
827 /// use google_cloud_lro::Poller;
828 /// use google_cloud_netapp_v1::Result;
829 /// async fn sample(
830 /// client: &NetApp, project_id: &str, location_id: &str, active_directory_id: &str
831 /// ) -> Result<()> {
832 /// client.delete_active_directory()
833 /// .set_name(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"))
834 /// .poller().until_done().await?;
835 /// Ok(())
836 /// }
837 /// ```
838 pub fn delete_active_directory(&self) -> super::builder::net_app::DeleteActiveDirectory {
839 super::builder::net_app::DeleteActiveDirectory::new(self.inner.clone())
840 }
841
842 /// Returns descriptions of all KMS configs owned by the caller.
843 ///
844 /// # Example
845 /// ```
846 /// # use google_cloud_netapp_v1::client::NetApp;
847 /// use google_cloud_gax::paginator::ItemPaginator as _;
848 /// use google_cloud_netapp_v1::Result;
849 /// async fn sample(
850 /// client: &NetApp, project_id: &str, location_id: &str
851 /// ) -> Result<()> {
852 /// let mut list = client.list_kms_configs()
853 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
854 /// .by_item();
855 /// while let Some(item) = list.next().await.transpose()? {
856 /// println!("{:?}", item);
857 /// }
858 /// Ok(())
859 /// }
860 /// ```
861 pub fn list_kms_configs(&self) -> super::builder::net_app::ListKmsConfigs {
862 super::builder::net_app::ListKmsConfigs::new(self.inner.clone())
863 }
864
865 /// Creates a new KMS config.
866 ///
867 /// # Long running operations
868 ///
869 /// This method is used to start, and/or poll a [long-running Operation].
870 /// The [Working with long-running operations] chapter in the [user guide]
871 /// covers these operations in detail.
872 ///
873 /// [long-running operation]: https://google.aip.dev/151
874 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
875 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
876 ///
877 /// # Example
878 /// ```
879 /// # use google_cloud_netapp_v1::client::NetApp;
880 /// use google_cloud_lro::Poller;
881 /// use google_cloud_netapp_v1::model::KmsConfig;
882 /// use google_cloud_netapp_v1::Result;
883 /// async fn sample(
884 /// client: &NetApp, project_id: &str, location_id: &str
885 /// ) -> Result<()> {
886 /// let response = client.create_kms_config()
887 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
888 /// .set_kms_config(
889 /// KmsConfig::new()/* set fields */
890 /// )
891 /// .poller().until_done().await?;
892 /// println!("response {:?}", response);
893 /// Ok(())
894 /// }
895 /// ```
896 pub fn create_kms_config(&self) -> super::builder::net_app::CreateKmsConfig {
897 super::builder::net_app::CreateKmsConfig::new(self.inner.clone())
898 }
899
900 /// Returns the description of the specified KMS config by kms_config_id.
901 ///
902 /// # Example
903 /// ```
904 /// # use google_cloud_netapp_v1::client::NetApp;
905 /// use google_cloud_netapp_v1::Result;
906 /// async fn sample(
907 /// client: &NetApp, project_id: &str, location_id: &str, kms_config_id: &str
908 /// ) -> Result<()> {
909 /// let response = client.get_kms_config()
910 /// .set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"))
911 /// .send().await?;
912 /// println!("response {:?}", response);
913 /// Ok(())
914 /// }
915 /// ```
916 pub fn get_kms_config(&self) -> super::builder::net_app::GetKmsConfig {
917 super::builder::net_app::GetKmsConfig::new(self.inner.clone())
918 }
919
920 /// Updates the Kms config properties with the full spec
921 ///
922 /// # Long running operations
923 ///
924 /// This method is used to start, and/or poll a [long-running Operation].
925 /// The [Working with long-running operations] chapter in the [user guide]
926 /// covers these operations in detail.
927 ///
928 /// [long-running operation]: https://google.aip.dev/151
929 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
930 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
931 ///
932 /// # Example
933 /// ```
934 /// # use google_cloud_netapp_v1::client::NetApp;
935 /// use google_cloud_lro::Poller;
936 /// # extern crate wkt as google_cloud_wkt;
937 /// use google_cloud_wkt::FieldMask;
938 /// use google_cloud_netapp_v1::model::KmsConfig;
939 /// use google_cloud_netapp_v1::Result;
940 /// async fn sample(
941 /// client: &NetApp, project_id: &str, location_id: &str, kms_config_id: &str
942 /// ) -> Result<()> {
943 /// let response = client.update_kms_config()
944 /// .set_kms_config(
945 /// KmsConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"))/* set fields */
946 /// )
947 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
948 /// .poller().until_done().await?;
949 /// println!("response {:?}", response);
950 /// Ok(())
951 /// }
952 /// ```
953 pub fn update_kms_config(&self) -> super::builder::net_app::UpdateKmsConfig {
954 super::builder::net_app::UpdateKmsConfig::new(self.inner.clone())
955 }
956
957 /// Encrypt the existing volumes without CMEK encryption with the desired the
958 /// KMS config for the whole region.
959 ///
960 /// # Long running operations
961 ///
962 /// This method is used to start, and/or poll a [long-running Operation].
963 /// The [Working with long-running operations] chapter in the [user guide]
964 /// covers these operations in detail.
965 ///
966 /// [long-running operation]: https://google.aip.dev/151
967 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
968 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
969 ///
970 /// # Example
971 /// ```
972 /// # use google_cloud_netapp_v1::client::NetApp;
973 /// use google_cloud_lro::Poller;
974 /// use google_cloud_netapp_v1::Result;
975 /// async fn sample(
976 /// client: &NetApp
977 /// ) -> Result<()> {
978 /// let response = client.encrypt_volumes()
979 /// /* set fields */
980 /// .poller().until_done().await?;
981 /// println!("response {:?}", response);
982 /// Ok(())
983 /// }
984 /// ```
985 pub fn encrypt_volumes(&self) -> super::builder::net_app::EncryptVolumes {
986 super::builder::net_app::EncryptVolumes::new(self.inner.clone())
987 }
988
989 /// Verifies KMS config reachability.
990 ///
991 /// # Example
992 /// ```
993 /// # use google_cloud_netapp_v1::client::NetApp;
994 /// use google_cloud_netapp_v1::Result;
995 /// async fn sample(
996 /// client: &NetApp
997 /// ) -> Result<()> {
998 /// let response = client.verify_kms_config()
999 /// /* set fields */
1000 /// .send().await?;
1001 /// println!("response {:?}", response);
1002 /// Ok(())
1003 /// }
1004 /// ```
1005 pub fn verify_kms_config(&self) -> super::builder::net_app::VerifyKmsConfig {
1006 super::builder::net_app::VerifyKmsConfig::new(self.inner.clone())
1007 }
1008
1009 /// Warning! This operation will permanently delete the Kms config.
1010 ///
1011 /// # Long running operations
1012 ///
1013 /// This method is used to start, and/or poll a [long-running Operation].
1014 /// The [Working with long-running operations] chapter in the [user guide]
1015 /// covers these operations in detail.
1016 ///
1017 /// [long-running operation]: https://google.aip.dev/151
1018 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1019 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1020 ///
1021 /// # Example
1022 /// ```
1023 /// # use google_cloud_netapp_v1::client::NetApp;
1024 /// use google_cloud_lro::Poller;
1025 /// use google_cloud_netapp_v1::Result;
1026 /// async fn sample(
1027 /// client: &NetApp, project_id: &str, location_id: &str, kms_config_id: &str
1028 /// ) -> Result<()> {
1029 /// client.delete_kms_config()
1030 /// .set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"))
1031 /// .poller().until_done().await?;
1032 /// Ok(())
1033 /// }
1034 /// ```
1035 pub fn delete_kms_config(&self) -> super::builder::net_app::DeleteKmsConfig {
1036 super::builder::net_app::DeleteKmsConfig::new(self.inner.clone())
1037 }
1038
1039 /// Returns descriptions of all replications for a volume.
1040 ///
1041 /// # Example
1042 /// ```
1043 /// # use google_cloud_netapp_v1::client::NetApp;
1044 /// use google_cloud_gax::paginator::ItemPaginator as _;
1045 /// use google_cloud_netapp_v1::Result;
1046 /// async fn sample(
1047 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str
1048 /// ) -> Result<()> {
1049 /// let mut list = client.list_replications()
1050 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))
1051 /// .by_item();
1052 /// while let Some(item) = list.next().await.transpose()? {
1053 /// println!("{:?}", item);
1054 /// }
1055 /// Ok(())
1056 /// }
1057 /// ```
1058 pub fn list_replications(&self) -> super::builder::net_app::ListReplications {
1059 super::builder::net_app::ListReplications::new(self.inner.clone())
1060 }
1061
1062 /// Describe a replication for a volume.
1063 ///
1064 /// # Example
1065 /// ```
1066 /// # use google_cloud_netapp_v1::client::NetApp;
1067 /// use google_cloud_netapp_v1::Result;
1068 /// async fn sample(
1069 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str, replication_id: &str
1070 /// ) -> Result<()> {
1071 /// let response = client.get_replication()
1072 /// .set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"))
1073 /// .send().await?;
1074 /// println!("response {:?}", response);
1075 /// Ok(())
1076 /// }
1077 /// ```
1078 pub fn get_replication(&self) -> super::builder::net_app::GetReplication {
1079 super::builder::net_app::GetReplication::new(self.inner.clone())
1080 }
1081
1082 /// Create a new replication for a volume.
1083 ///
1084 /// # Long running operations
1085 ///
1086 /// This method is used to start, and/or poll a [long-running Operation].
1087 /// The [Working with long-running operations] chapter in the [user guide]
1088 /// covers these operations in detail.
1089 ///
1090 /// [long-running operation]: https://google.aip.dev/151
1091 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1092 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1093 ///
1094 /// # Example
1095 /// ```
1096 /// # use google_cloud_netapp_v1::client::NetApp;
1097 /// use google_cloud_lro::Poller;
1098 /// use google_cloud_netapp_v1::model::Replication;
1099 /// use google_cloud_netapp_v1::Result;
1100 /// async fn sample(
1101 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str
1102 /// ) -> Result<()> {
1103 /// let response = client.create_replication()
1104 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))
1105 /// .set_replication_id("replication_id_value")
1106 /// .set_replication(
1107 /// Replication::new()/* set fields */
1108 /// )
1109 /// .poller().until_done().await?;
1110 /// println!("response {:?}", response);
1111 /// Ok(())
1112 /// }
1113 /// ```
1114 pub fn create_replication(&self) -> super::builder::net_app::CreateReplication {
1115 super::builder::net_app::CreateReplication::new(self.inner.clone())
1116 }
1117
1118 /// Deletes a replication.
1119 ///
1120 /// # Long running operations
1121 ///
1122 /// This method is used to start, and/or poll a [long-running Operation].
1123 /// The [Working with long-running operations] chapter in the [user guide]
1124 /// covers these operations in detail.
1125 ///
1126 /// [long-running operation]: https://google.aip.dev/151
1127 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1128 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1129 ///
1130 /// # Example
1131 /// ```
1132 /// # use google_cloud_netapp_v1::client::NetApp;
1133 /// use google_cloud_lro::Poller;
1134 /// use google_cloud_netapp_v1::Result;
1135 /// async fn sample(
1136 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str, replication_id: &str
1137 /// ) -> Result<()> {
1138 /// client.delete_replication()
1139 /// .set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"))
1140 /// .poller().until_done().await?;
1141 /// Ok(())
1142 /// }
1143 /// ```
1144 pub fn delete_replication(&self) -> super::builder::net_app::DeleteReplication {
1145 super::builder::net_app::DeleteReplication::new(self.inner.clone())
1146 }
1147
1148 /// Updates the settings of a specific replication.
1149 ///
1150 /// # Long running operations
1151 ///
1152 /// This method is used to start, and/or poll a [long-running Operation].
1153 /// The [Working with long-running operations] chapter in the [user guide]
1154 /// covers these operations in detail.
1155 ///
1156 /// [long-running operation]: https://google.aip.dev/151
1157 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1158 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1159 ///
1160 /// # Example
1161 /// ```
1162 /// # use google_cloud_netapp_v1::client::NetApp;
1163 /// use google_cloud_lro::Poller;
1164 /// # extern crate wkt as google_cloud_wkt;
1165 /// use google_cloud_wkt::FieldMask;
1166 /// use google_cloud_netapp_v1::model::Replication;
1167 /// use google_cloud_netapp_v1::Result;
1168 /// async fn sample(
1169 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str, replication_id: &str
1170 /// ) -> Result<()> {
1171 /// let response = client.update_replication()
1172 /// .set_replication(
1173 /// Replication::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"))/* set fields */
1174 /// )
1175 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1176 /// .poller().until_done().await?;
1177 /// println!("response {:?}", response);
1178 /// Ok(())
1179 /// }
1180 /// ```
1181 pub fn update_replication(&self) -> super::builder::net_app::UpdateReplication {
1182 super::builder::net_app::UpdateReplication::new(self.inner.clone())
1183 }
1184
1185 /// Stop Cross Region Replication.
1186 ///
1187 /// # Long running operations
1188 ///
1189 /// This method is used to start, and/or poll a [long-running Operation].
1190 /// The [Working with long-running operations] chapter in the [user guide]
1191 /// covers these operations in detail.
1192 ///
1193 /// [long-running operation]: https://google.aip.dev/151
1194 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1195 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1196 ///
1197 /// # Example
1198 /// ```
1199 /// # use google_cloud_netapp_v1::client::NetApp;
1200 /// use google_cloud_lro::Poller;
1201 /// use google_cloud_netapp_v1::Result;
1202 /// async fn sample(
1203 /// client: &NetApp
1204 /// ) -> Result<()> {
1205 /// let response = client.stop_replication()
1206 /// /* set fields */
1207 /// .poller().until_done().await?;
1208 /// println!("response {:?}", response);
1209 /// Ok(())
1210 /// }
1211 /// ```
1212 pub fn stop_replication(&self) -> super::builder::net_app::StopReplication {
1213 super::builder::net_app::StopReplication::new(self.inner.clone())
1214 }
1215
1216 /// Resume Cross Region Replication.
1217 ///
1218 /// # Long running operations
1219 ///
1220 /// This method is used to start, and/or poll a [long-running Operation].
1221 /// The [Working with long-running operations] chapter in the [user guide]
1222 /// covers these operations in detail.
1223 ///
1224 /// [long-running operation]: https://google.aip.dev/151
1225 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1226 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1227 ///
1228 /// # Example
1229 /// ```
1230 /// # use google_cloud_netapp_v1::client::NetApp;
1231 /// use google_cloud_lro::Poller;
1232 /// use google_cloud_netapp_v1::Result;
1233 /// async fn sample(
1234 /// client: &NetApp
1235 /// ) -> Result<()> {
1236 /// let response = client.resume_replication()
1237 /// /* set fields */
1238 /// .poller().until_done().await?;
1239 /// println!("response {:?}", response);
1240 /// Ok(())
1241 /// }
1242 /// ```
1243 pub fn resume_replication(&self) -> super::builder::net_app::ResumeReplication {
1244 super::builder::net_app::ResumeReplication::new(self.inner.clone())
1245 }
1246
1247 /// Reverses direction of replication. Source becomes destination and
1248 /// destination becomes source.
1249 ///
1250 /// # Long running operations
1251 ///
1252 /// This method is used to start, and/or poll a [long-running Operation].
1253 /// The [Working with long-running operations] chapter in the [user guide]
1254 /// covers these operations in detail.
1255 ///
1256 /// [long-running operation]: https://google.aip.dev/151
1257 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1258 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1259 ///
1260 /// # Example
1261 /// ```
1262 /// # use google_cloud_netapp_v1::client::NetApp;
1263 /// use google_cloud_lro::Poller;
1264 /// use google_cloud_netapp_v1::Result;
1265 /// async fn sample(
1266 /// client: &NetApp
1267 /// ) -> Result<()> {
1268 /// let response = client.reverse_replication_direction()
1269 /// /* set fields */
1270 /// .poller().until_done().await?;
1271 /// println!("response {:?}", response);
1272 /// Ok(())
1273 /// }
1274 /// ```
1275 pub fn reverse_replication_direction(
1276 &self,
1277 ) -> super::builder::net_app::ReverseReplicationDirection {
1278 super::builder::net_app::ReverseReplicationDirection::new(self.inner.clone())
1279 }
1280
1281 /// Establish replication peering.
1282 ///
1283 /// # Long running operations
1284 ///
1285 /// This method is used to start, and/or poll a [long-running Operation].
1286 /// The [Working with long-running operations] chapter in the [user guide]
1287 /// covers these operations in detail.
1288 ///
1289 /// [long-running operation]: https://google.aip.dev/151
1290 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1291 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1292 ///
1293 /// # Example
1294 /// ```
1295 /// # use google_cloud_netapp_v1::client::NetApp;
1296 /// use google_cloud_lro::Poller;
1297 /// use google_cloud_netapp_v1::Result;
1298 /// async fn sample(
1299 /// client: &NetApp
1300 /// ) -> Result<()> {
1301 /// let response = client.establish_peering()
1302 /// /* set fields */
1303 /// .poller().until_done().await?;
1304 /// println!("response {:?}", response);
1305 /// Ok(())
1306 /// }
1307 /// ```
1308 pub fn establish_peering(&self) -> super::builder::net_app::EstablishPeering {
1309 super::builder::net_app::EstablishPeering::new(self.inner.clone())
1310 }
1311
1312 /// Syncs the replication. This will invoke one time volume data transfer from
1313 /// source to destination.
1314 ///
1315 /// # Long running operations
1316 ///
1317 /// This method is used to start, and/or poll a [long-running Operation].
1318 /// The [Working with long-running operations] chapter in the [user guide]
1319 /// covers these operations in detail.
1320 ///
1321 /// [long-running operation]: https://google.aip.dev/151
1322 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1323 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1324 ///
1325 /// # Example
1326 /// ```
1327 /// # use google_cloud_netapp_v1::client::NetApp;
1328 /// use google_cloud_lro::Poller;
1329 /// use google_cloud_netapp_v1::Result;
1330 /// async fn sample(
1331 /// client: &NetApp
1332 /// ) -> Result<()> {
1333 /// let response = client.sync_replication()
1334 /// /* set fields */
1335 /// .poller().until_done().await?;
1336 /// println!("response {:?}", response);
1337 /// Ok(())
1338 /// }
1339 /// ```
1340 pub fn sync_replication(&self) -> super::builder::net_app::SyncReplication {
1341 super::builder::net_app::SyncReplication::new(self.inner.clone())
1342 }
1343
1344 /// Creates new backup vault
1345 ///
1346 /// # Long running operations
1347 ///
1348 /// This method is used to start, and/or poll a [long-running Operation].
1349 /// The [Working with long-running operations] chapter in the [user guide]
1350 /// covers these operations in detail.
1351 ///
1352 /// [long-running operation]: https://google.aip.dev/151
1353 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1354 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1355 ///
1356 /// # Example
1357 /// ```
1358 /// # use google_cloud_netapp_v1::client::NetApp;
1359 /// use google_cloud_lro::Poller;
1360 /// use google_cloud_netapp_v1::model::BackupVault;
1361 /// use google_cloud_netapp_v1::Result;
1362 /// async fn sample(
1363 /// client: &NetApp, project_id: &str, location_id: &str
1364 /// ) -> Result<()> {
1365 /// let response = client.create_backup_vault()
1366 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
1367 /// .set_backup_vault(
1368 /// BackupVault::new()/* set fields */
1369 /// )
1370 /// .poller().until_done().await?;
1371 /// println!("response {:?}", response);
1372 /// Ok(())
1373 /// }
1374 /// ```
1375 pub fn create_backup_vault(&self) -> super::builder::net_app::CreateBackupVault {
1376 super::builder::net_app::CreateBackupVault::new(self.inner.clone())
1377 }
1378
1379 /// Returns the description of the specified backup vault
1380 ///
1381 /// # Example
1382 /// ```
1383 /// # use google_cloud_netapp_v1::client::NetApp;
1384 /// use google_cloud_netapp_v1::Result;
1385 /// async fn sample(
1386 /// client: &NetApp, project_id: &str, location_id: &str, backup_vault_id: &str
1387 /// ) -> Result<()> {
1388 /// let response = client.get_backup_vault()
1389 /// .set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"))
1390 /// .send().await?;
1391 /// println!("response {:?}", response);
1392 /// Ok(())
1393 /// }
1394 /// ```
1395 pub fn get_backup_vault(&self) -> super::builder::net_app::GetBackupVault {
1396 super::builder::net_app::GetBackupVault::new(self.inner.clone())
1397 }
1398
1399 /// Returns list of all available backup vaults.
1400 ///
1401 /// # Example
1402 /// ```
1403 /// # use google_cloud_netapp_v1::client::NetApp;
1404 /// use google_cloud_gax::paginator::ItemPaginator as _;
1405 /// use google_cloud_netapp_v1::Result;
1406 /// async fn sample(
1407 /// client: &NetApp, project_id: &str, location_id: &str
1408 /// ) -> Result<()> {
1409 /// let mut list = client.list_backup_vaults()
1410 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
1411 /// .by_item();
1412 /// while let Some(item) = list.next().await.transpose()? {
1413 /// println!("{:?}", item);
1414 /// }
1415 /// Ok(())
1416 /// }
1417 /// ```
1418 pub fn list_backup_vaults(&self) -> super::builder::net_app::ListBackupVaults {
1419 super::builder::net_app::ListBackupVaults::new(self.inner.clone())
1420 }
1421
1422 /// Updates the settings of a specific backup vault.
1423 ///
1424 /// # Long running operations
1425 ///
1426 /// This method is used to start, and/or poll a [long-running Operation].
1427 /// The [Working with long-running operations] chapter in the [user guide]
1428 /// covers these operations in detail.
1429 ///
1430 /// [long-running operation]: https://google.aip.dev/151
1431 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1432 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1433 ///
1434 /// # Example
1435 /// ```
1436 /// # use google_cloud_netapp_v1::client::NetApp;
1437 /// use google_cloud_lro::Poller;
1438 /// # extern crate wkt as google_cloud_wkt;
1439 /// use google_cloud_wkt::FieldMask;
1440 /// use google_cloud_netapp_v1::model::BackupVault;
1441 /// use google_cloud_netapp_v1::Result;
1442 /// async fn sample(
1443 /// client: &NetApp, project_id: &str, location_id: &str, backup_vault_id: &str
1444 /// ) -> Result<()> {
1445 /// let response = client.update_backup_vault()
1446 /// .set_backup_vault(
1447 /// BackupVault::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"))/* set fields */
1448 /// )
1449 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1450 /// .poller().until_done().await?;
1451 /// println!("response {:?}", response);
1452 /// Ok(())
1453 /// }
1454 /// ```
1455 pub fn update_backup_vault(&self) -> super::builder::net_app::UpdateBackupVault {
1456 super::builder::net_app::UpdateBackupVault::new(self.inner.clone())
1457 }
1458
1459 /// Warning! This operation will permanently delete the backup vault.
1460 ///
1461 /// # Long running operations
1462 ///
1463 /// This method is used to start, and/or poll a [long-running Operation].
1464 /// The [Working with long-running operations] chapter in the [user guide]
1465 /// covers these operations in detail.
1466 ///
1467 /// [long-running operation]: https://google.aip.dev/151
1468 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1469 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1470 ///
1471 /// # Example
1472 /// ```
1473 /// # use google_cloud_netapp_v1::client::NetApp;
1474 /// use google_cloud_lro::Poller;
1475 /// use google_cloud_netapp_v1::Result;
1476 /// async fn sample(
1477 /// client: &NetApp, project_id: &str, location_id: &str, backup_vault_id: &str
1478 /// ) -> Result<()> {
1479 /// client.delete_backup_vault()
1480 /// .set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"))
1481 /// .poller().until_done().await?;
1482 /// Ok(())
1483 /// }
1484 /// ```
1485 pub fn delete_backup_vault(&self) -> super::builder::net_app::DeleteBackupVault {
1486 super::builder::net_app::DeleteBackupVault::new(self.inner.clone())
1487 }
1488
1489 /// Creates a backup from the volume specified in the request
1490 /// The backup can be created from the given snapshot if specified in the
1491 /// request. If no snapshot specified, there'll be a new snapshot taken to
1492 /// initiate the backup creation.
1493 ///
1494 /// # Long running operations
1495 ///
1496 /// This method is used to start, and/or poll a [long-running Operation].
1497 /// The [Working with long-running operations] chapter in the [user guide]
1498 /// covers these operations in detail.
1499 ///
1500 /// [long-running operation]: https://google.aip.dev/151
1501 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1502 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1503 ///
1504 /// # Example
1505 /// ```
1506 /// # use google_cloud_netapp_v1::client::NetApp;
1507 /// use google_cloud_lro::Poller;
1508 /// use google_cloud_netapp_v1::model::Backup;
1509 /// use google_cloud_netapp_v1::Result;
1510 /// async fn sample(
1511 /// client: &NetApp, project_id: &str, location_id: &str, backup_vault_id: &str
1512 /// ) -> Result<()> {
1513 /// let response = client.create_backup()
1514 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"))
1515 /// .set_backup_id("backup_id_value")
1516 /// .set_backup(
1517 /// Backup::new()/* set fields */
1518 /// )
1519 /// .poller().until_done().await?;
1520 /// println!("response {:?}", response);
1521 /// Ok(())
1522 /// }
1523 /// ```
1524 pub fn create_backup(&self) -> super::builder::net_app::CreateBackup {
1525 super::builder::net_app::CreateBackup::new(self.inner.clone())
1526 }
1527
1528 /// Returns the description of the specified backup
1529 ///
1530 /// # Example
1531 /// ```
1532 /// # use google_cloud_netapp_v1::client::NetApp;
1533 /// use google_cloud_netapp_v1::Result;
1534 /// async fn sample(
1535 /// client: &NetApp, project_id: &str, location_id: &str, backup_vault_id: &str, backup_id: &str
1536 /// ) -> Result<()> {
1537 /// let response = client.get_backup()
1538 /// .set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"))
1539 /// .send().await?;
1540 /// println!("response {:?}", response);
1541 /// Ok(())
1542 /// }
1543 /// ```
1544 pub fn get_backup(&self) -> super::builder::net_app::GetBackup {
1545 super::builder::net_app::GetBackup::new(self.inner.clone())
1546 }
1547
1548 /// Returns descriptions of all backups for a backupVault.
1549 ///
1550 /// # Example
1551 /// ```
1552 /// # use google_cloud_netapp_v1::client::NetApp;
1553 /// use google_cloud_gax::paginator::ItemPaginator as _;
1554 /// use google_cloud_netapp_v1::Result;
1555 /// async fn sample(
1556 /// client: &NetApp, project_id: &str, location_id: &str, backup_vault_id: &str
1557 /// ) -> Result<()> {
1558 /// let mut list = client.list_backups()
1559 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"))
1560 /// .by_item();
1561 /// while let Some(item) = list.next().await.transpose()? {
1562 /// println!("{:?}", item);
1563 /// }
1564 /// Ok(())
1565 /// }
1566 /// ```
1567 pub fn list_backups(&self) -> super::builder::net_app::ListBackups {
1568 super::builder::net_app::ListBackups::new(self.inner.clone())
1569 }
1570
1571 /// Warning! This operation will permanently delete the backup.
1572 ///
1573 /// # Long running operations
1574 ///
1575 /// This method is used to start, and/or poll a [long-running Operation].
1576 /// The [Working with long-running operations] chapter in the [user guide]
1577 /// covers these operations in detail.
1578 ///
1579 /// [long-running operation]: https://google.aip.dev/151
1580 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1581 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1582 ///
1583 /// # Example
1584 /// ```
1585 /// # use google_cloud_netapp_v1::client::NetApp;
1586 /// use google_cloud_lro::Poller;
1587 /// use google_cloud_netapp_v1::Result;
1588 /// async fn sample(
1589 /// client: &NetApp, project_id: &str, location_id: &str, backup_vault_id: &str, backup_id: &str
1590 /// ) -> Result<()> {
1591 /// client.delete_backup()
1592 /// .set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"))
1593 /// .poller().until_done().await?;
1594 /// Ok(())
1595 /// }
1596 /// ```
1597 pub fn delete_backup(&self) -> super::builder::net_app::DeleteBackup {
1598 super::builder::net_app::DeleteBackup::new(self.inner.clone())
1599 }
1600
1601 /// Update backup with full spec.
1602 ///
1603 /// # Long running operations
1604 ///
1605 /// This method is used to start, and/or poll a [long-running Operation].
1606 /// The [Working with long-running operations] chapter in the [user guide]
1607 /// covers these operations in detail.
1608 ///
1609 /// [long-running operation]: https://google.aip.dev/151
1610 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1611 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1612 ///
1613 /// # Example
1614 /// ```
1615 /// # use google_cloud_netapp_v1::client::NetApp;
1616 /// use google_cloud_lro::Poller;
1617 /// # extern crate wkt as google_cloud_wkt;
1618 /// use google_cloud_wkt::FieldMask;
1619 /// use google_cloud_netapp_v1::model::Backup;
1620 /// use google_cloud_netapp_v1::Result;
1621 /// async fn sample(
1622 /// client: &NetApp, project_id: &str, location_id: &str, backup_vault_id: &str, backup_id: &str
1623 /// ) -> Result<()> {
1624 /// let response = client.update_backup()
1625 /// .set_backup(
1626 /// Backup::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"))/* set fields */
1627 /// )
1628 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1629 /// .poller().until_done().await?;
1630 /// println!("response {:?}", response);
1631 /// Ok(())
1632 /// }
1633 /// ```
1634 pub fn update_backup(&self) -> super::builder::net_app::UpdateBackup {
1635 super::builder::net_app::UpdateBackup::new(self.inner.clone())
1636 }
1637
1638 /// Creates new backup policy
1639 ///
1640 /// # Long running operations
1641 ///
1642 /// This method is used to start, and/or poll a [long-running Operation].
1643 /// The [Working with long-running operations] chapter in the [user guide]
1644 /// covers these operations in detail.
1645 ///
1646 /// [long-running operation]: https://google.aip.dev/151
1647 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1648 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1649 ///
1650 /// # Example
1651 /// ```
1652 /// # use google_cloud_netapp_v1::client::NetApp;
1653 /// use google_cloud_lro::Poller;
1654 /// use google_cloud_netapp_v1::model::BackupPolicy;
1655 /// use google_cloud_netapp_v1::Result;
1656 /// async fn sample(
1657 /// client: &NetApp, project_id: &str, location_id: &str
1658 /// ) -> Result<()> {
1659 /// let response = client.create_backup_policy()
1660 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
1661 /// .set_backup_policy(
1662 /// BackupPolicy::new()/* set fields */
1663 /// )
1664 /// .poller().until_done().await?;
1665 /// println!("response {:?}", response);
1666 /// Ok(())
1667 /// }
1668 /// ```
1669 pub fn create_backup_policy(&self) -> super::builder::net_app::CreateBackupPolicy {
1670 super::builder::net_app::CreateBackupPolicy::new(self.inner.clone())
1671 }
1672
1673 /// Returns the description of the specified backup policy by backup_policy_id.
1674 ///
1675 /// # Example
1676 /// ```
1677 /// # use google_cloud_netapp_v1::client::NetApp;
1678 /// use google_cloud_netapp_v1::Result;
1679 /// async fn sample(
1680 /// client: &NetApp, project_id: &str, location_id: &str, backup_policy_id: &str
1681 /// ) -> Result<()> {
1682 /// let response = client.get_backup_policy()
1683 /// .set_name(format!("projects/{project_id}/locations/{location_id}/backupPolicies/{backup_policy_id}"))
1684 /// .send().await?;
1685 /// println!("response {:?}", response);
1686 /// Ok(())
1687 /// }
1688 /// ```
1689 pub fn get_backup_policy(&self) -> super::builder::net_app::GetBackupPolicy {
1690 super::builder::net_app::GetBackupPolicy::new(self.inner.clone())
1691 }
1692
1693 /// Returns list of all available backup policies.
1694 ///
1695 /// # Example
1696 /// ```
1697 /// # use google_cloud_netapp_v1::client::NetApp;
1698 /// use google_cloud_gax::paginator::ItemPaginator as _;
1699 /// use google_cloud_netapp_v1::Result;
1700 /// async fn sample(
1701 /// client: &NetApp, project_id: &str, location_id: &str
1702 /// ) -> Result<()> {
1703 /// let mut list = client.list_backup_policies()
1704 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
1705 /// .by_item();
1706 /// while let Some(item) = list.next().await.transpose()? {
1707 /// println!("{:?}", item);
1708 /// }
1709 /// Ok(())
1710 /// }
1711 /// ```
1712 pub fn list_backup_policies(&self) -> super::builder::net_app::ListBackupPolicies {
1713 super::builder::net_app::ListBackupPolicies::new(self.inner.clone())
1714 }
1715
1716 /// Updates settings of a specific backup policy.
1717 ///
1718 /// # Long running operations
1719 ///
1720 /// This method is used to start, and/or poll a [long-running Operation].
1721 /// The [Working with long-running operations] chapter in the [user guide]
1722 /// covers these operations in detail.
1723 ///
1724 /// [long-running operation]: https://google.aip.dev/151
1725 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1726 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1727 ///
1728 /// # Example
1729 /// ```
1730 /// # use google_cloud_netapp_v1::client::NetApp;
1731 /// use google_cloud_lro::Poller;
1732 /// # extern crate wkt as google_cloud_wkt;
1733 /// use google_cloud_wkt::FieldMask;
1734 /// use google_cloud_netapp_v1::model::BackupPolicy;
1735 /// use google_cloud_netapp_v1::Result;
1736 /// async fn sample(
1737 /// client: &NetApp, project_id: &str, location_id: &str, backup_policy_id: &str
1738 /// ) -> Result<()> {
1739 /// let response = client.update_backup_policy()
1740 /// .set_backup_policy(
1741 /// BackupPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupPolicies/{backup_policy_id}"))/* set fields */
1742 /// )
1743 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1744 /// .poller().until_done().await?;
1745 /// println!("response {:?}", response);
1746 /// Ok(())
1747 /// }
1748 /// ```
1749 pub fn update_backup_policy(&self) -> super::builder::net_app::UpdateBackupPolicy {
1750 super::builder::net_app::UpdateBackupPolicy::new(self.inner.clone())
1751 }
1752
1753 /// Warning! This operation will permanently delete the backup policy.
1754 ///
1755 /// # Long running operations
1756 ///
1757 /// This method is used to start, and/or poll a [long-running Operation].
1758 /// The [Working with long-running operations] chapter in the [user guide]
1759 /// covers these operations in detail.
1760 ///
1761 /// [long-running operation]: https://google.aip.dev/151
1762 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1763 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1764 ///
1765 /// # Example
1766 /// ```
1767 /// # use google_cloud_netapp_v1::client::NetApp;
1768 /// use google_cloud_lro::Poller;
1769 /// use google_cloud_netapp_v1::Result;
1770 /// async fn sample(
1771 /// client: &NetApp, project_id: &str, location_id: &str, backup_policy_id: &str
1772 /// ) -> Result<()> {
1773 /// client.delete_backup_policy()
1774 /// .set_name(format!("projects/{project_id}/locations/{location_id}/backupPolicies/{backup_policy_id}"))
1775 /// .poller().until_done().await?;
1776 /// Ok(())
1777 /// }
1778 /// ```
1779 pub fn delete_backup_policy(&self) -> super::builder::net_app::DeleteBackupPolicy {
1780 super::builder::net_app::DeleteBackupPolicy::new(self.inner.clone())
1781 }
1782
1783 /// Returns list of all quota rules in a location.
1784 ///
1785 /// # Example
1786 /// ```
1787 /// # use google_cloud_netapp_v1::client::NetApp;
1788 /// use google_cloud_gax::paginator::ItemPaginator as _;
1789 /// use google_cloud_netapp_v1::Result;
1790 /// async fn sample(
1791 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str
1792 /// ) -> Result<()> {
1793 /// let mut list = client.list_quota_rules()
1794 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))
1795 /// .by_item();
1796 /// while let Some(item) = list.next().await.transpose()? {
1797 /// println!("{:?}", item);
1798 /// }
1799 /// Ok(())
1800 /// }
1801 /// ```
1802 pub fn list_quota_rules(&self) -> super::builder::net_app::ListQuotaRules {
1803 super::builder::net_app::ListQuotaRules::new(self.inner.clone())
1804 }
1805
1806 /// Returns details of the specified quota rule.
1807 ///
1808 /// # Example
1809 /// ```
1810 /// # use google_cloud_netapp_v1::client::NetApp;
1811 /// use google_cloud_netapp_v1::Result;
1812 /// async fn sample(
1813 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str, quota_rule_id: &str
1814 /// ) -> Result<()> {
1815 /// let response = client.get_quota_rule()
1816 /// .set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/quotaRules/{quota_rule_id}"))
1817 /// .send().await?;
1818 /// println!("response {:?}", response);
1819 /// Ok(())
1820 /// }
1821 /// ```
1822 pub fn get_quota_rule(&self) -> super::builder::net_app::GetQuotaRule {
1823 super::builder::net_app::GetQuotaRule::new(self.inner.clone())
1824 }
1825
1826 /// Creates a new quota rule.
1827 ///
1828 /// # Long running operations
1829 ///
1830 /// This method is used to start, and/or poll a [long-running Operation].
1831 /// The [Working with long-running operations] chapter in the [user guide]
1832 /// covers these operations in detail.
1833 ///
1834 /// [long-running operation]: https://google.aip.dev/151
1835 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1836 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1837 ///
1838 /// # Example
1839 /// ```
1840 /// # use google_cloud_netapp_v1::client::NetApp;
1841 /// use google_cloud_lro::Poller;
1842 /// use google_cloud_netapp_v1::model::QuotaRule;
1843 /// use google_cloud_netapp_v1::Result;
1844 /// async fn sample(
1845 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str
1846 /// ) -> Result<()> {
1847 /// let response = client.create_quota_rule()
1848 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))
1849 /// .set_quota_rule(
1850 /// QuotaRule::new()/* set fields */
1851 /// )
1852 /// .poller().until_done().await?;
1853 /// println!("response {:?}", response);
1854 /// Ok(())
1855 /// }
1856 /// ```
1857 pub fn create_quota_rule(&self) -> super::builder::net_app::CreateQuotaRule {
1858 super::builder::net_app::CreateQuotaRule::new(self.inner.clone())
1859 }
1860
1861 /// Updates a quota rule.
1862 ///
1863 /// # Long running operations
1864 ///
1865 /// This method is used to start, and/or poll a [long-running Operation].
1866 /// The [Working with long-running operations] chapter in the [user guide]
1867 /// covers these operations in detail.
1868 ///
1869 /// [long-running operation]: https://google.aip.dev/151
1870 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1871 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1872 ///
1873 /// # Example
1874 /// ```
1875 /// # use google_cloud_netapp_v1::client::NetApp;
1876 /// use google_cloud_lro::Poller;
1877 /// # extern crate wkt as google_cloud_wkt;
1878 /// use google_cloud_wkt::FieldMask;
1879 /// use google_cloud_netapp_v1::model::QuotaRule;
1880 /// use google_cloud_netapp_v1::Result;
1881 /// async fn sample(
1882 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str, quota_rule_id: &str
1883 /// ) -> Result<()> {
1884 /// let response = client.update_quota_rule()
1885 /// .set_quota_rule(
1886 /// QuotaRule::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/quotaRules/{quota_rule_id}"))/* set fields */
1887 /// )
1888 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1889 /// .poller().until_done().await?;
1890 /// println!("response {:?}", response);
1891 /// Ok(())
1892 /// }
1893 /// ```
1894 pub fn update_quota_rule(&self) -> super::builder::net_app::UpdateQuotaRule {
1895 super::builder::net_app::UpdateQuotaRule::new(self.inner.clone())
1896 }
1897
1898 /// Deletes a quota rule.
1899 ///
1900 /// # Long running operations
1901 ///
1902 /// This method is used to start, and/or poll a [long-running Operation].
1903 /// The [Working with long-running operations] chapter in the [user guide]
1904 /// covers these operations in detail.
1905 ///
1906 /// [long-running operation]: https://google.aip.dev/151
1907 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1908 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1909 ///
1910 /// # Example
1911 /// ```
1912 /// # use google_cloud_netapp_v1::client::NetApp;
1913 /// use google_cloud_lro::Poller;
1914 /// use google_cloud_netapp_v1::Result;
1915 /// async fn sample(
1916 /// client: &NetApp, project_id: &str, location_id: &str, volume_id: &str, quota_rule_id: &str
1917 /// ) -> Result<()> {
1918 /// client.delete_quota_rule()
1919 /// .set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/quotaRules/{quota_rule_id}"))
1920 /// .poller().until_done().await?;
1921 /// Ok(())
1922 /// }
1923 /// ```
1924 pub fn delete_quota_rule(&self) -> super::builder::net_app::DeleteQuotaRule {
1925 super::builder::net_app::DeleteQuotaRule::new(self.inner.clone())
1926 }
1927
1928 /// Restore files from a backup to a volume.
1929 ///
1930 /// # Long running operations
1931 ///
1932 /// This method is used to start, and/or poll a [long-running Operation].
1933 /// The [Working with long-running operations] chapter in the [user guide]
1934 /// covers these operations in detail.
1935 ///
1936 /// [long-running operation]: https://google.aip.dev/151
1937 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1938 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1939 ///
1940 /// # Example
1941 /// ```
1942 /// # use google_cloud_netapp_v1::client::NetApp;
1943 /// use google_cloud_lro::Poller;
1944 /// use google_cloud_netapp_v1::Result;
1945 /// async fn sample(
1946 /// client: &NetApp
1947 /// ) -> Result<()> {
1948 /// let response = client.restore_backup_files()
1949 /// /* set fields */
1950 /// .poller().until_done().await?;
1951 /// println!("response {:?}", response);
1952 /// Ok(())
1953 /// }
1954 /// ```
1955 pub fn restore_backup_files(&self) -> super::builder::net_app::RestoreBackupFiles {
1956 super::builder::net_app::RestoreBackupFiles::new(self.inner.clone())
1957 }
1958
1959 /// Returns a list of host groups in a `location`. Use `-` as location to list
1960 /// host groups across all locations.
1961 ///
1962 /// # Example
1963 /// ```
1964 /// # use google_cloud_netapp_v1::client::NetApp;
1965 /// use google_cloud_gax::paginator::ItemPaginator as _;
1966 /// use google_cloud_netapp_v1::Result;
1967 /// async fn sample(
1968 /// client: &NetApp, project_id: &str, location_id: &str
1969 /// ) -> Result<()> {
1970 /// let mut list = client.list_host_groups()
1971 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
1972 /// .by_item();
1973 /// while let Some(item) = list.next().await.transpose()? {
1974 /// println!("{:?}", item);
1975 /// }
1976 /// Ok(())
1977 /// }
1978 /// ```
1979 pub fn list_host_groups(&self) -> super::builder::net_app::ListHostGroups {
1980 super::builder::net_app::ListHostGroups::new(self.inner.clone())
1981 }
1982
1983 /// Returns details of the specified host group.
1984 ///
1985 /// # Example
1986 /// ```
1987 /// # use google_cloud_netapp_v1::client::NetApp;
1988 /// use google_cloud_netapp_v1::Result;
1989 /// async fn sample(
1990 /// client: &NetApp, project_id: &str, location_id: &str, host_group_id: &str
1991 /// ) -> Result<()> {
1992 /// let response = client.get_host_group()
1993 /// .set_name(format!("projects/{project_id}/locations/{location_id}/hostGroups/{host_group_id}"))
1994 /// .send().await?;
1995 /// println!("response {:?}", response);
1996 /// Ok(())
1997 /// }
1998 /// ```
1999 pub fn get_host_group(&self) -> super::builder::net_app::GetHostGroup {
2000 super::builder::net_app::GetHostGroup::new(self.inner.clone())
2001 }
2002
2003 /// Creates a new host group.
2004 ///
2005 /// # Long running operations
2006 ///
2007 /// This method is used to start, and/or poll a [long-running Operation].
2008 /// The [Working with long-running operations] chapter in the [user guide]
2009 /// covers these operations in detail.
2010 ///
2011 /// [long-running operation]: https://google.aip.dev/151
2012 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2013 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2014 ///
2015 /// # Example
2016 /// ```
2017 /// # use google_cloud_netapp_v1::client::NetApp;
2018 /// use google_cloud_lro::Poller;
2019 /// use google_cloud_netapp_v1::model::HostGroup;
2020 /// use google_cloud_netapp_v1::Result;
2021 /// async fn sample(
2022 /// client: &NetApp, project_id: &str, location_id: &str
2023 /// ) -> Result<()> {
2024 /// let response = client.create_host_group()
2025 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
2026 /// .set_host_group(
2027 /// HostGroup::new()/* set fields */
2028 /// )
2029 /// .poller().until_done().await?;
2030 /// println!("response {:?}", response);
2031 /// Ok(())
2032 /// }
2033 /// ```
2034 pub fn create_host_group(&self) -> super::builder::net_app::CreateHostGroup {
2035 super::builder::net_app::CreateHostGroup::new(self.inner.clone())
2036 }
2037
2038 /// Updates an existing host group.
2039 ///
2040 /// # Long running operations
2041 ///
2042 /// This method is used to start, and/or poll a [long-running Operation].
2043 /// The [Working with long-running operations] chapter in the [user guide]
2044 /// covers these operations in detail.
2045 ///
2046 /// [long-running operation]: https://google.aip.dev/151
2047 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2048 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2049 ///
2050 /// # Example
2051 /// ```
2052 /// # use google_cloud_netapp_v1::client::NetApp;
2053 /// use google_cloud_lro::Poller;
2054 /// # extern crate wkt as google_cloud_wkt;
2055 /// use google_cloud_wkt::FieldMask;
2056 /// use google_cloud_netapp_v1::model::HostGroup;
2057 /// use google_cloud_netapp_v1::Result;
2058 /// async fn sample(
2059 /// client: &NetApp, project_id: &str, location_id: &str, host_group_id: &str
2060 /// ) -> Result<()> {
2061 /// let response = client.update_host_group()
2062 /// .set_host_group(
2063 /// HostGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/hostGroups/{host_group_id}"))/* set fields */
2064 /// )
2065 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
2066 /// .poller().until_done().await?;
2067 /// println!("response {:?}", response);
2068 /// Ok(())
2069 /// }
2070 /// ```
2071 pub fn update_host_group(&self) -> super::builder::net_app::UpdateHostGroup {
2072 super::builder::net_app::UpdateHostGroup::new(self.inner.clone())
2073 }
2074
2075 /// Deletes a host group.
2076 ///
2077 /// # Long running operations
2078 ///
2079 /// This method is used to start, and/or poll a [long-running Operation].
2080 /// The [Working with long-running operations] chapter in the [user guide]
2081 /// covers these operations in detail.
2082 ///
2083 /// [long-running operation]: https://google.aip.dev/151
2084 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2085 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2086 ///
2087 /// # Example
2088 /// ```
2089 /// # use google_cloud_netapp_v1::client::NetApp;
2090 /// use google_cloud_lro::Poller;
2091 /// use google_cloud_netapp_v1::Result;
2092 /// async fn sample(
2093 /// client: &NetApp, project_id: &str, location_id: &str, host_group_id: &str
2094 /// ) -> Result<()> {
2095 /// client.delete_host_group()
2096 /// .set_name(format!("projects/{project_id}/locations/{location_id}/hostGroups/{host_group_id}"))
2097 /// .poller().until_done().await?;
2098 /// Ok(())
2099 /// }
2100 /// ```
2101 pub fn delete_host_group(&self) -> super::builder::net_app::DeleteHostGroup {
2102 super::builder::net_app::DeleteHostGroup::new(self.inner.clone())
2103 }
2104
2105 /// `ExecuteOntapPost` dispatches the ONTAP `POST` request to the
2106 /// `StoragePool` cluster.
2107 ///
2108 /// # Example
2109 /// ```
2110 /// # use google_cloud_netapp_v1::client::NetApp;
2111 /// use google_cloud_netapp_v1::Result;
2112 /// async fn sample(
2113 /// client: &NetApp
2114 /// ) -> Result<()> {
2115 /// let response = client.execute_ontap_post()
2116 /// /* set fields */
2117 /// .send().await?;
2118 /// println!("response {:?}", response);
2119 /// Ok(())
2120 /// }
2121 /// ```
2122 pub fn execute_ontap_post(&self) -> super::builder::net_app::ExecuteOntapPost {
2123 super::builder::net_app::ExecuteOntapPost::new(self.inner.clone())
2124 }
2125
2126 /// `ExecuteOntapGet` dispatches the ONTAP `GET` request to the
2127 /// `StoragePool` cluster.
2128 ///
2129 /// # Example
2130 /// ```
2131 /// # use google_cloud_netapp_v1::client::NetApp;
2132 /// use google_cloud_netapp_v1::Result;
2133 /// async fn sample(
2134 /// client: &NetApp
2135 /// ) -> Result<()> {
2136 /// let response = client.execute_ontap_get()
2137 /// /* set fields */
2138 /// .send().await?;
2139 /// println!("response {:?}", response);
2140 /// Ok(())
2141 /// }
2142 /// ```
2143 pub fn execute_ontap_get(&self) -> super::builder::net_app::ExecuteOntapGet {
2144 super::builder::net_app::ExecuteOntapGet::new(self.inner.clone())
2145 }
2146
2147 /// `ExecuteOntapDelete` dispatches the ONTAP `DELETE` request to the
2148 /// `StoragePool` cluster.
2149 ///
2150 /// # Example
2151 /// ```
2152 /// # use google_cloud_netapp_v1::client::NetApp;
2153 /// use google_cloud_netapp_v1::Result;
2154 /// async fn sample(
2155 /// client: &NetApp
2156 /// ) -> Result<()> {
2157 /// let response = client.execute_ontap_delete()
2158 /// /* set fields */
2159 /// .send().await?;
2160 /// println!("response {:?}", response);
2161 /// Ok(())
2162 /// }
2163 /// ```
2164 pub fn execute_ontap_delete(&self) -> super::builder::net_app::ExecuteOntapDelete {
2165 super::builder::net_app::ExecuteOntapDelete::new(self.inner.clone())
2166 }
2167
2168 /// `ExecuteOntapPatch` dispatches the ONTAP `PATCH` request to the
2169 /// `StoragePool` cluster.
2170 ///
2171 /// # Example
2172 /// ```
2173 /// # use google_cloud_netapp_v1::client::NetApp;
2174 /// use google_cloud_netapp_v1::Result;
2175 /// async fn sample(
2176 /// client: &NetApp
2177 /// ) -> Result<()> {
2178 /// let response = client.execute_ontap_patch()
2179 /// /* set fields */
2180 /// .send().await?;
2181 /// println!("response {:?}", response);
2182 /// Ok(())
2183 /// }
2184 /// ```
2185 pub fn execute_ontap_patch(&self) -> super::builder::net_app::ExecuteOntapPatch {
2186 super::builder::net_app::ExecuteOntapPatch::new(self.inner.clone())
2187 }
2188
2189 /// Lists information about the supported locations for this service.
2190 ///
2191 /// This method lists locations based on the resource scope provided in
2192 /// the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: *
2193 /// **Global locations**: If `name` is empty, the method lists the
2194 /// public locations available to all projects. * **Project-specific
2195 /// locations**: If `name` follows the format
2196 /// `projects/{project}`, the method lists locations visible to that
2197 /// specific project. This includes public, private, or other
2198 /// project-specific locations enabled for the project.
2199 ///
2200 /// For gRPC and client library implementations, the resource name is
2201 /// passed as the `name` field. For direct service calls, the resource
2202 /// name is
2203 /// incorporated into the request path based on the specific service
2204 /// implementation and version.
2205 ///
2206 /// [google.cloud.location.ListLocationsRequest.name]: google_cloud_location::model::ListLocationsRequest::name
2207 ///
2208 /// # Example
2209 /// ```
2210 /// # use google_cloud_netapp_v1::client::NetApp;
2211 /// use google_cloud_gax::paginator::ItemPaginator as _;
2212 /// use google_cloud_netapp_v1::Result;
2213 /// async fn sample(
2214 /// client: &NetApp
2215 /// ) -> Result<()> {
2216 /// let mut list = client.list_locations()
2217 /// /* set fields */
2218 /// .by_item();
2219 /// while let Some(item) = list.next().await.transpose()? {
2220 /// println!("{:?}", item);
2221 /// }
2222 /// Ok(())
2223 /// }
2224 /// ```
2225 pub fn list_locations(&self) -> super::builder::net_app::ListLocations {
2226 super::builder::net_app::ListLocations::new(self.inner.clone())
2227 }
2228
2229 /// Gets information about a location.
2230 ///
2231 /// # Example
2232 /// ```
2233 /// # use google_cloud_netapp_v1::client::NetApp;
2234 /// use google_cloud_netapp_v1::Result;
2235 /// async fn sample(
2236 /// client: &NetApp
2237 /// ) -> Result<()> {
2238 /// let response = client.get_location()
2239 /// /* set fields */
2240 /// .send().await?;
2241 /// println!("response {:?}", response);
2242 /// Ok(())
2243 /// }
2244 /// ```
2245 pub fn get_location(&self) -> super::builder::net_app::GetLocation {
2246 super::builder::net_app::GetLocation::new(self.inner.clone())
2247 }
2248
2249 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2250 ///
2251 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2252 ///
2253 /// # Example
2254 /// ```
2255 /// # use google_cloud_netapp_v1::client::NetApp;
2256 /// use google_cloud_gax::paginator::ItemPaginator as _;
2257 /// use google_cloud_netapp_v1::Result;
2258 /// async fn sample(
2259 /// client: &NetApp
2260 /// ) -> Result<()> {
2261 /// let mut list = client.list_operations()
2262 /// /* set fields */
2263 /// .by_item();
2264 /// while let Some(item) = list.next().await.transpose()? {
2265 /// println!("{:?}", item);
2266 /// }
2267 /// Ok(())
2268 /// }
2269 /// ```
2270 pub fn list_operations(&self) -> super::builder::net_app::ListOperations {
2271 super::builder::net_app::ListOperations::new(self.inner.clone())
2272 }
2273
2274 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2275 ///
2276 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2277 ///
2278 /// # Example
2279 /// ```
2280 /// # use google_cloud_netapp_v1::client::NetApp;
2281 /// use google_cloud_netapp_v1::Result;
2282 /// async fn sample(
2283 /// client: &NetApp
2284 /// ) -> Result<()> {
2285 /// let response = client.get_operation()
2286 /// /* set fields */
2287 /// .send().await?;
2288 /// println!("response {:?}", response);
2289 /// Ok(())
2290 /// }
2291 /// ```
2292 pub fn get_operation(&self) -> super::builder::net_app::GetOperation {
2293 super::builder::net_app::GetOperation::new(self.inner.clone())
2294 }
2295
2296 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2297 ///
2298 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2299 ///
2300 /// # Example
2301 /// ```
2302 /// # use google_cloud_netapp_v1::client::NetApp;
2303 /// use google_cloud_netapp_v1::Result;
2304 /// async fn sample(
2305 /// client: &NetApp
2306 /// ) -> Result<()> {
2307 /// client.delete_operation()
2308 /// /* set fields */
2309 /// .send().await?;
2310 /// Ok(())
2311 /// }
2312 /// ```
2313 pub fn delete_operation(&self) -> super::builder::net_app::DeleteOperation {
2314 super::builder::net_app::DeleteOperation::new(self.inner.clone())
2315 }
2316
2317 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2318 ///
2319 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2320 ///
2321 /// # Example
2322 /// ```
2323 /// # use google_cloud_netapp_v1::client::NetApp;
2324 /// use google_cloud_netapp_v1::Result;
2325 /// async fn sample(
2326 /// client: &NetApp
2327 /// ) -> Result<()> {
2328 /// client.cancel_operation()
2329 /// /* set fields */
2330 /// .send().await?;
2331 /// Ok(())
2332 /// }
2333 /// ```
2334 pub fn cancel_operation(&self) -> super::builder::net_app::CancelOperation {
2335 super::builder::net_app::CancelOperation::new(self.inner.clone())
2336 }
2337}