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.

/// <p>Software license that is managed in License Manager.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct License {
    /// <p>Amazon Resource Name (ARN) of the license.</p>
    pub license_arn: ::std::option::Option<::std::string::String>,
    /// <p>License name.</p>
    pub license_name: ::std::option::Option<::std::string::String>,
    /// <p>Product name.</p>
    pub product_name: ::std::option::Option<::std::string::String>,
    /// <p>Product SKU.</p>
    pub product_sku: ::std::option::Option<::std::string::String>,
    /// <p>License issuer.</p>
    pub issuer: ::std::option::Option<crate::types::IssuerDetails>,
    /// <p>Home Region of the license.</p>
    pub home_region: ::std::option::Option<::std::string::String>,
    /// <p>License status.</p>
    pub status: ::std::option::Option<crate::types::LicenseStatus>,
    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
    pub validity: ::std::option::Option<crate::types::DatetimeRange>,
    /// <p>License beneficiary.</p>
    pub beneficiary: ::std::option::Option<::std::string::String>,
    /// <p>License entitlements.</p>
    pub entitlements: ::std::option::Option<::std::vec::Vec<crate::types::Entitlement>>,
    /// <p>Configuration for consumption of the license.</p>
    pub consumption_configuration: ::std::option::Option<crate::types::ConsumptionConfiguration>,
    /// <p>License metadata.</p>
    pub license_metadata: ::std::option::Option<::std::vec::Vec<crate::types::Metadata>>,
    /// <p>License creation time.</p>
    pub create_time: ::std::option::Option<::std::string::String>,
    /// <p>License version.</p>
    pub version: ::std::option::Option<::std::string::String>,
}
impl License {
    /// <p>Amazon Resource Name (ARN) of the license.</p>
    pub fn license_arn(&self) -> ::std::option::Option<&str> {
        self.license_arn.as_deref()
    }
    /// <p>License name.</p>
    pub fn license_name(&self) -> ::std::option::Option<&str> {
        self.license_name.as_deref()
    }
    /// <p>Product name.</p>
    pub fn product_name(&self) -> ::std::option::Option<&str> {
        self.product_name.as_deref()
    }
    /// <p>Product SKU.</p>
    pub fn product_sku(&self) -> ::std::option::Option<&str> {
        self.product_sku.as_deref()
    }
    /// <p>License issuer.</p>
    pub fn issuer(&self) -> ::std::option::Option<&crate::types::IssuerDetails> {
        self.issuer.as_ref()
    }
    /// <p>Home Region of the license.</p>
    pub fn home_region(&self) -> ::std::option::Option<&str> {
        self.home_region.as_deref()
    }
    /// <p>License status.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::LicenseStatus> {
        self.status.as_ref()
    }
    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
    pub fn validity(&self) -> ::std::option::Option<&crate::types::DatetimeRange> {
        self.validity.as_ref()
    }
    /// <p>License beneficiary.</p>
    pub fn beneficiary(&self) -> ::std::option::Option<&str> {
        self.beneficiary.as_deref()
    }
    /// <p>License entitlements.</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 `.entitlements.is_none()`.
    pub fn entitlements(&self) -> &[crate::types::Entitlement] {
        self.entitlements.as_deref().unwrap_or_default()
    }
    /// <p>Configuration for consumption of the license.</p>
    pub fn consumption_configuration(&self) -> ::std::option::Option<&crate::types::ConsumptionConfiguration> {
        self.consumption_configuration.as_ref()
    }
    /// <p>License metadata.</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_metadata.is_none()`.
    pub fn license_metadata(&self) -> &[crate::types::Metadata] {
        self.license_metadata.as_deref().unwrap_or_default()
    }
    /// <p>License creation time.</p>
    pub fn create_time(&self) -> ::std::option::Option<&str> {
        self.create_time.as_deref()
    }
    /// <p>License version.</p>
    pub fn version(&self) -> ::std::option::Option<&str> {
        self.version.as_deref()
    }
}
impl License {
    /// Creates a new builder-style object to manufacture [`License`](crate::types::License).
    pub fn builder() -> crate::types::builders::LicenseBuilder {
        crate::types::builders::LicenseBuilder::default()
    }
}

