aws-sdk-ram 1.103.0

AWS SDK for AWS Resource Access Manager
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes a principal for use with Resource Access Manager.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Principal {
    /// <p>The ID of the principal that can be associated with a resource share.</p>
    pub id: ::std::option::Option<::std::string::String>,
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of a resource share the principal is associated with.</p>
    pub resource_share_arn: ::std::option::Option<::std::string::String>,
    /// <p>The date and time when the principal was associated with the resource share.</p>
    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time when the association between the resource share and the principal was last updated.</p>
    pub last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Indicates the relationship between the Amazon Web Services account the principal belongs to and the account that owns the resource share:</p>
    /// <ul>
    /// <li>
    /// <p><code>True</code> – The two accounts belong to same organization.</p></li>
    /// <li>
    /// <p><code>False</code> – The two accounts do not belong to the same organization.</p></li>
    /// </ul>
    pub external: ::std::option::Option<bool>,
}
impl Principal {
    /// <p>The ID of the principal that can be associated with a resource share.</p>
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of a resource share the principal is associated with.</p>
    pub fn resource_share_arn(&self) -> ::std::option::Option<&str> {
        self.resource_share_arn.as_deref()
    }
    /// <p>The date and time when the principal was associated with the resource share.</p>
    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
    /// <p>The date and time when the association between the resource share and the principal was last updated.</p>
    pub fn last_updated_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_updated_time.as_ref()
    }
    /// <p>Indicates the relationship between the Amazon Web Services account the principal belongs to and the account that owns the resource share:</p>
    /// <ul>
    /// <li>
    /// <p><code>True</code> – The two accounts belong to same organization.</p></li>
    /// <li>
    /// <p><code>False</code> – The two accounts do not belong to the same organization.</p></li>
    /// </ul>
    pub fn external(&self) -> ::std::option::Option<bool> {
        self.external
    }
}
impl Principal {
    /// Creates a new builder-style object to manufacture [`Principal`](crate::types::Principal).
    pub fn builder() -> crate::types::builders::PrincipalBuilder {
        crate::types::builders::PrincipalBuilder::default()
    }
}

/// A builder for [`Principal`](crate::types::Principal).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PrincipalBuilder {
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) resource_share_arn: ::std::option::Option<::std::string::String>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_updated_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) external: ::std::option::Option<bool>,
}
impl PrincipalBuilder {
    /// <p>The ID of the principal that can be associated with a resource share.</p>
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the principal that can be associated with a resource share.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The ID of the principal that can be associated with a resource share.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of a resource share the principal is associated with.</p>
    pub fn resource_share_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_share_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of a resource share the principal is associated with.</p>
    pub fn set_resource_share_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_share_arn = input;
        self
    }
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of a resource share the principal is associated with.</p>
    pub fn get_resource_share_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_share_arn
    }
    /// <p>The date and time when the principal was associated with the resource share.</p>
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the principal was associated with the resource share.</p>
    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The date and time when the principal was associated with the resource share.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>The date and time when the association between the resource share and the principal was last updated.</p>
    pub fn last_updated_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_updated_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the association between the resource share and the principal was last updated.</p>
    pub fn set_last_updated_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_updated_time = input;
        self
    }
    /// <p>The date and time when the association between the resource share and the principal was last updated.</p>
    pub fn get_last_updated_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_updated_time
    }
    /// <p>Indicates the relationship between the Amazon Web Services account the principal belongs to and the account that owns the resource share:</p>
    /// <ul>
    /// <li>
    /// <p><code>True</code> – The two accounts belong to same organization.</p></li>
    /// <li>
    /// <p><code>False</code> – The two accounts do not belong to the same organization.</p></li>
    /// </ul>
    pub fn external(mut self, input: bool) -> Self {
        self.external = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates the relationship between the Amazon Web Services account the principal belongs to and the account that owns the resource share:</p>
    /// <ul>
    /// <li>
    /// <p><code>True</code> – The two accounts belong to same organization.</p></li>
    /// <li>
    /// <p><code>False</code> – The two accounts do not belong to the same organization.</p></li>
    /// </ul>
    pub fn set_external(mut self, input: ::std::option::Option<bool>) -> Self {
        self.external = input;
        self
    }
    /// <p>Indicates the relationship between the Amazon Web Services account the principal belongs to and the account that owns the resource share:</p>
    /// <ul>
    /// <li>
    /// <p><code>True</code> – The two accounts belong to same organization.</p></li>
    /// <li>
    /// <p><code>False</code> – The two accounts do not belong to the same organization.</p></li>
    /// </ul>
    pub fn get_external(&self) -> &::std::option::Option<bool> {
        &self.external
    }
    /// Consumes the builder and constructs a [`Principal`](crate::types::Principal).
    pub fn build(self) -> crate::types::Principal {
        crate::types::Principal {
            id: self.id,
            resource_share_arn: self.resource_share_arn,
            creation_time: self.creation_time,
            last_updated_time: self.last_updated_time,
            external: self.external,
        }
    }
}