aws-sdk-licensemanager 1.95.0

AWS SDK for AWS License Manager
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 CreateLicenseConfigurationInput {
    /// <p>Name of the license configuration.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>Description of the license configuration.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>Dimension used to track the license inventory.</p>
    pub license_counting_type: ::std::option::Option<crate::types::LicenseCountingType>,
    /// <p>Number of licenses managed by the license configuration.</p>
    pub license_count: ::std::option::Option<i64>,
    /// <p>Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of new instances.</p>
    pub license_count_hard_limit: ::std::option::Option<bool>,
    /// <p>License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available rules vary by dimension, as follows.</p>
    /// <ul>
    /// <li>
    /// <p><code>Cores</code> dimension: <code>allowedTenancy</code> | <code>licenseAffinityToHost</code> | <code>maximumCores</code> | <code>minimumCores</code></p></li>
    /// <li>
    /// <p><code>Instances</code> dimension: <code>allowedTenancy</code> | <code>maximumVcpus</code> | <code>minimumVcpus</code></p></li>
    /// <li>
    /// <p><code>Sockets</code> dimension: <code>allowedTenancy</code> | <code>licenseAffinityToHost</code> | <code>maximumSockets</code> | <code>minimumSockets</code></p></li>
    /// <li>
    /// <p><code>vCPUs</code> dimension: <code>allowedTenancy</code> | <code>honorVcpuOptimization</code> | <code>maximumVcpus</code> | <code>minimumVcpus</code></p></li>
    /// </ul>
    /// <p>The unit for <code>licenseAffinityToHost</code> is days and the range is 1 to 180. The possible values for <code>allowedTenancy</code> are <code>EC2-Default</code>, <code>EC2-DedicatedHost</code>, and <code>EC2-DedicatedInstance</code>. The possible values for <code>honorVcpuOptimization</code> are <code>True</code> and <code>False</code>.</p>
    pub license_rules: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Tags to add to the license configuration.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>When true, disassociates a resource when software is uninstalled.</p>
    pub disassociate_when_not_found: ::std::option::Option<bool>,
    /// <p>Product information.</p>
    pub product_information_list: ::std::option::Option<::std::vec::Vec<crate::types::ProductInformation>>,
    /// <p>License configuration expiry.</p>
    pub license_expiry: ::std::option::Option<i64>,
}
impl CreateLicenseConfigurationInput {
    /// <p>Name of the license configuration.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>Description of the license configuration.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>Dimension used to track the license inventory.</p>
    pub fn license_counting_type(&self) -> ::std::option::Option<&crate::types::LicenseCountingType> {
        self.license_counting_type.as_ref()
    }
    /// <p>Number of licenses managed by the license configuration.</p>
    pub fn license_count(&self) -> ::std::option::Option<i64> {
        self.license_count
    }
    /// <p>Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of new instances.</p>
    pub fn license_count_hard_limit(&self) -> ::std::option::Option<bool> {
        self.license_count_hard_limit
    }
    /// <p>License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available rules vary by dimension, as follows.</p>
    /// <ul>
    /// <li>
    /// <p><code>Cores</code> dimension: <code>allowedTenancy</code> | <code>licenseAffinityToHost</code> | <code>maximumCores</code> | <code>minimumCores</code></p></li>
    /// <li>
    /// <p><code>Instances</code> dimension: <code>allowedTenancy</code> | <code>maximumVcpus</code> | <code>minimumVcpus</code></p></li>
    /// <li>
    /// <p><code>Sockets</code> dimension: <code>allowedTenancy</code> | <code>licenseAffinityToHost</code> | <code>maximumSockets</code> | <code>minimumSockets</code></p></li>
    /// <li>
    /// <p><code>vCPUs</code> dimension: <code>allowedTenancy</code> | <code>honorVcpuOptimization</code> | <code>maximumVcpus</code> | <code>minimumVcpus</code></p></li>
    /// </ul>
    /// <p>The unit for <code>licenseAffinityToHost</code> is days and the range is 1 to 180. The possible values for <code>allowedTenancy</code> are <code>EC2-Default</code>, <code>EC2-DedicatedHost</code>, and <code>EC2-DedicatedInstance</code>. The possible values for <code>honorVcpuOptimization</code> are <code>True</code> and <code>False</code>.</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 `.license_rules.is_none()`.
    pub fn license_rules(&self) -> &[::std::string::String] {
        self.license_rules.as_deref().unwrap_or_default()
    }
    /// <p>Tags to add to the license configuration.</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 `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
    /// <p>When true, disassociates a resource when software is uninstalled.</p>
    pub fn disassociate_when_not_found(&self) -> ::std::option::Option<bool> {
        self.disassociate_when_not_found
    }
    /// <p>Product information.</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_information_list.is_none()`.
    pub fn product_information_list(&self) -> &[crate::types::ProductInformation] {
        self.product_information_list.as_deref().unwrap_or_default()
    }
    /// <p>License configuration expiry.</p>
    pub fn license_expiry(&self) -> ::std::option::Option<i64> {
        self.license_expiry
    }
}
impl CreateLicenseConfigurationInput {
    /// Creates a new builder-style object to manufacture [`CreateLicenseConfigurationInput`](crate::operation::create_license_configuration::CreateLicenseConfigurationInput).
    pub fn builder() -> crate::operation::create_license_configuration::builders::CreateLicenseConfigurationInputBuilder {
        crate::operation::create_license_configuration::builders::CreateLicenseConfigurationInputBuilder::default()
    }
}

