public void DescribeEventTypesMarshallTest() { var request = InstantiateClassGenerator.Execute <DescribeEventTypesRequest>(); var marshaller = new DescribeEventTypesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson <DescribeEventTypesRequest>(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("DescribeEventTypes").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DescribeEventTypesResponseUnmarshaller.Instance.Unmarshall(context) as DescribeEventTypesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
public void DescribeEventTypes_UnsupportedLocaleExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeEventTypes"); var request = InstantiateClassGenerator.Execute <DescribeEventTypesRequest>(); var marshaller = new DescribeEventTypesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson <DescribeEventTypesRequest>(request, jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("UnsupportedLocaleException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { { "x-amzn-RequestId", Guid.NewGuid().ToString() }, { "x-amz-crc32", "0" }, { "x-amzn-ErrorType", "UnsupportedLocaleException" }, { "Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString() } } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeEventTypesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
internal DescribeEventTypesResponse DescribeEventTypes(DescribeEventTypesRequest request) { var marshaller = new DescribeEventTypesRequestMarshaller(); var unmarshaller = DescribeEventTypesResponseUnmarshaller.Instance; return(Invoke <DescribeEventTypesRequest, DescribeEventTypesResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// Initiates the asynchronous execution of the DescribeEventTypes operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeEventTypes 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/health-2016-08-04/DescribeEventTypes">REST API Reference for DescribeEventTypes Operation</seealso> public Task <DescribeEventTypesResponse> DescribeEventTypesAsync(DescribeEventTypesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeEventTypesRequestMarshaller(); var unmarshaller = DescribeEventTypesResponseUnmarshaller.Instance; return(InvokeAsync <DescribeEventTypesRequest, DescribeEventTypesResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the DescribeEventTypes operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeEventTypes operation on AmazonAWSHealthClient.</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 EndDescribeEventTypes /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/health-2016-08-04/DescribeEventTypes">REST API Reference for DescribeEventTypes Operation</seealso> public IAsyncResult BeginDescribeEventTypes(DescribeEventTypesRequest request, AsyncCallback callback, object state) { var marshaller = new DescribeEventTypesRequestMarshaller(); var unmarshaller = DescribeEventTypesResponseUnmarshaller.Instance; return(BeginInvoke <DescribeEventTypesRequest>(request, marshaller, unmarshaller, callback, state)); }
public void DescribeEventTypesMarshallTest() { var request = InstantiateClassGenerator.Execute<DescribeEventTypesRequest>(); var marshaller = new DescribeEventTypesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson<DescribeEventTypesRequest>(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("DescribeEventTypes").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DescribeEventTypesResponseUnmarshaller.Instance.Unmarshall(context) as DescribeEventTypesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the DescribeEventTypes operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeEventTypes 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<DescribeEventTypesResponse> DescribeEventTypesAsync(DescribeEventTypesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeEventTypesRequestMarshaller(); var unmarshaller = DescribeEventTypesResponseUnmarshaller.Instance; return InvokeAsync<DescribeEventTypesRequest,DescribeEventTypesResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Gets a list of the event types that can be reported by Silvermine, based on the specified /// filter criteria. If no filter criteria are specified, all event types are returned, /// in no particular order. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeEventTypes service method.</param> /// /// <returns>The response from the DescribeEventTypes service method, as returned by AWSHealth.</returns> /// <exception cref="Amazon.AWSHealth.Model.InvalidPaginationTokenException"> /// /// </exception> /// <exception cref="Amazon.AWSHealth.Model.UnsupportedLocaleException"> /// /// </exception> public DescribeEventTypesResponse DescribeEventTypes(DescribeEventTypesRequest request) { var marshaller = new DescribeEventTypesRequestMarshaller(); var unmarshaller = DescribeEventTypesResponseUnmarshaller.Instance; return Invoke<DescribeEventTypesRequest,DescribeEventTypesResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DescribeEventTypes operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeEventTypes operation on AmazonAWSHealthClient.</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 EndDescribeEventTypes /// operation.</returns> public IAsyncResult BeginDescribeEventTypes(DescribeEventTypesRequest request, AsyncCallback callback, object state) { var marshaller = new DescribeEventTypesRequestMarshaller(); var unmarshaller = DescribeEventTypesResponseUnmarshaller.Instance; return BeginInvoke<DescribeEventTypesRequest>(request, marshaller, unmarshaller, callback, state); }