aws-sdk-workspaces 1.143.0

AWS SDK for Amazon WorkSpaces
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 DescribeAccountOutput {
    /// <p>The status of BYOL (whether BYOL is enabled or disabled).</p>
    pub dedicated_tenancy_support: ::std::option::Option<crate::types::DedicatedTenancySupportResultEnum>,
    /// <p>The IP address range, specified as an IPv4 CIDR block, used for the management network interface.</p>
    /// <p>The management network interface is connected to a secure Amazon WorkSpaces management network. It is used for interactive streaming of the WorkSpace desktop to Amazon WorkSpaces clients, and to allow Amazon WorkSpaces to manage the WorkSpace.</p>
    pub dedicated_tenancy_management_cidr_range: ::std::option::Option<::std::string::String>,
    /// <p>The type of linked account.</p>
    pub dedicated_tenancy_account_type: ::std::option::Option<crate::types::DedicatedTenancyAccountType>,
    /// <p>The text message to describe the status of BYOL.</p>
    pub message: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DescribeAccountOutput {
    /// <p>The status of BYOL (whether BYOL is enabled or disabled).</p>
    pub fn dedicated_tenancy_support(&self) -> ::std::option::Option<&crate::types::DedicatedTenancySupportResultEnum> {
        self.dedicated_tenancy_support.as_ref()
    }
    /// <p>The IP address range, specified as an IPv4 CIDR block, used for the management network interface.</p>
    /// <p>The management network interface is connected to a secure Amazon WorkSpaces management network. It is used for interactive streaming of the WorkSpace desktop to Amazon WorkSpaces clients, and to allow Amazon WorkSpaces to manage the WorkSpace.</p>
    pub fn dedicated_tenancy_management_cidr_range(&self) -> ::std::option::Option<&str> {
        self.dedicated_tenancy_management_cidr_range.as_deref()
    }
    /// <p>The type of linked account.</p>
    pub fn dedicated_tenancy_account_type(&self) -> ::std::option::Option<&crate::types::DedicatedTenancyAccountType> {
        self.dedicated_tenancy_account_type.as_ref()
    }
    /// <p>The text message to describe the status of BYOL.</p>
    pub fn message(&self) -> ::std::option::Option<&str> {
        self.message.as_deref()
    }
}
static DESCRIBEACCOUNTOUTPUT_MEMBER_DEDICATED_TENANCY_SUPPORT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.workspaces.synthetic#DescribeAccountOutput$DedicatedTenancySupport",
        "com.amazonaws.workspaces.synthetic",
        "DescribeAccountOutput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "DedicatedTenancySupport",
    0,
);
static DESCRIBEACCOUNTOUTPUT_MEMBER_DEDICATED_TENANCY_MANAGEMENT_CIDR_RANGE: ::aws_smithy_schema::Schema<'static> =
    ::aws_smithy_schema::Schema::new_member(
        ::aws_smithy_schema::ShapeId::from_parts(
            "com.amazonaws.workspaces.synthetic#DescribeAccountOutput$DedicatedTenancyManagementCidrRange",
            "com.amazonaws.workspaces.synthetic",
            "DescribeAccountOutput",
        ),
        ::aws_smithy_schema::ShapeType::String,
        "DedicatedTenancyManagementCidrRange",
        1,
    );
