com.amazonaws.services.sqs.model
Class AddPermissionRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.sqs.model.AddPermissionRequest
All Implemented Interfaces:
java.io.Serializable

public class AddPermissionRequest
extends AmazonWebServiceRequest
implements java.io.Serializable

Container for the parameters to the AddPermission operation.

Adds a permission to a queue for a specific principal . This allows for sharing access to the queue.

When you create a queue, you have full control access rights for the queue. Only you (as owner of the queue) can grant or deny permissions to the queue. For more information about these permissions, see Shared Queues in the Amazon SQS Developer Guide .

NOTE: AddPermission writes an Amazon SQS-generated policy. If you want to write your own policy, use SetQueueAttributes to upload your policy. For more information about writing your own policy, see Using The Access Policy Language in the Amazon SQS Developer Guide.

NOTE:Some API actions take lists of parameters. These lists are specified using the param.n notation. Values of n are integers starting from 1. For example, a parameter list with two elements looks like this:

&Attribute.1=this

&Attribute.2=that

See Also:
AmazonSQS.addPermission(AddPermissionRequest), Serialized Form

Constructor Summary
AddPermissionRequest()
          Default constructor for a new AddPermissionRequest object.
AddPermissionRequest(java.lang.String queueUrl, java.lang.String label, java.util.List<java.lang.String> aWSAccountIds, java.util.List<java.lang.String> actions)
          Constructs a new AddPermissionRequest object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.util.List<java.lang.String> getActions()
          The action the client wants to allow for the specified principal.
 java.util.List<java.lang.String> getAWSAccountIds()
          The AWS account number of the principal who will be given permission.
 java.lang.String getLabel()
          The unique identification of the permission you're setting (e.g., AliceSendMessage).
 java.lang.String getQueueUrl()
          The URL of the Amazon SQS queue to take action on.
 int hashCode()
           
 void setActions(java.util.Collection<java.lang.String> actions)
          The action the client wants to allow for the specified principal.
 void setAWSAccountIds(java.util.Collection<java.lang.String> aWSAccountIds)
          The AWS account number of the principal who will be given permission.
 void setLabel(java.lang.String label)
          The unique identification of the permission you're setting (e.g., AliceSendMessage).
 void setQueueUrl(java.lang.String queueUrl)
          The URL of the Amazon SQS queue to take action on.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 AddPermissionRequest withActions(java.util.Collection<java.lang.String> actions)
          The action the client wants to allow for the specified principal.
 AddPermissionRequest withActions(java.lang.String... actions)
          The action the client wants to allow for the specified principal.
 AddPermissionRequest withAWSAccountIds(java.util.Collection<java.lang.String> aWSAccountIds)
          The AWS account number of the principal who will be given permission.
 AddPermissionRequest withAWSAccountIds(java.lang.String... aWSAccountIds)
          The AWS account number of the principal who will be given permission.
 AddPermissionRequest withLabel(java.lang.String label)
          The unique identification of the permission you're setting (e.g., AliceSendMessage).
 AddPermissionRequest withQueueUrl(java.lang.String queueUrl)
          The URL of the Amazon SQS queue to take action on.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setDelegationToken, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AddPermissionRequest

public AddPermissionRequest()
Default constructor for a new AddPermissionRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.


AddPermissionRequest

public AddPermissionRequest(java.lang.String queueUrl,
                            java.lang.String label,
                            java.util.List<java.lang.String> aWSAccountIds,
                            java.util.List<java.lang.String> actions)
Constructs a new AddPermissionRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
queueUrl - The URL of the Amazon SQS queue to take action on.
label - The unique identification of the permission you're setting (e.g., AliceSendMessage). Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed.
aWSAccountIds - The AWS account number of the principal who will be given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS. For information about locating the AWS account identification, see Your AWS Identifiers in the Amazon SQS Developer Guide.
actions - The action the client wants to allow for the specified principal. The following are valid values: * | SendMessage | ReceiveMessage | DeleteMessage | ChangeMessageVisibility | GetQueueAttributes | GetQueueUrl. For more information about these actions, see Understanding Permissions in the Amazon SQS Developer Guide.

Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for the ActionName.n also grants permissions for the corresponding batch versions of those actions: SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch.

Method Detail

getQueueUrl

public java.lang.String getQueueUrl()
The URL of the Amazon SQS queue to take action on.

Returns:
The URL of the Amazon SQS queue to take action on.

setQueueUrl

public void setQueueUrl(java.lang.String queueUrl)
The URL of the Amazon SQS queue to take action on.

Parameters:
queueUrl - The URL of the Amazon SQS queue to take action on.

withQueueUrl

public AddPermissionRequest withQueueUrl(java.lang.String queueUrl)
The URL of the Amazon SQS queue to take action on.

Returns a reference to this object so that method calls can be chained together.

Parameters:
queueUrl - The URL of the Amazon SQS queue to take action on.
Returns:
A reference to this updated object so that method calls can be chained together.

getLabel

public java.lang.String getLabel()
The unique identification of the permission you're setting (e.g., AliceSendMessage). Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed.

Returns:
The unique identification of the permission you're setting (e.g., AliceSendMessage). Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed.

setLabel

public void setLabel(java.lang.String label)
The unique identification of the permission you're setting (e.g., AliceSendMessage). Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed.

Parameters:
label - The unique identification of the permission you're setting (e.g., AliceSendMessage). Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed.

withLabel

public AddPermissionRequest withLabel(java.lang.String label)
The unique identification of the permission you're setting (e.g., AliceSendMessage). Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed.

Returns a reference to this object so that method calls can be chained together.

Parameters:
label - The unique identification of the permission you're setting (e.g., AliceSendMessage). Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed.
Returns:
A reference to this updated object so that method calls can be chained together.

