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 UpdateTopicPermissionsInput {
/// <p>The ID of the Amazon Web Services account that contains the topic that you want to update the permissions for.</p>
pub aws_account_id: ::std::option::Option<::std::string::String>,
/// <p>The ID of the topic that you want to modify. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
pub topic_id: ::std::option::Option<::std::string::String>,
/// <p>The resource permissions that you want to grant to the topic.</p>
pub grant_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
/// <p>The resource permissions that you want to revoke from the topic.</p>
pub revoke_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
}
impl UpdateTopicPermissionsInput {
/// <p>The ID of the Amazon Web Services account that contains the topic that you want to update the permissions for.</p>
pub fn aws_account_id(&self) -> ::std::option::Option<&str> {
self.aws_account_id.as_deref()
}
/// <p>The ID of the topic that you want to modify. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
pub fn topic_id(&self) -> ::std::option::Option<&str> {
self.topic_id.as_deref()
}
/// <p>The resource permissions that you want to grant to the topic.</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>The resource permissions that you want to revoke from the topic.</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 UpdateTopicPermissionsInput {
/// Creates a new builder-style object to manufacture [`UpdateTopicPermissionsInput`](crate::operation::update_topic_permissions::UpdateTopicPermissionsInput).
pub fn builder() -> crate::operation::update_topic_permissions::builders::UpdateTopicPermissionsInputBuilder {
crate::operation::update_topic_permissions::builders::UpdateTopicPermissionsInputBuilder::default()
}
}
/// A builder for [`UpdateTopicPermissionsInput`](crate::operation::update_topic_permissions::UpdateTopicPermissionsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateTopicPermissionsInputBuilder {
pub(crate) aws_account_id: ::std::option::Option<::std::string::String>,
pub(crate) topic_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 UpdateTopicPermissionsInputBuilder {
/// <p>The ID of the Amazon Web Services account that contains the topic that you want to update the permissions for.</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 topic that you want to update the permissions for.</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 topic that you want to update the permissions for.</p>
pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.aws_account_id
}
/// <p>The ID of the topic that you want to modify. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
/// This field is required.
pub fn topic_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.topic_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the topic that you want to modify. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
pub fn set_topic_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.topic_id = input;
self
}
/// <p>The ID of the topic that you want to modify. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
pub fn get_topic_id(&self) -> &::std::option::Option<::std::string::String> {
&self.topic_id
}
/// Appends an item to `grant_permissions`.
///
/// To override the contents of this collection use [`set_grant_permissions`](Self::set_grant_permissions).
///
/// <p>The resource permissions that you want to grant to the topic.</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>The resource permissions that you want to grant to the topic.</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>The resource permissions that you want to grant to the topic.</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>The resource permissions that you want to revoke from the topic.</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>The resource permissions that you want to revoke from the topic.</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>The resource permissions that you want to revoke from the topic.</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 [`UpdateTopicPermissionsInput`](crate::operation::update_topic_permissions::UpdateTopicPermissionsInput).
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::update_topic_permissions::UpdateTopicPermissionsInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::update_topic_permissions::UpdateTopicPermissionsInput {
aws_account_id: self.aws_account_id,
topic_id: self.topic_id,
grant_permissions: self.grant_permissions,
revoke_permissions: self.revoke_permissions,
})
}
}