/// <summary>
        /// Sets the permissions on the queue
        /// </summary>
        /// <param name="queueUrl"></param>
        /// <param name="label"></param>
        /// <param name="actionNames"></param>
        /// <param name="awsAccountIds"></param>
        public void SetQueuePermissions(string queueUrl, string label, IEnumerable<string> actionNames, IEnumerable<string> awsAccountIds)
        {
            var request = new AddPermissionRequest
                              {
                                  ActionName = new List<string>(actionNames),
                                  QueueUrl = queueUrl,
                                  AWSAccountId = new List<string>(awsAccountIds),
                                  Label = label
                              };

            Client.AddPermission(request);
        }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.SQS.Model.AddPermissionRequest();

            if (cmdletContext.Action != null)
            {
                request.Actions = cmdletContext.Action;
            }
            if (cmdletContext.AWSAccountId != null)
            {
                request.AWSAccountIds = cmdletContext.AWSAccountId;
            }
            if (cmdletContext.Label != null)
            {
                request.Label = cmdletContext.Label;
            }
            if (cmdletContext.QueueUrl != null)
            {
                request.QueueUrl = cmdletContext.QueueUrl;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
 /// <summary>
 /// Adds a permission to a queue for a specific       <a href="http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principal</a>.
 ///      This allows for sharing access to the queue.
 /// 
 ///     
 /// <para>
 /// 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      <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html">Shared
 ///      Queues</a> in the <i>Amazon SQS Developer Guide</i>.
 /// </para>
 ///     <note>    
 /// <para>
 /// <code>AddPermission</code> writes an Amazon SQS-generated policy. If you want to 
 ///     write your own policy, use <a>SetQueueAttributes</a> to upload your policy. For
 /// more      information about writing your own policy, see      <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AccessPolicyLanguage.html">Using
 ///      The Access Policy Language</a> in the <i>Amazon SQS Developer Guide</i>.
 /// </para>
 ///     </note>        <note>Some API actions take lists of parameters. These lists are
 /// specified using the <code>param.n</code> notation. Values      of <code>n</code> are
 /// integers starting from 1. For example, a parameter list with two elements looks like
 /// this:     </note>    
 /// <para>
 /// <code>&amp;Attribute.1=this</code>
 /// </para>
 ///     
 /// <para>
 /// <code>&amp;Attribute.2=that</code>
 /// </para>
 /// </summary>
 /// <param name="queueUrl">The URL of the Amazon SQS queue to take action on.</param>
 /// <param name="label">The unique identification of the permission you're setting (e.g.,   <code>AliceSendMessage</code>). Constraints: Maximum 80 characters;   alphanumeric characters, hyphens (-), and underscores (_) are allowed.</param>
 /// <param name="awsAccountIds">The AWS account number of the <a href="http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principal</a>   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 <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AWSCredentials.html">Your  AWS Identifiers</a> in the <i>Amazon SQS Developer Guide</i>.</param>
 /// <param name="actions">The action the client wants to allow for the specified principal.    The following are valid values: <code>* | SendMessage | ReceiveMessage | DeleteMessage | ChangeMessageVisibility | GetQueueAttributes | GetQueueUrl</code>.    For more information about these actions, see <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html#PermissionTypes">Understanding   Permissions</a> in the <i>Amazon SQS Developer Guide</i>. Specifying <code>SendMessage</code>,   <code>DeleteMessage</code>, or <code>ChangeMessageVisibility</code> for the    <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>.</param>
 /// 
 /// <returns>The response from the AddPermission service method, as returned by SQS.</returns>
 /// <exception cref="OverLimitException">
 /// The action that you requested would violate a limit. For example,      ReceiveMessage
 /// returns this error if the maximum number of messages      inflight has already been
 /// reached. <a>AddPermission</a> returns this error if      the maximum number of permissions
 /// for the queue has already been reached.
 /// </exception>
 public AddPermissionResponse AddPermission(string queueUrl, string label, List<string> awsAccountIds, List<string> actions)
 {
     var request = new AddPermissionRequest();
     request.QueueUrl = queueUrl;
     request.Label = label;
     request.AWSAccountIds = awsAccountIds;
     request.Actions = actions;
     return AddPermission(request);
 }
Example #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the AddPermission operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the AddPermission operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<AddPermissionResponse> AddPermissionAsync(AddPermissionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new AddPermissionRequestMarshaller();
            var unmarshaller = AddPermissionResponseUnmarshaller.Instance;

            return InvokeAsync<AddPermissionRequest,AddPermissionResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Example #5
0
 /// <summary>
 /// Adds a permission to a queue for a specific <a href="http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principal</a>.
 /// This allows sharing access to the queue.
 /// 
 ///  
 /// <para>
 /// 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 <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html">Shared
 /// Queues</a> in the <i>Amazon SQS Developer Guide</i>.
 /// </para>
 ///  <note> 
 /// <para>
 ///  <code>AddPermission</code> writes an Amazon-SQS-generated policy. If you want to
 /// write your own policy, use <code> <a>SetQueueAttributes</a> </code> to upload your
 /// policy. For more information about writing your own policy, see <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AccessPolicyLanguage.html">Using
 /// The Access Policy Language</a> in the <i>Amazon SQS Developer Guide</i>.
 /// </para>
 ///  
 /// <para>
 /// Some actions take lists of parameters. These lists are specified using the <code>param.n</code>
 /// notation. Values of <code>n</code> are integers starting from 1. For example, a parameter
 /// list with two elements looks like this:
 /// </para>
 ///  
 /// <para>
 ///  <code>&amp;Attribute.1=this</code> 
 /// </para>
 ///  
 /// <para>
 ///  <code>&amp;Attribute.2=that</code> 
 /// </para>
 ///  </note>
 /// </summary>
 /// <param name="queueUrl">The URL of the Amazon SQS queue to which permissions are added. Queue URLs are case-sensitive.</param>
 /// <param name="label">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>).</param>
 /// <param name="awsAccountIds">The AWS account number of the <a href="http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principal</a> who is 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 <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AWSCredentials.html">Your AWS Identifiers</a> in the <i>Amazon SQS Developer Guide</i>.</param>
 /// <param name="actions">The action the client wants to allow for the specified principal. The following values are valid: <ul> <li>  <code>*</code>  </li> <li>  <code>ChangeMessageVisibility</code>  </li> <li>  <code>DeleteMessage</code>  </li> <li>  <code>GetQueueAttributes</code>  </li> <li>  <code>GetQueueUrl</code>  </li> <li>  <code>ReceiveMessage</code>  </li> <li>  <code>SendMessage</code>  </li> </ul> For more information about these actions, see <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html#PermissionTypes">Understanding Permissions</a> in the <i>Amazon SQS Developer Guide</i>. 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>.</param>
 /// <param name="cancellationToken">
 ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// 
 /// <returns>The response from the AddPermission service method, as returned by SQS.</returns>
 /// <exception cref="Amazon.SQS.Model.OverLimitException">
 /// The action that you requested would violate a limit. For example, <code>ReceiveMessage</code>
 /// returns this error if the maximum number of inflight messages is reached. <code> <a>AddPermission</a>
 /// </code> returns this error if the maximum number of permissions for the queue is reached.
 /// </exception>
 public Task<AddPermissionResponse> AddPermissionAsync(string queueUrl, string label, List<string> awsAccountIds, List<string> actions, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new AddPermissionRequest();
     request.QueueUrl = queueUrl;
     request.Label = label;
     request.AWSAccountIds = awsAccountIds;
     request.Actions = actions;
     return AddPermissionAsync(request, cancellationToken);
 }
 IAsyncResult invokeAddPermission(AddPermissionRequest addPermissionRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new AddPermissionRequestMarshaller().Marshall(addPermissionRequest);
     var unmarshaller = AddPermissionResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
        IAsyncResult invokeAddPermission(AddPermissionRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new AddPermissionRequestMarshaller();
            var unmarshaller = AddPermissionResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }
		internal AddPermissionResponse AddPermission(AddPermissionRequest request)
        {
            var task = AddPermissionAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the AddPermission operation.
        /// <seealso cref="Amazon.SQS.IAmazonSQS.AddPermission"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the AddPermission operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
		public async Task<AddPermissionResponse> AddPermissionAsync(AddPermissionRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new AddPermissionRequestMarshaller();
            var unmarshaller = AddPermissionResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, AddPermissionRequest, AddPermissionResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
 private Amazon.SQS.Model.AddPermissionResponse CallAWSServiceOperation(IAmazonSQS client, Amazon.SQS.Model.AddPermissionRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Simple Queue Service (SQS)", "AddPermission");
     try
     {
         #if DESKTOP
         return(client.AddPermission(request));
         #elif CORECLR
         return(client.AddPermissionAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
Example #11
0
 public Task<AddPermissionResponse> AddPermissionAsync(AddPermissionRequest request, CancellationToken cancellationToken = new CancellationToken())
 {
     throw new NotImplementedException();
 }
Example #12
0
 public AddPermissionResponse AddPermission(AddPermissionRequest request)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Initiates the asynchronous execution of the AddPermission operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the AddPermission operation on AmazonSQSClient.</param>
 /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
 /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///          procedure using the AsyncState property.</param>
 public void AddPermissionAsync(AddPermissionRequest request, AmazonServiceCallback<AddPermissionRequest, AddPermissionResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new AddPermissionRequestMarshaller();
     var unmarshaller = AddPermissionResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<AddPermissionRequest,AddPermissionResponse> responseObject 
                     = new AmazonServiceResult<AddPermissionRequest,AddPermissionResponse>((AddPermissionRequest)req, (AddPermissionResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<AddPermissionRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
 /// <summary>
 /// Adds a permission to a queue for a specific <a href="http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principal</a>.
 /// This allows for sharing access to the queue.
 /// 
 ///  
 /// <para>
 /// 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 <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html">Shared
 /// Queues</a> in the <i>Amazon SQS Developer Guide</i>.
 /// </para>
 ///  <note> 
 /// <para>
 /// <code>AddPermission</code> writes an Amazon SQS-generated policy. If you want to write
 /// your own policy, use <a>SetQueueAttributes</a> to upload your policy. For more information
 /// about writing your own policy, see <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AccessPolicyLanguage.html">Using
 /// The Access Policy Language</a> in the <i>Amazon SQS Developer Guide</i>.
 /// </para>
 ///  </note> <note>Some API actions take lists of parameters. These lists are specified
 /// using the <code>param.n</code> notation. Values of <code>n</code> are integers starting
 /// from 1. For example, a parameter list with two elements looks like this: </note> 
 /// <para>
 /// <code>&amp;Attribute.1=this</code>
 /// </para>
 ///  
 /// <para>
 /// <code>&amp;Attribute.2=that</code>
 /// </para>
 /// </summary>
 /// <param name="queueUrl">The URL of the Amazon SQS queue to take action on.</param>
 /// <param name="label">The unique identification of the permission you're setting (e.g., <code>AliceSendMessage</code>). Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed.</param>
 /// <param name="awsAccountIds">The AWS account number of the <a href="http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principal</a> 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 <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AWSCredentials.html">Your AWS Identifiers</a> in the <i>Amazon SQS Developer Guide</i>.</param>
 /// <param name="actions">The action the client wants to allow for the specified principal. The following are valid values: <code>* | SendMessage | ReceiveMessage | DeleteMessage | ChangeMessageVisibility | GetQueueAttributes | GetQueueUrl</code>. For more information about these actions, see <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html#PermissionTypes">Understanding Permissions</a> in the <i>Amazon SQS Developer Guide</i>. Specifying <code>SendMessage</code>, <code>DeleteMessage</code>, or <code>ChangeMessageVisibility</code> for the <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>.</param>
 /// <param name="options">
  ///     A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
  ///     procedure using the AsyncState property.
  /// </param>
 /// 
 /// <returns>The response from the AddPermission service method, as returned by SQS.</returns>
 /// <exception cref="Amazon.SQS.Model.OverLimitException">
 /// The action that you requested would violate a limit. For example, ReceiveMessage returns
 /// this error if the maximum number of messages inflight has already been reached. <a>AddPermission</a>
 /// returns this error if the maximum number of permissions for the queue has already
 /// been reached.
 /// </exception>
 public void AddPermissionAsync(string queueUrl, string label, List<string> awsAccountIds, List<string> actions,  AmazonServiceCallback<AddPermissionRequest, AddPermissionResponse> callback, AsyncOptions options = null)
 {
     var request = new AddPermissionRequest();
     request.QueueUrl = queueUrl;
     request.Label = label;
     request.AWSAccountIds = awsAccountIds;
     request.Actions = actions;
     AddPermissionAsync(request, callback, options);
 }
Example #15
0
    public static void SQSAddPermission()
    {
      #region SQSAddPermission
      var client = new AmazonSQSClient();

      var request = new AddPermissionRequest
      {
        Actions = new List<string>() { "GetQueueAttributes", "GetQueueUrl" },
        AWSAccountIds = new List<string>() { "80398EXAMPLE" },
        Label = "JohnDoeCanAccessQueues",
        QueueUrl = "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyTestQueue"
      };

      client.AddPermission(request);
      #endregion
    }
        /// <summary>
        /// Adds a permission to a queue for a specific       <a href="http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principal</a>.
        ///      This allows for sharing access to the queue.
        /// 
        ///     
        /// <para>
        /// 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      <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html">Shared
        ///      Queues</a> in the <i>Amazon SQS Developer Guide</i>.
        /// </para>
        ///     <note>    
        /// <para>
        /// <code>AddPermission</code> writes an Amazon SQS-generated policy. If you want to 
        ///     write your own policy, use <a>SetQueueAttributes</a> to upload your policy. For
        /// more      information about writing your own policy, see      <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AccessPolicyLanguage.html">Using
        ///      The Access Policy Language</a> in the <i>Amazon SQS Developer Guide</i>.
        /// </para>
        ///     </note>        <note>Some API actions take lists of parameters. These lists are
        /// specified using the <code>param.n</code> notation. Values      of <code>n</code> are
        /// integers starting from 1. For example, a parameter list with two elements looks like
        /// this:     </note>    
        /// <para>
        /// <code>&amp;Attribute.1=this</code>
        /// </para>
        ///     
        /// <para>
        /// <code>&amp;Attribute.2=that</code>
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the AddPermission service method.</param>
        /// 
        /// <returns>The response from the AddPermission service method, as returned by SQS.</returns>
        /// <exception cref="OverLimitException">
        /// The action that you requested would violate a limit. For example,      ReceiveMessage
        /// returns this error if the maximum number of messages      inflight has already been
        /// reached. <a>AddPermission</a> returns this error if      the maximum number of permissions
        /// for the queue has already been reached.
        /// </exception>
        public AddPermissionResponse AddPermission(AddPermissionRequest request)
        {
            var marshaller = new AddPermissionRequestMarshaller();
            var unmarshaller = AddPermissionResponseUnmarshaller.Instance;

            return Invoke<AddPermissionRequest,AddPermissionResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the AddPermission operation.
        /// <seealso cref="Amazon.SQS.IAmazonSQS"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the AddPermission operation on AmazonSQSClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAddPermission
        ///         operation.</returns>
        public IAsyncResult BeginAddPermission(AddPermissionRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new AddPermissionRequestMarshaller();
            var unmarshaller = AddPermissionResponseUnmarshaller.Instance;

            return BeginInvoke<AddPermissionRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        private void addQueuePermission(String queueUrl)
        {
            AddPermissionRequest permissionRequest = new AddPermissionRequest()
                .WithActionName("SendMessage")
                .WithAWSAccountId(properties.MessageGearsAWSAccountId)
                .WithLabel("MessageGears Send Permission")
                .WithQueueUrl(queueUrl);

            sqs.AddPermission(permissionRequest);
        }
Example #19
0
        /// <summary>
        /// <para>Adds a permission to a queue for a specific <a href="http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principal</a> .
        /// This allows for sharing access to the queue.</para> <para>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 <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html">Shared Queues</a> in the <i>Amazon SQS
        /// Developer Guide</i> .</para> <para><b>NOTE:</b> 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. </para> <para><b>NOTE:</b>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: </para> <para>
        /// <c>&amp;amp;Attribute.1=this</c> </para> <para> <c>&amp;amp;Attribute.2=that</c> </para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the AddPermission service method on AmazonSQS.</param>
        /// 
        /// <exception cref="T:Amazon.SQS.Model.OverLimitException" />
		public AddPermissionResponse AddPermission(AddPermissionRequest request)
        {
            var task = AddPermissionAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
Example #20
0
 /// <summary>
 /// <para>The AddPermission action adds a permission to a queue for a specific <a
 /// href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/Glossary.html" >principal</a> .
 /// This allows for sharing access to the queue.</para> <para>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 <a
 /// href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/?acp-overview.html" >Shared Queues</a> in the Amazon SQS
 /// Developer Guide.</para> <para> <c>AddPermission</c> writes an 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 <a
 /// href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/?AccessPolicyLanguage.html" >Appendix: The Access Policy
 /// Language</a> in the Amazon SQS Developer Guide.</para>
 /// </summary>
 /// 
 /// <param name="addPermissionRequest">Container for the necessary parameters to execute the AddPermission service method on AmazonSQS.</param>
 /// 
 /// <exception cref="OverLimitException"/>
 public AddPermissionResponse AddPermission(AddPermissionRequest addPermissionRequest)
 {
     IAsyncResult asyncResult = invokeAddPermission(addPermissionRequest, null, null, true);
     return EndAddPermission(asyncResult);
 }
        /// <summary>
        /// <para>The AddPermission action adds a permission to a queue for a specific <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/Glossary.html">principal</a> .
        /// This allows for sharing access to the queue.</para> <para>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 <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/?acp-overview.html">Shared Queues</a> in the Amazon SQS
        /// Developer Guide.</para> <para> <c>AddPermission</c> writes an 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 <a href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/?AccessPolicyLanguage.html">Appendix: The Access Policy
        /// Language</a> in the Amazon SQS Developer Guide.</para>
        /// </summary>
        /// 
        /// <param name="addPermissionRequest">Container for the necessary parameters to execute the AddPermission service method on AmazonSQS.</param>
        /// 
        /// <exception cref="T:Amazon.SQS.Model.OverLimitException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<AddPermissionResponse> AddPermissionAsync(AddPermissionRequest addPermissionRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new AddPermissionRequestMarshaller();
            var unmarshaller = AddPermissionResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, AddPermissionRequest, AddPermissionResponse>(addPermissionRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
Example #22
0
 /// <summary>
 /// Initiates the asynchronous execution of the AddPermission operation.
 /// <seealso cref="Amazon.SQS.IAmazonSQS.AddPermission"/>
 /// </summary>
 /// 
 /// <param name="addPermissionRequest">Container for the necessary parameters to execute the AddPermission operation on AmazonSQS.</param>
 /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
 /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///          procedure using the AsyncState property.</param>
 public IAsyncResult BeginAddPermission(AddPermissionRequest addPermissionRequest, AsyncCallback callback, object state)
 {
     return invokeAddPermission(addPermissionRequest, callback, state, false);
 }