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 CreateLicenseInput {
    /// <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::Issuer>,
    /// <p>Home Region for the license.</p>
    pub home_region: ::std::option::Option<::std::string::String>,
    /// <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 entitlements.</p>
    pub entitlements: ::std::option::Option<::std::vec::Vec<crate::types::Entitlement>>,
    /// <p>License beneficiary.</p>
    pub beneficiary: ::std::option::Option<::std::string::String>,
    /// <p>Configuration for consumption of the license. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</p>
    pub consumption_configuration: ::std::option::Option<crate::types::ConsumptionConfiguration>,
    /// <p>Information about the license.</p>
    pub license_metadata: ::std::option::Option<::std::vec::Vec<crate::types::Metadata>>,
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>Tags to add to the license. For more information about tagging support in License Manager, see the <a href="https://docs.aws.amazon.com/license-manager/latest/APIReference/API_TagResource.html">TagResource</a> operation.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateLicenseInput {
    /// <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::Issuer> {
        self.issuer.as_ref()
    }
    /// <p>Home Region for the license.</p>
    pub fn home_region(&self) -> ::std::option::Option<&str> {
        self.home_region.as_deref()
    }
    /// <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 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>License beneficiary.</p>
    pub fn beneficiary(&self) -> ::std::option::Option<&str> {
        self.beneficiary.as_deref()
    }
    /// <p>Configuration for consumption of the license. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</p>
    pub fn consumption_configuration(&self) -> ::std::option::Option<&crate::types::ConsumptionConfiguration> {
        self.consumption_configuration.as_ref()
    }
    /// <p>Information about the license.</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>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>Tags to add to the license. For more information about tagging support in License Manager, see the <a href="https://docs.aws.amazon.com/license-manager/latest/APIReference/API_TagResource.html">TagResource</a> operation.</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()
    }
}
impl CreateLicenseInput {
    /// Creates a new builder-style object to manufacture [`CreateLicenseInput`](crate::operation::create_license::CreateLicenseInput).
    pub fn builder() -> crate::operation::create_license::builders::CreateLicenseInputBuilder {
        crate::operation::create_license::builders::CreateLicenseInputBuilder::default()
    }
}

/// A builder for [`CreateLicenseInput`](crate::operation::create_license::CreateLicenseInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateLicenseInputBuilder {
    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::Issuer>,
    pub(crate) home_region: ::std::option::Option<::std::string::String>,
    pub(crate) validity: ::std::option::Option<crate::types::DatetimeRange>,
    pub(crate) entitlements: ::std::option::Option<::std::vec::Vec<crate::types::Entitlement>>,
    pub(crate) beneficiary: ::std::option::Option<::std::string::String>,
    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) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateLicenseInputBuilder {
    /// <p>License name.</p>
    /// This field is required.
    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>
    /// This field is required.
    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>
    /// This field is required.
    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>
    /// This field is required.
    pub fn issuer(mut self, input: crate::types::Issuer) -> 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::Issuer>) -> Self {
        self.issuer = input;
        self
    }
    /// <p>License issuer.</p>
    pub fn get_issuer(&self) -> &::std::option::Option<crate::types::Issuer> {
        &self.issuer
    }
    /// <p>Home Region for the license.</p>
    /// This field is required.
    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 for 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 for the license.</p>
    pub fn get_home_region(&self) -> &::std::option::Option<::std::string::String> {
        &self.home_region
    }
    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
    /// This field is required.
    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
    }
    /// 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>License beneficiary.</p>
    /// This field is required.
    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
    }
    /// <p>Configuration for consumption of the license. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</p>
    /// This field is required.
    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. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</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. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</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>Information about the license.</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>Information about the license.</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>Information about the license.</p>
    pub fn get_license_metadata(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Metadata>> {
        &self.license_metadata
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    /// This field is required.
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// 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. For more information about tagging support in License Manager, see the <a href="https://docs.aws.amazon.com/license-manager/latest/APIReference/API_TagResource.html">TagResource</a> operation.</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. For more information about tagging support in License Manager, see the <a href="https://docs.aws.amazon.com/license-manager/latest/APIReference/API_TagResource.html">TagResource</a> operation.</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. For more information about tagging support in License Manager, see the <a href="https://docs.aws.amazon.com/license-manager/latest/APIReference/API_TagResource.html">TagResource</a> operation.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateLicenseInput`](crate::operation::create_license::CreateLicenseInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_license::CreateLicenseInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_license::CreateLicenseInput {
            license_name: self.license_name,
            product_name: self.product_name,
            product_sku: self.product_sku,
            issuer: self.issuer,
            home_region: self.home_region,
            validity: self.validity,
            entitlements: self.entitlements,
            beneficiary: self.beneficiary,
            consumption_configuration: self.consumption_configuration,
            license_metadata: self.license_metadata,
            client_token: self.client_token,
            tags: self.tags,
        })
    }
}