public void CreateQueueMarshallTest()
        {
            var operation = service_model.FindOperation("CreateQueue");

            var request    = InstantiateClassGenerator.Execute <CreateQueueRequest>();
            var marshaller = new CreateQueueRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);

            TestTools.RequestValidator.Validate("CreateQueue", request, internalRequest, service_model);

            var webResponse = new WebResponseData
            {
                Headers =
                {
                    { "x-amzn-RequestId", Guid.NewGuid().ToString() },
                    { "x-amz-crc32",      "0"                       }
                }
            };

            var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();

            webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
            var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
            ResponseUnmarshaller unmarshaller = CreateQueueResponseUnmarshaller.Instance;
            var response = unmarshaller.Unmarshall(context)
                           as CreateQueueResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Esempio n. 2
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateQueue operation.
        /// <seealso cref="Amazon.SQS.IAmazonSQS"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateQueue 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 <CreateQueueResponse> CreateQueueAsync(CreateQueueRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.Instance;

            return(Invoke <IRequest, CreateQueueRequest, CreateQueueResponse>(request, marshaller, unmarshaller, signer, cancellationToken));
        }
Esempio n. 3
0
        internal virtual CreateQueueResponse CreateQueue(CreateQueueRequest request)
        {
            var marshaller   = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.Instance;

            return(Invoke <CreateQueueRequest, CreateQueueResponse>(request, marshaller, unmarshaller));
        }
Esempio n. 4
0
        /// <inheritdoc/>
        public IAsyncResult BeginCreateQueue(CreateQueueRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.Instance;

            return(BeginInvoke <CreateQueueRequest>(request, marshaller, unmarshaller,
                                                    callback, state));
        }
Esempio n. 5
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateQueue operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateQueue 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>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/CreateQueue">REST API Reference for CreateQueue Operation</seealso>
        public virtual Task <CreateQueueResponse> CreateQueueAsync(CreateQueueRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateQueueRequest, CreateQueueResponse>(request, marshaller,
                                                                         unmarshaller, cancellationToken));
        }
Esempio n. 6
0
        /// <inheritdoc/>
        public IAsyncResult BeginCreateQueue(CreateQueueRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.Instance;

            return BeginInvoke<CreateQueueRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Esempio n. 7
0
        public async Task <Queue> CreateQueueAsync(CreateQueueRequest request)
        {
            var marshaller   = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.Instance;

            var response = await InvokeAsync <CreateQueueRequest, CreateQueueResponse>(request, marshaller, unmarshaller).ConfigureAwait(false);

            return(new Queue(response.QueueUrl.Substring(response.QueueUrl.LastIndexOf("/") + 1), this));
        }
Esempio n. 8
0
        /// <inheritdoc/>
        public Queue CreateQueue(CreateQueueRequest request)
        {
            var marshaller   = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.Instance;

            var response = Invoke <CreateQueueRequest, CreateQueueResponse>(request, marshaller, unmarshaller);

            return(new Queue(response.QueueUrl.Substring(response.QueueUrl.LastIndexOf("/") + 1), this));
        }
        public void CreateQueueMarshallTest()
        {
            var operation = service_model.FindOperation("CreateQueue");

            var request = InstantiateClassGenerator.Execute<CreateQueueRequest>();
            var marshaller = new CreateQueueRequestMarshaller();
            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 = CreateQueueResponseUnmarshaller.Instance.Unmarshall(context)
                as CreateQueueResponse;   
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);       
        }
Esempio n. 10
0
        /// <summary>
        /// <para>The <c>CreateQueue</c> action creates a new queue, or returns the URL of an existing one. When you request <c>CreateQueue</c> , you
        /// provide a name for the queue. To successfully create a new queue, you must provide a name that is unique within the scope of your own
        /// queues.</para> <para>You may pass one or more attributes in the request. If you do not provide a value for any attribute, the queue will
        /// have the default value for that attribute. Permitted attributes are the same that can be set using SetQueueAttributes.</para> <para>If you
        /// provide the name of an existing queue, a new queue isn't created. If the values of attributes provided with the request match up with those
        /// on the existing queue, the queue URL is returned. Otherwise, a <c>QueueNameExists</c> error is returned.</para>
        /// </summary>
        /// 
        /// <param name="createQueueRequest">Container for the necessary parameters to execute the CreateQueue service method on AmazonSQS.</param>
        /// 
        /// <returns>The response from the CreateQueue service method, as returned by AmazonSQS.</returns>
        /// 
        /// <exception cref="T:Amazon.SQS.Model.QueueNameExistsException" />
        /// <exception cref="T:Amazon.SQS.Model.QueueDeletedRecentlyException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<CreateQueueResponse> CreateQueueAsync(CreateQueueRequest createQueueRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, CreateQueueRequest, CreateQueueResponse>(createQueueRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
