Container for the parameters to the CreateHealthCheck operation.

This action creates a new health check.

To create a new health check, send a POST request to the 2012-12-12/healthcheck resource. The request body must include an XML document with a CreateHealthCheckRequest element. The response returns the CreateHealthCheckResponse element that contains metadata about the health check.

Inheritance: Amazon.Runtime.AmazonWebServiceRequest
        /// <summary>
        /// <para> This action creates a new health check.</para> <para> To create a new health check, send a <c>POST</c> request to the
        /// <c>2013-04-01/healthcheck</c> resource. The request body must include an XML document with a <c>CreateHealthCheckRequest</c> element. The
        /// response returns the <c>CreateHealthCheckResponse</c> element that contains metadata about the health check.</para>
        /// </summary>
        /// 
        /// <param name="createHealthCheckRequest">Container for the necessary parameters to execute the CreateHealthCheck service method on
        /// AmazonRoute53.</param>
        /// 
        /// <returns>The response from the CreateHealthCheck service method, as returned by AmazonRoute53.</returns>
        /// 
        /// <exception cref="T:Amazon.Route53.Model.HealthCheckAlreadyExistsException" />
        /// <exception cref="T:Amazon.Route53.Model.InvalidInputException" />
        /// <exception cref="T:Amazon.Route53.Model.TooManyHealthChecksException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<CreateHealthCheckResponse> CreateHealthCheckAsync(CreateHealthCheckRequest createHealthCheckRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateHealthCheckRequestMarshaller();
            var unmarshaller = CreateHealthCheckResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, CreateHealthCheckRequest, CreateHealthCheckResponse>(createHealthCheckRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
        /// <summary>
        /// <para> This action creates a new health check.</para> <para> To create a new health check, send a <c>POST</c> request to the
        /// <c>2012-12-12/healthcheck</c> resource. The request body must include an XML document with a <c>CreateHealthCheckRequest</c> element. The
        /// response returns the <c>CreateHealthCheckResponse</c> element that contains metadata about the health check.</para>
        /// </summary>
        /// 
        /// <param name="createHealthCheckRequest">Container for the necessary parameters to execute the CreateHealthCheck service method on
        /// AmazonRoute53.</param>
        /// 
        /// <returns>The response from the CreateHealthCheck service method, as returned by AmazonRoute53.</returns>
        /// 
        /// <exception cref="T:Amazon.Route53.Model.InvalidInputException" />
        /// <exception cref="T:Amazon.Route53.Model.HealthCheckAlreadyExistsException" />
        /// <exception cref="T:Amazon.Route53.Model.TooManyHealthChecksException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public async Task<CreateHealthCheckResponse> CreateHealthCheckAsync(CreateHealthCheckRequest createHealthCheckRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateHealthCheckRequestMarshaller();
            var unmarshaller = CreateHealthCheckResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, CreateHealthCheckRequest, CreateHealthCheckResponse>(createHealthCheckRequest, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
		internal CreateHealthCheckResponse CreateHealthCheck(CreateHealthCheckRequest request)
        {
            var task = CreateHealthCheckAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateHealthCheck operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateHealthCheck 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<CreateHealthCheckResponse> CreateHealthCheckAsync(CreateHealthCheckRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateHealthCheckRequestMarshaller();
            var unmarshaller = CreateHealthCheckResponseUnmarshaller.Instance;

            return InvokeAsync<CreateHealthCheckRequest,CreateHealthCheckResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
		internal CreateHealthCheckResponse CreateHealthCheck(CreateHealthCheckRequest request)
        {
            var task = CreateHealthCheckAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
        /// <summary>
        /// This action creates a new health check.
        /// 
        ///  
        /// <para>
        ///  To create a new health check, send a <code>POST</code> request to the <code>2013-04-01/healthcheck</code>
        /// resource. The request body must include an XML document with a <code>CreateHealthCheckRequest</code>
        /// element. The response returns the <code>CreateHealthCheckResponse</code> element that
        /// contains metadata about the health check.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateHealthCheck service method.</param>
        /// 
        /// <returns>The response from the CreateHealthCheck service method, as returned by Route53.</returns>
        /// <exception cref="Amazon.Route53.Model.HealthCheckAlreadyExistsException">
        /// The health check you are trying to create already exists. Route 53 returns this error
        /// when a health check has already been created with the specified <code>CallerReference</code>.
        /// </exception>
        /// <exception cref="Amazon.Route53.Model.InvalidInputException">
        /// Some value specified in the request is invalid or the XML document is malformed.
        /// </exception>
        /// <exception cref="Amazon.Route53.Model.TooManyHealthChecksException">
        /// 
        /// </exception>
        public CreateHealthCheckResponse CreateHealthCheck(CreateHealthCheckRequest request)
        {
            var marshaller = new CreateHealthCheckRequestMarshaller();
            var unmarshaller = CreateHealthCheckResponseUnmarshaller.Instance;

            return Invoke<CreateHealthCheckRequest,CreateHealthCheckResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateHealthCheck operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateHealthCheck operation on AmazonRoute53Client.</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 EndCreateHealthCheck
        ///         operation.</returns>
        public IAsyncResult BeginCreateHealthCheck(CreateHealthCheckRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateHealthCheckRequestMarshaller();
            var unmarshaller = CreateHealthCheckResponseUnmarshaller.Instance;

            return BeginInvoke<CreateHealthCheckRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 IAsyncResult invokeCreateHealthCheck(CreateHealthCheckRequest createHealthCheckRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new CreateHealthCheckRequestMarshaller().Marshall(createHealthCheckRequest);
     var unmarshaller = CreateHealthCheckResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
 /// <summary>
 /// Initiates the asynchronous execution of the CreateHealthCheck operation.
 /// <seealso cref="Amazon.Route53.IAmazonRoute53.CreateHealthCheck"/>
 /// </summary>
 /// 
 /// <param name="createHealthCheckRequest">Container for the necessary parameters to execute the CreateHealthCheck operation on
 ///          AmazonRoute53.</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 EndCreateHealthCheck
 ///         operation.</returns>
 public IAsyncResult BeginCreateHealthCheck(CreateHealthCheckRequest createHealthCheckRequest, AsyncCallback callback, object state)
 {
     return invokeCreateHealthCheck(createHealthCheckRequest, callback, state, false);
 }
 /// <summary>
 /// <para> This action creates a new health check.</para> <para> To create a new health check, send a <c>POST</c> request to the
 /// <c>2013-04-01/healthcheck</c> resource. The request body must include an XML document with a <c>CreateHealthCheckRequest</c> element. The
 /// response returns the <c>CreateHealthCheckResponse</c> element that contains metadata about the health check.</para>
 /// </summary>
 /// 
 /// <param name="createHealthCheckRequest">Container for the necessary parameters to execute the CreateHealthCheck service method on
 ///          AmazonRoute53.</param>
 /// 
 /// <returns>The response from the CreateHealthCheck service method, as returned by AmazonRoute53.</returns>
 /// 
 /// <exception cref="HealthCheckAlreadyExistsException"/>
 /// <exception cref="InvalidInputException"/>
 /// <exception cref="TooManyHealthChecksException"/>
 public CreateHealthCheckResponse CreateHealthCheck(CreateHealthCheckRequest createHealthCheckRequest)
 {
     IAsyncResult asyncResult = invokeCreateHealthCheck(createHealthCheckRequest, null, null, true);
     return EndCreateHealthCheck(asyncResult);
 }