Container for the parameters to the DeleteStream operation. Deletes an Amazon Kinesis stream and all its shards and data. You must shut down any applications that are operating on the stream before you delete the stream. If an application attempts to operate on a deleted stream, it will receive the exception ResourceNotFoundException.

If the stream is in the ACTIVE state, you can delete it. After a DeleteStream request, the specified stream is in the DELETING state until Amazon Kinesis completes the deletion.

Note: Amazon Kinesis might continue to accept data read and write operations, such as PutRecord, PutRecords, and GetRecords, on a stream in the DELETING state until the stream deletion is complete.

When you delete a stream, any shards in that stream are also deleted, and any tags are dissociated from the stream.

You can use the DescribeStream operation to check the state of the stream, which is returned in StreamStatus.

DeleteStream has a limit of 5 transactions per second per account.

Inheritance: AmazonKinesisRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Kinesis.Model.DeleteStreamRequest();

            if (cmdletContext.EnforceConsumerDeletion != null)
            {
                request.EnforceConsumerDeletion = cmdletContext.EnforceConsumerDeletion.Value;
            }
            if (cmdletContext.StreamName != null)
            {
                request.StreamName = cmdletContext.StreamName;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
        /// <summary>
        /// <para>This operation deletes a stream and all of its shards and data. You must shut down any applications that are operating on the stream
        /// before you delete the stream. If an application attempts to operate on a deleted stream, it will receive the exception
        /// <c>ResourceNotFoundException</c> .</para> <para>If the stream is in the ACTIVE state, you can delete it. After a <c>DeleteStream</c>
        /// request, the specified stream is in the DELETING state until Amazon Kinesis completes the deletion.</para> <para> <b>Note:</b> Amazon
        /// Kinesis might continue to accept data read and write operations, such as PutRecord and GetRecords, on a stream in the DELETING state until
        /// the stream deletion is complete.</para> <para>When you delete a stream, any shards in that stream are also deleted.</para> <para>You can use
        /// the DescribeStream operation to check the state of the stream, which is returned in <c>StreamStatus</c> .</para> <para> <c>DeleteStream</c>
        /// has a limit of 5 transactions per second per account.</para>
        /// </summary>
        /// 
        /// <param name="deleteStreamRequest">Container for the necessary parameters to execute the DeleteStream service method on
        /// AmazonKinesis.</param>
        /// 
        /// <exception cref="T:Amazon.Kinesis.Model.LimitExceededException" />
        /// <exception cref="T:Amazon.Kinesis.Model.ResourceNotFoundException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<DeleteStreamResponse> DeleteStreamAsync(DeleteStreamRequest deleteStreamRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DeleteStreamRequestMarshaller();
            var unmarshaller = DeleteStreamResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, DeleteStreamRequest, DeleteStreamResponse>(deleteStreamRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
		internal DeleteStreamResponse DeleteStream(DeleteStreamRequest request)
        {
            var task = DeleteStreamAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteStream operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteStream 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<DeleteStreamResponse> DeleteStreamAsync(DeleteStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DeleteStreamRequestMarshaller();
            var unmarshaller = DeleteStreamResponseUnmarshaller.Instance;

            return InvokeAsync<DeleteStreamRequest,DeleteStreamResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        internal DeleteStreamResponse DeleteStream(DeleteStreamRequest request)
        {
            var marshaller = new DeleteStreamRequestMarshaller();
            var unmarshaller = DeleteStreamResponseUnmarshaller.Instance;

            return Invoke<DeleteStreamRequest,DeleteStreamResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteStream operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteStream operation on AmazonKinesisClient.</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 EndDeleteStream
        ///         operation.</returns>
        public IAsyncResult BeginDeleteStream(DeleteStreamRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DeleteStreamRequestMarshaller();
            var unmarshaller = DeleteStreamResponseUnmarshaller.Instance;

            return BeginInvoke<DeleteStreamRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// <para>This operation deletes a stream and all of its shards and data. You must shut down any applications that are operating on the stream
        /// before you delete the stream. If an application attempts to operate on a deleted stream, it will receive the exception
        /// <c>ResourceNotFoundException</c> .</para> <para>If the stream is in the ACTIVE state, you can delete it. After a <c>DeleteStream</c>
        /// request, the specified stream is in the DELETING state until Amazon Kinesis completes the deletion.</para> <para> <b>Note:</b> Amazon
        /// Kinesis might continue to accept data read and write operations, such as PutRecord and GetRecords, on a stream in the DELETING state until
        /// the stream deletion is complete.</para> <para>When you delete a stream, any shards in that stream are also deleted.</para> <para>You can use
        /// the DescribeStream operation to check the state of the stream, which is returned in <c>StreamStatus</c> .</para> <para> <c>DeleteStream</c>
        /// has a limit of 5 transactions per second per account.</para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteStream service method on
        /// AmazonKinesis.</param>
        /// 
        /// <exception cref="T:Amazon.Kinesis.Model.LimitExceededException" />
        /// <exception cref="T:Amazon.Kinesis.Model.ResourceNotFoundException" />
		public DeleteStreamResponse DeleteStream(DeleteStreamRequest request)
        {
            var task = DeleteStreamAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
 /// <summary>
 /// Initiates the asynchronous execution of the DeleteStream operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the DeleteStream operation on AmazonKinesisClient.</param>
 /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
 /// <param name="options">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>
 public void DeleteStreamAsync(DeleteStreamRequest request, AmazonServiceCallback<DeleteStreamRequest, DeleteStreamResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new DeleteStreamRequestMarshaller();
     var unmarshaller = DeleteStreamResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<DeleteStreamRequest,DeleteStreamResponse> responseObject 
                     = new AmazonServiceResult<DeleteStreamRequest,DeleteStreamResponse>((DeleteStreamRequest)req, (DeleteStreamResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<DeleteStreamRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
 IAsyncResult invokeDeleteStream(DeleteStreamRequest deleteStreamRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new DeleteStreamRequestMarshaller().Marshall(deleteStreamRequest);
     var unmarshaller = DeleteStreamResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
 /// <summary>
 /// Initiates the asynchronous execution of the DeleteStream operation.
 /// <seealso cref="Amazon.Kinesis.IAmazonKinesis.DeleteStream"/>
 /// </summary>
 /// 
 /// <param name="deleteStreamRequest">Container for the necessary parameters to execute the DeleteStream operation on AmazonKinesis.</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>
 public IAsyncResult BeginDeleteStream(DeleteStreamRequest deleteStreamRequest, AsyncCallback callback, object state)
 {
     return invokeDeleteStream(deleteStreamRequest, callback, state, false);
 }
 /// <summary>
 /// <para>This operation deletes a stream and all of its shards and data. You must shut down any applications that are operating on the stream
 /// before you delete the stream. If an application attempts to operate on a deleted stream, it will receive the exception
 /// <c>ResourceNotFoundException</c> .</para> <para>If the stream is in the ACTIVE state, you can delete it. After a <c>DeleteStream</c>
 /// request, the specified stream is in the DELETING state until Amazon Kinesis completes the deletion.</para> <para> <b>Note:</b> Amazon
 /// Kinesis might continue to accept data read and write operations, such as PutRecord and GetRecords, on a stream in the DELETING state until
 /// the stream deletion is complete.</para> <para>When you delete a stream, any shards in that stream are also deleted.</para> <para>You can use
 /// the DescribeStream operation to check the state of the stream, which is returned in <c>StreamStatus</c> .</para> <para> <c>DeleteStream</c>
 /// has a limit of 5 transactions per second per account.</para>
 /// </summary>
 /// 
 /// <param name="deleteStreamRequest">Container for the necessary parameters to execute the DeleteStream service method on
 ///          AmazonKinesis.</param>
 /// 
 /// <exception cref="LimitExceededException"/>
 /// <exception cref="ResourceNotFoundException"/>
 public DeleteStreamResponse DeleteStream(DeleteStreamRequest deleteStreamRequest)
 {
     IAsyncResult asyncResult = invokeDeleteStream(deleteStreamRequest, null, null, true);
     return EndDeleteStream(asyncResult);
 }
 private Amazon.Kinesis.Model.DeleteStreamResponse CallAWSServiceOperation(IAmazonKinesis client, Amazon.Kinesis.Model.DeleteStreamRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Kinesis", "DeleteStream");
     try
     {
         #if DESKTOP
         return(client.DeleteStream(request));
         #elif CORECLR
         return(client.DeleteStreamAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }