aws-sdk-workspaces 1.144.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 ModifyAccountInput {
    /// <p>The status of BYOL.</p>
    pub dedicated_tenancy_support: ::std::option::Option<crate::types::DedicatedTenancySupportEnum>,
    /// <p>The IP address range, specified as an IPv4 CIDR block, for the management network interface. Specify an IP address range that is compatible with your network and in CIDR notation (that is, specify the range as an IPv4 CIDR block). The CIDR block size must be /16 (for example, 203.0.113.25/16). It must also be specified as available by the <code>ListAvailableManagementCidrRanges</code> operation.</p>
    pub dedicated_tenancy_management_cidr_range: ::std::option::Option<::std::string::String>,
}
impl ModifyAccountInput {
    /// <p>The status of BYOL.</p>
    pub fn dedicated_tenancy_support(&self) -> ::std::option::Option<&crate::types::DedicatedTenancySupportEnum> {
        self.dedicated_tenancy_support.as_ref()
    }
    /// <p>The IP address range, specified as an IPv4 CIDR block, for the management network interface. Specify an IP address range that is compatible with your network and in CIDR notation (that is, specify the range as an IPv4 CIDR block). The CIDR block size must be /16 (for example, 203.0.113.25/16). It must also be specified as available by the <code>ListAvailableManagementCidrRanges</code> operation.</p>
    pub fn dedicated_tenancy_management_cidr_range(&self) -> ::std::option::Option<&str> {
        self.dedicated_tenancy_management_cidr_range.as_deref()
    }
}
static MODIFYACCOUNTINPUT_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#ModifyAccountInput$DedicatedTenancySupport",
        "com.amazonaws.workspaces.synthetic",
        "ModifyAccountInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "DedicatedTenancySupport",
    0,
);
static MODIFYACCOUNTINPUT_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#ModifyAccountInput$DedicatedTenancyManagementCidrRange",
            "com.amazonaws.workspaces.synthetic",
            "ModifyAccountInput",
        ),
        ::aws_smithy_schema::ShapeType::String,
        "DedicatedTenancyManagementCidrRange",
        1,
    );
static MODIFYACCOUNTINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.workspaces.synthetic#ModifyAccountInput",
        "com.amazonaws.workspaces.synthetic",
        "ModifyAccountInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[
        &MODIFYACCOUNTINPUT_MEMBER_DEDICATED_TENANCY_SUPPORT,
        &MODIFYACCOUNTINPUT_MEMBER_DEDICATED_TENANCY_MANAGEMENT_CIDR_RANGE,
    ],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("ModifyAccountRequest");
impl ModifyAccountInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &MODIFYACCOUNTINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for ModifyAccountInput {
    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(&MODIFYACCOUNTINPUT_MEMBER_DEDICATED_TENANCY_SUPPORT, val.as_str())?;
        }
        if let Some(ref val) = self.dedicated_tenancy_management_cidr_range {
            ser.write_string(&MODIFYACCOUNTINPUT_MEMBER_DEDICATED_TENANCY_MANAGEMENT_CIDR_RANGE, val)?;
        }
        Ok(())
    }
}
impl crate::operation::modify_account::builders::ModifyAccountInputBuilder {
    #[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(&MODIFYACCOUNTINPUT_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::DedicatedTenancySupportEnum::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)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl ModifyAccountInput {
    /// 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)?;
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
    }
}
impl ModifyAccountInput {
    /// Creates a new builder-style object to manufacture [`ModifyAccountInput`](crate::operation::modify_account::ModifyAccountInput).
    pub fn builder() -> crate::operation::modify_account::builders::ModifyAccountInputBuilder {
        crate::operation::modify_account::builders::ModifyAccountInputBuilder::default()
    }
}

/// A builder for [`ModifyAccountInput`](crate::operation::modify_account::ModifyAccountInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ModifyAccountInputBuilder {
    pub(crate) dedicated_tenancy_support: ::std::option::Option<crate::types::DedicatedTenancySupportEnum>,
    pub(crate) dedicated_tenancy_management_cidr_range: ::std::option::Option<::std::string::String>,
}
impl ModifyAccountInputBuilder {
    /// <p>The status of BYOL.</p>
    pub fn dedicated_tenancy_support(mut self, input: crate::types::DedicatedTenancySupportEnum) -> Self {
        self.dedicated_tenancy_support = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of BYOL.</p>
    pub fn set_dedicated_tenancy_support(mut self, input: ::std::option::Option<crate::types::DedicatedTenancySupportEnum>) -> Self {
        self.dedicated_tenancy_support = input;
        self
    }
    /// <p>The status of BYOL.</p>
    pub fn get_dedicated_tenancy_support(&self) -> &::std::option::Option<crate::types::DedicatedTenancySupportEnum> {
        &self.dedicated_tenancy_support
    }
    /// <p>The IP address range, specified as an IPv4 CIDR block, for the management network interface. Specify an IP address range that is compatible with your network and in CIDR notation (that is, specify the range as an IPv4 CIDR block). The CIDR block size must be /16 (for example, 203.0.113.25/16). It must also be specified as available by the <code>ListAvailableManagementCidrRanges</code> operation.</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, for the management network interface. Specify an IP address range that is compatible with your network and in CIDR notation (that is, specify the range as an IPv4 CIDR block). The CIDR block size must be /16 (for example, 203.0.113.25/16). It must also be specified as available by the <code>ListAvailableManagementCidrRanges</code> operation.</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, for the management network interface. Specify an IP address range that is compatible with your network and in CIDR notation (that is, specify the range as an IPv4 CIDR block). The CIDR block size must be /16 (for example, 203.0.113.25/16). It must also be specified as available by the <code>ListAvailableManagementCidrRanges</code> operation.</p>
    pub fn get_dedicated_tenancy_management_cidr_range(&self) -> &::std::option::Option<::std::string::String> {
        &self.dedicated_tenancy_management_cidr_range
    }
    /// Consumes the builder and constructs a [`ModifyAccountInput`](crate::operation::modify_account::ModifyAccountInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::modify_account::ModifyAccountInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::modify_account::ModifyAccountInput {
            dedicated_tenancy_support: self.dedicated_tenancy_support,
            dedicated_tenancy_management_cidr_range: self.dedicated_tenancy_management_cidr_range,
        })
    }
}