Container for the parameters to the ChangeMessageVisibilityBatch operation. Changes the visibility timeout of multiple messages. This is a batch version of ChangeMessageVisibility . The result of the action on each message is reported individually in the response. You can send up to 10 ChangeMessageVisibility requests with each ChangeMessageVisibilityBatch action.

Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of 200.

Some 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

Inheritance: AmazonSQSRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.SQS.Model.ChangeMessageVisibilityBatchRequest();

            if (cmdletContext.Entry != null)
            {
                request.Entries = cmdletContext.Entry;
            }
            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>
        /// Initiates the asynchronous execution of the ChangeMessageVisibilityBatch operation.
        /// <seealso cref="Amazon.SQS.IAmazonSQS"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ChangeMessageVisibilityBatch 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 EndChangeMessageVisibilityBatch
        ///         operation.</returns>
        public IAsyncResult BeginChangeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new ChangeMessageVisibilityBatchRequestMarshaller();
            var unmarshaller = ChangeMessageVisibilityBatchResponseUnmarshaller.Instance;

            return BeginInvoke<ChangeMessageVisibilityBatchRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ChangeMessageVisibilityBatch operation.
        /// <seealso cref="Amazon.SQS.IAmazonSQS.ChangeMessageVisibilityBatch"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ChangeMessageVisibilityBatch 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<ChangeMessageVisibilityBatchResponse> ChangeMessageVisibilityBatchAsync(ChangeMessageVisibilityBatchRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ChangeMessageVisibilityBatchRequestMarshaller();
            var unmarshaller = ChangeMessageVisibilityBatchResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, ChangeMessageVisibilityBatchRequest, ChangeMessageVisibilityBatchResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
 /// <summary>
 /// Changes the visibility timeout of multiple messages.      This is a batch version
 /// of <a>ChangeMessageVisibility</a>. The      result of the action on each message is
 /// reported individually in the      response. You can send up to 10 <a>ChangeMessageVisibility</a>
 /// requests with each <code>ChangeMessageVisibilityBatch</code> action.
 /// 
 ///        <important>Because the batch request can result in a combination of successful
 /// and unsuccessful actions,     you should check for batch errors even when the call
 /// returns an HTTP status code of 200.</important>    <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="entries">A list of receipt handles of the messages for which the visibility timeout   must be changed.</param>
 /// 
 /// <returns>The response from the ChangeMessageVisibilityBatch service method, as returned by SQS.</returns>
 /// <exception cref="BatchEntryIdsNotDistinctException">
 /// Two or more batch entries have the same <code>Id</code> in the request.
 /// </exception>
 /// <exception cref="EmptyBatchRequestException">
 /// Batch request does not contain an entry.
 /// </exception>
 /// <exception cref="InvalidBatchEntryIdException">
 /// The <code>Id</code> of a batch entry in a batch request does not abide      by the
 /// specification.
 /// </exception>
 /// <exception cref="TooManyEntriesInBatchRequestException">
 /// Batch request contains more number of entries than permissible.
 /// </exception>
 public ChangeMessageVisibilityBatchResponse ChangeMessageVisibilityBatch(string queueUrl, List<ChangeMessageVisibilityBatchRequestEntry> entries)
 {
     var request = new ChangeMessageVisibilityBatchRequest();
     request.QueueUrl = queueUrl;
     request.Entries = entries;
     return ChangeMessageVisibilityBatch(request);
 }
        /// <summary>
        /// Changes the visibility timeout of multiple messages.      This is a batch version
        /// of <a>ChangeMessageVisibility</a>. The      result of the action on each message is
        /// reported individually in the      response. You can send up to 10 <a>ChangeMessageVisibility</a>
        /// requests with each <code>ChangeMessageVisibilityBatch</code> action.
        /// 
        ///        <important>Because the batch request can result in a combination of successful
        /// and unsuccessful actions,     you should check for batch errors even when the call
        /// returns an HTTP status code of 200.</important>    <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 ChangeMessageVisibilityBatch service method.</param>
        /// 
        /// <returns>The response from the ChangeMessageVisibilityBatch service method, as returned by SQS.</returns>
        /// <exception cref="BatchEntryIdsNotDistinctException">
        /// Two or more batch entries have the same <code>Id</code> in the request.
        /// </exception>
        /// <exception cref="EmptyBatchRequestException">
        /// Batch request does not contain an entry.
        /// </exception>
        /// <exception cref="InvalidBatchEntryIdException">
        /// The <code>Id</code> of a batch entry in a batch request does not abide      by the
        /// specification.
        /// </exception>
        /// <exception cref="TooManyEntriesInBatchRequestException">
        /// Batch request contains more number of entries than permissible.
        /// </exception>
        public ChangeMessageVisibilityBatchResponse ChangeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest request)
        {
            var marshaller = new ChangeMessageVisibilityBatchRequestMarshaller();
            var unmarshaller = ChangeMessageVisibilityBatchResponseUnmarshaller.Instance;

            return Invoke<ChangeMessageVisibilityBatchRequest,ChangeMessageVisibilityBatchResponse>(request, marshaller, unmarshaller);
        }
		internal ChangeMessageVisibilityBatchResponse ChangeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest request)
        {
            var task = ChangeMessageVisibilityBatchAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
Beispiel #7
0
    public static void SQSChangeMessageVisibilityBatch()
    {
      #region SQSChangeMessageVisibilityBatch
      var client = new AmazonSQSClient();

      var url = "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyTestQueue";

      // Receive messages.
      var msgRequest = new ReceiveMessageRequest
      {
        AttributeNames = new List<string>() { "All" },
        QueueUrl = url
      };

      var msgResponse = client.ReceiveMessage(msgRequest);

      // Change visibility timeout for each message.
      if (msgResponse.Messages.Count > 0)
      {
        var entries = new List<ChangeMessageVisibilityBatchRequestEntry>();

        int numMessages = 0;

        foreach (var message in msgResponse.Messages)
        {
          numMessages += 1;

          var entry = new ChangeMessageVisibilityBatchRequestEntry
          {
            Id = "Entry" + numMessages.ToString(),
            ReceiptHandle = message.ReceiptHandle,
            VisibilityTimeout = (int)TimeSpan.FromMinutes(10).TotalSeconds
          };

          entries.Add(entry);
        }

        var batRequest = new ChangeMessageVisibilityBatchRequest
        {
          Entries = entries,
          QueueUrl = url
        };

        var batResponse = client.ChangeMessageVisibilityBatch(batRequest);

        Console.WriteLine("Successes: " + batResponse.Successful.Count +
          ", Failures: " + batResponse.Failed.Count);

        if (batResponse.Successful.Count > 0)
        {
          foreach (var success in batResponse.Successful)
          {
            Console.WriteLine("  Success ID " + success.Id);
          }
        }

        if (batResponse.Failed.Count > 0)
        {
          foreach (var fail in batResponse.Failed)
          {
            Console.WriteLine("  Failure ID " + fail.Id + ":");
            Console.WriteLine("    Code: " + fail.Code);
            Console.WriteLine("    Message: " + fail.Message);
            Console.WriteLine("    Sender's fault?: " + fail.SenderFault);
          }
        }
      }
      #endregion

      Console.ReadLine();
    }
 /// <summary>
 /// Initiates the asynchronous execution of the ChangeMessageVisibilityBatch operation.
 /// <seealso cref="Amazon.SQS.IAmazonSQS.ChangeMessageVisibilityBatch"/>
 /// </summary>
 /// 
 /// <param name="changeMessageVisibilityBatchRequest">Container for the necessary parameters to execute the ChangeMessageVisibilityBatch
 ///          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>
 /// 
 /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking
 ///         EndChangeMessageVisibilityBatch operation.</returns>
 public IAsyncResult BeginChangeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest, AsyncCallback callback, object state)
 {
     return invokeChangeMessageVisibilityBatch(changeMessageVisibilityBatchRequest, callback, state, false);
 }
 IAsyncResult invokeChangeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new ChangeMessageVisibilityBatchRequestMarshaller().Marshall(changeMessageVisibilityBatchRequest);
     var unmarshaller = ChangeMessageVisibilityBatchResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
 public Task<ChangeMessageVisibilityBatchResponse> ChangeMessageVisibilityBatchAsync(ChangeMessageVisibilityBatchRequest request, CancellationToken cancellationToken = new CancellationToken())
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// <para>This is a batch version of ChangeMessageVisibility. It takes multiple receipt handles and performs the operation on each of the them.
 /// The result of the operation on each message is reported individually in the response.</para>
 /// </summary>
 /// 
 /// <param name="changeMessageVisibilityBatchRequest">Container for the necessary parameters to execute the ChangeMessageVisibilityBatch service
 ///          method on AmazonSQS.</param>
 /// 
 /// <returns>The response from the ChangeMessageVisibilityBatch service method, as returned by AmazonSQS.</returns>
 /// 
 /// <exception cref="BatchEntryIdsNotDistinctException"/>
 /// <exception cref="TooManyEntriesInBatchRequestException"/>
 /// <exception cref="InvalidBatchEntryIdException"/>
 /// <exception cref="EmptyBatchRequestException"/>
 public ChangeMessageVisibilityBatchResponse ChangeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest)
 {
     IAsyncResult asyncResult = invokeChangeMessageVisibilityBatch(changeMessageVisibilityBatchRequest, null, null, true);
     return EndChangeMessageVisibilityBatch(asyncResult);
 }
        public ChangeMessageVisibilityBatchResponse ChangeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest request)
        {
            if (request.Entries == null || request.Entries.Count <= 0)
            {
                throw new EmptyBatchRequestException("No entires in request");
            }
            if (request.Entries.Count > SqsQueueDefinition.MaxBatchCvItems)
            {
                throw new TooManyEntriesInBatchRequestException("Count of [{0}] exceeds limit of [{1]}".Fmt(request.Entries.Count, SqsQueueDefinition.MaxBatchCvItems));
            }

            var q = GetQueue(request.QueueUrl);

            var response = new ChangeMessageVisibilityBatchResponse
            {
                Failed = new List<BatchResultErrorEntry>(),
                Successful = new List<ChangeMessageVisibilityBatchResultEntry>()
            };

            var entryIds = new HashSet<string>();

            foreach (var entry in request.Entries)
            {
                if (entryIds.Contains(entry.Id))
                {
                    throw new BatchEntryIdsNotDistinctException("Duplicate Id of [{0}]".Fmt(entry.Id));
                }

                entryIds.Add(entry.Id);

                var success = false;
                BatchResultErrorEntry batchError = null;

                try
                {
                    success = q.ChangeVisibility(new ChangeMessageVisibilityRequest
                    {
                        QueueUrl = request.QueueUrl,
                        ReceiptHandle = entry.ReceiptHandle,
                        VisibilityTimeout = entry.VisibilityTimeout
                    });
                }
                catch (ReceiptHandleIsInvalidException rhex)
                {
                    batchError = new BatchResultErrorEntry
                    {
                        Id = entry.Id,
                        Message = rhex.Message,
                        Code = rhex.ErrorCode
                    };
                }
                catch (MessageNotInflightException mfex)
                {
                    batchError = new BatchResultErrorEntry
                    {
                        Id = entry.Id,
                        Message = mfex.Message,
                        Code = mfex.ErrorCode
                    };
                }

                if (success)
                {
                    response.Successful.Add(new ChangeMessageVisibilityBatchResultEntry
                    {
                        Id = entry.Id
                    });
                }
                else
                {
                    var entryToQueue = batchError ?? new BatchResultErrorEntry
                    {
                        Id = entry.Id,
                        Message = "FakeCvError",
                        Code = "123"
                    };

                    response.Failed.Add(entryToQueue);
                }
            }

            return response;
        }
 /// <summary>
 /// Initiates the asynchronous execution of the ChangeMessageVisibilityBatch operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the ChangeMessageVisibilityBatch 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 ChangeMessageVisibilityBatchAsync(ChangeMessageVisibilityBatchRequest request, AmazonServiceCallback<ChangeMessageVisibilityBatchRequest, ChangeMessageVisibilityBatchResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new ChangeMessageVisibilityBatchRequestMarshaller();
     var unmarshaller = ChangeMessageVisibilityBatchResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<ChangeMessageVisibilityBatchRequest,ChangeMessageVisibilityBatchResponse> responseObject 
                     = new AmazonServiceResult<ChangeMessageVisibilityBatchRequest,ChangeMessageVisibilityBatchResponse>((ChangeMessageVisibilityBatchRequest)req, (ChangeMessageVisibilityBatchResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<ChangeMessageVisibilityBatchRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
 /// <summary>
 /// Changes the visibility timeout of multiple messages. This is a batch version of <a>ChangeMessageVisibility</a>.
 /// The result of the action on each message is reported individually in the response.
 /// You can send up to 10 <a>ChangeMessageVisibility</a> requests with each <code>ChangeMessageVisibilityBatch</code>
 /// action.
 /// 
 ///  <important>Because the batch request can result in a combination of successful and
 /// unsuccessful actions, you should check for batch errors even when the call returns
 /// an HTTP status code of 200.</important> <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="entries">A list of receipt handles of the messages for which the visibility timeout must be changed.</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 ChangeMessageVisibilityBatch service method, as returned by SQS.</returns>
 /// <exception cref="Amazon.SQS.Model.BatchEntryIdsNotDistinctException">
 /// Two or more batch entries have the same <code>Id</code> in the request.
 /// </exception>
 /// <exception cref="Amazon.SQS.Model.EmptyBatchRequestException">
 /// Batch request does not contain an entry.
 /// </exception>
 /// <exception cref="Amazon.SQS.Model.InvalidBatchEntryIdException">
 /// The <code>Id</code> of a batch entry in a batch request does not abide by the specification.
 /// </exception>
 /// <exception cref="Amazon.SQS.Model.TooManyEntriesInBatchRequestException">
 /// Batch request contains more number of entries than permissible.
 /// </exception>
 public void ChangeMessageVisibilityBatchAsync(string queueUrl, List<ChangeMessageVisibilityBatchRequestEntry> entries,  AmazonServiceCallback<ChangeMessageVisibilityBatchRequest, ChangeMessageVisibilityBatchResponse> callback, AsyncOptions options = null)
 {
     var request = new ChangeMessageVisibilityBatchRequest();
     request.QueueUrl = queueUrl;
     request.Entries = entries;
     ChangeMessageVisibilityBatchAsync(request, callback, options);
 }
 private Amazon.SQS.Model.ChangeMessageVisibilityBatchResponse CallAWSServiceOperation(IAmazonSQS client, Amazon.SQS.Model.ChangeMessageVisibilityBatchRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Simple Queue Service (SQS)", "ChangeMessageVisibilityBatch");
     try
     {
         #if DESKTOP
         return(client.ChangeMessageVisibilityBatch(request));
         #elif CORECLR
         return(client.ChangeMessageVisibilityBatchAsync(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;
     }
 }
Beispiel #16
0
 /// <summary>
 /// Changes the visibility timeout of multiple messages. This is a batch version of <code>
 /// <a>ChangeMessageVisibility</a> </code>. The result of the action on each message is
 /// reported individually in the response. You can send up to 10 <code> <a>ChangeMessageVisibility</a>
 /// </code> requests with each <code>ChangeMessageVisibilityBatch</code> action.
 /// 
 ///  <important> 
 /// <para>
 /// Because the batch request can result in a combination of successful and unsuccessful
 /// actions, you should check for batch errors even when the call returns an HTTP status
 /// code of <code>200</code>.
 /// </para>
 ///  </important> <note> 
 /// <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 whose messages' visibility is changed. Queue URLs are case-sensitive.</param>
 /// <param name="entries">A list of receipt handles of the messages for which the visibility timeout must be changed.</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 ChangeMessageVisibilityBatch service method, as returned by SQS.</returns>
 /// <exception cref="Amazon.SQS.Model.BatchEntryIdsNotDistinctException">
 /// Two or more batch entries in the request have the same <code>Id</code>.
 /// </exception>
 /// <exception cref="Amazon.SQS.Model.EmptyBatchRequestException">
 /// The batch request doesn't contain any entries.
 /// </exception>
 /// <exception cref="Amazon.SQS.Model.InvalidBatchEntryIdException">
 /// The <code>Id</code> of a batch entry in a batch request doesn't abide by the specification.
 /// </exception>
 /// <exception cref="Amazon.SQS.Model.TooManyEntriesInBatchRequestException">
 /// The batch request contains more entries than permissible.
 /// </exception>
 public Task<ChangeMessageVisibilityBatchResponse> ChangeMessageVisibilityBatchAsync(string queueUrl, List<ChangeMessageVisibilityBatchRequestEntry> entries, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new ChangeMessageVisibilityBatchRequest();
     request.QueueUrl = queueUrl;
     request.Entries = entries;
     return ChangeMessageVisibilityBatchAsync(request, cancellationToken);
 }
Beispiel #17
0
        /// <summary>
        /// <para>Changes the visibility timeout of multiple messages. This is a batch version of ChangeMessageVisibility. The result of the action on
        /// each message is reported individually in the response. You can send up to 10 ChangeMessageVisibility requests with each
        /// <c>ChangeMessageVisibilityBatch</c> action.</para> <para><b>IMPORTANT:</b>Because the batch request can result in a combination of
        /// successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of 200.</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 ChangeMessageVisibilityBatch service
        /// method on AmazonSQS.</param>
        /// 
        /// <returns>The response from the ChangeMessageVisibilityBatch service method, as returned by AmazonSQS.</returns>
        /// 
        /// <exception cref="T:Amazon.SQS.Model.BatchEntryIdsNotDistinctException" />
        /// <exception cref="T:Amazon.SQS.Model.TooManyEntriesInBatchRequestException" />
        /// <exception cref="T:Amazon.SQS.Model.InvalidBatchEntryIdException" />
        /// <exception cref="T:Amazon.SQS.Model.EmptyBatchRequestException" />
		public ChangeMessageVisibilityBatchResponse ChangeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest request)
        {
            var task = ChangeMessageVisibilityBatchAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
Beispiel #18
0
        /// <summary>
        /// Initiates the asynchronous execution of the ChangeMessageVisibilityBatch operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ChangeMessageVisibilityBatch 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<ChangeMessageVisibilityBatchResponse> ChangeMessageVisibilityBatchAsync(ChangeMessageVisibilityBatchRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ChangeMessageVisibilityBatchRequestMarshaller();
            var unmarshaller = ChangeMessageVisibilityBatchResponseUnmarshaller.Instance;

            return InvokeAsync<ChangeMessageVisibilityBatchRequest,ChangeMessageVisibilityBatchResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        /// <summary>
        /// <para>This is a batch version of ChangeMessageVisibility. It takes multiple receipt handles and performs the operation on each of the them.
        /// The result of the operation on each message is reported individually in the response.</para>
        /// </summary>
        /// 
        /// <param name="changeMessageVisibilityBatchRequest">Container for the necessary parameters to execute the ChangeMessageVisibilityBatch service
        /// method on AmazonSQS.</param>
        /// 
        /// <returns>The response from the ChangeMessageVisibilityBatch service method, as returned by AmazonSQS.</returns>
        /// 
        /// <exception cref="T:Amazon.SQS.Model.BatchEntryIdsNotDistinctException" />
        /// <exception cref="T:Amazon.SQS.Model.TooManyEntriesInBatchRequestException" />
        /// <exception cref="T:Amazon.SQS.Model.InvalidBatchEntryIdException" />
        /// <exception cref="T:Amazon.SQS.Model.EmptyBatchRequestException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<ChangeMessageVisibilityBatchResponse> ChangeMessageVisibilityBatchAsync(ChangeMessageVisibilityBatchRequest changeMessageVisibilityBatchRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ChangeMessageVisibilityBatchRequestMarshaller();
            var unmarshaller = ChangeMessageVisibilityBatchResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, ChangeMessageVisibilityBatchRequest, ChangeMessageVisibilityBatchResponse>(changeMessageVisibilityBatchRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
        IAsyncResult invokeChangeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new ChangeMessageVisibilityBatchRequestMarshaller();
            var unmarshaller = ChangeMessageVisibilityBatchResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }