/// <summary>
        /// Closes a tunnel identified by the unique tunnel id. When a <code>CloseTunnel</code>
        /// request is received, we close the WebSocket connections between the client and proxy
        /// server so no data can be transmitted.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CloseTunnel service method.</param>
        ///
        /// <returns>The response from the CloseTunnel service method, as returned by IoTSecureTunneling.</returns>
        /// <exception cref="Amazon.IoTSecureTunneling.Model.ResourceNotFoundException">
        /// Thrown when an operation is attempted on a resource that does not exist.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotsecuretunneling-2018-10-05/CloseTunnel">REST API Reference for CloseTunnel Operation</seealso>
        public virtual CloseTunnelResponse CloseTunnel(CloseTunnelRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CloseTunnelRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CloseTunnelResponseUnmarshaller.Instance;

            return(Invoke <CloseTunnelResponse>(request, options));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CloseTunnel operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CloseTunnel operation on AmazonIoTSecureTunnelingClient.</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 EndCloseTunnel
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotsecuretunneling-2018-10-05/CloseTunnel">REST API Reference for CloseTunnel Operation</seealso>
        public virtual IAsyncResult BeginCloseTunnel(CloseTunnelRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CloseTunnelRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CloseTunnelResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
        /// <summary>
        /// Closes a tunnel identified by the unique tunnel id. When a <code>CloseTunnel</code>
        /// request is received, we close the WebSocket connections between the client and proxy
        /// server so no data can be transmitted.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CloseTunnel service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the CloseTunnel service method, as returned by IoTSecureTunneling.</returns>
        /// <exception cref="Amazon.IoTSecureTunneling.Model.ResourceNotFoundException">
        /// Thrown when an operation is attempted on a resource that does not exist.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotsecuretunneling-2018-10-05/CloseTunnel">REST API Reference for CloseTunnel Operation</seealso>
        public virtual Task <CloseTunnelResponse> CloseTunnelAsync(CloseTunnelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CloseTunnelRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CloseTunnelResponseUnmarshaller.Instance;

            return(InvokeAsync <CloseTunnelResponse>(request, options, cancellationToken));
        }