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