static DESCRIBEACCOUNTOUTPUT_MEMBER_DEDICATED_TENANCY_ACCOUNT_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.workspaces.synthetic#DescribeAccountOutput$DedicatedTenancyAccountType",
        "com.amazonaws.workspaces.synthetic",
        "DescribeAccountOutput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "DedicatedTenancyAccountType",
    2,
);
static DESCRIBEACCOUNTOUTPUT_MEMBER_MESSAGE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.workspaces.synthetic#DescribeAccountOutput$Message",
        "com.amazonaws.workspaces.synthetic",
        "DescribeAccountOutput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "Message",
    3,
);
static DESCRIBEACCOUNTOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.workspaces.synthetic#DescribeAccountOutput",
        "com.amazonaws.workspaces.synthetic",
        "DescribeAccountOutput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[
        &DESCRIBEACCOUNTOUTPUT_MEMBER_DEDICATED_TENANCY_SUPPORT,
        &DESCRIBEACCOUNTOUTPUT_MEMBER_DEDICATED_TENANCY_MANAGEMENT_CIDR_RANGE,
        &DESCRIBEACCOUNTOUTPUT_MEMBER_DEDICATED_TENANCY_ACCOUNT_TYPE,
        &DESCRIBEACCOUNTOUTPUT_MEMBER_MESSAGE,
    ],
)
.with_original_name("DescribeAccountResult");
impl DescribeAccountOutput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBEACCOUNTOUTPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for DescribeAccountOutput {
    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
        Self::SCHEMA
    }

    #[allow(unused_variables, clippy::diverging_sub_expression)]
    fn serialize_members(
        &self,
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
        if let Some(ref val) = self.dedicated_tenancy_support {
            ser.write_string(&DESCRIBEACCOUNTOUTPUT_MEMBER_DEDICATED_TENANCY_SUPPORT, val.as_str())?;
        }
        if let Some(ref val) = self.dedicated_tenancy_management_cidr_range {
            ser.write_string(&DESCRIBEACCOUNTOUTPUT_MEMBER_DEDICATED_TENANCY_MANAGEMENT_CIDR_RANGE, val)?;
        }
        if let Some(ref val) = self.dedicated_tenancy_account_type {
            ser.write_string(&DESCRIBEACCOUNTOUTPUT_MEMBER_DEDICATED_TENANCY_ACCOUNT_TYPE, val.as_str())?;
        }
        if let Some(ref val) = self.message {
            ser.write_string(&DESCRIBEACCOUNTOUTPUT_MEMBER_MESSAGE, val)?;
        }
        Ok(())
    }
}
impl crate::operation::describe_account::builders::DescribeAccountOutputBuilder {
    #[allow(
        unused_variables,
        unreachable_code,
        clippy::single_match,
        clippy::match_single_binding,
        clippy::diverging_sub_expression
    )]
    pub(crate) fn deserialize_members(
        &mut self,
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
        deserializer.read_struct(&DESCRIBEACCOUNTOUTPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.dedicated_tenancy_support =
                            Some(crate::types::DedicatedTenancySupportResultEnum::from(deser.read_string(member)?.as_str()));
                    }
                }
                Some(1) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.dedicated_tenancy_management_cidr_range = Some(deser.read_string(member)?);
                    }
                }
                Some(2) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.dedicated_tenancy_account_type =
                            Some(crate::types::DedicatedTenancyAccountType::from(deser.read_string(member)?.as_str()));
                    }
                }
                Some(3) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.message = Some(deser.read_string(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl DescribeAccountOutput {
    /// Deserializes this structure from a [`ShapeDeserializer`].
    pub fn deserialize(
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
        let mut builder = Self::builder();
        builder.deserialize_members(deserializer)?;
        Ok(builder.build())
    }
}
impl ::aws_types::request_id::RequestId for DescribeAccountOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeAccountOutput {
    /// Creates a new builder-style object to manufacture [`DescribeAccountOutput`](crate::operation::describe_account::DescribeAccountOutput).
    pub fn builder() -> crate::operation::describe_account::builders::DescribeAccountOutputBuilder {
        crate::operation::describe_account::builders::DescribeAccountOutputBuilder::default()
    }
}

/// A builder for [`DescribeAccountOutput`](crate::operation::describe_account::DescribeAccountOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeAccountOutputBuilder {
    pub(crate) dedicated_tenancy_support: ::std::option::Option<crate::types::DedicatedTenancySupportResultEnum>,
    pub(crate) dedicated_tenancy_management_cidr_range: ::std::option::Option<::std::string::String>,
    pub(crate) dedicated_tenancy_account_type: ::std::option::Option<crate::types::DedicatedTenancyAccountType>,
    pub(crate) message: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DescribeAccountOutputBuilder {
    /// <p>The status of BYOL (whether BYOL is enabled or disabled).</p>
    pub fn dedicated_tenancy_support(mut self, input: crate::types::DedicatedTenancySupportResultEnum) -> Self {
        self.dedicated_tenancy_support = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of BYOL (whether BYOL is enabled or disabled).</p>
    pub fn set_dedicated_tenancy_support(mut self, input: ::std::option::Option<crate::types::DedicatedTenancySupportResultEnum>) -> Self {
        self.dedicated_tenancy_support = input;
        self
    }
    /// <p>The status of BYOL (whether BYOL is enabled or disabled).</p>
    pub fn get_dedicated_tenancy_support(&self) -> &::std::option::Option<crate::types::DedicatedTenancySupportResultEnum> {
        &self.dedicated_tenancy_support
    }
    /// <p>The IP address range, specified as an IPv4 CIDR block, used for the management network interface.</p>
    /// <p>The management network interface is connected to a secure Amazon WorkSpaces management network. It is used for interactive streaming of the WorkSpace desktop to Amazon WorkSpaces clients, and to allow Amazon WorkSpaces to manage the WorkSpace.</p>
    pub fn dedicated_tenancy_management_cidr_range(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.dedicated_tenancy_management_cidr_range = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The IP address range, specified as an IPv4 CIDR block, used for the management network interface.</p>
    /// <p>The management network interface is connected to a secure Amazon WorkSpaces management network. It is used for interactive streaming of the WorkSpace desktop to Amazon WorkSpaces clients, and to allow Amazon WorkSpaces to manage the WorkSpace.</p>
    pub fn set_dedicated_tenancy_management_cidr_range(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.dedicated_tenancy_management_cidr_range = input;
        self
    }
    /// <p>The IP address range, specified as an IPv4 CIDR block, used for the management network interface.</p>
    /// <p>The management network interface is connected to a secure Amazon WorkSpaces management network. It is used for interactive streaming of the WorkSpace desktop to Amazon WorkSpaces clients, and to allow Amazon WorkSpaces to manage the WorkSpace.</p>
    pub fn get_dedicated_tenancy_management_cidr_range(&self) -> &::std::option::Option<::std::string::String> {
        &self.dedicated_tenancy_management_cidr_range
    }
    /// <p>The type of linked account.</p>
    pub fn dedicated_tenancy_account_type(mut self, input: crate::types::DedicatedTenancyAccountType) -> Self {
        self.dedicated_tenancy_account_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of linked account.</p>
    pub fn set_dedicated_tenancy_account_type(mut self, input: ::std::option::Option<crate::types::DedicatedTenancyAccountType>) -> Self {
        self.dedicated_tenancy_account_type = input;
        self
    }
    /// <p>The type of linked account.</p>
    pub fn get_dedicated_tenancy_account_type(&self) -> &::std::option::Option<crate::types::DedicatedTenancyAccountType> {
        &self.dedicated_tenancy_account_type
    }
    /// <p>The text message to describe the status of BYOL.</p>
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The text message to describe the status of BYOL.</p>
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.message = input;
        self
    }
    /// <p>The text message to describe the status of BYOL.</p>
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.message
    }
    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 [`DescribeAccountOutput`](crate::operation::describe_account::DescribeAccountOutput).
    pub fn build(self) -> crate::operation::describe_account::DescribeAccountOutput {
        crate::operation::describe_account::DescribeAccountOutput {
            dedicated_tenancy_support: self.dedicated_tenancy_support,
            dedicated_tenancy_management_cidr_range: self.dedicated_tenancy_management_cidr_range,
            dedicated_tenancy_account_type: self.dedicated_tenancy_account_type,
            message: self.message,
            _request_id: self._request_id,
        }
    }
}