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 CreateLicenseVersionInput {
    /// <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>License issuer.</p>
    pub issuer: ::std::option::Option<crate::types::Issuer>,
    /// <p>Home Region of 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>Information about the license.</p>
    pub license_metadata: ::std::option::Option<::std::vec::Vec<crate::types::Metadata>>,
    /// <p>License entitlements.</p>
    pub entitlements: ::std::option::Option<::std::vec::Vec<crate::types::Entitlement>>,
    /// <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>License status.</p>
    pub status: ::std::option::Option<crate::types::LicenseStatus>,
    /// <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>Current version of the license.</p>
    pub source_version: ::std::option::Option<::std::string::String>,
}
impl CreateLicenseVersionInput {
    /// <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>License issuer.</p>
    pub fn issuer(&self) -> ::std::option::Option<&crate::types::Issuer> {
        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>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>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>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. 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>License status.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::LicenseStatus> {
        self.status.as_ref()
    }
    /// <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>Current version of the license.</p>
    pub fn source_version(&self) -> ::std::option::Option<&str> {
        self.source_version.as_deref()
    }
}
impl CreateLicenseVersionInput {
    /// Creates a new builder-style object to manufacture [`CreateLicenseVersionInput`](crate::operation::create_license_version::CreateLicenseVersionInput).
    pub fn builder() -> crate::operation::create_license_version::builders::CreateLicenseVersionInputBuilder {
        crate::operation::create_license_version::builders::CreateLicenseVersionInputBuilder::default()
    }
}

/// A builder for [`CreateLicenseVersionInput`](crate::operation::create_license_version::CreateLicenseVersionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateLicenseVersionInputBuilder {
    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) 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) license_metadata: ::std::option::Option<::std::vec::Vec<crate::types::Metadata>>,
    pub(crate) entitlements: ::std::option::Option<::std::vec::Vec<crate::types::Entitlement>>,
    pub(crate) consumption_configuration: ::std::option::Option<crate::types::ConsumptionConfiguration>,
    pub(crate) status: ::std::option::Option<crate::types::LicenseStatus>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) source_version: ::std::option::Option<::std::string::String>,
}
impl CreateLicenseVersionInputBuilder {
    /// <p>Amazon Resource Name (ARN) of the license.</p>
    /// This field is required.
    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>
    /// 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>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 of 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 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>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 `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
    }
    /// 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. 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
    }
    /// <p>License status.</p>
    /// This field is required.
    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>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
    }
    /// <p>Current version of the license.</p>
    pub fn source_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Current version of the license.</p>
    pub fn set_source_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_version = input;
        self
    }
    /// <p>Current version of the license.</p>
    pub fn get_source_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_version
    }
    /// Consumes the builder and constructs a [`CreateLicenseVersionInput`](crate::operation::create_license_version::CreateLicenseVersionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_license_version::CreateLicenseVersionInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_license_version::CreateLicenseVersionInput {
            license_arn: self.license_arn,
            license_name: self.license_name,
            product_name: self.product_name,
            issuer: self.issuer,
            home_region: self.home_region,
            validity: self.validity,
            license_metadata: self.license_metadata,
            entitlements: self.entitlements,
            consumption_configuration: self.consumption_configuration,
            status: self.status,
            client_token: self.client_token,
            source_version: self.source_version,
        })
    }
}