internal SelectResponse Select(SelectRequest request)
        {
            var marshaller   = new SelectRequestMarshaller();
            var unmarshaller = SelectResponseUnmarshaller.Instance;

            return(Invoke <SelectRequest, SelectResponse>(request, marshaller, unmarshaller));
        }
示例#2
0
        /// <summary>
        /// Initiates the asynchronous execution of the Select operation.
        /// <seealso cref="Amazon.SimpleDB.IAmazonSimpleDB"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the Select 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 <SelectResponse> SelectAsync(SelectRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new SelectRequestMarshaller();
            var unmarshaller = SelectResponseUnmarshaller.Instance;

            return(InvokeAsync <SelectRequest, SelectResponse>(request, marshaller,
                                                               unmarshaller, cancellationToken));
        }
        public void SelectMarshallTest()
        {
            var operation = service_model.FindOperation("Select");

            var request         = InstantiateClassGenerator.Execute <SelectRequest>();
            var marshaller      = new SelectRequestMarshaller();
            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        = SelectResponseUnmarshaller.Instance.Unmarshall(context)
                                  as SelectResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        /// <summary>
        /// <para> The <c>Select</c> operation returns a set of attributes for <c>ItemNames</c> that match the select expression. <c>Select</c> is
        /// similar to the standard SQL SELECT statement. </para> <para> The total size of the response cannot exceed 1 MB in total size. Amazon
        /// SimpleDB automatically adjusts the number of items returned per page to enforce this limit. For example, if the client asks to retrieve 2500
        /// items, but each individual item is 10 kB in size, the system returns 100 items and an appropriate <c>NextToken</c> so the client can access
        /// the next page of results. </para> <para> For information on how to construct select expressions, see Using Select to Create Amazon SimpleDB
        /// Queries in the Developer Guide. </para>
        /// </summary>
        /// 
        /// <param name="selectRequest">Container for the necessary parameters to execute the Select service method on AmazonSimpleDB.</param>
        /// 
        /// <returns>The response from the Select service method, as returned by AmazonSimpleDB.</returns>
        /// 
        /// <exception cref="T:Amazon.SimpleDB.Model.InvalidParameterValueException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.InvalidQueryExpressionException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.RequestTimeoutException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.InvalidNumberPredicatesException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.NoSuchDomainException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.InvalidNextTokenException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.TooManyRequestedAttributesException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.MissingParameterException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.InvalidNumberValueTestsException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public async Task<SelectResponse> SelectAsync(SelectRequest selectRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SelectRequestMarshaller();
            var unmarshaller = SelectResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, SelectRequest, SelectResponse>(selectRequest, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
        /// <summary>
        /// Initiates the asynchronous execution of the Select operation.
        /// <seealso cref="Amazon.SimpleDB.IAmazonSimpleDB"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the Select 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<SelectResponse> SelectAsync(SelectRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SelectRequestMarshaller();
            var unmarshaller = SelectResponseUnmarshaller.Instance;

            return InvokeAsync<SelectRequest,SelectResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        /// <summary>
        /// The <code>Select</code> operation returns a set of attributes for <code>ItemNames</code>
        /// that match the select expression. <code>Select</code> is similar to the standard SQL
        /// SELECT statement. 
        /// 
        ///  
        /// <para>
        ///  The total size of the response cannot exceed 1 MB in total size. Amazon SimpleDB
        /// automatically adjusts the number of items returned per page to enforce this limit.
        /// For example, if the client asks to retrieve 2500 items, but each individual item is
        /// 10 kB in size, the system returns 100 items and an appropriate <code>NextToken</code>
        /// so the client can access the next page of results. 
        /// </para>
        ///  
        /// <para>
        ///  For information on how to construct select expressions, see Using Select to Create
        /// Amazon SimpleDB Queries in the Developer Guide. 
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the Select service method.</param>
        /// 
        /// <returns>The response from the Select service method, as returned by SimpleDB.</returns>
        /// <exception cref="InvalidNextTokenException">
        /// The specified NextToken is not valid.
        /// </exception>
        /// <exception cref="InvalidNumberPredicatesException">
        /// Too many predicates exist in the query expression.
        /// </exception>
        /// <exception cref="InvalidNumberValueTestsException">
        /// Too many predicates exist in the query expression.
        /// </exception>
        /// <exception cref="InvalidParameterValueException">
        /// The value for a parameter is invalid.
        /// </exception>
        /// <exception cref="InvalidQueryExpressionException">
        /// The specified query expression syntax is not valid.
        /// </exception>
        /// <exception cref="MissingParameterException">
        /// The request must contain the specified missing parameter.
        /// </exception>
        /// <exception cref="NoSuchDomainException">
        /// The specified domain does not exist.
        /// </exception>
        /// <exception cref="RequestTimeoutException">
        /// A timeout occurred when attempting to query the specified domain with specified query
        /// expression.
        /// </exception>
        /// <exception cref="TooManyRequestedAttributesException">
        /// Too many attributes requested.
        /// </exception>
        public SelectResponse Select(SelectRequest request)
        {
            var marshaller = new SelectRequestMarshaller();
            var unmarshaller = SelectResponseUnmarshaller.Instance;

            return Invoke<SelectRequest,SelectResponse>(request, marshaller, unmarshaller);
        }
 IAsyncResult invokeSelect(SelectRequest selectRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new SelectRequestMarshaller().Marshall(selectRequest);
     var unmarshaller = SelectResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
        /// <summary>
        /// Initiates the asynchronous execution of the Select operation.
        /// <seealso cref="Amazon.SimpleDB.IAmazonSimpleDB.Select"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the Select 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<SelectResponse> SelectAsync(SelectRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SelectRequestMarshaller();
            var unmarshaller = SelectResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, SelectRequest, SelectResponse>(request, marshaller, unmarshaller, signer, cancellationToken);
        }
        /// <summary>
        /// <para> The <c>Select</c> operation returns a set of attributes for <c>ItemNames</c> that match the select expression. <c>Select</c> is
        /// similar to the standard SQL SELECT statement. </para> <para> The total size of the response cannot exceed 1 MB in total size. Amazon
        /// SimpleDB automatically adjusts the number of items returned per page to enforce this limit. For example, if the client asks to retrieve 2500
        /// items, but each individual item is 10 kB in size, the system returns 100 items and an appropriate <c>NextToken</c> so the client can access
        /// the next page of results. </para> <para> For information on how to construct select expressions, see Using Select to Create Amazon SimpleDB
        /// Queries in the Developer Guide. </para>
        /// </summary>
        /// 
        /// <param name="selectRequest">Container for the necessary parameters to execute the Select service method on AmazonSimpleDB.</param>
        /// 
        /// <returns>The response from the Select service method, as returned by AmazonSimpleDB.</returns>
        /// 
        /// <exception cref="T:Amazon.SimpleDB.Model.InvalidParameterValueException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.InvalidQueryExpressionException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.RequestTimeoutException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.InvalidNumberPredicatesException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.NoSuchDomainException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.InvalidNextTokenException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.TooManyRequestedAttributesException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.MissingParameterException" />
        /// <exception cref="T:Amazon.SimpleDB.Model.InvalidNumberValueTestsException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<SelectResponse> SelectAsync(SelectRequest selectRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SelectRequestMarshaller();
            var unmarshaller = SelectResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, SelectRequest, SelectResponse>(selectRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the Select operation.
        /// <seealso cref="Amazon.SimpleDB.IAmazonSimpleDB"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the Select operation on AmazonSimpleDBClient.</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 EndSelect
        ///         operation.</returns>
        public IAsyncResult BeginSelect(SelectRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new SelectRequestMarshaller();
            var unmarshaller = SelectResponseUnmarshaller.Instance;

            return BeginInvoke<SelectRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        public void SelectMarshallTest()
        {
            var operation = service_model.FindOperation("Select");

            var request = InstantiateClassGenerator.Execute<SelectRequest>();
            var marshaller = new SelectRequestMarshaller();
            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 = SelectResponseUnmarshaller.Instance.Unmarshall(context)
                as SelectResponse;   
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);       
        }