Esempio n. 11
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateQueue operation.
        /// <seealso cref="Amazon.SQS.IAmazonSQS.CreateQueue"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateQueue 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<CreateQueueResponse> CreateQueueAsync(CreateQueueRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, CreateQueueRequest, CreateQueueResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
Esempio n. 12
0
        /// <summary>
        /// Creates a new queue, or returns the URL      of an existing one. When you request
        /// <code>CreateQueue</code>, you provide a      name for the queue. To successfully create
        /// a new queue, you must provide a name      that is unique within the scope of your
        /// own queues.
        /// 
        ///         <note>      
        /// <para>
        /// If you delete a queue, you must wait at least 60 seconds before creating a queue with
        /// the        same name.
        /// </para>
        ///           </note>    
        /// <para>
        /// You may pass one or more attributes in the request. If you do not      provide a value
        /// for any attribute, the queue will have the default value      for that attribute.
        /// Permitted attributes are the same that can be set      using <a>SetQueueAttributes</a>.
        /// </para>
        ///         <note>
        /// <para>
        /// Use <a>GetQueueUrl</a> to get a queue's URL.      <a>GetQueueUrl</a> requires only
        /// the <code>QueueName</code> parameter.
        /// </para>
        /// </note>        
        /// <para>
        /// If you provide the name of an existing queue, along with the exact names and values
        /// of all the queue's attributes,      <code>CreateQueue</code> returns the queue URL
        /// for the existing queue. If the queue name, attribute names,       or attribute values
        /// do not match an existing queue, <code>CreateQueue</code> returns an error.
        /// </para>
        ///         <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 CreateQueue service method.</param>
        /// 
        /// <returns>The response from the CreateQueue service method, as returned by SQS.</returns>
        /// <exception cref="QueueDeletedRecentlyException">
        /// You must wait 60 seconds after deleting a queue before you can create another    
        ///  with the same name.
        /// </exception>
        /// <exception cref="QueueNameExistsException">
        /// A queue already exists with this name. Amazon SQS returns this error only if the request
        /// includes      attributes whose values differ from those of the existing queue.
        /// </exception>
        public CreateQueueResponse CreateQueue(CreateQueueRequest request)
        {
            var marshaller = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.Instance;

            return Invoke<CreateQueueRequest,CreateQueueResponse>(request, marshaller, unmarshaller);
        }
Esempio n. 13
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateQueue operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateQueue 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<CreateQueueResponse> CreateQueueAsync(CreateQueueRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.Instance;

            return InvokeAsync<CreateQueueRequest,CreateQueueResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Esempio n. 14
0
 IAsyncResult invokeCreateQueue(CreateQueueRequest createQueueRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new CreateQueueRequestMarshaller().Marshall(createQueueRequest);
     var unmarshaller = CreateQueueResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
        IAsyncResult invokeCreateQueue(CreateQueueRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }
Esempio n. 16
0
        /// <inheritdoc/>
        public Queue CreateQueue(CreateQueueRequest request)
        {
            var marshaller = new CreateQueueRequestMarshaller();
            var unmarshaller = CreateQueueResponseUnmarshaller.Instance;

            var response = Invoke<CreateQueueRequest, CreateQueueResponse>(request, marshaller, unmarshaller);
            return new Queue(response.QueueUrl, this);
        }
Esempio n. 17
0
 /// <summary>
 /// Initiates the asynchronous execution of the CreateQueue operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the CreateQueue 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 CreateQueueAsync(CreateQueueRequest request, AmazonServiceCallback<CreateQueueRequest, CreateQueueResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new CreateQueueRequestMarshaller();
     var unmarshaller = CreateQueueResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<CreateQueueRequest,CreateQueueResponse> responseObject 
                     = new AmazonServiceResult<CreateQueueRequest,CreateQueueResponse>((CreateQueueRequest)req, (CreateQueueResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<CreateQueueRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }