/// <summary>
        /// Returns a paginated list all of the <code>Products</code> objects to which the caller
        /// has access.
        ///
        ///
        /// <para>
        /// The output of this operation can be used as input for other operations, such as <a>DescribeProductView</a>.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the SearchProducts service method.</param>
        ///
        /// <returns>The response from the SearchProducts service method, as returned by ServiceCatalog.</returns>
        /// <exception cref="Amazon.ServiceCatalog.Model.InvalidParametersException">
        /// One or more parameters provided to the operation are invalid.
        /// </exception>
        public SearchProductsResponse SearchProducts(SearchProductsRequest request)
        {
            var marshaller   = new SearchProductsRequestMarshaller();
            var unmarshaller = SearchProductsResponseUnmarshaller.Instance;

            return(Invoke <SearchProductsRequest, SearchProductsResponse>(request, marshaller, unmarshaller));
        }
Beispiel #2
0
        public void SearchProductsMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <SearchProductsRequest>();
            var marshaller = new SearchProductsRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest     = UTF8Encoding.UTF8.GetString(internalRequest.Content);

            Comparer.CompareObjectToJson <SearchProductsRequest>(request, jsonRequest);

            var webResponse = new WebResponseData
            {
                Headers =
                {
                    { "x-amzn-RequestId", Guid.NewGuid().ToString() },
                    { "x-amz-crc32",      "0"                       }
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("SearchProducts").ResponseStructure).Execute();

            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = SearchProductsResponseUnmarshaller.Instance.Unmarshall(context)
                           as SearchProductsResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the SearchProducts operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the SearchProducts operation on AmazonServiceCatalogClient.</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 EndSearchProducts
        ///         operation.</returns>
        public IAsyncResult BeginSearchProducts(SearchProductsRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new SearchProductsRequestMarshaller();
            var unmarshaller = SearchProductsResponseUnmarshaller.Instance;

            return(BeginInvoke <SearchProductsRequest>(request, marshaller, unmarshaller,
                                                       callback, state));
        }
Beispiel #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the SearchProducts operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the SearchProducts 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 <SearchProductsResponse> SearchProductsAsync(SearchProductsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new SearchProductsRequestMarshaller();
            var unmarshaller = SearchProductsResponseUnmarshaller.Instance;

            return(InvokeAsync <SearchProductsRequest, SearchProductsResponse>(request, marshaller,
                                                                               unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the SearchProducts operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SearchProducts 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<SearchProductsResponse> SearchProductsAsync(SearchProductsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new SearchProductsRequestMarshaller();
            var unmarshaller = SearchProductsResponseUnmarshaller.Instance;

            return InvokeAsync<SearchProductsRequest,SearchProductsResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        internal SearchProductsResponse SearchProducts(SearchProductsRequest request)
        {
            var marshaller = new SearchProductsRequestMarshaller();
            var unmarshaller = SearchProductsResponseUnmarshaller.Instance;

            return Invoke<SearchProductsRequest,SearchProductsResponse>(request, marshaller, unmarshaller);
        }
        public void SearchProductsMarshallTest()
        {
            var request = InstantiateClassGenerator.Execute<SearchProductsRequest>();
            var marshaller = new SearchProductsRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content);                        
            Comparer.CompareObjectToJson<SearchProductsRequest>(request,jsonRequest);

            var webResponse = new WebResponseData
            {
                Headers = {
                    {"x-amzn-RequestId", Guid.NewGuid().ToString()},
                    {"x-amz-crc32","0"}
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("SearchProducts").ResponseStructure).Execute();
            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = SearchProductsResponseUnmarshaller.Instance.Unmarshall(context)
                as SearchProductsResponse;
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the SearchProducts operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the SearchProducts operation on AmazonServiceCatalogClient.</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 EndSearchProducts
        ///         operation.</returns>
        public IAsyncResult BeginSearchProducts(SearchProductsRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new SearchProductsRequestMarshaller();
            var unmarshaller = SearchProductsResponseUnmarshaller.Instance;

            return BeginInvoke<SearchProductsRequest>(request, marshaller, unmarshaller,
                callback, state);
        }