internal SendMessageBatchResponse SendMessageBatch(SendMessageBatchRequest request)
        {
            var marshaller   = new SendMessageBatchRequestMarshaller();
            var unmarshaller = SendMessageBatchResponseUnmarshaller.Instance;

            return(Invoke <SendMessageBatchRequest, SendMessageBatchResponse>(request, marshaller, unmarshaller));
        }
Esempio n. 2
0
        /// <summary>
        /// Initiates the asynchronous execution of the SendMessageBatch operation.
        /// <seealso cref="Amazon.SQS.IAmazonSQS"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the SendMessageBatch 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 <SendMessageBatchResponse> SendMessageBatchAsync(SendMessageBatchRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new SendMessageBatchRequestMarshaller();
            var unmarshaller = SendMessageBatchResponseUnmarshaller.Instance;

            return(Invoke <IRequest, SendMessageBatchRequest, SendMessageBatchResponse>(request, marshaller, unmarshaller, signer, cancellationToken));
        }
        public void SendMessageBatchMarshallTest()
        {
            var operation = service_model.FindOperation("SendMessageBatch");

            var request = InstantiateClassGenerator.Execute<SendMessageBatchRequest>();
            var marshaller = new SendMessageBatchRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation);
            validator.Validate();


            var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute();
            var context = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null);
            var response = SendMessageBatchResponseUnmarshaller.Instance.Unmarshall(context)
                as SendMessageBatchResponse;   
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);       
        }
Esempio n. 4
0
        /// <summary>
        /// <para>This is a batch version of SendMessage. It takes multiple messages and adds each of them to the queue. The result of each add
        /// operation is reported individually in the response.</para>
        /// </summary>
        /// 
        /// <param name="sendMessageBatchRequest">Container for the necessary parameters to execute the SendMessageBatch service method on
        /// AmazonSQS.</param>
        /// 
        /// <returns>The response from the SendMessageBatch 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.BatchRequestTooLongException" />
        /// <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<SendMessageBatchResponse> SendMessageBatchAsync(SendMessageBatchRequest sendMessageBatchRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SendMessageBatchRequestMarshaller();
            var unmarshaller = SendMessageBatchResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, SendMessageBatchRequest, SendMessageBatchResponse>(sendMessageBatchRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
Esempio n. 5
0
        /// <summary>
        /// Initiates the asynchronous execution of the SendMessageBatch operation.
        /// <seealso cref="Amazon.SQS.IAmazonSQS.SendMessageBatch"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SendMessageBatch 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<SendMessageBatchResponse> SendMessageBatchAsync(SendMessageBatchRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SendMessageBatchRequestMarshaller();
            var unmarshaller = SendMessageBatchResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, SendMessageBatchRequest, SendMessageBatchResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
Esempio n. 6
0
        /// <summary>
        /// Initiates the asynchronous execution of the SendMessageBatch operation.
        /// <seealso cref="Amazon.SQS.IAmazonSQS"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SendMessageBatch 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 EndSendMessageBatch
        ///         operation.</returns>
        public IAsyncResult BeginSendMessageBatch(SendMessageBatchRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new SendMessageBatchRequestMarshaller();
            var unmarshaller = SendMessageBatchResponseUnmarshaller.Instance;

            return BeginInvoke<SendMessageBatchRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Esempio n. 7
0
        /// <summary>
        /// Delivers up to ten messages to the specified queue.      This is a batch version of
        /// <a>SendMessage</a>.      The result of the send action on each message is reported
        /// individually in the response.      The maximum allowed individual message size is
        /// 256 KB (262,144 bytes).
        /// 
        ///     
        /// <para>
        /// The maximum total payload size (i.e., the sum of all a batch's individual message
        /// lengths)      is also 256 KB (262,144 bytes).
        /// </para>
        ///     
        /// <para>
        /// If the <code>DelaySeconds</code> parameter is not specified for an entry,     the
        /// default for the queue is used.
        /// </para>
        ///     <important>The following list shows the characters (in Unicode) that are allowed
        /// in your message, according      to the W3C XML specification. For more information,
        /// go to <a href="http://www.faqs.org/rfcs/rfc1321.html">http://www.faqs.org/rfcs/rfc1321.html</a>.
        ///       If you send any characters that are not included in the list, your request will
        /// be rejected.      
        /// <para>
        /// #x9 | #xA | #xD | [#x20 to #xD7FF] | [#xE000 to #xFFFD] | [#x10000 to #x10FFFF]
        /// </para>
        ///     </important>    <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 SendMessageBatch service method.</param>
        /// 
        /// <returns>The response from the SendMessageBatch 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="BatchRequestTooLongException">
        /// The length of all the messages put together is more than the limit.
        /// </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>
        /// <exception cref="UnsupportedOperationException">
        /// Error code 400. Unsupported operation.
        /// </exception>
        public SendMessageBatchResponse SendMessageBatch(SendMessageBatchRequest request)
        {
            var marshaller = new SendMessageBatchRequestMarshaller();
            var unmarshaller = SendMessageBatchResponseUnmarshaller.Instance;

            return Invoke<SendMessageBatchRequest,SendMessageBatchResponse>(request, marshaller, unmarshaller);
        }
Esempio n. 8
0
        /// <summary>
        /// Initiates the asynchronous execution of the SendMessageBatch operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SendMessageBatch 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<SendMessageBatchResponse> SendMessageBatchAsync(SendMessageBatchRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SendMessageBatchRequestMarshaller();
            var unmarshaller = SendMessageBatchResponseUnmarshaller.Instance;

            return InvokeAsync<SendMessageBatchRequest,SendMessageBatchResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Esempio n. 9
0
 IAsyncResult invokeSendMessageBatch(SendMessageBatchRequest sendMessageBatchRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new SendMessageBatchRequestMarshaller().Marshall(sendMessageBatchRequest);
     var unmarshaller = SendMessageBatchResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
Esempio n. 10
0
 /// <summary>
 /// Initiates the asynchronous execution of the SendMessageBatch operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the SendMessageBatch 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 SendMessageBatchAsync(SendMessageBatchRequest request, AmazonServiceCallback<SendMessageBatchRequest, SendMessageBatchResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new SendMessageBatchRequestMarshaller();
     var unmarshaller = SendMessageBatchResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<SendMessageBatchRequest,SendMessageBatchResponse> responseObject 
                     = new AmazonServiceResult<SendMessageBatchRequest,SendMessageBatchResponse>((SendMessageBatchRequest)req, (SendMessageBatchResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<SendMessageBatchRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
        IAsyncResult invokeSendMessageBatch(SendMessageBatchRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new SendMessageBatchRequestMarshaller();
            var unmarshaller = SendMessageBatchResponseUnmarshaller.Instance;

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