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 /// Returns descriptions of all snapshots for a volume.
516 ///
517 /// # Example
518 /// ```
519 /// # use google_cloud_netapp_v1::client::NetApp;
520 /// use google_cloud_gax::paginator::ItemPaginator as _;
521 /// use google_cloud_netapp_v1::Result;
522 /// async fn sample(
523 /// client: &NetApp, parent: &str
524 /// ) -> Result<()> {
525 /// let mut list = client.list_snapshots()
526 /// .set_parent(parent)
527 /// .by_item();
528 /// while let Some(item) = list.next().await.transpose()? {
529 /// println!("{:?}", item);
530 /// }
531 /// Ok(())
532 /// }
533 /// ```
534 pub fn list_snapshots(&self) -> super::builder::net_app::ListSnapshots {
535 super::builder::net_app::ListSnapshots::new(self.inner.clone())
536 }
537
538 /// Describe a snapshot for a volume.
539 ///
540 /// # Example
541 /// ```
542 /// # use google_cloud_netapp_v1::client::NetApp;
543 /// use google_cloud_netapp_v1::Result;
544 /// async fn sample(
545 /// client: &NetApp, name: &str
546 /// ) -> Result<()> {
547 /// let response = client.get_snapshot()
548 /// .set_name(name)
549 /// .send().await?;
550 /// println!("response {:?}", response);
551 /// Ok(())
552 /// }
553 /// ```
554 pub fn get_snapshot(&self) -> super::builder::net_app::GetSnapshot {
555 super::builder::net_app::GetSnapshot::new(self.inner.clone())
556 }
557
558 /// Create a new snapshot for a volume.
559 ///
560 /// # Long running operations
561 ///
562 /// This method is used to start, and/or poll a [long-running Operation].
563 /// The [Working with long-running operations] chapter in the [user guide]
564 /// covers these operations in detail.
565 ///
566 /// [long-running operation]: https://google.aip.dev/151
567 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
568 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
569 ///
570 /// # Example
571 /// ```
572 /// # use google_cloud_netapp_v1::client::NetApp;
573 /// use google_cloud_lro::Poller;
574 /// use google_cloud_netapp_v1::model::Snapshot;
575 /// use google_cloud_netapp_v1::Result;
576 /// async fn sample(
577 /// client: &NetApp, parent: &str
578 /// ) -> Result<()> {
579 /// let response = client.create_snapshot()
580 /// .set_parent(parent)
581 /// .set_snapshot_id("snapshot_id_value")
582 /// .set_snapshot(
583 /// Snapshot::new()/* set fields */
584 /// )
585 /// .poller().until_done().await?;
586 /// println!("response {:?}", response);
587 /// Ok(())
588 /// }
589 /// ```
590 pub fn create_snapshot(&self) -> super::builder::net_app::CreateSnapshot {
591 super::builder::net_app::CreateSnapshot::new(self.inner.clone())
592 }
593
594 /// Deletes a snapshot.
595 ///
596 /// # Long running operations
597 ///
598 /// This method is used to start, and/or poll a [long-running Operation].
599 /// The [Working with long-running operations] chapter in the [user guide]
600 /// covers these operations in detail.
601 ///
602 /// [long-running operation]: https://google.aip.dev/151
603 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
604 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
605 ///
606 /// # Example
607 /// ```
608 /// # use google_cloud_netapp_v1::client::NetApp;
609 /// use google_cloud_lro::Poller;
610 /// use google_cloud_netapp_v1::Result;
611 /// async fn sample(
612 /// client: &NetApp, name: &str
613 /// ) -> Result<()> {
614 /// client.delete_snapshot()
615 /// .set_name(name)
616 /// .poller().until_done().await?;
617 /// Ok(())
618 /// }
619 /// ```
620 pub fn delete_snapshot(&self) -> super::builder::net_app::DeleteSnapshot {
621 super::builder::net_app::DeleteSnapshot::new(self.inner.clone())
622 }
623
624 /// Updates the settings of a specific snapshot.
625 ///
626 /// # Long running operations
627 ///
628 /// This method is used to start, and/or poll a [long-running Operation].
629 /// The [Working with long-running operations] chapter in the [user guide]
630 /// covers these operations in detail.
631 ///
632 /// [long-running operation]: https://google.aip.dev/151
633 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
634 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
635 ///
636 /// # Example
637 /// ```
638 /// # use google_cloud_netapp_v1::client::NetApp;
639 /// use google_cloud_lro::Poller;
640 /// # extern crate wkt as google_cloud_wkt;
641 /// use google_cloud_wkt::FieldMask;
642 /// use google_cloud_netapp_v1::model::Snapshot;
643 /// use google_cloud_netapp_v1::Result;
644 /// async fn sample(
645 /// client: &NetApp, name: &str
646 /// ) -> Result<()> {
647 /// let response = client.update_snapshot()
648 /// .set_snapshot(
649 /// Snapshot::new().set_name(name)/* set fields */
650 /// )
651 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
652 /// .poller().until_done().await?;
653 /// println!("response {:?}", response);
654 /// Ok(())
655 /// }
656 /// ```
657 pub fn update_snapshot(&self) -> super::builder::net_app::UpdateSnapshot {
658 super::builder::net_app::UpdateSnapshot::new(self.inner.clone())
659 }
660
661 /// Lists active directories.
662 ///
663 /// # Example
664 /// ```
665 /// # use google_cloud_netapp_v1::client::NetApp;
666 /// use google_cloud_gax::paginator::ItemPaginator as _;
667 /// use google_cloud_netapp_v1::Result;
668 /// async fn sample(
669 /// client: &NetApp, parent: &str
670 /// ) -> Result<()> {
671 /// let mut list = client.list_active_directories()
672 /// .set_parent(parent)
673 /// .by_item();
674 /// while let Some(item) = list.next().await.transpose()? {
675 /// println!("{:?}", item);
676 /// }
677 /// Ok(())
678 /// }
679 /// ```
680 pub fn list_active_directories(&self) -> super::builder::net_app::ListActiveDirectories {
681 super::builder::net_app::ListActiveDirectories::new(self.inner.clone())
682 }
683
684 /// Describes a specified active directory.
685 ///
686 /// # Example
687 /// ```
688 /// # use google_cloud_netapp_v1::client::NetApp;
689 /// use google_cloud_netapp_v1::Result;
690 /// async fn sample(
691 /// client: &NetApp, name: &str
692 /// ) -> Result<()> {
693 /// let response = client.get_active_directory()
694 /// .set_name(name)
695 /// .send().await?;
696 /// println!("response {:?}", response);
697 /// Ok(())
698 /// }
699 /// ```
700 pub fn get_active_directory(&self) -> super::builder::net_app::GetActiveDirectory {
701 super::builder::net_app::GetActiveDirectory::new(self.inner.clone())
702 }
703
704 /// CreateActiveDirectory
705 /// Creates the active directory specified in the request.
706 ///
707 /// # Long running operations
708 ///
709 /// This method is used to start, and/or poll a [long-running Operation].
710 /// The [Working with long-running operations] chapter in the [user guide]
711 /// covers these operations in detail.
712 ///
713 /// [long-running operation]: https://google.aip.dev/151
714 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
715 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
716 ///
717 /// # Example
718 /// ```
719 /// # use google_cloud_netapp_v1::client::NetApp;
720 /// use google_cloud_lro::Poller;
721 /// use google_cloud_netapp_v1::model::ActiveDirectory;
722 /// use google_cloud_netapp_v1::Result;
723 /// async fn sample(
724 /// client: &NetApp, parent: &str
725 /// ) -> Result<()> {
726 /// let response = client.create_active_directory()
727 /// .set_parent(parent)
728 /// .set_active_directory(
729 /// ActiveDirectory::new()/* set fields */
730 /// )
731 /// .poller().until_done().await?;
732 /// println!("response {:?}", response);
733 /// Ok(())
734 /// }
735 /// ```
736 pub fn create_active_directory(&self) -> super::builder::net_app::CreateActiveDirectory {
737 super::builder::net_app::CreateActiveDirectory::new(self.inner.clone())
738 }
739
740 /// Update the parameters of an active directories.
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 /// # extern crate wkt as google_cloud_wkt;
757 /// use google_cloud_wkt::FieldMask;
758 /// use google_cloud_netapp_v1::model::ActiveDirectory;
759 /// use google_cloud_netapp_v1::Result;
760 /// async fn sample(
761 /// client: &NetApp, name: &str
762 /// ) -> Result<()> {
763 /// let response = client.update_active_directory()
764 /// .set_active_directory(
765 /// ActiveDirectory::new().set_name(name)/* set fields */
766 /// )
767 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
768 /// .poller().until_done().await?;
769 /// println!("response {:?}", response);
770 /// Ok(())
771 /// }
772 /// ```
773 pub fn update_active_directory(&self) -> super::builder::net_app::UpdateActiveDirectory {
774 super::builder::net_app::UpdateActiveDirectory::new(self.inner.clone())
775 }
776
777 /// Delete the active directory specified in the request.
778 ///
779 /// # Long running operations
780 ///
781 /// This method is used to start, and/or poll a [long-running Operation].
782 /// The [Working with long-running operations] chapter in the [user guide]
783 /// covers these operations in detail.
784 ///
785 /// [long-running operation]: https://google.aip.dev/151
786 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
787 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
788 ///
789 /// # Example
790 /// ```
791 /// # use google_cloud_netapp_v1::client::NetApp;
792 /// use google_cloud_lro::Poller;
793 /// use google_cloud_netapp_v1::Result;
794 /// async fn sample(
795 /// client: &NetApp, name: &str
796 /// ) -> Result<()> {
797 /// client.delete_active_directory()
798 /// .set_name(name)
799 /// .poller().until_done().await?;
800 /// Ok(())
801 /// }
802 /// ```
803 pub fn delete_active_directory(&self) -> super::builder::net_app::DeleteActiveDirectory {
804 super::builder::net_app::DeleteActiveDirectory::new(self.inner.clone())
805 }
806
807 /// Returns descriptions of all KMS configs owned by the caller.
808 ///
809 /// # Example
810 /// ```
811 /// # use google_cloud_netapp_v1::client::NetApp;
812 /// use google_cloud_gax::paginator::ItemPaginator as _;
813 /// use google_cloud_netapp_v1::Result;
814 /// async fn sample(
815 /// client: &NetApp, parent: &str
816 /// ) -> Result<()> {
817 /// let mut list = client.list_kms_configs()
818 /// .set_parent(parent)
819 /// .by_item();
820 /// while let Some(item) = list.next().await.transpose()? {
821 /// println!("{:?}", item);
822 /// }
823 /// Ok(())
824 /// }
825 /// ```
826 pub fn list_kms_configs(&self) -> super::builder::net_app::ListKmsConfigs {
827 super::builder::net_app::ListKmsConfigs::new(self.inner.clone())
828 }
829
830 /// Creates a new KMS config.
831 ///
832 /// # Long running operations
833 ///
834 /// This method is used to start, and/or poll a [long-running Operation].
835 /// The [Working with long-running operations] chapter in the [user guide]
836 /// covers these operations in detail.
837 ///
838 /// [long-running operation]: https://google.aip.dev/151
839 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
840 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
841 ///
842 /// # Example
843 /// ```
844 /// # use google_cloud_netapp_v1::client::NetApp;
845 /// use google_cloud_lro::Poller;
846 /// use google_cloud_netapp_v1::model::KmsConfig;
847 /// use google_cloud_netapp_v1::Result;
848 /// async fn sample(
849 /// client: &NetApp, parent: &str
850 /// ) -> Result<()> {
851 /// let response = client.create_kms_config()
852 /// .set_parent(parent)
853 /// .set_kms_config(
854 /// KmsConfig::new()/* set fields */
855 /// )
856 /// .poller().until_done().await?;
857 /// println!("response {:?}", response);
858 /// Ok(())
859 /// }
860 /// ```
861 pub fn create_kms_config(&self) -> super::builder::net_app::CreateKmsConfig {
862 super::builder::net_app::CreateKmsConfig::new(self.inner.clone())
863 }
864
865 /// Returns the description of the specified KMS config by kms_config_id.
866 ///
867 /// # Example
868 /// ```
869 /// # use google_cloud_netapp_v1::client::NetApp;
870 /// use google_cloud_netapp_v1::Result;
871 /// async fn sample(
872 /// client: &NetApp, name: &str
873 /// ) -> Result<()> {
874 /// let response = client.get_kms_config()
875 /// .set_name(name)
876 /// .send().await?;
877 /// println!("response {:?}", response);
878 /// Ok(())
879 /// }
880 /// ```
881 pub fn get_kms_config(&self) -> super::builder::net_app::GetKmsConfig {
882 super::builder::net_app::GetKmsConfig::new(self.inner.clone())
883 }
884
885 /// Updates the Kms config properties with the full spec
886 ///
887 /// # Long running operations
888 ///
889 /// This method is used to start, and/or poll a [long-running Operation].
890 /// The [Working with long-running operations] chapter in the [user guide]
891 /// covers these operations in detail.
892 ///
893 /// [long-running operation]: https://google.aip.dev/151
894 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
895 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
896 ///
897 /// # Example
898 /// ```
899 /// # use google_cloud_netapp_v1::client::NetApp;
900 /// use google_cloud_lro::Poller;
901 /// # extern crate wkt as google_cloud_wkt;
902 /// use google_cloud_wkt::FieldMask;
903 /// use google_cloud_netapp_v1::model::KmsConfig;
904 /// use google_cloud_netapp_v1::Result;
905 /// async fn sample(
906 /// client: &NetApp, name: &str
907 /// ) -> Result<()> {
908 /// let response = client.update_kms_config()
909 /// .set_kms_config(
910 /// KmsConfig::new().set_name(name)/* set fields */
911 /// )
912 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
913 /// .poller().until_done().await?;
914 /// println!("response {:?}", response);
915 /// Ok(())
916 /// }
917 /// ```
918 pub fn update_kms_config(&self) -> super::builder::net_app::UpdateKmsConfig {
919 super::builder::net_app::UpdateKmsConfig::new(self.inner.clone())
920 }
921
922 /// Encrypt the existing volumes without CMEK encryption with the desired the
923 /// KMS config for the whole region.
924 ///
925 /// # Long running operations
926 ///
927 /// This method is used to start, and/or poll a [long-running Operation].
928 /// The [Working with long-running operations] chapter in the [user guide]
929 /// covers these operations in detail.
930 ///
931 /// [long-running operation]: https://google.aip.dev/151
932 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
933 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
934 ///
935 /// # Example
936 /// ```
937 /// # use google_cloud_netapp_v1::client::NetApp;
938 /// use google_cloud_lro::Poller;
939 /// use google_cloud_netapp_v1::Result;
940 /// async fn sample(
941 /// client: &NetApp
942 /// ) -> Result<()> {
943 /// let response = client.encrypt_volumes()
944 /// /* set fields */
945 /// .poller().until_done().await?;
946 /// println!("response {:?}", response);
947 /// Ok(())
948 /// }
949 /// ```
950 pub fn encrypt_volumes(&self) -> super::builder::net_app::EncryptVolumes {
951 super::builder::net_app::EncryptVolumes::new(self.inner.clone())
952 }
953
954 /// Verifies KMS config reachability.
955 ///
956 /// # Example
957 /// ```
958 /// # use google_cloud_netapp_v1::client::NetApp;
959 /// use google_cloud_netapp_v1::Result;
960 /// async fn sample(
961 /// client: &NetApp
962 /// ) -> Result<()> {
963 /// let response = client.verify_kms_config()
964 /// /* set fields */
965 /// .send().await?;
966 /// println!("response {:?}", response);
967 /// Ok(())
968 /// }
969 /// ```
970 pub fn verify_kms_config(&self) -> super::builder::net_app::VerifyKmsConfig {
971 super::builder::net_app::VerifyKmsConfig::new(self.inner.clone())
972 }
973
974 /// Warning! This operation will permanently delete the Kms config.
975 ///
976 /// # Long running operations
977 ///
978 /// This method is used to start, and/or poll a [long-running Operation].
979 /// The [Working with long-running operations] chapter in the [user guide]
980 /// covers these operations in detail.
981 ///
982 /// [long-running operation]: https://google.aip.dev/151
983 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
984 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
985 ///
986 /// # Example
987 /// ```
988 /// # use google_cloud_netapp_v1::client::NetApp;
989 /// use google_cloud_lro::Poller;
990 /// use google_cloud_netapp_v1::Result;
991 /// async fn sample(
992 /// client: &NetApp, name: &str
993 /// ) -> Result<()> {
994 /// client.delete_kms_config()
995 /// .set_name(name)
996 /// .poller().until_done().await?;
997 /// Ok(())
998 /// }
999 /// ```
1000 pub fn delete_kms_config(&self) -> super::builder::net_app::DeleteKmsConfig {
1001 super::builder::net_app::DeleteKmsConfig::new(self.inner.clone())
1002 }
1003
1004 /// Returns descriptions of all replications for a volume.
1005 ///
1006 /// # Example
1007 /// ```
1008 /// # use google_cloud_netapp_v1::client::NetApp;
1009 /// use google_cloud_gax::paginator::ItemPaginator as _;
1010 /// use google_cloud_netapp_v1::Result;
1011 /// async fn sample(
1012 /// client: &NetApp, parent: &str
1013 /// ) -> Result<()> {
1014 /// let mut list = client.list_replications()
1015 /// .set_parent(parent)
1016 /// .by_item();
1017 /// while let Some(item) = list.next().await.transpose()? {
1018 /// println!("{:?}", item);
1019 /// }
1020 /// Ok(())
1021 /// }
1022 /// ```
1023 pub fn list_replications(&self) -> super::builder::net_app::ListReplications {
1024 super::builder::net_app::ListReplications::new(self.inner.clone())
1025 }
1026
1027 /// Describe a replication for a volume.
1028 ///
1029 /// # Example
1030 /// ```
1031 /// # use google_cloud_netapp_v1::client::NetApp;
1032 /// use google_cloud_netapp_v1::Result;
1033 /// async fn sample(
1034 /// client: &NetApp, name: &str
1035 /// ) -> Result<()> {
1036 /// let response = client.get_replication()
1037 /// .set_name(name)
1038 /// .send().await?;
1039 /// println!("response {:?}", response);
1040 /// Ok(())
1041 /// }
1042 /// ```
1043 pub fn get_replication(&self) -> super::builder::net_app::GetReplication {
1044 super::builder::net_app::GetReplication::new(self.inner.clone())
1045 }
1046
1047 /// Create a new replication for a volume.
1048 ///
1049 /// # Long running operations
1050 ///
1051 /// This method is used to start, and/or poll a [long-running Operation].
1052 /// The [Working with long-running operations] chapter in the [user guide]
1053 /// covers these operations in detail.
1054 ///
1055 /// [long-running operation]: https://google.aip.dev/151
1056 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1057 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1058 ///
1059 /// # Example
1060 /// ```
1061 /// # use google_cloud_netapp_v1::client::NetApp;
1062 /// use google_cloud_lro::Poller;
1063 /// use google_cloud_netapp_v1::model::Replication;
1064 /// use google_cloud_netapp_v1::Result;
1065 /// async fn sample(
1066 /// client: &NetApp, parent: &str
1067 /// ) -> Result<()> {
1068 /// let response = client.create_replication()
1069 /// .set_parent(parent)
1070 /// .set_replication_id("replication_id_value")
1071 /// .set_replication(
1072 /// Replication::new()/* set fields */
1073 /// )
1074 /// .poller().until_done().await?;
1075 /// println!("response {:?}", response);
1076 /// Ok(())
1077 /// }
1078 /// ```
1079 pub fn create_replication(&self) -> super::builder::net_app::CreateReplication {
1080 super::builder::net_app::CreateReplication::new(self.inner.clone())
1081 }
1082
1083 /// Deletes a replication.
1084 ///
1085 /// # Long running operations
1086 ///
1087 /// This method is used to start, and/or poll a [long-running Operation].
1088 /// The [Working with long-running operations] chapter in the [user guide]
1089 /// covers these operations in detail.
1090 ///
1091 /// [long-running operation]: https://google.aip.dev/151
1092 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1093 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1094 ///
1095 /// # Example
1096 /// ```
1097 /// # use google_cloud_netapp_v1::client::NetApp;
1098 /// use google_cloud_lro::Poller;
1099 /// use google_cloud_netapp_v1::Result;
1100 /// async fn sample(
1101 /// client: &NetApp, name: &str
1102 /// ) -> Result<()> {
1103 /// client.delete_replication()
1104 /// .set_name(name)
1105 /// .poller().until_done().await?;
1106 /// Ok(())
1107 /// }
1108 /// ```
1109 pub fn delete_replication(&self) -> super::builder::net_app::DeleteReplication {
1110 super::builder::net_app::DeleteReplication::new(self.inner.clone())
1111 }
1112
1113 /// Updates the settings of a specific replication.
1114 ///
1115 /// # Long running operations
1116 ///
1117 /// This method is used to start, and/or poll a [long-running Operation].
1118 /// The [Working with long-running operations] chapter in the [user guide]
1119 /// covers these operations in detail.
1120 ///
1121 /// [long-running operation]: https://google.aip.dev/151
1122 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1123 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1124 ///
1125 /// # Example
1126 /// ```
1127 /// # use google_cloud_netapp_v1::client::NetApp;
1128 /// use google_cloud_lro::Poller;
1129 /// # extern crate wkt as google_cloud_wkt;
1130 /// use google_cloud_wkt::FieldMask;
1131 /// use google_cloud_netapp_v1::model::Replication;
1132 /// use google_cloud_netapp_v1::Result;
1133 /// async fn sample(
1134 /// client: &NetApp, name: &str
1135 /// ) -> Result<()> {
1136 /// let response = client.update_replication()
1137 /// .set_replication(
1138 /// Replication::new().set_name(name)/* set fields */
1139 /// )
1140 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1141 /// .poller().until_done().await?;
1142 /// println!("response {:?}", response);
1143 /// Ok(())
1144 /// }
1145 /// ```
1146 pub fn update_replication(&self) -> super::builder::net_app::UpdateReplication {
1147 super::builder::net_app::UpdateReplication::new(self.inner.clone())
1148 }
1149
1150 /// Stop Cross Region Replication.
1151 ///
1152 /// # Long running operations
1153 ///
1154 /// This method is used to start, and/or poll a [long-running Operation].
1155 /// The [Working with long-running operations] chapter in the [user guide]
1156 /// covers these operations in detail.
1157 ///
1158 /// [long-running operation]: https://google.aip.dev/151
1159 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1160 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1161 ///
1162 /// # Example
1163 /// ```
1164 /// # use google_cloud_netapp_v1::client::NetApp;
1165 /// use google_cloud_lro::Poller;
1166 /// use google_cloud_netapp_v1::Result;
1167 /// async fn sample(
1168 /// client: &NetApp
1169 /// ) -> Result<()> {
1170 /// let response = client.stop_replication()
1171 /// /* set fields */
1172 /// .poller().until_done().await?;
1173 /// println!("response {:?}", response);
1174 /// Ok(())
1175 /// }
1176 /// ```
1177 pub fn stop_replication(&self) -> super::builder::net_app::StopReplication {
1178 super::builder::net_app::StopReplication::new(self.inner.clone())
1179 }
1180
1181 /// Resume Cross Region Replication.
1182 ///
1183 /// # Long running operations
1184 ///
1185 /// This method is used to start, and/or poll a [long-running Operation].
1186 /// The [Working with long-running operations] chapter in the [user guide]
1187 /// covers these operations in detail.
1188 ///
1189 /// [long-running operation]: https://google.aip.dev/151
1190 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1191 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1192 ///
1193 /// # Example
1194 /// ```
1195 /// # use google_cloud_netapp_v1::client::NetApp;
1196 /// use google_cloud_lro::Poller;
1197 /// use google_cloud_netapp_v1::Result;
1198 /// async fn sample(
1199 /// client: &NetApp
1200 /// ) -> Result<()> {
1201 /// let response = client.resume_replication()
1202 /// /* set fields */
1203 /// .poller().until_done().await?;
1204 /// println!("response {:?}", response);
1205 /// Ok(())
1206 /// }
1207 /// ```
1208 pub fn resume_replication(&self) -> super::builder::net_app::ResumeReplication {
1209 super::builder::net_app::ResumeReplication::new(self.inner.clone())
1210 }
1211
1212 /// Reverses direction of replication. Source becomes destination and
1213 /// destination becomes source.
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.reverse_replication_direction()
1234 /// /* set fields */
1235 /// .poller().until_done().await?;
1236 /// println!("response {:?}", response);
1237 /// Ok(())
1238 /// }
1239 /// ```
1240 pub fn reverse_replication_direction(
1241 &self,
1242 ) -> super::builder::net_app::ReverseReplicationDirection {
1243 super::builder::net_app::ReverseReplicationDirection::new(self.inner.clone())
1244 }
1245
1246 /// Establish replication peering.
1247 ///
1248 /// # Long running operations
1249 ///
1250 /// This method is used to start, and/or poll a [long-running Operation].
1251 /// The [Working with long-running operations] chapter in the [user guide]
1252 /// covers these operations in detail.
1253 ///
1254 /// [long-running operation]: https://google.aip.dev/151
1255 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1256 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1257 ///
1258 /// # Example
1259 /// ```
1260 /// # use google_cloud_netapp_v1::client::NetApp;
1261 /// use google_cloud_lro::Poller;
1262 /// use google_cloud_netapp_v1::Result;
1263 /// async fn sample(
1264 /// client: &NetApp
1265 /// ) -> Result<()> {
1266 /// let response = client.establish_peering()
1267 /// /* set fields */
1268 /// .poller().until_done().await?;
1269 /// println!("response {:?}", response);
1270 /// Ok(())
1271 /// }
1272 /// ```
1273 pub fn establish_peering(&self) -> super::builder::net_app::EstablishPeering {
1274 super::builder::net_app::EstablishPeering::new(self.inner.clone())
1275 }
1276
1277 /// Syncs the replication. This will invoke one time volume data transfer from
1278 /// source to destination.
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.sync_replication()
1299 /// /* set fields */
1300 /// .poller().until_done().await?;
1301 /// println!("response {:?}", response);
1302 /// Ok(())
1303 /// }
1304 /// ```
1305 pub fn sync_replication(&self) -> super::builder::net_app::SyncReplication {
1306 super::builder::net_app::SyncReplication::new(self.inner.clone())
1307 }
1308
1309 /// Creates new backup vault
1310 ///
1311 /// # Long running operations
1312 ///
1313 /// This method is used to start, and/or poll a [long-running Operation].
1314 /// The [Working with long-running operations] chapter in the [user guide]
1315 /// covers these operations in detail.
1316 ///
1317 /// [long-running operation]: https://google.aip.dev/151
1318 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1319 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1320 ///
1321 /// # Example
1322 /// ```
1323 /// # use google_cloud_netapp_v1::client::NetApp;
1324 /// use google_cloud_lro::Poller;
1325 /// use google_cloud_netapp_v1::model::BackupVault;
1326 /// use google_cloud_netapp_v1::Result;
1327 /// async fn sample(
1328 /// client: &NetApp, parent: &str
1329 /// ) -> Result<()> {
1330 /// let response = client.create_backup_vault()
1331 /// .set_parent(parent)
1332 /// .set_backup_vault(
1333 /// BackupVault::new()/* set fields */
1334 /// )
1335 /// .poller().until_done().await?;
1336 /// println!("response {:?}", response);
1337 /// Ok(())
1338 /// }
1339 /// ```
1340 pub fn create_backup_vault(&self) -> super::builder::net_app::CreateBackupVault {
1341 super::builder::net_app::CreateBackupVault::new(self.inner.clone())
1342 }
1343
1344 /// Returns the description of the specified backup vault
1345 ///
1346 /// # Example
1347 /// ```
1348 /// # use google_cloud_netapp_v1::client::NetApp;
1349 /// use google_cloud_netapp_v1::Result;
1350 /// async fn sample(
1351 /// client: &NetApp, name: &str
1352 /// ) -> Result<()> {
1353 /// let response = client.get_backup_vault()
1354 /// .set_name(name)
1355 /// .send().await?;
1356 /// println!("response {:?}", response);
1357 /// Ok(())
1358 /// }
1359 /// ```
1360 pub fn get_backup_vault(&self) -> super::builder::net_app::GetBackupVault {
1361 super::builder::net_app::GetBackupVault::new(self.inner.clone())
1362 }
1363
1364 /// Returns list of all available backup vaults.
1365 ///
1366 /// # Example
1367 /// ```
1368 /// # use google_cloud_netapp_v1::client::NetApp;
1369 /// use google_cloud_gax::paginator::ItemPaginator as _;
1370 /// use google_cloud_netapp_v1::Result;
1371 /// async fn sample(
1372 /// client: &NetApp, parent: &str
1373 /// ) -> Result<()> {
1374 /// let mut list = client.list_backup_vaults()
1375 /// .set_parent(parent)
1376 /// .by_item();
1377 /// while let Some(item) = list.next().await.transpose()? {
1378 /// println!("{:?}", item);
1379 /// }
1380 /// Ok(())
1381 /// }
1382 /// ```
1383 pub fn list_backup_vaults(&self) -> super::builder::net_app::ListBackupVaults {
1384 super::builder::net_app::ListBackupVaults::new(self.inner.clone())
1385 }
1386
1387 /// Updates the settings of a specific backup vault.
1388 ///
1389 /// # Long running operations
1390 ///
1391 /// This method is used to start, and/or poll a [long-running Operation].
1392 /// The [Working with long-running operations] chapter in the [user guide]
1393 /// covers these operations in detail.
1394 ///
1395 /// [long-running operation]: https://google.aip.dev/151
1396 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1397 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1398 ///
1399 /// # Example
1400 /// ```
1401 /// # use google_cloud_netapp_v1::client::NetApp;
1402 /// use google_cloud_lro::Poller;
1403 /// # extern crate wkt as google_cloud_wkt;
1404 /// use google_cloud_wkt::FieldMask;
1405 /// use google_cloud_netapp_v1::model::BackupVault;
1406 /// use google_cloud_netapp_v1::Result;
1407 /// async fn sample(
1408 /// client: &NetApp, name: &str
1409 /// ) -> Result<()> {
1410 /// let response = client.update_backup_vault()
1411 /// .set_backup_vault(
1412 /// BackupVault::new().set_name(name)/* set fields */
1413 /// )
1414 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1415 /// .poller().until_done().await?;
1416 /// println!("response {:?}", response);
1417 /// Ok(())
1418 /// }
1419 /// ```
1420 pub fn update_backup_vault(&self) -> super::builder::net_app::UpdateBackupVault {
1421 super::builder::net_app::UpdateBackupVault::new(self.inner.clone())
1422 }
1423
1424 /// Warning! This operation will permanently delete the backup vault.
1425 ///
1426 /// # Long running operations
1427 ///
1428 /// This method is used to start, and/or poll a [long-running Operation].
1429 /// The [Working with long-running operations] chapter in the [user guide]
1430 /// covers these operations in detail.
1431 ///
1432 /// [long-running operation]: https://google.aip.dev/151
1433 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1434 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1435 ///
1436 /// # Example
1437 /// ```
1438 /// # use google_cloud_netapp_v1::client::NetApp;
1439 /// use google_cloud_lro::Poller;
1440 /// use google_cloud_netapp_v1::Result;
1441 /// async fn sample(
1442 /// client: &NetApp, name: &str
1443 /// ) -> Result<()> {
1444 /// client.delete_backup_vault()
1445 /// .set_name(name)
1446 /// .poller().until_done().await?;
1447 /// Ok(())
1448 /// }
1449 /// ```
1450 pub fn delete_backup_vault(&self) -> super::builder::net_app::DeleteBackupVault {
1451 super::builder::net_app::DeleteBackupVault::new(self.inner.clone())
1452 }
1453
1454 /// Creates a backup from the volume specified in the request
1455 /// The backup can be created from the given snapshot if specified in the
1456 /// request. If no snapshot specified, there'll be a new snapshot taken to
1457 /// initiate the backup creation.
1458 ///
1459 /// # Long running operations
1460 ///
1461 /// This method is used to start, and/or poll a [long-running Operation].
1462 /// The [Working with long-running operations] chapter in the [user guide]
1463 /// covers these operations in detail.
1464 ///
1465 /// [long-running operation]: https://google.aip.dev/151
1466 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1467 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1468 ///
1469 /// # Example
1470 /// ```
1471 /// # use google_cloud_netapp_v1::client::NetApp;
1472 /// use google_cloud_lro::Poller;
1473 /// use google_cloud_netapp_v1::model::Backup;
1474 /// use google_cloud_netapp_v1::Result;
1475 /// async fn sample(
1476 /// client: &NetApp, parent: &str
1477 /// ) -> Result<()> {
1478 /// let response = client.create_backup()
1479 /// .set_parent(parent)
1480 /// .set_backup_id("backup_id_value")
1481 /// .set_backup(
1482 /// Backup::new()/* set fields */
1483 /// )
1484 /// .poller().until_done().await?;
1485 /// println!("response {:?}", response);
1486 /// Ok(())
1487 /// }
1488 /// ```
1489 pub fn create_backup(&self) -> super::builder::net_app::CreateBackup {
1490 super::builder::net_app::CreateBackup::new(self.inner.clone())
1491 }
1492
1493 /// Returns the description of the specified backup
1494 ///
1495 /// # Example
1496 /// ```
1497 /// # use google_cloud_netapp_v1::client::NetApp;
1498 /// use google_cloud_netapp_v1::Result;
1499 /// async fn sample(
1500 /// client: &NetApp, name: &str
1501 /// ) -> Result<()> {
1502 /// let response = client.get_backup()
1503 /// .set_name(name)
1504 /// .send().await?;
1505 /// println!("response {:?}", response);
1506 /// Ok(())
1507 /// }
1508 /// ```
1509 pub fn get_backup(&self) -> super::builder::net_app::GetBackup {
1510 super::builder::net_app::GetBackup::new(self.inner.clone())
1511 }
1512
1513 /// Returns descriptions of all backups for a backupVault.
1514 ///
1515 /// # Example
1516 /// ```
1517 /// # use google_cloud_netapp_v1::client::NetApp;
1518 /// use google_cloud_gax::paginator::ItemPaginator as _;
1519 /// use google_cloud_netapp_v1::Result;
1520 /// async fn sample(
1521 /// client: &NetApp, parent: &str
1522 /// ) -> Result<()> {
1523 /// let mut list = client.list_backups()
1524 /// .set_parent(parent)
1525 /// .by_item();
1526 /// while let Some(item) = list.next().await.transpose()? {
1527 /// println!("{:?}", item);
1528 /// }
1529 /// Ok(())
1530 /// }
1531 /// ```
1532 pub fn list_backups(&self) -> super::builder::net_app::ListBackups {
1533 super::builder::net_app::ListBackups::new(self.inner.clone())
1534 }
1535
1536 /// Warning! This operation will permanently delete the backup.
1537 ///
1538 /// # Long running operations
1539 ///
1540 /// This method is used to start, and/or poll a [long-running Operation].
1541 /// The [Working with long-running operations] chapter in the [user guide]
1542 /// covers these operations in detail.
1543 ///
1544 /// [long-running operation]: https://google.aip.dev/151
1545 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1546 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1547 ///
1548 /// # Example
1549 /// ```
1550 /// # use google_cloud_netapp_v1::client::NetApp;
1551 /// use google_cloud_lro::Poller;
1552 /// use google_cloud_netapp_v1::Result;
1553 /// async fn sample(
1554 /// client: &NetApp, name: &str
1555 /// ) -> Result<()> {
1556 /// client.delete_backup()
1557 /// .set_name(name)
1558 /// .poller().until_done().await?;
1559 /// Ok(())
1560 /// }
1561 /// ```
1562 pub fn delete_backup(&self) -> super::builder::net_app::DeleteBackup {
1563 super::builder::net_app::DeleteBackup::new(self.inner.clone())
1564 }
1565
1566 /// Update backup with full spec.
1567 ///
1568 /// # Long running operations
1569 ///
1570 /// This method is used to start, and/or poll a [long-running Operation].
1571 /// The [Working with long-running operations] chapter in the [user guide]
1572 /// covers these operations in detail.
1573 ///
1574 /// [long-running operation]: https://google.aip.dev/151
1575 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1576 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1577 ///
1578 /// # Example
1579 /// ```
1580 /// # use google_cloud_netapp_v1::client::NetApp;
1581 /// use google_cloud_lro::Poller;
1582 /// # extern crate wkt as google_cloud_wkt;
1583 /// use google_cloud_wkt::FieldMask;
1584 /// use google_cloud_netapp_v1::model::Backup;
1585 /// use google_cloud_netapp_v1::Result;
1586 /// async fn sample(
1587 /// client: &NetApp, name: &str
1588 /// ) -> Result<()> {
1589 /// let response = client.update_backup()
1590 /// .set_backup(
1591 /// Backup::new().set_name(name)/* set fields */
1592 /// )
1593 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1594 /// .poller().until_done().await?;
1595 /// println!("response {:?}", response);
1596 /// Ok(())
1597 /// }
1598 /// ```
1599 pub fn update_backup(&self) -> super::builder::net_app::UpdateBackup {
1600 super::builder::net_app::UpdateBackup::new(self.inner.clone())
1601 }
1602
1603 /// Creates new backup policy
1604 ///
1605 /// # Long running operations
1606 ///
1607 /// This method is used to start, and/or poll a [long-running Operation].
1608 /// The [Working with long-running operations] chapter in the [user guide]
1609 /// covers these operations in detail.
1610 ///
1611 /// [long-running operation]: https://google.aip.dev/151
1612 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1613 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1614 ///
1615 /// # Example
1616 /// ```
1617 /// # use google_cloud_netapp_v1::client::NetApp;
1618 /// use google_cloud_lro::Poller;
1619 /// use google_cloud_netapp_v1::model::BackupPolicy;
1620 /// use google_cloud_netapp_v1::Result;
1621 /// async fn sample(
1622 /// client: &NetApp, parent: &str
1623 /// ) -> Result<()> {
1624 /// let response = client.create_backup_policy()
1625 /// .set_parent(parent)
1626 /// .set_backup_policy(
1627 /// BackupPolicy::new()/* set fields */
1628 /// )
1629 /// .poller().until_done().await?;
1630 /// println!("response {:?}", response);
1631 /// Ok(())
1632 /// }
1633 /// ```
1634 pub fn create_backup_policy(&self) -> super::builder::net_app::CreateBackupPolicy {
1635 super::builder::net_app::CreateBackupPolicy::new(self.inner.clone())
1636 }
1637
1638 /// Returns the description of the specified backup policy by backup_policy_id.
1639 ///
1640 /// # Example
1641 /// ```
1642 /// # use google_cloud_netapp_v1::client::NetApp;
1643 /// use google_cloud_netapp_v1::Result;
1644 /// async fn sample(
1645 /// client: &NetApp, name: &str
1646 /// ) -> Result<()> {
1647 /// let response = client.get_backup_policy()
1648 /// .set_name(name)
1649 /// .send().await?;
1650 /// println!("response {:?}", response);
1651 /// Ok(())
1652 /// }
1653 /// ```
1654 pub fn get_backup_policy(&self) -> super::builder::net_app::GetBackupPolicy {
1655 super::builder::net_app::GetBackupPolicy::new(self.inner.clone())
1656 }
1657
1658 /// Returns list of all available backup policies.
1659 ///
1660 /// # Example
1661 /// ```
1662 /// # use google_cloud_netapp_v1::client::NetApp;
1663 /// use google_cloud_gax::paginator::ItemPaginator as _;
1664 /// use google_cloud_netapp_v1::Result;
1665 /// async fn sample(
1666 /// client: &NetApp, parent: &str
1667 /// ) -> Result<()> {
1668 /// let mut list = client.list_backup_policies()
1669 /// .set_parent(parent)
1670 /// .by_item();
1671 /// while let Some(item) = list.next().await.transpose()? {
1672 /// println!("{:?}", item);
1673 /// }
1674 /// Ok(())
1675 /// }
1676 /// ```
1677 pub fn list_backup_policies(&self) -> super::builder::net_app::ListBackupPolicies {
1678 super::builder::net_app::ListBackupPolicies::new(self.inner.clone())
1679 }
1680
1681 /// Updates settings of a specific backup policy.
1682 ///
1683 /// # Long running operations
1684 ///
1685 /// This method is used to start, and/or poll a [long-running Operation].
1686 /// The [Working with long-running operations] chapter in the [user guide]
1687 /// covers these operations in detail.
1688 ///
1689 /// [long-running operation]: https://google.aip.dev/151
1690 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1691 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1692 ///
1693 /// # Example
1694 /// ```
1695 /// # use google_cloud_netapp_v1::client::NetApp;
1696 /// use google_cloud_lro::Poller;
1697 /// # extern crate wkt as google_cloud_wkt;
1698 /// use google_cloud_wkt::FieldMask;
1699 /// use google_cloud_netapp_v1::model::BackupPolicy;
1700 /// use google_cloud_netapp_v1::Result;
1701 /// async fn sample(
1702 /// client: &NetApp, name: &str
1703 /// ) -> Result<()> {
1704 /// let response = client.update_backup_policy()
1705 /// .set_backup_policy(
1706 /// BackupPolicy::new().set_name(name)/* set fields */
1707 /// )
1708 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1709 /// .poller().until_done().await?;
1710 /// println!("response {:?}", response);
1711 /// Ok(())
1712 /// }
1713 /// ```
1714 pub fn update_backup_policy(&self) -> super::builder::net_app::UpdateBackupPolicy {
1715 super::builder::net_app::UpdateBackupPolicy::new(self.inner.clone())
1716 }
1717
1718 /// Warning! This operation will permanently delete the backup policy.
1719 ///
1720 /// # Long running operations
1721 ///
1722 /// This method is used to start, and/or poll a [long-running Operation].
1723 /// The [Working with long-running operations] chapter in the [user guide]
1724 /// covers these operations in detail.
1725 ///
1726 /// [long-running operation]: https://google.aip.dev/151
1727 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1728 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1729 ///
1730 /// # Example
1731 /// ```
1732 /// # use google_cloud_netapp_v1::client::NetApp;
1733 /// use google_cloud_lro::Poller;
1734 /// use google_cloud_netapp_v1::Result;
1735 /// async fn sample(
1736 /// client: &NetApp, name: &str
1737 /// ) -> Result<()> {
1738 /// client.delete_backup_policy()
1739 /// .set_name(name)
1740 /// .poller().until_done().await?;
1741 /// Ok(())
1742 /// }
1743 /// ```
1744 pub fn delete_backup_policy(&self) -> super::builder::net_app::DeleteBackupPolicy {
1745 super::builder::net_app::DeleteBackupPolicy::new(self.inner.clone())
1746 }
1747
1748 /// Returns list of all quota rules in a location.
1749 ///
1750 /// # Example
1751 /// ```
1752 /// # use google_cloud_netapp_v1::client::NetApp;
1753 /// use google_cloud_gax::paginator::ItemPaginator as _;
1754 /// use google_cloud_netapp_v1::Result;
1755 /// async fn sample(
1756 /// client: &NetApp, parent: &str
1757 /// ) -> Result<()> {
1758 /// let mut list = client.list_quota_rules()
1759 /// .set_parent(parent)
1760 /// .by_item();
1761 /// while let Some(item) = list.next().await.transpose()? {
1762 /// println!("{:?}", item);
1763 /// }
1764 /// Ok(())
1765 /// }
1766 /// ```
1767 pub fn list_quota_rules(&self) -> super::builder::net_app::ListQuotaRules {
1768 super::builder::net_app::ListQuotaRules::new(self.inner.clone())
1769 }
1770
1771 /// Returns details of the specified quota rule.
1772 ///
1773 /// # Example
1774 /// ```
1775 /// # use google_cloud_netapp_v1::client::NetApp;
1776 /// use google_cloud_netapp_v1::Result;
1777 /// async fn sample(
1778 /// client: &NetApp, name: &str
1779 /// ) -> Result<()> {
1780 /// let response = client.get_quota_rule()
1781 /// .set_name(name)
1782 /// .send().await?;
1783 /// println!("response {:?}", response);
1784 /// Ok(())
1785 /// }
1786 /// ```
1787 pub fn get_quota_rule(&self) -> super::builder::net_app::GetQuotaRule {
1788 super::builder::net_app::GetQuotaRule::new(self.inner.clone())
1789 }
1790
1791 /// Creates a new quota rule.
1792 ///
1793 /// # Long running operations
1794 ///
1795 /// This method is used to start, and/or poll a [long-running Operation].
1796 /// The [Working with long-running operations] chapter in the [user guide]
1797 /// covers these operations in detail.
1798 ///
1799 /// [long-running operation]: https://google.aip.dev/151
1800 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1801 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1802 ///
1803 /// # Example
1804 /// ```
1805 /// # use google_cloud_netapp_v1::client::NetApp;
1806 /// use google_cloud_lro::Poller;
1807 /// use google_cloud_netapp_v1::model::QuotaRule;
1808 /// use google_cloud_netapp_v1::Result;
1809 /// async fn sample(
1810 /// client: &NetApp, parent: &str
1811 /// ) -> Result<()> {
1812 /// let response = client.create_quota_rule()
1813 /// .set_parent(parent)
1814 /// .set_quota_rule(
1815 /// QuotaRule::new()/* set fields */
1816 /// )
1817 /// .poller().until_done().await?;
1818 /// println!("response {:?}", response);
1819 /// Ok(())
1820 /// }
1821 /// ```
1822 pub fn create_quota_rule(&self) -> super::builder::net_app::CreateQuotaRule {
1823 super::builder::net_app::CreateQuotaRule::new(self.inner.clone())
1824 }
1825
1826 /// Updates a 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 /// # extern crate wkt as google_cloud_wkt;
1843 /// use google_cloud_wkt::FieldMask;
1844 /// use google_cloud_netapp_v1::model::QuotaRule;
1845 /// use google_cloud_netapp_v1::Result;
1846 /// async fn sample(
1847 /// client: &NetApp, name: &str
1848 /// ) -> Result<()> {
1849 /// let response = client.update_quota_rule()
1850 /// .set_quota_rule(
1851 /// QuotaRule::new().set_name(name)/* set fields */
1852 /// )
1853 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1854 /// .poller().until_done().await?;
1855 /// println!("response {:?}", response);
1856 /// Ok(())
1857 /// }
1858 /// ```
1859 pub fn update_quota_rule(&self) -> super::builder::net_app::UpdateQuotaRule {
1860 super::builder::net_app::UpdateQuotaRule::new(self.inner.clone())
1861 }
1862
1863 /// Deletes a quota rule.
1864 ///
1865 /// # Long running operations
1866 ///
1867 /// This method is used to start, and/or poll a [long-running Operation].
1868 /// The [Working with long-running operations] chapter in the [user guide]
1869 /// covers these operations in detail.
1870 ///
1871 /// [long-running operation]: https://google.aip.dev/151
1872 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1873 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1874 ///
1875 /// # Example
1876 /// ```
1877 /// # use google_cloud_netapp_v1::client::NetApp;
1878 /// use google_cloud_lro::Poller;
1879 /// use google_cloud_netapp_v1::Result;
1880 /// async fn sample(
1881 /// client: &NetApp, name: &str
1882 /// ) -> Result<()> {
1883 /// client.delete_quota_rule()
1884 /// .set_name(name)
1885 /// .poller().until_done().await?;
1886 /// Ok(())
1887 /// }
1888 /// ```
1889 pub fn delete_quota_rule(&self) -> super::builder::net_app::DeleteQuotaRule {
1890 super::builder::net_app::DeleteQuotaRule::new(self.inner.clone())
1891 }
1892
1893 /// Restore files from a backup to a volume.
1894 ///
1895 /// # Long running operations
1896 ///
1897 /// This method is used to start, and/or poll a [long-running Operation].
1898 /// The [Working with long-running operations] chapter in the [user guide]
1899 /// covers these operations in detail.
1900 ///
1901 /// [long-running operation]: https://google.aip.dev/151
1902 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1903 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1904 ///
1905 /// # Example
1906 /// ```
1907 /// # use google_cloud_netapp_v1::client::NetApp;
1908 /// use google_cloud_lro::Poller;
1909 /// use google_cloud_netapp_v1::Result;
1910 /// async fn sample(
1911 /// client: &NetApp
1912 /// ) -> Result<()> {
1913 /// let response = client.restore_backup_files()
1914 /// /* set fields */
1915 /// .poller().until_done().await?;
1916 /// println!("response {:?}", response);
1917 /// Ok(())
1918 /// }
1919 /// ```
1920 pub fn restore_backup_files(&self) -> super::builder::net_app::RestoreBackupFiles {
1921 super::builder::net_app::RestoreBackupFiles::new(self.inner.clone())
1922 }
1923
1924 /// Returns a list of host groups in a `location`. Use `-` as location to list
1925 /// host groups across all locations.
1926 ///
1927 /// # Example
1928 /// ```
1929 /// # use google_cloud_netapp_v1::client::NetApp;
1930 /// use google_cloud_gax::paginator::ItemPaginator as _;
1931 /// use google_cloud_netapp_v1::Result;
1932 /// async fn sample(
1933 /// client: &NetApp, parent: &str
1934 /// ) -> Result<()> {
1935 /// let mut list = client.list_host_groups()
1936 /// .set_parent(parent)
1937 /// .by_item();
1938 /// while let Some(item) = list.next().await.transpose()? {
1939 /// println!("{:?}", item);
1940 /// }
1941 /// Ok(())
1942 /// }
1943 /// ```
1944 pub fn list_host_groups(&self) -> super::builder::net_app::ListHostGroups {
1945 super::builder::net_app::ListHostGroups::new(self.inner.clone())
1946 }
1947
1948 /// Returns details of the specified host group.
1949 ///
1950 /// # Example
1951 /// ```
1952 /// # use google_cloud_netapp_v1::client::NetApp;
1953 /// use google_cloud_netapp_v1::Result;
1954 /// async fn sample(
1955 /// client: &NetApp, name: &str
1956 /// ) -> Result<()> {
1957 /// let response = client.get_host_group()
1958 /// .set_name(name)
1959 /// .send().await?;
1960 /// println!("response {:?}", response);
1961 /// Ok(())
1962 /// }
1963 /// ```
1964 pub fn get_host_group(&self) -> super::builder::net_app::GetHostGroup {
1965 super::builder::net_app::GetHostGroup::new(self.inner.clone())
1966 }
1967
1968 /// Creates a new host group.
1969 ///
1970 /// # Long running operations
1971 ///
1972 /// This method is used to start, and/or poll a [long-running Operation].
1973 /// The [Working with long-running operations] chapter in the [user guide]
1974 /// covers these operations in detail.
1975 ///
1976 /// [long-running operation]: https://google.aip.dev/151
1977 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1978 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1979 ///
1980 /// # Example
1981 /// ```
1982 /// # use google_cloud_netapp_v1::client::NetApp;
1983 /// use google_cloud_lro::Poller;
1984 /// use google_cloud_netapp_v1::model::HostGroup;
1985 /// use google_cloud_netapp_v1::Result;
1986 /// async fn sample(
1987 /// client: &NetApp, parent: &str
1988 /// ) -> Result<()> {
1989 /// let response = client.create_host_group()
1990 /// .set_parent(parent)
1991 /// .set_host_group(
1992 /// HostGroup::new()/* set fields */
1993 /// )
1994 /// .poller().until_done().await?;
1995 /// println!("response {:?}", response);
1996 /// Ok(())
1997 /// }
1998 /// ```
1999 pub fn create_host_group(&self) -> super::builder::net_app::CreateHostGroup {
2000 super::builder::net_app::CreateHostGroup::new(self.inner.clone())
2001 }
2002
2003 /// Updates an existing 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 /// # extern crate wkt as google_cloud_wkt;
2020 /// use google_cloud_wkt::FieldMask;
2021 /// use google_cloud_netapp_v1::model::HostGroup;
2022 /// use google_cloud_netapp_v1::Result;
2023 /// async fn sample(
2024 /// client: &NetApp, name: &str
2025 /// ) -> Result<()> {
2026 /// let response = client.update_host_group()
2027 /// .set_host_group(
2028 /// HostGroup::new().set_name(name)/* set fields */
2029 /// )
2030 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
2031 /// .poller().until_done().await?;
2032 /// println!("response {:?}", response);
2033 /// Ok(())
2034 /// }
2035 /// ```
2036 pub fn update_host_group(&self) -> super::builder::net_app::UpdateHostGroup {
2037 super::builder::net_app::UpdateHostGroup::new(self.inner.clone())
2038 }
2039
2040 /// Deletes a host group.
2041 ///
2042 /// # Long running operations
2043 ///
2044 /// This method is used to start, and/or poll a [long-running Operation].
2045 /// The [Working with long-running operations] chapter in the [user guide]
2046 /// covers these operations in detail.
2047 ///
2048 /// [long-running operation]: https://google.aip.dev/151
2049 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2050 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2051 ///
2052 /// # Example
2053 /// ```
2054 /// # use google_cloud_netapp_v1::client::NetApp;
2055 /// use google_cloud_lro::Poller;
2056 /// use google_cloud_netapp_v1::Result;
2057 /// async fn sample(
2058 /// client: &NetApp, name: &str
2059 /// ) -> Result<()> {
2060 /// client.delete_host_group()
2061 /// .set_name(name)
2062 /// .poller().until_done().await?;
2063 /// Ok(())
2064 /// }
2065 /// ```
2066 pub fn delete_host_group(&self) -> super::builder::net_app::DeleteHostGroup {
2067 super::builder::net_app::DeleteHostGroup::new(self.inner.clone())
2068 }
2069
2070 /// Lists information about the supported locations for this service.
2071 ///
2072 /// # Example
2073 /// ```
2074 /// # use google_cloud_netapp_v1::client::NetApp;
2075 /// use google_cloud_gax::paginator::ItemPaginator as _;
2076 /// use google_cloud_netapp_v1::Result;
2077 /// async fn sample(
2078 /// client: &NetApp
2079 /// ) -> Result<()> {
2080 /// let mut list = client.list_locations()
2081 /// /* set fields */
2082 /// .by_item();
2083 /// while let Some(item) = list.next().await.transpose()? {
2084 /// println!("{:?}", item);
2085 /// }
2086 /// Ok(())
2087 /// }
2088 /// ```
2089 pub fn list_locations(&self) -> super::builder::net_app::ListLocations {
2090 super::builder::net_app::ListLocations::new(self.inner.clone())
2091 }
2092
2093 /// Gets information about a location.
2094 ///
2095 /// # Example
2096 /// ```
2097 /// # use google_cloud_netapp_v1::client::NetApp;
2098 /// use google_cloud_netapp_v1::Result;
2099 /// async fn sample(
2100 /// client: &NetApp
2101 /// ) -> Result<()> {
2102 /// let response = client.get_location()
2103 /// /* set fields */
2104 /// .send().await?;
2105 /// println!("response {:?}", response);
2106 /// Ok(())
2107 /// }
2108 /// ```
2109 pub fn get_location(&self) -> super::builder::net_app::GetLocation {
2110 super::builder::net_app::GetLocation::new(self.inner.clone())
2111 }
2112
2113 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2114 ///
2115 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2116 ///
2117 /// # Example
2118 /// ```
2119 /// # use google_cloud_netapp_v1::client::NetApp;
2120 /// use google_cloud_gax::paginator::ItemPaginator as _;
2121 /// use google_cloud_netapp_v1::Result;
2122 /// async fn sample(
2123 /// client: &NetApp
2124 /// ) -> Result<()> {
2125 /// let mut list = client.list_operations()
2126 /// /* set fields */
2127 /// .by_item();
2128 /// while let Some(item) = list.next().await.transpose()? {
2129 /// println!("{:?}", item);
2130 /// }
2131 /// Ok(())
2132 /// }
2133 /// ```
2134 pub fn list_operations(&self) -> super::builder::net_app::ListOperations {
2135 super::builder::net_app::ListOperations::new(self.inner.clone())
2136 }
2137
2138 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2139 ///
2140 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2141 ///
2142 /// # Example
2143 /// ```
2144 /// # use google_cloud_netapp_v1::client::NetApp;
2145 /// use google_cloud_netapp_v1::Result;
2146 /// async fn sample(
2147 /// client: &NetApp
2148 /// ) -> Result<()> {
2149 /// let response = client.get_operation()
2150 /// /* set fields */
2151 /// .send().await?;
2152 /// println!("response {:?}", response);
2153 /// Ok(())
2154 /// }
2155 /// ```
2156 pub fn get_operation(&self) -> super::builder::net_app::GetOperation {
2157 super::builder::net_app::GetOperation::new(self.inner.clone())
2158 }
2159
2160 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2161 ///
2162 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2163 ///
2164 /// # Example
2165 /// ```
2166 /// # use google_cloud_netapp_v1::client::NetApp;
2167 /// use google_cloud_netapp_v1::Result;
2168 /// async fn sample(
2169 /// client: &NetApp
2170 /// ) -> Result<()> {
2171 /// client.delete_operation()
2172 /// /* set fields */
2173 /// .send().await?;
2174 /// Ok(())
2175 /// }
2176 /// ```
2177 pub fn delete_operation(&self) -> super::builder::net_app::DeleteOperation {
2178 super::builder::net_app::DeleteOperation::new(self.inner.clone())
2179 }
2180
2181 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2182 ///
2183 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2184 ///
2185 /// # Example
2186 /// ```
2187 /// # use google_cloud_netapp_v1::client::NetApp;
2188 /// use google_cloud_netapp_v1::Result;
2189 /// async fn sample(
2190 /// client: &NetApp
2191 /// ) -> Result<()> {
2192 /// client.cancel_operation()
2193 /// /* set fields */
2194 /// .send().await?;
2195 /// Ok(())
2196 /// }
2197 /// ```
2198 pub fn cancel_operation(&self) -> super::builder::net_app::CancelOperation {
2199 super::builder::net_app::CancelOperation::new(self.inner.clone())
2200 }
2201}