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 CheckoutLicenseInput {
    /// <p>Product SKU.</p>
    pub product_sku: ::std::option::Option<::std::string::String>,
    /// <p>Checkout type.</p>
    pub checkout_type: ::std::option::Option<crate::types::CheckoutType>,
    /// <p>Key fingerprint identifying the license.</p>
    pub key_fingerprint: ::std::option::Option<::std::string::String>,
    /// <p>License entitlements.</p>
    pub entitlements: ::std::option::Option<::std::vec::Vec<crate::types::EntitlementData>>,
    /// <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>License beneficiary.</p>
    pub beneficiary: ::std::option::Option<::std::string::String>,
    /// <p>Node ID.</p>
    pub node_id: ::std::option::Option<::std::string::String>,
}
impl CheckoutLicenseInput {
    /// <p>Product SKU.</p>
    pub fn product_sku(&self) -> ::std::option::Option<&str> {
        self.product_sku.as_deref()
    }
    /// <p>Checkout type.</p>
    pub fn checkout_type(&self) -> ::std::option::Option<&crate::types::CheckoutType> {
        self.checkout_type.as_ref()
    }
    /// <p>Key fingerprint identifying the license.</p>
    pub fn key_fingerprint(&self) -> ::std::option::Option<&str> {
        self.key_fingerprint.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::EntitlementData] {
        self.entitlements.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>License beneficiary.</p>
    pub fn beneficiary(&self) -> ::std::option::Option<&str> {
        self.beneficiary.as_deref()
    }
    /// <p>Node ID.</p>
    pub fn node_id(&self) -> ::std::option::Option<&str> {
        self.node_id.as_deref()
    }
}
impl CheckoutLicenseInput {
    /// Creates a new builder-style object to manufacture [`CheckoutLicenseInput`](crate::operation::checkout_license::CheckoutLicenseInput).
    pub fn builder() -> crate::operation::checkout_license::builders::CheckoutLicenseInputBuilder {
        crate::operation::checkout_license::builders::CheckoutLicenseInputBuilder::default()
    }
}

/// A builder for [`CheckoutLicenseInput`](crate::operation::checkout_license::CheckoutLicenseInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CheckoutLicenseInputBuilder {
    pub(crate) product_sku: ::std::option::Option<::std::string::String>,
    pub(crate) checkout_type: ::std::option::Option<crate::types::CheckoutType>,
    pub(crate) key_fingerprint: ::std::option::Option<::std::string::String>,
    pub(crate) entitlements: ::std::option::Option<::std::vec::Vec<crate::types::EntitlementData>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) beneficiary: ::std::option::Option<::std::string::String>,
    pub(crate) node_id: ::std::option::Option<::std::string::String>,
}
impl CheckoutLicenseInputBuilder {
    /// <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>Checkout type.</p>
    /// This field is required.
    pub fn checkout_type(mut self, input: crate::types::CheckoutType) -> Self {
        self.checkout_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Checkout type.</p>
    pub fn set_checkout_type(mut self, input: ::std::option::Option<crate::types::CheckoutType>) -> Self {
        self.checkout_type = input;
        self
    }
    /// <p>Checkout type.</p>
    pub fn get_checkout_type(&self) -> &::std::option::Option<crate::types::CheckoutType> {
        &self.checkout_type
    }
    /// <p>Key fingerprint identifying the license.</p>
    /// This field is required.
    pub fn key_fingerprint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.key_fingerprint = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Key fingerprint identifying the license.</p>
    pub fn set_key_fingerprint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.key_fingerprint = input;
        self
    }
    /// <p>Key fingerprint identifying the license.</p>
    pub fn get_key_fingerprint(&self) -> &::std::option::Option<::std::string::String> {
        &self.key_fingerprint
    }
    /// 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::EntitlementData) -> 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::EntitlementData>>) -> Self {
        self.entitlements = input;
        self
    }
    /// <p>License entitlements.</p>
    pub fn get_entitlements(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EntitlementData>> {
        &self.entitlements
    }
    /// <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>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
    }
    /// <p>Node ID.</p>
    pub fn node_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.node_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Node ID.</p>
    pub fn set_node_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.node_id = input;
        self
    }
    /// <p>Node ID.</p>
    pub fn get_node_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.node_id
    }
    /// Consumes the builder and constructs a [`CheckoutLicenseInput`](crate::operation::checkout_license::CheckoutLicenseInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::checkout_license::CheckoutLicenseInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::checkout_license::CheckoutLicenseInput {
            product_sku: self.product_sku,
            checkout_type: self.checkout_type,
            key_fingerprint: self.key_fingerprint,
            entitlements: self.entitlements,
            client_token: self.client_token,
            beneficiary: self.beneficiary,
            node_id: self.node_id,
        })
    }
}