aws_sdk_lightsail/operation/delete_disk/
_delete_disk_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DeleteDiskInput {
6    /// <p>The unique name of the disk you want to delete (<code>my-disk</code>).</p>
7    pub disk_name: ::std::option::Option<::std::string::String>,
8    /// <p>A Boolean value to indicate whether to delete all add-ons for the disk.</p>
9    pub force_delete_add_ons: ::std::option::Option<bool>,
10}
11impl DeleteDiskInput {
12    /// <p>The unique name of the disk you want to delete (<code>my-disk</code>).</p>
13    pub fn disk_name(&self) -> ::std::option::Option<&str> {
14        self.disk_name.as_deref()
15    }
16    /// <p>A Boolean value to indicate whether to delete all add-ons for the disk.</p>
17    pub fn force_delete_add_ons(&self) -> ::std::option::Option<bool> {
18        self.force_delete_add_ons
19    }
20}
21impl DeleteDiskInput {
22    /// Creates a new builder-style object to manufacture [`DeleteDiskInput`](crate::operation::delete_disk::DeleteDiskInput).
23    pub fn builder() -> crate::operation::delete_disk::builders::DeleteDiskInputBuilder {
24        crate::operation::delete_disk::builders::DeleteDiskInputBuilder::default()
25    }
26}
27
28/// A builder for [`DeleteDiskInput`](crate::operation::delete_disk::DeleteDiskInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct DeleteDiskInputBuilder {
32    pub(crate) disk_name: ::std::option::Option<::std::string::String>,
33    pub(crate) force_delete_add_ons: ::std::option::Option<bool>,
34}
35impl DeleteDiskInputBuilder {
36    /// <p>The unique name of the disk you want to delete (<code>my-disk</code>).</p>
37    /// This field is required.
38    pub fn disk_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.disk_name = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The unique name of the disk you want to delete (<code>my-disk</code>).</p>
43    pub fn set_disk_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.disk_name = input;
45        self
46    }
47    /// <p>The unique name of the disk you want to delete (<code>my-disk</code>).</p>
48    pub fn get_disk_name(&self) -> &::std::option::Option<::std::string::String> {
49        &self.disk_name
50    }
51    /// <p>A Boolean value to indicate whether to delete all add-ons for the disk.</p>
52    pub fn force_delete_add_ons(mut self, input: bool) -> Self {
53        self.force_delete_add_ons = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>A Boolean value to indicate whether to delete all add-ons for the disk.</p>
57    pub fn set_force_delete_add_ons(mut self, input: ::std::option::Option<bool>) -> Self {
58        self.force_delete_add_ons = input;
59        self
60    }
61    /// <p>A Boolean value to indicate whether to delete all add-ons for the disk.</p>
62    pub fn get_force_delete_add_ons(&self) -> &::std::option::Option<bool> {
63        &self.force_delete_add_ons
64    }
65    /// Consumes the builder and constructs a [`DeleteDiskInput`](crate::operation::delete_disk::DeleteDiskInput).
66    pub fn build(self) -> ::std::result::Result<crate::operation::delete_disk::DeleteDiskInput, ::aws_smithy_types::error::operation::BuildError> {
67        ::std::result::Result::Ok(crate::operation::delete_disk::DeleteDiskInput {
68            disk_name: self.disk_name,
69            force_delete_add_ons: self.force_delete_add_ons,
70        })
71    }
72}