예제 #1
0
        internal virtual BatchDetectKeyPhrasesResponse BatchDetectKeyPhrases(BatchDetectKeyPhrasesRequest request)
        {
            var marshaller   = new BatchDetectKeyPhrasesRequestMarshaller();
            var unmarshaller = BatchDetectKeyPhrasesResponseUnmarshaller.Instance;

            return(Invoke <BatchDetectKeyPhrasesRequest, BatchDetectKeyPhrasesResponse>(request, marshaller, unmarshaller));
        }
예제 #2
0
        public void BatchDetectKeyPhrasesMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <BatchDetectKeyPhrasesRequest>();
            var marshaller = new BatchDetectKeyPhrasesRequestMarshaller();

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

            Comparer.CompareObjectToJson <BatchDetectKeyPhrasesRequest>(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("BatchDetectKeyPhrases").ResponseStructure).Execute();

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

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
예제 #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the BatchDetectKeyPhrases operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the BatchDetectKeyPhrases 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/comprehend-2017-11-27/BatchDetectKeyPhrases">REST API Reference for BatchDetectKeyPhrases Operation</seealso>
        public virtual Task <BatchDetectKeyPhrasesResponse> BatchDetectKeyPhrasesAsync(BatchDetectKeyPhrasesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new BatchDetectKeyPhrasesRequestMarshaller();
            var unmarshaller = BatchDetectKeyPhrasesResponseUnmarshaller.Instance;

            return(InvokeAsync <BatchDetectKeyPhrasesRequest, BatchDetectKeyPhrasesResponse>(request, marshaller,
                                                                                             unmarshaller, cancellationToken));
        }