/// A builder for [`CreateLicenseConfigurationInput`](crate::operation::create_license_configuration::CreateLicenseConfigurationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateLicenseConfigurationInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) license_counting_type: ::std::option::Option<crate::types::LicenseCountingType>,
    pub(crate) license_count: ::std::option::Option<i64>,
    pub(crate) license_count_hard_limit: ::std::option::Option<bool>,
    pub(crate) license_rules: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) disassociate_when_not_found: ::std::option::Option<bool>,
    pub(crate) product_information_list: ::std::option::Option<::std::vec::Vec<crate::types::ProductInformation>>,
    pub(crate) license_expiry: ::std::option::Option<i64>,
}
impl CreateLicenseConfigurationInputBuilder {
    /// <p>Name of the license configuration.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Name of the license configuration.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>Name of the license configuration.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>Description of the license configuration.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Description of the license configuration.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>Description of the license configuration.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>Dimension used to track the license inventory.</p>
    /// This field is required.
    pub fn license_counting_type(mut self, input: crate::types::LicenseCountingType) -> Self {
        self.license_counting_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Dimension used to track the license inventory.</p>
    pub fn set_license_counting_type(mut self, input: ::std::option::Option<crate::types::LicenseCountingType>) -> Self {
        self.license_counting_type = input;
        self
    }
    /// <p>Dimension used to track the license inventory.</p>
    pub fn get_license_counting_type(&self) -> &::std::option::Option<crate::types::LicenseCountingType> {
        &self.license_counting_type
    }
    /// <p>Number of licenses managed by the license configuration.</p>
    pub fn license_count(mut self, input: i64) -> Self {
        self.license_count = ::std::option::Option::Some(input);
        self
    }
    /// <p>Number of licenses managed by the license configuration.</p>
    pub fn set_license_count(mut self, input: ::std::option::Option<i64>) -> Self {
        self.license_count = input;
        self
    }
    /// <p>Number of licenses managed by the license configuration.</p>
    pub fn get_license_count(&self) -> &::std::option::Option<i64> {
        &self.license_count
    }
    /// <p>Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of new instances.</p>
    pub fn license_count_hard_limit(mut self, input: bool) -> Self {
        self.license_count_hard_limit = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of new instances.</p>
    pub fn set_license_count_hard_limit(mut self, input: ::std::option::Option<bool>) -> Self {
        self.license_count_hard_limit = input;
        self
    }
    /// <p>Indicates whether hard or soft license enforcement is used. Exceeding a hard limit blocks the launch of new instances.</p>
    pub fn get_license_count_hard_limit(&self) -> &::std::option::Option<bool> {
        &self.license_count_hard_limit
    }
    /// Appends an item to `license_rules`.
    ///
    /// To override the contents of this collection use [`set_license_rules`](Self::set_license_rules).
    ///
    /// <p>License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available rules vary by dimension, as follows.</p>
    /// <ul>
    /// <li>
    /// <p><code>Cores</code> dimension: <code>allowedTenancy</code> | <code>licenseAffinityToHost</code> | <code>maximumCores</code> | <code>minimumCores</code></p></li>
    /// <li>
    /// <p><code>Instances</code> dimension: <code>allowedTenancy</code> | <code>maximumVcpus</code> | <code>minimumVcpus</code></p></li>
    /// <li>
    /// <p><code>Sockets</code> dimension: <code>allowedTenancy</code> | <code>licenseAffinityToHost</code> | <code>maximumSockets</code> | <code>minimumSockets</code></p></li>
    /// <li>
    /// <p><code>vCPUs</code> dimension: <code>allowedTenancy</code> | <code>honorVcpuOptimization</code> | <code>maximumVcpus</code> | <code>minimumVcpus</code></p></li>
    /// </ul>
    /// <p>The unit for <code>licenseAffinityToHost</code> is days and the range is 1 to 180. The possible values for <code>allowedTenancy</code> are <code>EC2-Default</code>, <code>EC2-DedicatedHost</code>, and <code>EC2-DedicatedInstance</code>. The possible values for <code>honorVcpuOptimization</code> are <code>True</code> and <code>False</code>.</p>
    pub fn license_rules(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.license_rules.unwrap_or_default();
        v.push(input.into());
        self.license_rules = ::std::option::Option::Some(v);
        self
    }
    /// <p>License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available rules vary by dimension, as follows.</p>
    /// <ul>
    /// <li>
    /// <p><code>Cores</code> dimension: <code>allowedTenancy</code> | <code>licenseAffinityToHost</code> | <code>maximumCores</code> | <code>minimumCores</code></p></li>
    /// <li>
    /// <p><code>Instances</code> dimension: <code>allowedTenancy</code> | <code>maximumVcpus</code> | <code>minimumVcpus</code></p></li>
    /// <li>
    /// <p><code>Sockets</code> dimension: <code>allowedTenancy</code> | <code>licenseAffinityToHost</code> | <code>maximumSockets</code> | <code>minimumSockets</code></p></li>
    /// <li>
    /// <p><code>vCPUs</code> dimension: <code>allowedTenancy</code> | <code>honorVcpuOptimization</code> | <code>maximumVcpus</code> | <code>minimumVcpus</code></p></li>
    /// </ul>
    /// <p>The unit for <code>licenseAffinityToHost</code> is days and the range is 1 to 180. The possible values for <code>allowedTenancy</code> are <code>EC2-Default</code>, <code>EC2-DedicatedHost</code>, and <code>EC2-DedicatedInstance</code>. The possible values for <code>honorVcpuOptimization</code> are <code>True</code> and <code>False</code>.</p>
    pub fn set_license_rules(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.license_rules = input;
        self
    }
    /// <p>License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). The available rules vary by dimension, as follows.</p>
    /// <ul>
    /// <li>
    /// <p><code>Cores</code> dimension: <code>allowedTenancy</code> | <code>licenseAffinityToHost</code> | <code>maximumCores</code> | <code>minimumCores</code></p></li>
    /// <li>
    /// <p><code>Instances</code> dimension: <code>allowedTenancy</code> | <code>maximumVcpus</code> | <code>minimumVcpus</code></p></li>
    /// <li>
    /// <p><code>Sockets</code> dimension: <code>allowedTenancy</code> | <code>licenseAffinityToHost</code> | <code>maximumSockets</code> | <code>minimumSockets</code></p></li>
    /// <li>
    /// <p><code>vCPUs</code> dimension: <code>allowedTenancy</code> | <code>honorVcpuOptimization</code> | <code>maximumVcpus</code> | <code>minimumVcpus</code></p></li>
    /// </ul>
    /// <p>The unit for <code>licenseAffinityToHost</code> is days and the range is 1 to 180. The possible values for <code>allowedTenancy</code> are <code>EC2-Default</code>, <code>EC2-DedicatedHost</code>, and <code>EC2-DedicatedInstance</code>. The possible values for <code>honorVcpuOptimization</code> are <code>True</code> and <code>False</code>.</p>
    pub fn get_license_rules(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.license_rules
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Tags to add to the license configuration.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>Tags to add to the license configuration.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Tags to add to the license configuration.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>When true, disassociates a resource when software is uninstalled.</p>
    pub fn disassociate_when_not_found(mut self, input: bool) -> Self {
        self.disassociate_when_not_found = ::std::option::Option::Some(input);
        self
    }
    /// <p>When true, disassociates a resource when software is uninstalled.</p>
    pub fn set_disassociate_when_not_found(mut self, input: ::std::option::Option<bool>) -> Self {
        self.disassociate_when_not_found = input;
        self
    }
    /// <p>When true, disassociates a resource when software is uninstalled.</p>
    pub fn get_disassociate_when_not_found(&self) -> &::std::option::Option<bool> {
        &self.disassociate_when_not_found
    }
    /// Appends an item to `product_information_list`.
    ///
    /// To override the contents of this collection use [`set_product_information_list`](Self::set_product_information_list).
    ///
    /// <p>Product information.</p>
    pub fn product_information_list(mut self, input: crate::types::ProductInformation) -> Self {
        let mut v = self.product_information_list.unwrap_or_default();
        v.push(input);
        self.product_information_list = ::std::option::Option::Some(v);
        self
    }
    /// <p>Product information.</p>
    pub fn set_product_information_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProductInformation>>) -> Self {
        self.product_information_list = input;
        self
    }
    /// <p>Product information.</p>
    pub fn get_product_information_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProductInformation>> {
        &self.product_information_list
    }
    /// <p>License configuration expiry.</p>
    pub fn license_expiry(mut self, input: i64) -> Self {
        self.license_expiry = ::std::option::Option::Some(input);
        self
    }
    /// <p>License configuration expiry.</p>
    pub fn set_license_expiry(mut self, input: ::std::option::Option<i64>) -> Self {
        self.license_expiry = input;
        self
    }
    /// <p>License configuration expiry.</p>
    pub fn get_license_expiry(&self) -> &::std::option::Option<i64> {
        &self.license_expiry
    }
    /// Consumes the builder and constructs a [`CreateLicenseConfigurationInput`](crate::operation::create_license_configuration::CreateLicenseConfigurationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_license_configuration::CreateLicenseConfigurationInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::create_license_configuration::CreateLicenseConfigurationInput {
            name: self.name,
            description: self.description,
            license_counting_type: self.license_counting_type,
            license_count: self.license_count,
            license_count_hard_limit: self.license_count_hard_limit,
            license_rules: self.license_rules,
            tags: self.tags,
            disassociate_when_not_found: self.disassociate_when_not_found,
            product_information_list: self.product_information_list,
            license_expiry: self.license_expiry,
        })
    }
}