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
// 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 UpdateAnalysisPermissionsInput {
/// <p>The ID of the Amazon Web Services account that contains the analysis whose permissions you're updating. You must be using the Amazon Web Services account that the analysis is in.</p>
pub aws_account_id: ::std::option::Option<::std::string::String>,
/// <p>The ID of the analysis whose permissions you're updating. The ID is part of the analysis URL.</p>
pub analysis_id: ::std::option::Option<::std::string::String>,
/// <p>A structure that describes the permissions to add and the principal to add them to.</p>
pub grant_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
/// <p>A structure that describes the permissions to remove and the principal to remove them from.</p>
pub revoke_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
}
impl UpdateAnalysisPermissionsInput {
/// <p>The ID of the Amazon Web Services account that contains the analysis whose permissions you're updating. You must be using the Amazon Web Services account that the analysis is in.</p>
pub fn aws_account_id(&self) -> ::std::option::Option<&str> {
self.aws_account_id.as_deref()
}
/// <p>The ID of the analysis whose permissions you're updating. The ID is part of the analysis URL.</p>
pub fn analysis_id(&self) -> ::std::option::Option<&str> {
self.analysis_id.as_deref()
}
/// <p>A structure that describes the permissions to add and the principal to add them to.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.grant_permissions.is_none()`.
pub fn grant_permissions(&self) -> &[crate::types::ResourcePermission] {
self.grant_permissions.as_deref().unwrap_or_default()
}
/// <p>A structure that describes the permissions to remove and the principal to remove them from.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.revoke_permissions.is_none()`.
pub fn revoke_permissions(&self) -> &[crate::types::ResourcePermission] {
self.revoke_permissions.as_deref().unwrap_or_default()
}
}
impl UpdateAnalysisPermissionsInput {
/// Creates a new builder-style object to manufacture [`UpdateAnalysisPermissionsInput`](crate::operation::update_analysis_permissions::UpdateAnalysisPermissionsInput).
pub fn builder() -> crate::operation::update_analysis_permissions::builders::UpdateAnalysisPermissionsInputBuilder {
crate::operation::update_analysis_permissions::builders::UpdateAnalysisPermissionsInputBuilder::default()
}
}
/// A builder for [`UpdateAnalysisPermissionsInput`](crate::operation::update_analysis_permissions::UpdateAnalysisPermissionsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateAnalysisPermissionsInputBuilder {
pub(crate) aws_account_id: ::std::option::Option<::std::string::String>,
pub(crate) analysis_id: ::std::option::Option<::std::string::String>,
pub(crate) grant_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
pub(crate) revoke_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
}
impl UpdateAnalysisPermissionsInputBuilder {
/// <p>The ID of the Amazon Web Services account that contains the analysis whose permissions you're updating. You must be using the Amazon Web Services account that the analysis is in.</p>
/// This field is required.
pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.aws_account_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the Amazon Web Services account that contains the analysis whose permissions you're updating. You must be using the Amazon Web Services account that the analysis is in.</p>
pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.aws_account_id = input;
self
}
/// <p>The ID of the Amazon Web Services account that contains the analysis whose permissions you're updating. You must be using the Amazon Web Services account that the analysis is in.</p>
pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.aws_account_id
}
/// <p>The ID of the analysis whose permissions you're updating. The ID is part of the analysis URL.</p>
/// This field is required.
pub fn analysis_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.analysis_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the analysis whose permissions you're updating. The ID is part of the analysis URL.</p>
pub fn set_analysis_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.analysis_id = input;
self
}
/// <p>The ID of the analysis whose permissions you're updating. The ID is part of the analysis URL.</p>
pub fn get_analysis_id(&self) -> &::std::option::Option<::std::string::String> {
&self.analysis_id
}
/// Appends an item to `grant_permissions`.
///
/// To override the contents of this collection use [`set_grant_permissions`](Self::set_grant_permissions).
///
/// <p>A structure that describes the permissions to add and the principal to add them to.</p>
pub fn grant_permissions(mut self, input: crate::types::ResourcePermission) -> Self {
let mut v = self.grant_permissions.unwrap_or_default();
v.push(input);
self.grant_permissions = ::std::option::Option::Some(v);
self
}
/// <p>A structure that describes the permissions to add and the principal to add them to.</p>
pub fn set_grant_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
self.grant_permissions = input;
self
}
/// <p>A structure that describes the permissions to add and the principal to add them to.</p>
pub fn get_grant_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
&self.grant_permissions
}
/// Appends an item to `revoke_permissions`.
///
/// To override the contents of this collection use [`set_revoke_permissions`](Self::set_revoke_permissions).
///
/// <p>A structure that describes the permissions to remove and the principal to remove them from.</p>
pub fn revoke_permissions(mut self, input: crate::types::ResourcePermission) -> Self {
let mut v = self.revoke_permissions.unwrap_or_default();
v.push(input);
self.revoke_permissions = ::std::option::Option::Some(v);
self
}
/// <p>A structure that describes the permissions to remove and the principal to remove them from.</p>
pub fn set_revoke_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
self.revoke_permissions = input;
self
}
/// <p>A structure that describes the permissions to remove and the principal to remove them from.</p>
pub fn get_revoke_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
&self.revoke_permissions
}
/// Consumes the builder and constructs a [`UpdateAnalysisPermissionsInput`](crate::operation::update_analysis_permissions::UpdateAnalysisPermissionsInput).
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::update_analysis_permissions::UpdateAnalysisPermissionsInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::update_analysis_permissions::UpdateAnalysisPermissionsInput {
aws_account_id: self.aws_account_id,
analysis_id: self.analysis_id,
grant_permissions: self.grant_permissions,
revoke_permissions: self.revoke_permissions,
})
}
}