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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The current account setting for a resource.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Setting {
/// <p>The Amazon ECS resource name.</p>
pub name: ::std::option::Option<crate::types::SettingName>,
/// <p>Determines whether the account setting is on or off for the specified resource.</p>
pub value: ::std::option::Option<::std::string::String>,
/// <p>The ARN of the principal. It can be a user, role, or the root user. If this field is omitted, the authenticated user is assumed.</p>
pub principal_arn: ::std::option::Option<::std::string::String>,
/// <p>Indicates whether Amazon Web Services manages the account setting, or if the user manages it.</p>
/// <p><code>aws_managed</code> account settings are read-only, as Amazon Web Services manages such on the customer's behalf. Currently, the <code>guardDutyActivate</code> account setting is the only one Amazon Web Services manages.</p>
pub r#type: ::std::option::Option<crate::types::SettingType>,
}
impl Setting {
/// <p>The Amazon ECS resource name.</p>
pub fn name(&self) -> ::std::option::Option<&crate::types::SettingName> {
self.name.as_ref()
}
/// <p>Determines whether the account setting is on or off for the specified resource.</p>
pub fn value(&self) -> ::std::option::Option<&str> {
self.value.as_deref()
}
/// <p>The ARN of the principal. It can be a user, role, or the root user. If this field is omitted, the authenticated user is assumed.</p>
pub fn principal_arn(&self) -> ::std::option::Option<&str> {
self.principal_arn.as_deref()
}
/// <p>Indicates whether Amazon Web Services manages the account setting, or if the user manages it.</p>
/// <p><code>aws_managed</code> account settings are read-only, as Amazon Web Services manages such on the customer's behalf. Currently, the <code>guardDutyActivate</code> account setting is the only one Amazon Web Services manages.</p>
pub fn r#type(&self) -> ::std::option::Option<&crate::types::SettingType> {
self.r#type.as_ref()
}
}
impl Setting {
/// Creates a new builder-style object to manufacture [`Setting`](crate::types::Setting).
pub fn builder() -> crate::types::builders::SettingBuilder {
crate::types::builders::SettingBuilder::default()
}
}
/// A builder for [`Setting`](crate::types::Setting).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SettingBuilder {
pub(crate) name: ::std::option::Option<crate::types::SettingName>,
pub(crate) value: ::std::option::Option<::std::string::String>,
pub(crate) principal_arn: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<crate::types::SettingType>,
}
impl SettingBuilder {
/// <p>The Amazon ECS resource name.</p>
pub fn name(mut self, input: crate::types::SettingName) -> Self {
self.name = ::std::option::Option::Some(input);
self
}
/// <p>The Amazon ECS resource name.</p>
pub fn set_name(mut self, input: ::std::option::Option<crate::types::SettingName>) -> Self {
self.name = input;
self
}
/// <p>The Amazon ECS resource name.</p>
pub fn get_name(&self) -> &::std::option::Option<crate::types::SettingName> {
&self.name
}
/// <p>Determines whether the account setting is on or off for the specified resource.</p>
pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.value = ::std::option::Option::Some(input.into());
self
}
/// <p>Determines whether the account setting is on or off for the specified resource.</p>
pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.value = input;
self
}
/// <p>Determines whether the account setting is on or off for the specified resource.</p>
pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
&self.value
}
/// <p>The ARN of the principal. It can be a user, role, or the root user. If this field is omitted, the authenticated user is assumed.</p>
pub fn principal_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.principal_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN of the principal. It can be a user, role, or the root user. If this field is omitted, the authenticated user is assumed.</p>
pub fn set_principal_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.principal_arn = input;
self
}
/// <p>The ARN of the principal. It can be a user, role, or the root user. If this field is omitted, the authenticated user is assumed.</p>
pub fn get_principal_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.principal_arn
}
/// <p>Indicates whether Amazon Web Services manages the account setting, or if the user manages it.</p>
/// <p><code>aws_managed</code> account settings are read-only, as Amazon Web Services manages such on the customer's behalf. Currently, the <code>guardDutyActivate</code> account setting is the only one Amazon Web Services manages.</p>
pub fn r#type(mut self, input: crate::types::SettingType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// <p>Indicates whether Amazon Web Services manages the account setting, or if the user manages it.</p>
/// <p><code>aws_managed</code> account settings are read-only, as Amazon Web Services manages such on the customer's behalf. Currently, the <code>guardDutyActivate</code> account setting is the only one Amazon Web Services manages.</p>
pub fn set_type(mut self, input: ::std::option::Option<crate::types::SettingType>) -> Self {
self.r#type = input;
self
}
/// <p>Indicates whether Amazon Web Services manages the account setting, or if the user manages it.</p>
/// <p><code>aws_managed</code> account settings are read-only, as Amazon Web Services manages such on the customer's behalf. Currently, the <code>guardDutyActivate</code> account setting is the only one Amazon Web Services manages.</p>
pub fn get_type(&self) -> &::std::option::Option<crate::types::SettingType> {
&self.r#type
}
/// Consumes the builder and constructs a [`Setting`](crate::types::Setting).
pub fn build(self) -> crate::types::Setting {
crate::types::Setting {
name: self.name,
value: self.value,
principal_arn: self.principal_arn,
r#type: self.r#type,
}
}
}