getAWSAccountIds

public java.util.List<java.lang.String> getAWSAccountIds()
The AWS account number of the principal who will be given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS. For information about locating the AWS account identification, see Your AWS Identifiers in the Amazon SQS Developer Guide.

Returns:
The AWS account number of the principal who will be given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS. For information about locating the AWS account identification, see Your AWS Identifiers in the Amazon SQS Developer Guide.

setAWSAccountIds

public void setAWSAccountIds(java.util.Collection<java.lang.String> aWSAccountIds)
The AWS account number of the principal who will be given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS. For information about locating the AWS account identification, see Your AWS Identifiers in the Amazon SQS Developer Guide.

Parameters:
aWSAccountIds - The AWS account number of the principal who will be given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS. For information about locating the AWS account identification, see Your AWS Identifiers in the Amazon SQS Developer Guide.

withAWSAccountIds

public AddPermissionRequest withAWSAccountIds(java.lang.String... aWSAccountIds)
The AWS account number of the principal who will be given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS. For information about locating the AWS account identification, see Your AWS Identifiers in the Amazon SQS Developer Guide.

Returns a reference to this object so that method calls can be chained together.

Parameters:
aWSAccountIds - The AWS account number of the principal who will be given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS. For information about locating the AWS account identification, see Your AWS Identifiers in the Amazon SQS Developer Guide.
Returns:
A reference to this updated object so that method calls can be chained together.

withAWSAccountIds

public AddPermissionRequest withAWSAccountIds(java.util.Collection<java.lang.String> aWSAccountIds)
The AWS account number of the principal who will be given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS. For information about locating the AWS account identification, see Your AWS Identifiers in the Amazon SQS Developer Guide.

Returns a reference to this object so that method calls can be chained together.

Parameters:
aWSAccountIds - The AWS account number of the principal who will be given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS. For information about locating the AWS account identification, see Your AWS Identifiers in the Amazon SQS Developer Guide.
Returns:
A reference to this updated object so that method calls can be chained together.

getActions

public java.util.List<java.lang.String> getActions()
The action the client wants to allow for the specified principal. The following are valid values: * | SendMessage | ReceiveMessage | DeleteMessage | ChangeMessageVisibility | GetQueueAttributes | GetQueueUrl. For more information about these actions, see Understanding Permissions in the Amazon SQS Developer Guide.

Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for the ActionName.n also grants permissions for the corresponding batch versions of those actions: SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch.

Returns:
The action the client wants to allow for the specified principal. The following are valid values: * | SendMessage | ReceiveMessage | DeleteMessage | ChangeMessageVisibility | GetQueueAttributes | GetQueueUrl. For more information about these actions, see Understanding Permissions in the Amazon SQS Developer Guide.

Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for the ActionName.n also grants permissions for the corresponding batch versions of those actions: SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch.


setActions

public void setActions(java.util.Collection<java.lang.String> actions)
The action the client wants to allow for the specified principal. The following are valid values: * | SendMessage | ReceiveMessage | DeleteMessage | ChangeMessageVisibility | GetQueueAttributes | GetQueueUrl. For more information about these actions, see Understanding Permissions in the Amazon SQS Developer Guide.

Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for the ActionName.n also grants permissions for the corresponding batch versions of those actions: SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch.

Parameters:
actions - The action the client wants to allow for the specified principal. The following are valid values: * | SendMessage | ReceiveMessage | DeleteMessage | ChangeMessageVisibility | GetQueueAttributes | GetQueueUrl. For more information about these actions, see Understanding Permissions in the Amazon SQS Developer Guide.

Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for the ActionName.n also grants permissions for the corresponding batch versions of those actions: SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch.


withActions

public AddPermissionRequest withActions(java.lang.String... actions)
The action the client wants to allow for the specified principal. The following are valid values: * | SendMessage | ReceiveMessage | DeleteMessage | ChangeMessageVisibility | GetQueueAttributes | GetQueueUrl. For more information about these actions, see Understanding Permissions in the Amazon SQS Developer Guide.

Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for the ActionName.n also grants permissions for the corresponding batch versions of those actions: SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch.

Returns a reference to this object so that method calls can be chained together.

Parameters:
actions - The action the client wants to allow for the specified principal. The following are valid values: * | SendMessage | ReceiveMessage | DeleteMessage | ChangeMessageVisibility | GetQueueAttributes | GetQueueUrl. For more information about these actions, see Understanding Permissions in the Amazon SQS Developer Guide.

Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for the ActionName.n also grants permissions for the corresponding batch versions of those actions: SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch.

Returns:
A reference to this updated object so that method calls can be chained together.

withActions

public AddPermissionRequest withActions(java.util.Collection<java.lang.String> actions)
The action the client wants to allow for the specified principal. The following are valid values: * | SendMessage | ReceiveMessage | DeleteMessage | ChangeMessageVisibility | GetQueueAttributes | GetQueueUrl. For more information about these actions, see Understanding Permissions in the Amazon SQS Developer Guide.

Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for the ActionName.n also grants permissions for the corresponding batch versions of those actions: SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch.

Returns a reference to this object so that method calls can be chained together.

Parameters:
actions - The action the client wants to allow for the specified principal. The following are valid values: * | SendMessage | ReceiveMessage | DeleteMessage | ChangeMessageVisibility | GetQueueAttributes | GetQueueUrl. For more information about these actions, see Understanding Permissions in the Amazon SQS Developer Guide.

Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for the ActionName.n also grants permissions for the corresponding batch versions of those actions: SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch.

Returns:
A reference to this updated object so that method calls can be chained together.

toString

public java.lang.String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.