/// A builder for [`License`](crate::types::License).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct LicenseBuilder {
    pub(crate) license_arn: ::std::option::Option<::std::string::String>,
    pub(crate) license_name: ::std::option::Option<::std::string::String>,
    pub(crate) product_name: ::std::option::Option<::std::string::String>,
    pub(crate) product_sku: ::std::option::Option<::std::string::String>,
    pub(crate) issuer: ::std::option::Option<crate::types::IssuerDetails>,
    pub(crate) home_region: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::LicenseStatus>,
    pub(crate) validity: ::std::option::Option<crate::types::DatetimeRange>,
    pub(crate) beneficiary: ::std::option::Option<::std::string::String>,
    pub(crate) entitlements: ::std::option::Option<::std::vec::Vec<crate::types::Entitlement>>,
    pub(crate) consumption_configuration: ::std::option::Option<crate::types::ConsumptionConfiguration>,
    pub(crate) license_metadata: ::std::option::Option<::std::vec::Vec<crate::types::Metadata>>,
    pub(crate) create_time: ::std::option::Option<::std::string::String>,
    pub(crate) version: ::std::option::Option<::std::string::String>,
}
impl LicenseBuilder {
    /// <p>Amazon Resource Name (ARN) of the license.</p>
    pub fn license_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.license_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Amazon Resource Name (ARN) of the license.</p>
    pub fn set_license_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.license_arn = input;
        self
    }
    /// <p>Amazon Resource Name (ARN) of the license.</p>
    pub fn get_license_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.license_arn
    }
    /// <p>License name.</p>
    pub fn license_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.license_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>License name.</p>
    pub fn set_license_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.license_name = input;
        self
    }
    /// <p>License name.</p>
    pub fn get_license_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.license_name
    }
    /// <p>Product name.</p>
    pub fn product_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.product_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Product name.</p>
    pub fn set_product_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.product_name = input;
        self
    }
    /// <p>Product name.</p>
    pub fn get_product_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.product_name
    }
    /// <p>Product SKU.</p>
    pub fn product_sku(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.product_sku = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Product SKU.</p>
    pub fn set_product_sku(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.product_sku = input;
        self
    }
    /// <p>Product SKU.</p>
    pub fn get_product_sku(&self) -> &::std::option::Option<::std::string::String> {
        &self.product_sku
    }
    /// <p>License issuer.</p>
    pub fn issuer(mut self, input: crate::types::IssuerDetails) -> Self {
        self.issuer = ::std::option::Option::Some(input);
        self
    }
    /// <p>License issuer.</p>
    pub fn set_issuer(mut self, input: ::std::option::Option<crate::types::IssuerDetails>) -> Self {
        self.issuer = input;
        self
    }
    /// <p>License issuer.</p>
    pub fn get_issuer(&self) -> &::std::option::Option<crate::types::IssuerDetails> {
        &self.issuer
    }
    /// <p>Home Region of the license.</p>
    pub fn home_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.home_region = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Home Region of the license.</p>
    pub fn set_home_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.home_region = input;
        self
    }
    /// <p>Home Region of the license.</p>
    pub fn get_home_region(&self) -> &::std::option::Option<::std::string::String> {
        &self.home_region
    }
    /// <p>License status.</p>
    pub fn status(mut self, input: crate::types::LicenseStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>License status.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::LicenseStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>License status.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::LicenseStatus> {
        &self.status
    }
    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
    pub fn validity(mut self, input: crate::types::DatetimeRange) -> Self {
        self.validity = ::std::option::Option::Some(input);
        self
    }
    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
    pub fn set_validity(mut self, input: ::std::option::Option<crate::types::DatetimeRange>) -> Self {
        self.validity = input;
        self
    }
    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
    pub fn get_validity(&self) -> &::std::option::Option<crate::types::DatetimeRange> {
        &self.validity
    }
    /// <p>License beneficiary.</p>
    pub fn beneficiary(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.beneficiary = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>License beneficiary.</p>
    pub fn set_beneficiary(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.beneficiary = input;
        self
    }
    /// <p>License beneficiary.</p>
    pub fn get_beneficiary(&self) -> &::std::option::Option<::std::string::String> {
        &self.beneficiary
    }
    /// Appends an item to `entitlements`.
    ///
    /// To override the contents of this collection use [`set_entitlements`](Self::set_entitlements).
    ///
    /// <p>License entitlements.</p>
    pub fn entitlements(mut self, input: crate::types::Entitlement) -> Self {
        let mut v = self.entitlements.unwrap_or_default();
        v.push(input);
        self.entitlements = ::std::option::Option::Some(v);
        self
    }
    /// <p>License entitlements.</p>
    pub fn set_entitlements(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Entitlement>>) -> Self {
        self.entitlements = input;
        self
    }
    /// <p>License entitlements.</p>
    pub fn get_entitlements(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Entitlement>> {
        &self.entitlements
    }
    /// <p>Configuration for consumption of the license.</p>
    pub fn consumption_configuration(mut self, input: crate::types::ConsumptionConfiguration) -> Self {
        self.consumption_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Configuration for consumption of the license.</p>
    pub fn set_consumption_configuration(mut self, input: ::std::option::Option<crate::types::ConsumptionConfiguration>) -> Self {
        self.consumption_configuration = input;
        self
    }
    /// <p>Configuration for consumption of the license.</p>
    pub fn get_consumption_configuration(&self) -> &::std::option::Option<crate::types::ConsumptionConfiguration> {
        &self.consumption_configuration
    }
    /// Appends an item to `license_metadata`.
    ///
    /// To override the contents of this collection use [`set_license_metadata`](Self::set_license_metadata).
    ///
    /// <p>License metadata.</p>
    pub fn license_metadata(mut self, input: crate::types::Metadata) -> Self {
        let mut v = self.license_metadata.unwrap_or_default();
        v.push(input);
        self.license_metadata = ::std::option::Option::Some(v);
        self
    }
    /// <p>License metadata.</p>
    pub fn set_license_metadata(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Metadata>>) -> Self {
        self.license_metadata = input;
        self
    }
    /// <p>License metadata.</p>
    pub fn get_license_metadata(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Metadata>> {
        &self.license_metadata
    }
    /// <p>License creation time.</p>
    pub fn create_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.create_time = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>License creation time.</p>
    pub fn set_create_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.create_time = input;
        self
    }
    /// <p>License creation time.</p>
    pub fn get_create_time(&self) -> &::std::option::Option<::std::string::String> {
        &self.create_time
    }
    /// <p>License version.</p>
    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>License version.</p>
    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.version = input;
        self
    }
    /// <p>License version.</p>
    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.version
    }
    /// Consumes the builder and constructs a [`License`](crate::types::License).
    pub fn build(self) -> crate::types::License {
        crate::types::License {
            license_arn: self.license_arn,
            license_name: self.license_name,
            product_name: self.product_name,
            product_sku: self.product_sku,
            issuer: self.issuer,
            home_region: self.home_region,
            status: self.status,
            validity: self.validity,
            beneficiary: self.beneficiary,
            entitlements: self.entitlements,
            consumption_configuration: self.consumption_configuration,
            license_metadata: self.license_metadata,
            create_time: self.create_time,
            version: self.version,
        }
    }
}