aws-sdk-ec2 1.223.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeVolumeAttributeOutput {
    /// <p>The state of <code>autoEnableIO</code> attribute.</p>
    pub auto_enable_io: ::std::option::Option<crate::types::AttributeBooleanValue>,
    /// <p>A list of product codes.</p>
    pub product_codes: ::std::option::Option<::std::vec::Vec<crate::types::ProductCode>>,
    /// <p>The ID of the volume.</p>
    pub volume_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DescribeVolumeAttributeOutput {
    /// <p>The state of <code>autoEnableIO</code> attribute.</p>
    pub fn auto_enable_io(&self) -> ::std::option::Option<&crate::types::AttributeBooleanValue> {
        self.auto_enable_io.as_ref()
    }
    /// <p>A list of product codes.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.product_codes.is_none()`.
    pub fn product_codes(&self) -> &[crate::types::ProductCode] {
        self.product_codes.as_deref().unwrap_or_default()
    }
    /// <p>The ID of the volume.</p>
    pub fn volume_id(&self) -> ::std::option::Option<&str> {
        self.volume_id.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for DescribeVolumeAttributeOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeVolumeAttributeOutput {
    /// Creates a new builder-style object to manufacture [`DescribeVolumeAttributeOutput`](crate::operation::describe_volume_attribute::DescribeVolumeAttributeOutput).
    pub fn builder() -> crate::operation::describe_volume_attribute::builders::DescribeVolumeAttributeOutputBuilder {
        crate::operation::describe_volume_attribute::builders::DescribeVolumeAttributeOutputBuilder::default()
    }
}

/// A builder for [`DescribeVolumeAttributeOutput`](crate::operation::describe_volume_attribute::DescribeVolumeAttributeOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeVolumeAttributeOutputBuilder {
    pub(crate) auto_enable_io: ::std::option::Option<crate::types::AttributeBooleanValue>,
    pub(crate) product_codes: ::std::option::Option<::std::vec::Vec<crate::types::ProductCode>>,
    pub(crate) volume_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DescribeVolumeAttributeOutputBuilder {
    /// <p>The state of <code>autoEnableIO</code> attribute.</p>
    pub fn auto_enable_io(mut self, input: crate::types::AttributeBooleanValue) -> Self {
        self.auto_enable_io = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of <code>autoEnableIO</code> attribute.</p>
    pub fn set_auto_enable_io(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
        self.auto_enable_io = input;
        self
    }
    /// <p>The state of <code>autoEnableIO</code> attribute.</p>
    pub fn get_auto_enable_io(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
        &self.auto_enable_io
    }
    /// Appends an item to `product_codes`.
    ///
    /// To override the contents of this collection use [`set_product_codes`](Self::set_product_codes).
    ///
    /// <p>A list of product codes.</p>
    pub fn product_codes(mut self, input: crate::types::ProductCode) -> Self {
        let mut v = self.product_codes.unwrap_or_default();
        v.push(input);
        self.product_codes = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of product codes.</p>
    pub fn set_product_codes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProductCode>>) -> Self {
        self.product_codes = input;
        self
    }
    /// <p>A list of product codes.</p>
    pub fn get_product_codes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProductCode>> {
        &self.product_codes
    }
    /// <p>The ID of the volume.</p>
    pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.volume_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the volume.</p>
    pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.volume_id = input;
        self
    }
    /// <p>The ID of the volume.</p>
    pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.volume_id
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DescribeVolumeAttributeOutput`](crate::operation::describe_volume_attribute::DescribeVolumeAttributeOutput).
    pub fn build(self) -> crate::operation::describe_volume_attribute::DescribeVolumeAttributeOutput {
        crate::operation::describe_volume_attribute::DescribeVolumeAttributeOutput {
            auto_enable_io: self.auto_enable_io,
            product_codes: self.product_codes,
            volume_id: self.volume_id,
            _request_id: self._request_id,
        }
    }
}