/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the sqs-2012-11-05.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.SQS.Model
{
///
/// Container for the parameters to the AddPermission operation.
/// Adds a permission to a queue for a specific principal.
/// This allows sharing access to the queue.
///
///
///
/// When you create a queue, you have full control access rights for the queue. Only you,
/// the owner of the queue, can grant or deny permissions to the queue. For more information
/// about these permissions, see Allow
/// Developers to Write Messages to a Shared Queue in the Amazon SQS Developer
/// Guide.
///
/// -
///
///
AddPermission
generates a policy for you. You can use SetQueueAttributes
///
to upload your policy. For more information, see Using
/// Custom Policies with the Amazon SQS Access Policy Language in the Amazon SQS
/// Developer Guide.
///
/// -
///
/// An Amazon SQS policy can have a maximum of seven actions per statement.
///
///
-
///
/// To remove the ability to change queue permissions, you must deny permission to the
///
AddPermission
, RemovePermission
, and SetQueueAttributes
/// actions in your IAM policy.
///
/// -
///
/// Amazon SQS
AddPermission
does not support adding a non-account principal.
///
///
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
///
public partial class AddPermissionRequest : AmazonSQSRequest
{
private List _actions = new List();
private List _awsAccountIds = new List();
private string _label;
private string _queueUrl;
///
/// Empty constructor used to set properties independently even when a simple constructor is available
///
public AddPermissionRequest() { }
///
/// Instantiates AddPermissionRequest with the parameterized properties
///
/// The URL of the Amazon SQS queue to which permissions are added. Queue URLs and names are case-sensitive.
/// The unique identification of the permission you're setting (for example, AliceSendMessage
). Maximum 80 characters. Allowed characters include alphanumeric characters, hyphens (-
), and underscores (_
).
/// The Amazon Web Services account numbers of the principals who are to receive permission. For information about locating the Amazon Web Services account identification, see Your Amazon Web Services Identifiers in the Amazon SQS Developer Guide.
/// The action the client wants to allow for the specified principal. Valid values: the name of any action or *
. For more information about these actions, see Overview of Managing Access Permissions to Your Amazon Simple Queue Service Resource in the Amazon SQS Developer Guide. Specifying SendMessage
, DeleteMessage
, or ChangeMessageVisibility
for ActionName.n
also grants permissions for the corresponding batch versions of those actions: SendMessageBatch
, DeleteMessageBatch
, and ChangeMessageVisibilityBatch
.
public AddPermissionRequest(string queueUrl, string label, List awsAccountIds, List actions)
{
_queueUrl = queueUrl;
_label = label;
_awsAccountIds = awsAccountIds;
_actions = actions;
}
///
/// Gets and sets the property Actions.
///
/// The action the client wants to allow for the specified principal. Valid values: the
/// name of any action or *
.
///
///
///
/// For more information about these actions, see Overview
/// of Managing Access Permissions to Your Amazon Simple Queue Service Resource in
/// the Amazon SQS Developer Guide.
///
///
///
/// Specifying SendMessage
, DeleteMessage
, or ChangeMessageVisibility
/// for ActionName.n
also grants permissions for the corresponding batch
/// versions of those actions: SendMessageBatch
, DeleteMessageBatch
,
/// and ChangeMessageVisibilityBatch
.
///
///
[AWSProperty(Required=true)]
public List Actions
{
get { return this._actions; }
set { this._actions = value; }
}
// Check to see if Actions property is set
internal bool IsSetActions()
{
return this._actions != null && this._actions.Count > 0;
}
///
/// Gets and sets the property AWSAccountIds.
///
/// The Amazon Web Services account numbers of the principals
/// who are to receive permission. For information about locating the Amazon Web Services
/// account identification, see Your
/// Amazon Web Services Identifiers in the Amazon SQS Developer Guide.
///
///
[AWSProperty(Required=true)]
public List AWSAccountIds
{
get { return this._awsAccountIds; }
set { this._awsAccountIds = value; }
}
// Check to see if AWSAccountIds property is set
internal bool IsSetAWSAccountIds()
{
return this._awsAccountIds != null && this._awsAccountIds.Count > 0;
}
///
/// Gets and sets the property Label.
///
/// The unique identification of the permission you're setting (for example, AliceSendMessage
).
/// Maximum 80 characters. Allowed characters include alphanumeric characters, hyphens
/// (-
), and underscores (_
).
///
///
[AWSProperty(Required=true)]
public string Label
{
get { return this._label; }
set { this._label = value; }
}
// Check to see if Label property is set
internal bool IsSetLabel()
{
return this._label != null;
}
///
/// Gets and sets the property QueueUrl.
///
/// The URL of the Amazon SQS queue to which permissions are added.
///
///
///
/// Queue URLs and names are case-sensitive.
///
///
[AWSProperty(Required=true)]
public string QueueUrl
{
get { return this._queueUrl; }
set { this._queueUrl = value; }
}
// Check to see if QueueUrl property is set
internal bool IsSetQueueUrl()
{
return this._queueUrl != null;
}
}
}