aws_sdk_lightsail/operation/get_disk/
_get_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 GetDiskInput {
6    /// <p>The name of the disk (<code>my-disk</code>).</p>
7    pub disk_name: ::std::option::Option<::std::string::String>,
8}
9impl GetDiskInput {
10    /// <p>The name of the disk (<code>my-disk</code>).</p>
11    pub fn disk_name(&self) -> ::std::option::Option<&str> {
12        self.disk_name.as_deref()
13    }
14}
15impl GetDiskInput {
16    /// Creates a new builder-style object to manufacture [`GetDiskInput`](crate::operation::get_disk::GetDiskInput).
17    pub fn builder() -> crate::operation::get_disk::builders::GetDiskInputBuilder {
18        crate::operation::get_disk::builders::GetDiskInputBuilder::default()
19    }
20}
21
22/// A builder for [`GetDiskInput`](crate::operation::get_disk::GetDiskInput).
23#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
24#[non_exhaustive]
25pub struct GetDiskInputBuilder {
26    pub(crate) disk_name: ::std::option::Option<::std::string::String>,
27}
28impl GetDiskInputBuilder {
29    /// <p>The name of the disk (<code>my-disk</code>).</p>
30    /// This field is required.
31    pub fn disk_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
32        self.disk_name = ::std::option::Option::Some(input.into());
33        self
34    }
35    /// <p>The name of the disk (<code>my-disk</code>).</p>
36    pub fn set_disk_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
37        self.disk_name = input;
38        self
39    }
40    /// <p>The name of the disk (<code>my-disk</code>).</p>
41    pub fn get_disk_name(&self) -> &::std::option::Option<::std::string::String> {
42        &self.disk_name
43    }
44    /// Consumes the builder and constructs a [`GetDiskInput`](crate::operation::get_disk::GetDiskInput).
45    pub fn build(self) -> ::std::result::Result<crate::operation::get_disk::GetDiskInput, ::aws_smithy_types::error::operation::BuildError> {
46        ::std::result::Result::Ok(crate::operation::get_disk::GetDiskInput { disk_name: self.disk_name })
47    }
48}