google_cloud_baremetalsolution_v2/client.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::bare_urls)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::invalid_html_tags)]
19#![allow(rustdoc::redundant_explicit_links)]
20
21/// Implements a client for the Bare Metal Solution API.
22///
23/// # Example
24/// ```
25/// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
26/// use google_cloud_gax::paginator::ItemPaginator as _;
27/// async fn sample(
28/// parent: &str,
29/// ) -> anyhow::Result<()> {
30/// let client = BareMetalSolution::builder().build().await?;
31/// let mut list = client.list_instances()
32/// .set_parent(parent)
33/// .by_item();
34/// while let Some(item) = list.next().await.transpose()? {
35/// println!("{:?}", item);
36/// }
37/// Ok(())
38/// }
39/// ```
40///
41/// # Service Description
42///
43/// Performs management operations on Bare Metal Solution servers.
44///
45/// The `baremetalsolution.googleapis.com` service provides management
46/// capabilities for Bare Metal Solution servers. To access the API methods, you
47/// must assign Bare Metal Solution IAM roles containing the desired permissions
48/// to your staff in your Google Cloud project. You must also enable the Bare
49/// Metal Solution API. Once enabled, the methods act
50/// upon specific servers in your Bare Metal Solution environment.
51///
52/// # Configuration
53///
54/// To configure `BareMetalSolution` use the `with_*` methods in the type returned
55/// by [builder()][BareMetalSolution::builder]. The default configuration should
56/// work for most applications. Common configuration changes include
57///
58/// * [with_endpoint()]: by default this client uses the global default endpoint
59/// (`https://baremetalsolution.googleapis.com`). Applications using regional
60/// endpoints or running in restricted networks (e.g. a network configured
61/// with [Private Google Access with VPC Service Controls]) may want to
62/// override this default.
63/// * [with_credentials()]: by default this client uses
64/// [Application Default Credentials]. Applications using custom
65/// authentication may need to override this default.
66///
67/// [with_endpoint()]: super::builder::bare_metal_solution::ClientBuilder::with_endpoint
68/// [with_credentials()]: super::builder::bare_metal_solution::ClientBuilder::with_credentials
69/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
70/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
71///
72/// # Pooling and Cloning
73///
74/// `BareMetalSolution` holds a connection pool internally, it is advised to
75/// create one and reuse it. You do not need to wrap `BareMetalSolution` in
76/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
77/// already uses an `Arc` internally.
78#[derive(Clone, Debug)]
79pub struct BareMetalSolution {
80 inner: std::sync::Arc<dyn super::stub::dynamic::BareMetalSolution>,
81}
82
83impl BareMetalSolution {
84 /// Returns a builder for [BareMetalSolution].
85 ///
86 /// ```
87 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
88 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
89 /// let client = BareMetalSolution::builder().build().await?;
90 /// # Ok(()) }
91 /// ```
92 pub fn builder() -> super::builder::bare_metal_solution::ClientBuilder {
93 crate::new_client_builder(super::builder::bare_metal_solution::client::Factory)
94 }
95
96 /// Creates a new client from the provided stub.
97 ///
98 /// The most common case for calling this function is in tests mocking the
99 /// client's behavior.
100 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
101 where
102 T: super::stub::BareMetalSolution + 'static,
103 {
104 Self { inner: stub.into() }
105 }
106
107 pub(crate) async fn new(
108 config: gaxi::options::ClientConfig,
109 ) -> crate::ClientBuilderResult<Self> {
110 let inner = Self::build_inner(config).await?;
111 Ok(Self { inner })
112 }
113
114 async fn build_inner(
115 conf: gaxi::options::ClientConfig,
116 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BareMetalSolution>>
117 {
118 if gaxi::options::tracing_enabled(&conf) {
119 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
120 }
121 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
122 }
123
124 async fn build_transport(
125 conf: gaxi::options::ClientConfig,
126 ) -> crate::ClientBuilderResult<impl super::stub::BareMetalSolution> {
127 super::transport::BareMetalSolution::new(conf).await
128 }
129
130 async fn build_with_tracing(
131 conf: gaxi::options::ClientConfig,
132 ) -> crate::ClientBuilderResult<impl super::stub::BareMetalSolution> {
133 Self::build_transport(conf)
134 .await
135 .map(super::tracing::BareMetalSolution::new)
136 }
137
138 /// List servers in a given project and location.
139 ///
140 /// # Example
141 /// ```
142 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
143 /// use google_cloud_gax::paginator::ItemPaginator as _;
144 /// use google_cloud_baremetalsolution_v2::Result;
145 /// async fn sample(
146 /// client: &BareMetalSolution, parent: &str
147 /// ) -> Result<()> {
148 /// let mut list = client.list_instances()
149 /// .set_parent(parent)
150 /// .by_item();
151 /// while let Some(item) = list.next().await.transpose()? {
152 /// println!("{:?}", item);
153 /// }
154 /// Ok(())
155 /// }
156 /// ```
157 pub fn list_instances(&self) -> super::builder::bare_metal_solution::ListInstances {
158 super::builder::bare_metal_solution::ListInstances::new(self.inner.clone())
159 }
160
161 /// Get details about a single server.
162 ///
163 /// # Example
164 /// ```
165 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
166 /// use google_cloud_baremetalsolution_v2::Result;
167 /// async fn sample(
168 /// client: &BareMetalSolution, project_id: &str, location_id: &str, instance_id: &str
169 /// ) -> Result<()> {
170 /// let response = client.get_instance()
171 /// .set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"))
172 /// .send().await?;
173 /// println!("response {:?}", response);
174 /// Ok(())
175 /// }
176 /// ```
177 pub fn get_instance(&self) -> super::builder::bare_metal_solution::GetInstance {
178 super::builder::bare_metal_solution::GetInstance::new(self.inner.clone())
179 }
180
181 /// Update details of a single server.
182 ///
183 /// # Long running operations
184 ///
185 /// This method is used to start, and/or poll a [long-running Operation].
186 /// The [Working with long-running operations] chapter in the [user guide]
187 /// covers these operations in detail.
188 ///
189 /// [long-running operation]: https://google.aip.dev/151
190 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
191 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
192 ///
193 /// # Example
194 /// ```
195 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
196 /// use google_cloud_lro::Poller;
197 /// # extern crate wkt as google_cloud_wkt;
198 /// use google_cloud_wkt::FieldMask;
199 /// use google_cloud_baremetalsolution_v2::model::Instance;
200 /// use google_cloud_baremetalsolution_v2::Result;
201 /// async fn sample(
202 /// client: &BareMetalSolution, project_id: &str, location_id: &str, instance_id: &str
203 /// ) -> Result<()> {
204 /// let response = client.update_instance()
205 /// .set_instance(
206 /// Instance::new().set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"))/* set fields */
207 /// )
208 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
209 /// .poller().until_done().await?;
210 /// println!("response {:?}", response);
211 /// Ok(())
212 /// }
213 /// ```
214 pub fn update_instance(&self) -> super::builder::bare_metal_solution::UpdateInstance {
215 super::builder::bare_metal_solution::UpdateInstance::new(self.inner.clone())
216 }
217
218 /// RenameInstance sets a new name for an instance.
219 /// Use with caution, previous names become immediately invalidated.
220 ///
221 /// # Example
222 /// ```
223 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
224 /// use google_cloud_baremetalsolution_v2::Result;
225 /// async fn sample(
226 /// client: &BareMetalSolution
227 /// ) -> Result<()> {
228 /// let response = client.rename_instance()
229 /// /* set fields */
230 /// .send().await?;
231 /// println!("response {:?}", response);
232 /// Ok(())
233 /// }
234 /// ```
235 pub fn rename_instance(&self) -> super::builder::bare_metal_solution::RenameInstance {
236 super::builder::bare_metal_solution::RenameInstance::new(self.inner.clone())
237 }
238
239 /// Perform an ungraceful, hard reset on a server. Equivalent to shutting the
240 /// power off and then turning it back on.
241 ///
242 /// # Long running operations
243 ///
244 /// This method is used to start, and/or poll a [long-running Operation].
245 /// The [Working with long-running operations] chapter in the [user guide]
246 /// covers these operations in detail.
247 ///
248 /// [long-running operation]: https://google.aip.dev/151
249 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
250 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
251 ///
252 /// # Example
253 /// ```
254 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
255 /// use google_cloud_lro::Poller;
256 /// use google_cloud_baremetalsolution_v2::Result;
257 /// async fn sample(
258 /// client: &BareMetalSolution
259 /// ) -> Result<()> {
260 /// let response = client.reset_instance()
261 /// /* set fields */
262 /// .poller().until_done().await?;
263 /// println!("response {:?}", response);
264 /// Ok(())
265 /// }
266 /// ```
267 pub fn reset_instance(&self) -> super::builder::bare_metal_solution::ResetInstance {
268 super::builder::bare_metal_solution::ResetInstance::new(self.inner.clone())
269 }
270
271 /// Starts a server that was shutdown.
272 ///
273 /// # Long running operations
274 ///
275 /// This method is used to start, and/or poll a [long-running Operation].
276 /// The [Working with long-running operations] chapter in the [user guide]
277 /// covers these operations in detail.
278 ///
279 /// [long-running operation]: https://google.aip.dev/151
280 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
281 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
282 ///
283 /// # Example
284 /// ```
285 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
286 /// use google_cloud_lro::Poller;
287 /// use google_cloud_baremetalsolution_v2::Result;
288 /// async fn sample(
289 /// client: &BareMetalSolution
290 /// ) -> Result<()> {
291 /// let response = client.start_instance()
292 /// /* set fields */
293 /// .poller().until_done().await?;
294 /// println!("response {:?}", response);
295 /// Ok(())
296 /// }
297 /// ```
298 pub fn start_instance(&self) -> super::builder::bare_metal_solution::StartInstance {
299 super::builder::bare_metal_solution::StartInstance::new(self.inner.clone())
300 }
301
302 /// Stop a running server.
303 ///
304 /// # Long running operations
305 ///
306 /// This method is used to start, and/or poll a [long-running Operation].
307 /// The [Working with long-running operations] chapter in the [user guide]
308 /// covers these operations in detail.
309 ///
310 /// [long-running operation]: https://google.aip.dev/151
311 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
312 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
313 ///
314 /// # Example
315 /// ```
316 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
317 /// use google_cloud_lro::Poller;
318 /// use google_cloud_baremetalsolution_v2::Result;
319 /// async fn sample(
320 /// client: &BareMetalSolution
321 /// ) -> Result<()> {
322 /// let response = client.stop_instance()
323 /// /* set fields */
324 /// .poller().until_done().await?;
325 /// println!("response {:?}", response);
326 /// Ok(())
327 /// }
328 /// ```
329 pub fn stop_instance(&self) -> super::builder::bare_metal_solution::StopInstance {
330 super::builder::bare_metal_solution::StopInstance::new(self.inner.clone())
331 }
332
333 /// Enable the interactive serial console feature on an instance.
334 ///
335 /// # Long running operations
336 ///
337 /// This method is used to start, and/or poll a [long-running Operation].
338 /// The [Working with long-running operations] chapter in the [user guide]
339 /// covers these operations in detail.
340 ///
341 /// [long-running operation]: https://google.aip.dev/151
342 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
343 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
344 ///
345 /// # Example
346 /// ```
347 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
348 /// use google_cloud_lro::Poller;
349 /// use google_cloud_baremetalsolution_v2::Result;
350 /// async fn sample(
351 /// client: &BareMetalSolution
352 /// ) -> Result<()> {
353 /// let response = client.enable_interactive_serial_console()
354 /// /* set fields */
355 /// .poller().until_done().await?;
356 /// println!("response {:?}", response);
357 /// Ok(())
358 /// }
359 /// ```
360 pub fn enable_interactive_serial_console(
361 &self,
362 ) -> super::builder::bare_metal_solution::EnableInteractiveSerialConsole {
363 super::builder::bare_metal_solution::EnableInteractiveSerialConsole::new(self.inner.clone())
364 }
365
366 /// Disable the interactive serial console feature on an instance.
367 ///
368 /// # Long running operations
369 ///
370 /// This method is used to start, and/or poll a [long-running Operation].
371 /// The [Working with long-running operations] chapter in the [user guide]
372 /// covers these operations in detail.
373 ///
374 /// [long-running operation]: https://google.aip.dev/151
375 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
376 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
377 ///
378 /// # Example
379 /// ```
380 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
381 /// use google_cloud_lro::Poller;
382 /// use google_cloud_baremetalsolution_v2::Result;
383 /// async fn sample(
384 /// client: &BareMetalSolution
385 /// ) -> Result<()> {
386 /// let response = client.disable_interactive_serial_console()
387 /// /* set fields */
388 /// .poller().until_done().await?;
389 /// println!("response {:?}", response);
390 /// Ok(())
391 /// }
392 /// ```
393 pub fn disable_interactive_serial_console(
394 &self,
395 ) -> super::builder::bare_metal_solution::DisableInteractiveSerialConsole {
396 super::builder::bare_metal_solution::DisableInteractiveSerialConsole::new(
397 self.inner.clone(),
398 )
399 }
400
401 /// Detach LUN from Instance.
402 ///
403 /// # Long running operations
404 ///
405 /// This method is used to start, and/or poll a [long-running Operation].
406 /// The [Working with long-running operations] chapter in the [user guide]
407 /// covers these operations in detail.
408 ///
409 /// [long-running operation]: https://google.aip.dev/151
410 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
411 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
412 ///
413 /// # Example
414 /// ```
415 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
416 /// use google_cloud_lro::Poller;
417 /// use google_cloud_baremetalsolution_v2::Result;
418 /// async fn sample(
419 /// client: &BareMetalSolution
420 /// ) -> Result<()> {
421 /// let response = client.detach_lun()
422 /// /* set fields */
423 /// .poller().until_done().await?;
424 /// println!("response {:?}", response);
425 /// Ok(())
426 /// }
427 /// ```
428 pub fn detach_lun(&self) -> super::builder::bare_metal_solution::DetachLun {
429 super::builder::bare_metal_solution::DetachLun::new(self.inner.clone())
430 }
431
432 /// Lists the public SSH keys registered for the specified project.
433 /// These SSH keys are used only for the interactive serial console feature.
434 ///
435 /// # Example
436 /// ```
437 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
438 /// use google_cloud_gax::paginator::ItemPaginator as _;
439 /// use google_cloud_baremetalsolution_v2::Result;
440 /// async fn sample(
441 /// client: &BareMetalSolution, parent: &str
442 /// ) -> Result<()> {
443 /// let mut list = client.list_ssh_keys()
444 /// .set_parent(parent)
445 /// .by_item();
446 /// while let Some(item) = list.next().await.transpose()? {
447 /// println!("{:?}", item);
448 /// }
449 /// Ok(())
450 /// }
451 /// ```
452 pub fn list_ssh_keys(&self) -> super::builder::bare_metal_solution::ListSSHKeys {
453 super::builder::bare_metal_solution::ListSSHKeys::new(self.inner.clone())
454 }
455
456 /// Register a public SSH key in the specified project for use with the
457 /// interactive serial console feature.
458 ///
459 /// # Example
460 /// ```
461 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
462 /// use google_cloud_baremetalsolution_v2::model::SSHKey;
463 /// use google_cloud_baremetalsolution_v2::Result;
464 /// async fn sample(
465 /// client: &BareMetalSolution, parent: &str
466 /// ) -> Result<()> {
467 /// let response = client.create_ssh_key()
468 /// .set_parent(parent)
469 /// .set_ssh_key(
470 /// SSHKey::new()/* set fields */
471 /// )
472 /// .send().await?;
473 /// println!("response {:?}", response);
474 /// Ok(())
475 /// }
476 /// ```
477 pub fn create_ssh_key(&self) -> super::builder::bare_metal_solution::CreateSSHKey {
478 super::builder::bare_metal_solution::CreateSSHKey::new(self.inner.clone())
479 }
480
481 /// Deletes a public SSH key registered in the specified project.
482 ///
483 /// # Example
484 /// ```
485 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
486 /// use google_cloud_baremetalsolution_v2::Result;
487 /// async fn sample(
488 /// client: &BareMetalSolution, project_id: &str, location_id: &str, ssh_key_id: &str
489 /// ) -> Result<()> {
490 /// client.delete_ssh_key()
491 /// .set_name(format!("projects/{project_id}/locations/{location_id}/sshKeys/{ssh_key_id}"))
492 /// .send().await?;
493 /// Ok(())
494 /// }
495 /// ```
496 pub fn delete_ssh_key(&self) -> super::builder::bare_metal_solution::DeleteSSHKey {
497 super::builder::bare_metal_solution::DeleteSSHKey::new(self.inner.clone())
498 }
499
500 /// List storage volumes in a given project and location.
501 ///
502 /// # Example
503 /// ```
504 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
505 /// use google_cloud_gax::paginator::ItemPaginator as _;
506 /// use google_cloud_baremetalsolution_v2::Result;
507 /// async fn sample(
508 /// client: &BareMetalSolution, parent: &str
509 /// ) -> Result<()> {
510 /// let mut list = client.list_volumes()
511 /// .set_parent(parent)
512 /// .by_item();
513 /// while let Some(item) = list.next().await.transpose()? {
514 /// println!("{:?}", item);
515 /// }
516 /// Ok(())
517 /// }
518 /// ```
519 pub fn list_volumes(&self) -> super::builder::bare_metal_solution::ListVolumes {
520 super::builder::bare_metal_solution::ListVolumes::new(self.inner.clone())
521 }
522
523 /// Get details of a single storage volume.
524 ///
525 /// # Example
526 /// ```
527 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
528 /// use google_cloud_baremetalsolution_v2::Result;
529 /// async fn sample(
530 /// client: &BareMetalSolution, project_id: &str, location_id: &str, volume_id: &str
531 /// ) -> Result<()> {
532 /// let response = client.get_volume()
533 /// .set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))
534 /// .send().await?;
535 /// println!("response {:?}", response);
536 /// Ok(())
537 /// }
538 /// ```
539 pub fn get_volume(&self) -> super::builder::bare_metal_solution::GetVolume {
540 super::builder::bare_metal_solution::GetVolume::new(self.inner.clone())
541 }
542
543 /// Update details of a single storage volume.
544 ///
545 /// # Long running operations
546 ///
547 /// This method is used to start, and/or poll a [long-running Operation].
548 /// The [Working with long-running operations] chapter in the [user guide]
549 /// covers these operations in detail.
550 ///
551 /// [long-running operation]: https://google.aip.dev/151
552 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
553 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
554 ///
555 /// # Example
556 /// ```
557 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
558 /// use google_cloud_lro::Poller;
559 /// # extern crate wkt as google_cloud_wkt;
560 /// use google_cloud_wkt::FieldMask;
561 /// use google_cloud_baremetalsolution_v2::model::Volume;
562 /// use google_cloud_baremetalsolution_v2::Result;
563 /// async fn sample(
564 /// client: &BareMetalSolution, project_id: &str, location_id: &str, volume_id: &str
565 /// ) -> Result<()> {
566 /// let response = client.update_volume()
567 /// .set_volume(
568 /// Volume::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))/* set fields */
569 /// )
570 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
571 /// .poller().until_done().await?;
572 /// println!("response {:?}", response);
573 /// Ok(())
574 /// }
575 /// ```
576 pub fn update_volume(&self) -> super::builder::bare_metal_solution::UpdateVolume {
577 super::builder::bare_metal_solution::UpdateVolume::new(self.inner.clone())
578 }
579
580 /// RenameVolume sets a new name for a volume.
581 /// Use with caution, previous names become immediately invalidated.
582 ///
583 /// # Example
584 /// ```
585 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
586 /// use google_cloud_baremetalsolution_v2::Result;
587 /// async fn sample(
588 /// client: &BareMetalSolution
589 /// ) -> Result<()> {
590 /// let response = client.rename_volume()
591 /// /* set fields */
592 /// .send().await?;
593 /// println!("response {:?}", response);
594 /// Ok(())
595 /// }
596 /// ```
597 pub fn rename_volume(&self) -> super::builder::bare_metal_solution::RenameVolume {
598 super::builder::bare_metal_solution::RenameVolume::new(self.inner.clone())
599 }
600
601 /// Skips volume's cooloff and deletes it now.
602 /// Volume must be in cooloff state.
603 ///
604 /// # Long running operations
605 ///
606 /// This method is used to start, and/or poll a [long-running Operation].
607 /// The [Working with long-running operations] chapter in the [user guide]
608 /// covers these operations in detail.
609 ///
610 /// [long-running operation]: https://google.aip.dev/151
611 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
612 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
613 ///
614 /// # Example
615 /// ```
616 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
617 /// use google_cloud_lro::Poller;
618 /// use google_cloud_baremetalsolution_v2::Result;
619 /// async fn sample(
620 /// client: &BareMetalSolution
621 /// ) -> Result<()> {
622 /// client.evict_volume()
623 /// /* set fields */
624 /// .poller().until_done().await?;
625 /// Ok(())
626 /// }
627 /// ```
628 pub fn evict_volume(&self) -> super::builder::bare_metal_solution::EvictVolume {
629 super::builder::bare_metal_solution::EvictVolume::new(self.inner.clone())
630 }
631
632 /// Emergency Volume resize.
633 ///
634 /// # Long running operations
635 ///
636 /// This method is used to start, and/or poll a [long-running Operation].
637 /// The [Working with long-running operations] chapter in the [user guide]
638 /// covers these operations in detail.
639 ///
640 /// [long-running operation]: https://google.aip.dev/151
641 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
642 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
643 ///
644 /// # Example
645 /// ```
646 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
647 /// use google_cloud_lro::Poller;
648 /// use google_cloud_baremetalsolution_v2::Result;
649 /// async fn sample(
650 /// client: &BareMetalSolution
651 /// ) -> Result<()> {
652 /// let response = client.resize_volume()
653 /// /* set fields */
654 /// .poller().until_done().await?;
655 /// println!("response {:?}", response);
656 /// Ok(())
657 /// }
658 /// ```
659 pub fn resize_volume(&self) -> super::builder::bare_metal_solution::ResizeVolume {
660 super::builder::bare_metal_solution::ResizeVolume::new(self.inner.clone())
661 }
662
663 /// List network in a given project and location.
664 ///
665 /// # Example
666 /// ```
667 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
668 /// use google_cloud_gax::paginator::ItemPaginator as _;
669 /// use google_cloud_baremetalsolution_v2::Result;
670 /// async fn sample(
671 /// client: &BareMetalSolution, parent: &str
672 /// ) -> Result<()> {
673 /// let mut list = client.list_networks()
674 /// .set_parent(parent)
675 /// .by_item();
676 /// while let Some(item) = list.next().await.transpose()? {
677 /// println!("{:?}", item);
678 /// }
679 /// Ok(())
680 /// }
681 /// ```
682 pub fn list_networks(&self) -> super::builder::bare_metal_solution::ListNetworks {
683 super::builder::bare_metal_solution::ListNetworks::new(self.inner.clone())
684 }
685
686 /// List all Networks (and used IPs for each Network) in the vendor account
687 /// associated with the specified project.
688 ///
689 /// # Example
690 /// ```
691 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
692 /// use google_cloud_baremetalsolution_v2::Result;
693 /// async fn sample(
694 /// client: &BareMetalSolution
695 /// ) -> Result<()> {
696 /// let response = client.list_network_usage()
697 /// /* set fields */
698 /// .send().await?;
699 /// println!("response {:?}", response);
700 /// Ok(())
701 /// }
702 /// ```
703 pub fn list_network_usage(&self) -> super::builder::bare_metal_solution::ListNetworkUsage {
704 super::builder::bare_metal_solution::ListNetworkUsage::new(self.inner.clone())
705 }
706
707 /// Get details of a single network.
708 ///
709 /// # Example
710 /// ```
711 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
712 /// use google_cloud_baremetalsolution_v2::Result;
713 /// async fn sample(
714 /// client: &BareMetalSolution, project_id: &str, location_id: &str, network_id: &str
715 /// ) -> Result<()> {
716 /// let response = client.get_network()
717 /// .set_name(format!("projects/{project_id}/locations/{location_id}/networks/{network_id}"))
718 /// .send().await?;
719 /// println!("response {:?}", response);
720 /// Ok(())
721 /// }
722 /// ```
723 pub fn get_network(&self) -> super::builder::bare_metal_solution::GetNetwork {
724 super::builder::bare_metal_solution::GetNetwork::new(self.inner.clone())
725 }
726
727 /// Update details of a single network.
728 ///
729 /// # Long running operations
730 ///
731 /// This method is used to start, and/or poll a [long-running Operation].
732 /// The [Working with long-running operations] chapter in the [user guide]
733 /// covers these operations in detail.
734 ///
735 /// [long-running operation]: https://google.aip.dev/151
736 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
737 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
738 ///
739 /// # Example
740 /// ```
741 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
742 /// use google_cloud_lro::Poller;
743 /// # extern crate wkt as google_cloud_wkt;
744 /// use google_cloud_wkt::FieldMask;
745 /// use google_cloud_baremetalsolution_v2::model::Network;
746 /// use google_cloud_baremetalsolution_v2::Result;
747 /// async fn sample(
748 /// client: &BareMetalSolution, project_id: &str, location_id: &str, network_id: &str
749 /// ) -> Result<()> {
750 /// let response = client.update_network()
751 /// .set_network(
752 /// Network::new().set_name(format!("projects/{project_id}/locations/{location_id}/networks/{network_id}"))/* set fields */
753 /// )
754 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
755 /// .poller().until_done().await?;
756 /// println!("response {:?}", response);
757 /// Ok(())
758 /// }
759 /// ```
760 pub fn update_network(&self) -> super::builder::bare_metal_solution::UpdateNetwork {
761 super::builder::bare_metal_solution::UpdateNetwork::new(self.inner.clone())
762 }
763
764 /// Takes a snapshot of a boot volume.
765 /// Returns INVALID_ARGUMENT if called for a non-boot volume.
766 ///
767 /// # Example
768 /// ```
769 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
770 /// use google_cloud_baremetalsolution_v2::model::VolumeSnapshot;
771 /// use google_cloud_baremetalsolution_v2::Result;
772 /// async fn sample(
773 /// client: &BareMetalSolution, project_id: &str, location_id: &str, volume_id: &str
774 /// ) -> Result<()> {
775 /// let response = client.create_volume_snapshot()
776 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))
777 /// .set_volume_snapshot(
778 /// VolumeSnapshot::new()/* set fields */
779 /// )
780 /// .send().await?;
781 /// println!("response {:?}", response);
782 /// Ok(())
783 /// }
784 /// ```
785 pub fn create_volume_snapshot(
786 &self,
787 ) -> super::builder::bare_metal_solution::CreateVolumeSnapshot {
788 super::builder::bare_metal_solution::CreateVolumeSnapshot::new(self.inner.clone())
789 }
790
791 /// Uses the specified snapshot to restore its parent volume.
792 /// Returns INVALID_ARGUMENT if called for a non-boot volume.
793 ///
794 /// # Long running operations
795 ///
796 /// This method is used to start, and/or poll a [long-running Operation].
797 /// The [Working with long-running operations] chapter in the [user guide]
798 /// covers these operations in detail.
799 ///
800 /// [long-running operation]: https://google.aip.dev/151
801 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
802 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
803 ///
804 /// # Example
805 /// ```
806 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
807 /// use google_cloud_lro::Poller;
808 /// use google_cloud_baremetalsolution_v2::Result;
809 /// async fn sample(
810 /// client: &BareMetalSolution
811 /// ) -> Result<()> {
812 /// let response = client.restore_volume_snapshot()
813 /// /* set fields */
814 /// .poller().until_done().await?;
815 /// println!("response {:?}", response);
816 /// Ok(())
817 /// }
818 /// ```
819 pub fn restore_volume_snapshot(
820 &self,
821 ) -> super::builder::bare_metal_solution::RestoreVolumeSnapshot {
822 super::builder::bare_metal_solution::RestoreVolumeSnapshot::new(self.inner.clone())
823 }
824
825 /// Deletes a volume snapshot.
826 /// Returns INVALID_ARGUMENT if called for a non-boot volume.
827 ///
828 /// # Example
829 /// ```
830 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
831 /// use google_cloud_baremetalsolution_v2::Result;
832 /// async fn sample(
833 /// client: &BareMetalSolution, project_id: &str, location_id: &str, volume_id: &str, snapshot_id: &str
834 /// ) -> Result<()> {
835 /// client.delete_volume_snapshot()
836 /// .set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"))
837 /// .send().await?;
838 /// Ok(())
839 /// }
840 /// ```
841 pub fn delete_volume_snapshot(
842 &self,
843 ) -> super::builder::bare_metal_solution::DeleteVolumeSnapshot {
844 super::builder::bare_metal_solution::DeleteVolumeSnapshot::new(self.inner.clone())
845 }
846
847 /// Returns the specified snapshot resource.
848 /// Returns INVALID_ARGUMENT if called for a non-boot volume.
849 ///
850 /// # Example
851 /// ```
852 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
853 /// use google_cloud_baremetalsolution_v2::Result;
854 /// async fn sample(
855 /// client: &BareMetalSolution, project_id: &str, location_id: &str, volume_id: &str, snapshot_id: &str
856 /// ) -> Result<()> {
857 /// let response = client.get_volume_snapshot()
858 /// .set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"))
859 /// .send().await?;
860 /// println!("response {:?}", response);
861 /// Ok(())
862 /// }
863 /// ```
864 pub fn get_volume_snapshot(&self) -> super::builder::bare_metal_solution::GetVolumeSnapshot {
865 super::builder::bare_metal_solution::GetVolumeSnapshot::new(self.inner.clone())
866 }
867
868 /// Retrieves the list of snapshots for the specified volume.
869 /// Returns a response with an empty list of snapshots if called
870 /// for a non-boot volume.
871 ///
872 /// # Example
873 /// ```
874 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
875 /// use google_cloud_gax::paginator::ItemPaginator as _;
876 /// use google_cloud_baremetalsolution_v2::Result;
877 /// async fn sample(
878 /// client: &BareMetalSolution, project_id: &str, location_id: &str, volume_id: &str
879 /// ) -> Result<()> {
880 /// let mut list = client.list_volume_snapshots()
881 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))
882 /// .by_item();
883 /// while let Some(item) = list.next().await.transpose()? {
884 /// println!("{:?}", item);
885 /// }
886 /// Ok(())
887 /// }
888 /// ```
889 pub fn list_volume_snapshots(
890 &self,
891 ) -> super::builder::bare_metal_solution::ListVolumeSnapshots {
892 super::builder::bare_metal_solution::ListVolumeSnapshots::new(self.inner.clone())
893 }
894
895 /// Get details of a single storage logical unit number(LUN).
896 ///
897 /// # Example
898 /// ```
899 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
900 /// use google_cloud_baremetalsolution_v2::Result;
901 /// async fn sample(
902 /// client: &BareMetalSolution, project_id: &str, location_id: &str, volume_id: &str, lun_id: &str
903 /// ) -> Result<()> {
904 /// let response = client.get_lun()
905 /// .set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/luns/{lun_id}"))
906 /// .send().await?;
907 /// println!("response {:?}", response);
908 /// Ok(())
909 /// }
910 /// ```
911 pub fn get_lun(&self) -> super::builder::bare_metal_solution::GetLun {
912 super::builder::bare_metal_solution::GetLun::new(self.inner.clone())
913 }
914
915 /// List storage volume luns for given storage volume.
916 ///
917 /// # Example
918 /// ```
919 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
920 /// use google_cloud_gax::paginator::ItemPaginator as _;
921 /// use google_cloud_baremetalsolution_v2::Result;
922 /// async fn sample(
923 /// client: &BareMetalSolution, project_id: &str, location_id: &str, volume_id: &str
924 /// ) -> Result<()> {
925 /// let mut list = client.list_luns()
926 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"))
927 /// .by_item();
928 /// while let Some(item) = list.next().await.transpose()? {
929 /// println!("{:?}", item);
930 /// }
931 /// Ok(())
932 /// }
933 /// ```
934 pub fn list_luns(&self) -> super::builder::bare_metal_solution::ListLuns {
935 super::builder::bare_metal_solution::ListLuns::new(self.inner.clone())
936 }
937
938 /// Skips lun's cooloff and deletes it now.
939 /// Lun must be in cooloff state.
940 ///
941 /// # Long running operations
942 ///
943 /// This method is used to start, and/or poll a [long-running Operation].
944 /// The [Working with long-running operations] chapter in the [user guide]
945 /// covers these operations in detail.
946 ///
947 /// [long-running operation]: https://google.aip.dev/151
948 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
949 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
950 ///
951 /// # Example
952 /// ```
953 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
954 /// use google_cloud_lro::Poller;
955 /// use google_cloud_baremetalsolution_v2::Result;
956 /// async fn sample(
957 /// client: &BareMetalSolution
958 /// ) -> Result<()> {
959 /// client.evict_lun()
960 /// /* set fields */
961 /// .poller().until_done().await?;
962 /// Ok(())
963 /// }
964 /// ```
965 pub fn evict_lun(&self) -> super::builder::bare_metal_solution::EvictLun {
966 super::builder::bare_metal_solution::EvictLun::new(self.inner.clone())
967 }
968
969 /// Get details of a single NFS share.
970 ///
971 /// # Example
972 /// ```
973 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
974 /// use google_cloud_baremetalsolution_v2::Result;
975 /// async fn sample(
976 /// client: &BareMetalSolution, project_id: &str, location_id: &str, nfs_share_id: &str
977 /// ) -> Result<()> {
978 /// let response = client.get_nfs_share()
979 /// .set_name(format!("projects/{project_id}/locations/{location_id}/nfsShares/{nfs_share_id}"))
980 /// .send().await?;
981 /// println!("response {:?}", response);
982 /// Ok(())
983 /// }
984 /// ```
985 pub fn get_nfs_share(&self) -> super::builder::bare_metal_solution::GetNfsShare {
986 super::builder::bare_metal_solution::GetNfsShare::new(self.inner.clone())
987 }
988
989 /// List NFS shares.
990 ///
991 /// # Example
992 /// ```
993 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
994 /// use google_cloud_gax::paginator::ItemPaginator as _;
995 /// use google_cloud_baremetalsolution_v2::Result;
996 /// async fn sample(
997 /// client: &BareMetalSolution, parent: &str
998 /// ) -> Result<()> {
999 /// let mut list = client.list_nfs_shares()
1000 /// .set_parent(parent)
1001 /// .by_item();
1002 /// while let Some(item) = list.next().await.transpose()? {
1003 /// println!("{:?}", item);
1004 /// }
1005 /// Ok(())
1006 /// }
1007 /// ```
1008 pub fn list_nfs_shares(&self) -> super::builder::bare_metal_solution::ListNfsShares {
1009 super::builder::bare_metal_solution::ListNfsShares::new(self.inner.clone())
1010 }
1011
1012 /// Update details of a single NFS share.
1013 ///
1014 /// # Long running operations
1015 ///
1016 /// This method is used to start, and/or poll a [long-running Operation].
1017 /// The [Working with long-running operations] chapter in the [user guide]
1018 /// covers these operations in detail.
1019 ///
1020 /// [long-running operation]: https://google.aip.dev/151
1021 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1022 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1023 ///
1024 /// # Example
1025 /// ```
1026 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1027 /// use google_cloud_lro::Poller;
1028 /// # extern crate wkt as google_cloud_wkt;
1029 /// use google_cloud_wkt::FieldMask;
1030 /// use google_cloud_baremetalsolution_v2::model::NfsShare;
1031 /// use google_cloud_baremetalsolution_v2::Result;
1032 /// async fn sample(
1033 /// client: &BareMetalSolution, project_id: &str, location_id: &str, nfs_share_id: &str
1034 /// ) -> Result<()> {
1035 /// let response = client.update_nfs_share()
1036 /// .set_nfs_share(
1037 /// NfsShare::new().set_name(format!("projects/{project_id}/locations/{location_id}/nfsShares/{nfs_share_id}"))/* set fields */
1038 /// )
1039 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1040 /// .poller().until_done().await?;
1041 /// println!("response {:?}", response);
1042 /// Ok(())
1043 /// }
1044 /// ```
1045 pub fn update_nfs_share(&self) -> super::builder::bare_metal_solution::UpdateNfsShare {
1046 super::builder::bare_metal_solution::UpdateNfsShare::new(self.inner.clone())
1047 }
1048
1049 /// Create an NFS share.
1050 ///
1051 /// # Long running operations
1052 ///
1053 /// This method is used to start, and/or poll a [long-running Operation].
1054 /// The [Working with long-running operations] chapter in the [user guide]
1055 /// covers these operations in detail.
1056 ///
1057 /// [long-running operation]: https://google.aip.dev/151
1058 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1059 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1060 ///
1061 /// # Example
1062 /// ```
1063 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1064 /// use google_cloud_lro::Poller;
1065 /// use google_cloud_baremetalsolution_v2::model::NfsShare;
1066 /// use google_cloud_baremetalsolution_v2::Result;
1067 /// async fn sample(
1068 /// client: &BareMetalSolution, parent: &str
1069 /// ) -> Result<()> {
1070 /// let response = client.create_nfs_share()
1071 /// .set_parent(parent)
1072 /// .set_nfs_share(
1073 /// NfsShare::new()/* set fields */
1074 /// )
1075 /// .poller().until_done().await?;
1076 /// println!("response {:?}", response);
1077 /// Ok(())
1078 /// }
1079 /// ```
1080 pub fn create_nfs_share(&self) -> super::builder::bare_metal_solution::CreateNfsShare {
1081 super::builder::bare_metal_solution::CreateNfsShare::new(self.inner.clone())
1082 }
1083
1084 /// RenameNfsShare sets a new name for an nfsshare.
1085 /// Use with caution, previous names become immediately invalidated.
1086 ///
1087 /// # Example
1088 /// ```
1089 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1090 /// use google_cloud_baremetalsolution_v2::Result;
1091 /// async fn sample(
1092 /// client: &BareMetalSolution
1093 /// ) -> Result<()> {
1094 /// let response = client.rename_nfs_share()
1095 /// /* set fields */
1096 /// .send().await?;
1097 /// println!("response {:?}", response);
1098 /// Ok(())
1099 /// }
1100 /// ```
1101 pub fn rename_nfs_share(&self) -> super::builder::bare_metal_solution::RenameNfsShare {
1102 super::builder::bare_metal_solution::RenameNfsShare::new(self.inner.clone())
1103 }
1104
1105 /// Delete an NFS share. The underlying volume is automatically deleted.
1106 ///
1107 /// # Long running operations
1108 ///
1109 /// This method is used to start, and/or poll a [long-running Operation].
1110 /// The [Working with long-running operations] chapter in the [user guide]
1111 /// covers these operations in detail.
1112 ///
1113 /// [long-running operation]: https://google.aip.dev/151
1114 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1115 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1116 ///
1117 /// # Example
1118 /// ```
1119 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1120 /// use google_cloud_lro::Poller;
1121 /// use google_cloud_baremetalsolution_v2::Result;
1122 /// async fn sample(
1123 /// client: &BareMetalSolution, project_id: &str, location_id: &str, nfs_share_id: &str
1124 /// ) -> Result<()> {
1125 /// client.delete_nfs_share()
1126 /// .set_name(format!("projects/{project_id}/locations/{location_id}/nfsShares/{nfs_share_id}"))
1127 /// .poller().until_done().await?;
1128 /// Ok(())
1129 /// }
1130 /// ```
1131 pub fn delete_nfs_share(&self) -> super::builder::bare_metal_solution::DeleteNfsShare {
1132 super::builder::bare_metal_solution::DeleteNfsShare::new(self.inner.clone())
1133 }
1134
1135 /// List the budget details to provision resources on a given project.
1136 ///
1137 /// # Example
1138 /// ```
1139 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1140 /// use google_cloud_gax::paginator::ItemPaginator as _;
1141 /// use google_cloud_baremetalsolution_v2::Result;
1142 /// async fn sample(
1143 /// client: &BareMetalSolution, parent: &str
1144 /// ) -> Result<()> {
1145 /// let mut list = client.list_provisioning_quotas()
1146 /// .set_parent(parent)
1147 /// .by_item();
1148 /// while let Some(item) = list.next().await.transpose()? {
1149 /// println!("{:?}", item);
1150 /// }
1151 /// Ok(())
1152 /// }
1153 /// ```
1154 pub fn list_provisioning_quotas(
1155 &self,
1156 ) -> super::builder::bare_metal_solution::ListProvisioningQuotas {
1157 super::builder::bare_metal_solution::ListProvisioningQuotas::new(self.inner.clone())
1158 }
1159
1160 /// Submit a provisiong configuration for a given project.
1161 ///
1162 /// # Example
1163 /// ```
1164 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1165 /// use google_cloud_baremetalsolution_v2::Result;
1166 /// async fn sample(
1167 /// client: &BareMetalSolution
1168 /// ) -> Result<()> {
1169 /// let response = client.submit_provisioning_config()
1170 /// /* set fields */
1171 /// .send().await?;
1172 /// println!("response {:?}", response);
1173 /// Ok(())
1174 /// }
1175 /// ```
1176 pub fn submit_provisioning_config(
1177 &self,
1178 ) -> super::builder::bare_metal_solution::SubmitProvisioningConfig {
1179 super::builder::bare_metal_solution::SubmitProvisioningConfig::new(self.inner.clone())
1180 }
1181
1182 /// Get ProvisioningConfig by name.
1183 ///
1184 /// # Example
1185 /// ```
1186 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1187 /// use google_cloud_baremetalsolution_v2::Result;
1188 /// async fn sample(
1189 /// client: &BareMetalSolution, project_id: &str, location_id: &str, provisioning_config_id: &str
1190 /// ) -> Result<()> {
1191 /// let response = client.get_provisioning_config()
1192 /// .set_name(format!("projects/{project_id}/locations/{location_id}/provisioningConfigs/{provisioning_config_id}"))
1193 /// .send().await?;
1194 /// println!("response {:?}", response);
1195 /// Ok(())
1196 /// }
1197 /// ```
1198 pub fn get_provisioning_config(
1199 &self,
1200 ) -> super::builder::bare_metal_solution::GetProvisioningConfig {
1201 super::builder::bare_metal_solution::GetProvisioningConfig::new(self.inner.clone())
1202 }
1203
1204 /// Create new ProvisioningConfig.
1205 ///
1206 /// # Example
1207 /// ```
1208 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1209 /// use google_cloud_baremetalsolution_v2::model::ProvisioningConfig;
1210 /// use google_cloud_baremetalsolution_v2::Result;
1211 /// async fn sample(
1212 /// client: &BareMetalSolution, parent: &str
1213 /// ) -> Result<()> {
1214 /// let response = client.create_provisioning_config()
1215 /// .set_parent(parent)
1216 /// .set_provisioning_config(
1217 /// ProvisioningConfig::new()/* set fields */
1218 /// )
1219 /// .send().await?;
1220 /// println!("response {:?}", response);
1221 /// Ok(())
1222 /// }
1223 /// ```
1224 pub fn create_provisioning_config(
1225 &self,
1226 ) -> super::builder::bare_metal_solution::CreateProvisioningConfig {
1227 super::builder::bare_metal_solution::CreateProvisioningConfig::new(self.inner.clone())
1228 }
1229
1230 /// Update existing ProvisioningConfig.
1231 ///
1232 /// # Example
1233 /// ```
1234 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1235 /// # extern crate wkt as google_cloud_wkt;
1236 /// use google_cloud_wkt::FieldMask;
1237 /// use google_cloud_baremetalsolution_v2::model::ProvisioningConfig;
1238 /// use google_cloud_baremetalsolution_v2::Result;
1239 /// async fn sample(
1240 /// client: &BareMetalSolution, project_id: &str, location_id: &str, provisioning_config_id: &str
1241 /// ) -> Result<()> {
1242 /// let response = client.update_provisioning_config()
1243 /// .set_provisioning_config(
1244 /// ProvisioningConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/provisioningConfigs/{provisioning_config_id}"))/* set fields */
1245 /// )
1246 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1247 /// .send().await?;
1248 /// println!("response {:?}", response);
1249 /// Ok(())
1250 /// }
1251 /// ```
1252 pub fn update_provisioning_config(
1253 &self,
1254 ) -> super::builder::bare_metal_solution::UpdateProvisioningConfig {
1255 super::builder::bare_metal_solution::UpdateProvisioningConfig::new(self.inner.clone())
1256 }
1257
1258 /// RenameNetwork sets a new name for a network.
1259 /// Use with caution, previous names become immediately invalidated.
1260 ///
1261 /// # Example
1262 /// ```
1263 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1264 /// use google_cloud_baremetalsolution_v2::Result;
1265 /// async fn sample(
1266 /// client: &BareMetalSolution
1267 /// ) -> Result<()> {
1268 /// let response = client.rename_network()
1269 /// /* set fields */
1270 /// .send().await?;
1271 /// println!("response {:?}", response);
1272 /// Ok(())
1273 /// }
1274 /// ```
1275 pub fn rename_network(&self) -> super::builder::bare_metal_solution::RenameNetwork {
1276 super::builder::bare_metal_solution::RenameNetwork::new(self.inner.clone())
1277 }
1278
1279 /// Retrieves the list of OS images which are currently approved.
1280 ///
1281 /// # Example
1282 /// ```
1283 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1284 /// use google_cloud_gax::paginator::ItemPaginator as _;
1285 /// use google_cloud_baremetalsolution_v2::Result;
1286 /// async fn sample(
1287 /// client: &BareMetalSolution, parent: &str
1288 /// ) -> Result<()> {
1289 /// let mut list = client.list_os_images()
1290 /// .set_parent(parent)
1291 /// .by_item();
1292 /// while let Some(item) = list.next().await.transpose()? {
1293 /// println!("{:?}", item);
1294 /// }
1295 /// Ok(())
1296 /// }
1297 /// ```
1298 pub fn list_os_images(&self) -> super::builder::bare_metal_solution::ListOSImages {
1299 super::builder::bare_metal_solution::ListOSImages::new(self.inner.clone())
1300 }
1301
1302 /// Lists information about the supported locations for this service.
1303 ///
1304 /// # Example
1305 /// ```
1306 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1307 /// use google_cloud_gax::paginator::ItemPaginator as _;
1308 /// use google_cloud_baremetalsolution_v2::Result;
1309 /// async fn sample(
1310 /// client: &BareMetalSolution
1311 /// ) -> Result<()> {
1312 /// let mut list = client.list_locations()
1313 /// /* set fields */
1314 /// .by_item();
1315 /// while let Some(item) = list.next().await.transpose()? {
1316 /// println!("{:?}", item);
1317 /// }
1318 /// Ok(())
1319 /// }
1320 /// ```
1321 pub fn list_locations(&self) -> super::builder::bare_metal_solution::ListLocations {
1322 super::builder::bare_metal_solution::ListLocations::new(self.inner.clone())
1323 }
1324
1325 /// Gets information about a location.
1326 ///
1327 /// # Example
1328 /// ```
1329 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1330 /// use google_cloud_baremetalsolution_v2::Result;
1331 /// async fn sample(
1332 /// client: &BareMetalSolution
1333 /// ) -> Result<()> {
1334 /// let response = client.get_location()
1335 /// /* set fields */
1336 /// .send().await?;
1337 /// println!("response {:?}", response);
1338 /// Ok(())
1339 /// }
1340 /// ```
1341 pub fn get_location(&self) -> super::builder::bare_metal_solution::GetLocation {
1342 super::builder::bare_metal_solution::GetLocation::new(self.inner.clone())
1343 }
1344
1345 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1346 ///
1347 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1348 ///
1349 /// # Example
1350 /// ```
1351 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1352 /// use google_cloud_baremetalsolution_v2::Result;
1353 /// async fn sample(
1354 /// client: &BareMetalSolution
1355 /// ) -> Result<()> {
1356 /// let response = client.get_operation()
1357 /// /* set fields */
1358 /// .send().await?;
1359 /// println!("response {:?}", response);
1360 /// Ok(())
1361 /// }
1362 /// ```
1363 pub fn get_operation(&self) -> super::builder::bare_metal_solution::GetOperation {
1364 super::builder::bare_metal_solution::GetOperation::new(self.inner.clone())
1365 }
1366}