public void DetectModerationLabelsMarshallTest() { var request = InstantiateClassGenerator.Execute <DetectModerationLabelsRequest>(); var marshaller = new DetectModerationLabelsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson <DetectModerationLabelsRequest>(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("DetectModerationLabels").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DetectModerationLabelsResponseUnmarshaller.Instance.Unmarshall(context) as DetectModerationLabelsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
internal DetectModerationLabelsResponse DetectModerationLabels(DetectModerationLabelsRequest request) { var marshaller = new DetectModerationLabelsRequestMarshaller(); var unmarshaller = DetectModerationLabelsResponseUnmarshaller.Instance; return(Invoke <DetectModerationLabelsRequest, DetectModerationLabelsResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// Initiates the asynchronous execution of the DetectModerationLabels operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DetectModerationLabels 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/rekognition-2016-06-27/DetectModerationLabels">REST API Reference for DetectModerationLabels Operation</seealso> public Task <DetectModerationLabelsResponse> DetectModerationLabelsAsync(DetectModerationLabelsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DetectModerationLabelsRequestMarshaller(); var unmarshaller = DetectModerationLabelsResponseUnmarshaller.Instance; return(InvokeAsync <DetectModerationLabelsRequest, DetectModerationLabelsResponse>(request, marshaller, unmarshaller, cancellationToken)); }