aws-sdk-accountaccess 1.2.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 GetEntitlementOutput {
    /// <p>The ARN of the application that the entitlement belongs to.</p>
    pub application_arn: ::std::string::String,
    /// <p>The unique identifier of the entitlement.</p>
    pub entitlement_id: ::std::string::String,
    /// <p>The entitlement details, including the principal, IAM role, and target account.</p>
    pub entitlement: ::std::option::Option<crate::types::EntitlementDetails>,
    /// <p>The date and time when the entitlement was created.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl GetEntitlementOutput {
    /// <p>The ARN of the application that the entitlement belongs to.</p>
    pub fn application_arn(&self) -> &str {
        use std::ops::Deref;
        self.application_arn.deref()
    }
    /// <p>The unique identifier of the entitlement.</p>
    pub fn entitlement_id(&self) -> &str {
        use std::ops::Deref;
        self.entitlement_id.deref()
    }
    /// <p>The entitlement details, including the principal, IAM role, and target account.</p>
    pub fn entitlement(&self) -> ::std::option::Option<&crate::types::EntitlementDetails> {
        self.entitlement.as_ref()
    }
    /// <p>The date and time when the entitlement was created.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
}
impl ::aws_types::request_id::RequestId for GetEntitlementOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetEntitlementOutput {
    /// Creates a new builder-style object to manufacture [`GetEntitlementOutput`](crate::operation::get_entitlement::GetEntitlementOutput).
    pub fn builder() -> crate::operation::get_entitlement::builders::GetEntitlementOutputBuilder {
        crate::operation::get_entitlement::builders::GetEntitlementOutputBuilder::default()
    }
}

/// A builder for [`GetEntitlementOutput`](crate::operation::get_entitlement::GetEntitlementOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetEntitlementOutputBuilder {
    pub(crate) application_arn: ::std::option::Option<::std::string::String>,
    pub(crate) entitlement_id: ::std::option::Option<::std::string::String>,
    pub(crate) entitlement: ::std::option::Option<crate::types::EntitlementDetails>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetEntitlementOutputBuilder {
    /// <p>The ARN of the application that the entitlement belongs to.</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>The ARN of the application that the entitlement belongs to.</p>
    pub fn set_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application_arn = input;
        self
    }
    /// <p>The ARN of the application that the entitlement belongs to.</p>
    pub fn get_application_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.application_arn
    }
    /// <p>The unique identifier of the entitlement.</p>
    /// This field is required.
    pub fn entitlement_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.entitlement_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the entitlement.</p>
    pub fn set_entitlement_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.entitlement_id = input;
        self
    }
    /// <p>The unique identifier of the entitlement.</p>
    pub fn get_entitlement_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.entitlement_id
    }
    /// <p>The entitlement details, including the principal, IAM role, and target account.</p>
    /// This field is required.
    pub fn entitlement(mut self, input: crate::types::EntitlementDetails) -> Self {
        self.entitlement = ::std::option::Option::Some(input);
        self
    }
    /// <p>The entitlement details, including the principal, IAM role, and target account.</p>
    pub fn set_entitlement(mut self, input: ::std::option::Option<crate::types::EntitlementDetails>) -> Self {
        self.entitlement = input;
        self
    }
    /// <p>The entitlement details, including the principal, IAM role, and target account.</p>
    pub fn get_entitlement(&self) -> &::std::option::Option<crate::types::EntitlementDetails> {
        &self.entitlement
    }
    /// <p>The date and time when the entitlement was created.</p>
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the entitlement was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The date and time when the entitlement was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetEntitlementOutput`](crate::operation::get_entitlement::GetEntitlementOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`application_arn`](crate::operation::get_entitlement::builders::GetEntitlementOutputBuilder::application_arn)
    /// - [`entitlement_id`](crate::operation::get_entitlement::builders::GetEntitlementOutputBuilder::entitlement_id)
    /// - [`created_at`](crate::operation::get_entitlement::builders::GetEntitlementOutputBuilder::created_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_entitlement::GetEntitlementOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_entitlement::GetEntitlementOutput {
            application_arn: self.application_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "application_arn",
                    "application_arn was not specified but it is required when building GetEntitlementOutput",
                )
            })?,
            entitlement_id: self.entitlement_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "entitlement_id",
                    "entitlement_id was not specified but it is required when building GetEntitlementOutput",
                )
            })?,
            entitlement: self.entitlement,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building GetEntitlementOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}