aws-sdk-accountaccess 1.4.0

AWS SDK for Account Access
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 CreateEntitlementInput {
    /// <p>Specifies the ARN of the application to create the entitlement for.</p>
    pub application_arn: ::std::option::Option<::std::string::String>,
    /// <p>Specifies the entitlement configuration, including the principal and the IAM role to grant access to.</p>
    pub entitlement: ::std::option::Option<crate::types::Entitlement>,
}
impl CreateEntitlementInput {
    /// <p>Specifies the ARN of the application to create the entitlement for.</p>
    pub fn application_arn(&self) -> ::std::option::Option<&str> {
        self.application_arn.as_deref()
    }
    /// <p>Specifies the entitlement configuration, including the principal and the IAM role to grant access to.</p>
    pub fn entitlement(&self) -> ::std::option::Option<&crate::types::Entitlement> {
        self.entitlement.as_ref()
    }
}
impl CreateEntitlementInput {
    /// Creates a new builder-style object to manufacture [`CreateEntitlementInput`](crate::operation::create_entitlement::CreateEntitlementInput).
    pub fn builder() -> crate::operation::create_entitlement::builders::CreateEntitlementInputBuilder {
        crate::operation::create_entitlement::builders::CreateEntitlementInputBuilder::default()
    }
}

/// A builder for [`CreateEntitlementInput`](crate::operation::create_entitlement::CreateEntitlementInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateEntitlementInputBuilder {
    pub(crate) application_arn: ::std::option::Option<::std::string::String>,
    pub(crate) entitlement: ::std::option::Option<crate::types::Entitlement>,
}
impl CreateEntitlementInputBuilder {
    /// <p>Specifies the ARN of the application to create the entitlement for.</p>
    /// This field is required.
    pub fn application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.application_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies the ARN of the application to create the entitlement for.</p>
    pub fn set_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application_arn = input;
        self
    }
    /// <p>Specifies the ARN of the application to create the entitlement for.</p>
    pub fn get_application_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.application_arn
    }
    /// <p>Specifies the entitlement configuration, including the principal and the IAM role to grant access to.</p>
    /// This field is required.
    pub fn entitlement(mut self, input: crate::types::Entitlement) -> Self {
        self.entitlement = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the entitlement configuration, including the principal and the IAM role to grant access to.</p>
    pub fn set_entitlement(mut self, input: ::std::option::Option<crate::types::Entitlement>) -> Self {
        self.entitlement = input;
        self
    }
    /// <p>Specifies the entitlement configuration, including the principal and the IAM role to grant access to.</p>
    pub fn get_entitlement(&self) -> &::std::option::Option<crate::types::Entitlement> {
        &self.entitlement
    }
    /// Consumes the builder and constructs a [`CreateEntitlementInput`](crate::operation::create_entitlement::CreateEntitlementInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_entitlement::CreateEntitlementInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_entitlement::CreateEntitlementInput {
            application_arn: self.application_arn,
            entitlement: self.entitlement,
        })
    }
}