1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// 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).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
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,
        }
    }
}