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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p></p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AddPermissionInput {
/// <p>The URL of the Amazon SQS queue to which permissions are added.</p>
/// <p>Queue URLs and names are case-sensitive.</p>
#[doc(hidden)]
pub queue_url: std::option::Option<std::string::String>,
/// <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>
#[doc(hidden)]
pub label: std::option::Option<std::string::String>,
/// <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>
#[doc(hidden)]
pub aws_account_ids: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The action the client wants to allow for the specified principal. Valid values: the name of any action or <code>*</code>.</p>
/// <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>
/// <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>
#[doc(hidden)]
pub actions: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl AddPermissionInput {
/// <p>The URL of the Amazon SQS queue to which permissions are added.</p>
/// <p>Queue URLs and names are case-sensitive.</p>
pub fn queue_url(&self) -> std::option::Option<&str> {
self.queue_url.as_deref()
}
/// <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>
pub fn label(&self) -> std::option::Option<&str> {
self.label.as_deref()
}
/// <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>
pub fn aws_account_ids(&self) -> std::option::Option<&[std::string::String]> {
self.aws_account_ids.as_deref()
}
/// <p>The action the client wants to allow for the specified principal. Valid values: the name of any action or <code>*</code>.</p>
/// <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>
/// <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>
pub fn actions(&self) -> std::option::Option<&[std::string::String]> {
self.actions.as_deref()
}
}
impl AddPermissionInput {
/// Creates a new builder-style object to manufacture [`AddPermissionInput`](crate::operation::add_permission::AddPermissionInput).
pub fn builder() -> crate::operation::add_permission::builders::AddPermissionInputBuilder {
crate::operation::add_permission::builders::AddPermissionInputBuilder::default()
}
}
/// A builder for [`AddPermissionInput`](crate::operation::add_permission::AddPermissionInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct AddPermissionInputBuilder {
pub(crate) queue_url: std::option::Option<std::string::String>,
pub(crate) label: std::option::Option<std::string::String>,
pub(crate) aws_account_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) actions: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl AddPermissionInputBuilder {
/// <p>The URL of the Amazon SQS queue to which permissions are added.</p>
/// <p>Queue URLs and names are case-sensitive.</p>
pub fn queue_url(mut self, input: impl Into<std::string::String>) -> Self {
self.queue_url = Some(input.into());
self
}
/// <p>The URL of the Amazon SQS queue to which permissions are added.</p>
/// <p>Queue URLs and names are case-sensitive.</p>
pub fn set_queue_url(mut self, input: std::option::Option<std::string::String>) -> Self {
self.queue_url = input;
self
}
/// <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>
pub fn label(mut self, input: impl Into<std::string::String>) -> Self {
self.label = Some(input.into());
self
}
/// <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>
pub fn set_label(mut self, input: std::option::Option<std::string::String>) -> Self {
self.label = input;
self
}
/// Appends an item to `aws_account_ids`.
///
/// To override the contents of this collection use [`set_aws_account_ids`](Self::set_aws_account_ids).
///
/// <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>
pub fn aws_account_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.aws_account_ids.unwrap_or_default();
v.push(input.into());
self.aws_account_ids = Some(v);
self
}
/// <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>
pub fn set_aws_account_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.aws_account_ids = input;
self
}
/// Appends an item to `actions`.
///
/// To override the contents of this collection use [`set_actions`](Self::set_actions).
///
/// <p>The action the client wants to allow for the specified principal. Valid values: the name of any action or <code>*</code>.</p>
/// <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>
/// <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>
pub fn actions(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.actions.unwrap_or_default();
v.push(input.into());
self.actions = Some(v);
self
}
/// <p>The action the client wants to allow for the specified principal. Valid values: the name of any action or <code>*</code>.</p>
/// <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>
/// <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>
pub fn set_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.actions = input;
self
}
/// Consumes the builder and constructs a [`AddPermissionInput`](crate::operation::add_permission::AddPermissionInput).
pub fn build(
self,
) -> Result<
crate::operation::add_permission::AddPermissionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::operation::add_permission::AddPermissionInput {
queue_url: self.queue_url,
label: self.label,
aws_account_ids: self.aws_account_ids,
actions: self.actions,
})
}
}