aws_sdk_sqs/operation/add_permission/_add_permission_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p></p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AddPermissionInput {
7 /// <p>The URL of the Amazon SQS queue to which permissions are added.</p>
8 /// <p>Queue URLs and names are case-sensitive.</p>
9 pub queue_url: ::std::option::Option<::std::string::String>,
10 /// <p>The unique identification of the permission you're setting (for example, <code>AliceSendMessage</code>). Maximum 80 characters. Allowed characters include alphanumeric characters, hyphens (<code>-</code>), and underscores (<code>_</code>).</p>
11 pub label: ::std::option::Option<::std::string::String>,
12 /// <p>The Amazon Web Services account numbers of the <a href="https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principals</a> who are to receive permission. For information about locating the Amazon Web Services account identification, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication">Your Amazon Web Services Identifiers</a> in the <i>Amazon SQS Developer Guide</i>.</p>
13 pub aws_account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14 /// <p>The action the client wants to allow for the specified principal. Valid values: the name of any action or <code>*</code>.</p>
15 /// <p>For more information about these actions, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html">Overview of Managing Access Permissions to Your Amazon Simple Queue Service Resource</a> in the <i>Amazon SQS Developer Guide</i>.</p>
16 /// <p>Specifying <code>SendMessage</code>, <code>DeleteMessage</code>, or <code>ChangeMessageVisibility</code> for <code>ActionName.n</code> also grants permissions for the corresponding batch versions of those actions: <code>SendMessageBatch</code>, <code>DeleteMessageBatch</code>, and <code>ChangeMessageVisibilityBatch</code>.</p>
17 pub actions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
18}
19impl AddPermissionInput {
20 /// <p>The URL of the Amazon SQS queue to which permissions are added.</p>
21 /// <p>Queue URLs and names are case-sensitive.</p>
22 pub fn queue_url(&self) -> ::std::option::Option<&str> {
23 self.queue_url.as_deref()
24 }
25 /// <p>The unique identification of the permission you're setting (for example, <code>AliceSendMessage</code>). Maximum 80 characters. Allowed characters include alphanumeric characters, hyphens (<code>-</code>), and underscores (<code>_</code>).</p>
26 pub fn label(&self) -> ::std::option::Option<&str> {
27 self.label.as_deref()
28 }
29 /// <p>The Amazon Web Services account numbers of the <a href="https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principals</a> who are to receive permission. For information about locating the Amazon Web Services account identification, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication">Your Amazon Web Services Identifiers</a> in the <i>Amazon SQS Developer Guide</i>.</p>
30 ///
31 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.aws_account_ids.is_none()`.
32 pub fn aws_account_ids(&self) -> &[::std::string::String] {
33 self.aws_account_ids.as_deref().unwrap_or_default()
34 }
35 /// <p>The action the client wants to allow for the specified principal. Valid values: the name of any action or <code>*</code>.</p>
36 /// <p>For more information about these actions, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html">Overview of Managing Access Permissions to Your Amazon Simple Queue Service Resource</a> in the <i>Amazon SQS Developer Guide</i>.</p>
37 /// <p>Specifying <code>SendMessage</code>, <code>DeleteMessage</code>, or <code>ChangeMessageVisibility</code> for <code>ActionName.n</code> also grants permissions for the corresponding batch versions of those actions: <code>SendMessageBatch</code>, <code>DeleteMessageBatch</code>, and <code>ChangeMessageVisibilityBatch</code>.</p>
38 ///
39 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.actions.is_none()`.
40 pub fn actions(&self) -> &[::std::string::String] {
41 self.actions.as_deref().unwrap_or_default()
42 }
43}
44impl AddPermissionInput {
45 /// Creates a new builder-style object to manufacture [`AddPermissionInput`](crate::operation::add_permission::AddPermissionInput).
46 pub fn builder() -> crate::operation::add_permission::builders::AddPermissionInputBuilder {
47 crate::operation::add_permission::builders::AddPermissionInputBuilder::default()
48 }
49}
50
51/// A builder for [`AddPermissionInput`](crate::operation::add_permission::AddPermissionInput).
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
53#[non_exhaustive]
54pub struct AddPermissionInputBuilder {
55 pub(crate) queue_url: ::std::option::Option<::std::string::String>,
56 pub(crate) label: ::std::option::Option<::std::string::String>,
57 pub(crate) aws_account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
58 pub(crate) actions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
59}
60impl AddPermissionInputBuilder {
61 /// <p>The URL of the Amazon SQS queue to which permissions are added.</p>
62 /// <p>Queue URLs and names are case-sensitive.</p>
63 /// This field is required.
64 pub fn queue_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65 self.queue_url = ::std::option::Option::Some(input.into());
66 self
67 }
68 /// <p>The URL of the Amazon SQS queue to which permissions are added.</p>
69 /// <p>Queue URLs and names are case-sensitive.</p>
70 pub fn set_queue_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71 self.queue_url = input;
72 self
73 }
74 /// <p>The URL of the Amazon SQS queue to which permissions are added.</p>
75 /// <p>Queue URLs and names are case-sensitive.</p>
76 pub fn get_queue_url(&self) -> &::std::option::Option<::std::string::String> {
77 &self.queue_url
78 }
79 /// <p>The unique identification of the permission you're setting (for example, <code>AliceSendMessage</code>). Maximum 80 characters. Allowed characters include alphanumeric characters, hyphens (<code>-</code>), and underscores (<code>_</code>).</p>
80 /// This field is required.
81 pub fn label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.label = ::std::option::Option::Some(input.into());
83 self
84 }
85 /// <p>The unique identification of the permission you're setting (for example, <code>AliceSendMessage</code>). Maximum 80 characters. Allowed characters include alphanumeric characters, hyphens (<code>-</code>), and underscores (<code>_</code>).</p>
86 pub fn set_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87 self.label = input;
88 self
89 }
90 /// <p>The unique identification of the permission you're setting (for example, <code>AliceSendMessage</code>). Maximum 80 characters. Allowed characters include alphanumeric characters, hyphens (<code>-</code>), and underscores (<code>_</code>).</p>
91 pub fn get_label(&self) -> &::std::option::Option<::std::string::String> {
92 &self.label
93 }
94 /// Appends an item to `aws_account_ids`.
95 ///
96 /// To override the contents of this collection use [`set_aws_account_ids`](Self::set_aws_account_ids).
97 ///
98 /// <p>The Amazon Web Services account numbers of the <a href="https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principals</a> who are to receive permission. For information about locating the Amazon Web Services account identification, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication">Your Amazon Web Services Identifiers</a> in the <i>Amazon SQS Developer Guide</i>.</p>
99 pub fn aws_account_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100 let mut v = self.aws_account_ids.unwrap_or_default();
101 v.push(input.into());
102 self.aws_account_ids = ::std::option::Option::Some(v);
103 self
104 }
105 /// <p>The Amazon Web Services account numbers of the <a href="https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principals</a> who are to receive permission. For information about locating the Amazon Web Services account identification, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication">Your Amazon Web Services Identifiers</a> in the <i>Amazon SQS Developer Guide</i>.</p>
106 pub fn set_aws_account_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
107 self.aws_account_ids = input;
108 self
109 }
110 /// <p>The Amazon Web Services account numbers of the <a href="https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principals</a> who are to receive permission. For information about locating the Amazon Web Services account identification, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication">Your Amazon Web Services Identifiers</a> in the <i>Amazon SQS Developer Guide</i>.</p>
111 pub fn get_aws_account_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
112 &self.aws_account_ids
113 }
114 /// Appends an item to `actions`.
115 ///
116 /// To override the contents of this collection use [`set_actions`](Self::set_actions).
117 ///
118 /// <p>The action the client wants to allow for the specified principal. Valid values: the name of any action or <code>*</code>.</p>
119 /// <p>For more information about these actions, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html">Overview of Managing Access Permissions to Your Amazon Simple Queue Service Resource</a> in the <i>Amazon SQS Developer Guide</i>.</p>
120 /// <p>Specifying <code>SendMessage</code>, <code>DeleteMessage</code>, or <code>ChangeMessageVisibility</code> for <code>ActionName.n</code> also grants permissions for the corresponding batch versions of those actions: <code>SendMessageBatch</code>, <code>DeleteMessageBatch</code>, and <code>ChangeMessageVisibilityBatch</code>.</p>
121 pub fn actions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 let mut v = self.actions.unwrap_or_default();
123 v.push(input.into());
124 self.actions = ::std::option::Option::Some(v);
125 self
126 }
127 /// <p>The action the client wants to allow for the specified principal. Valid values: the name of any action or <code>*</code>.</p>
128 /// <p>For more information about these actions, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html">Overview of Managing Access Permissions to Your Amazon Simple Queue Service Resource</a> in the <i>Amazon SQS Developer Guide</i>.</p>
129 /// <p>Specifying <code>SendMessage</code>, <code>DeleteMessage</code>, or <code>ChangeMessageVisibility</code> for <code>ActionName.n</code> also grants permissions for the corresponding batch versions of those actions: <code>SendMessageBatch</code>, <code>DeleteMessageBatch</code>, and <code>ChangeMessageVisibilityBatch</code>.</p>
130 pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
131 self.actions = input;
132 self
133 }
134 /// <p>The action the client wants to allow for the specified principal. Valid values: the name of any action or <code>*</code>.</p>
135 /// <p>For more information about these actions, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html">Overview of Managing Access Permissions to Your Amazon Simple Queue Service Resource</a> in the <i>Amazon SQS Developer Guide</i>.</p>
136 /// <p>Specifying <code>SendMessage</code>, <code>DeleteMessage</code>, or <code>ChangeMessageVisibility</code> for <code>ActionName.n</code> also grants permissions for the corresponding batch versions of those actions: <code>SendMessageBatch</code>, <code>DeleteMessageBatch</code>, and <code>ChangeMessageVisibilityBatch</code>.</p>
137 pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
138 &self.actions
139 }
140 /// Consumes the builder and constructs a [`AddPermissionInput`](crate::operation::add_permission::AddPermissionInput).
141 pub fn build(
142 self,
143 ) -> ::std::result::Result<crate::operation::add_permission::AddPermissionInput, ::aws_smithy_types::error::operation::BuildError> {
144 ::std::result::Result::Ok(crate::operation::add_permission::AddPermissionInput {
145 queue_url: self.queue_url,
146 label: self.label,
147 aws_account_ids: self.aws_account_ids,
148 actions: self.actions,
149 })
150 }
151}