示例#1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.KinesisFirehose.Model.DeleteDeliveryStreamRequest();

            if (cmdletContext.AllowForceDelete != null)
            {
                request.AllowForceDelete = cmdletContext.AllowForceDelete.Value;
            }
            if (cmdletContext.DeliveryStreamName != null)
            {
                request.DeliveryStreamName = cmdletContext.DeliveryStreamName;
            }

            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>
        /// Initiates the asynchronous execution of the DeleteDeliveryStream operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteDeliveryStream 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<DeleteDeliveryStreamResponse> DeleteDeliveryStreamAsync(DeleteDeliveryStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DeleteDeliveryStreamRequestMarshaller();
            var unmarshaller = DeleteDeliveryStreamResponseUnmarshaller.Instance;

            return InvokeAsync<DeleteDeliveryStreamRequest,DeleteDeliveryStreamResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        /// <summary>
        /// Deletes a delivery stream and its data.
        /// 
        ///  
        /// <para>
        /// You can delete a delivery stream only if it is in <code>ACTIVE</code> or <code>DELETING</code>
        /// state, and not in the <code>CREATING</code> state. While the deletion request is in
        /// process, the delivery stream is in the <code>DELETING</code> state.
        /// </para>
        ///  
        /// <para>
        /// To check the state of a delivery stream, use <a>DescribeDeliveryStream</a>.
        /// </para>
        ///  
        /// <para>
        /// While the delivery stream is <code>DELETING</code> state, the service may continue
        /// to accept the records, but the service doesn't make any guarantees with respect to
        /// delivering the data. Therefore, as a best practice, you should first stop any applications
        /// that are sending records before deleting a delivery stream.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DeleteDeliveryStream service method.</param>
        /// 
        /// <returns>The response from the DeleteDeliveryStream service method, as returned by KinesisFirehose.</returns>
        /// <exception cref="Amazon.KinesisFirehose.Model.ResourceInUseException">
        /// The resource is already in use and not available for this operation.
        /// </exception>
        /// <exception cref="Amazon.KinesisFirehose.Model.ResourceNotFoundException">
        /// The specified resource could not be found.
        /// </exception>
        public DeleteDeliveryStreamResponse DeleteDeliveryStream(DeleteDeliveryStreamRequest request)
        {
            var marshaller = new DeleteDeliveryStreamRequestMarshaller();
            var unmarshaller = DeleteDeliveryStreamResponseUnmarshaller.Instance;

            return Invoke<DeleteDeliveryStreamRequest,DeleteDeliveryStreamResponse>(request, marshaller, unmarshaller);
        }
 /// <summary>
 /// Deletes a delivery stream and its data.
 /// 
 ///  
 /// <para>
 /// You can delete a delivery stream only if it is in <code>ACTIVE</code> or <code>DELETING</code>
 /// state, and not in the <code>CREATING</code> state. While the deletion request is in
 /// process, the delivery stream is in the <code>DELETING</code> state.
 /// </para>
 ///  
 /// <para>
 /// To check the state of a delivery stream, use <a>DescribeDeliveryStream</a>.
 /// </para>
 ///  
 /// <para>
 /// While the delivery stream is <code>DELETING</code> state, the service may continue
 /// to accept the records, but the service doesn't make any guarantees with respect to
 /// delivering the data. Therefore, as a best practice, you should first stop any applications
 /// that are sending records before deleting a delivery stream.
 /// </para>
 /// </summary>
 /// <param name="deliveryStreamName">The name of the delivery stream.</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 DeleteDeliveryStream service method, as returned by KinesisFirehose.</returns>
 /// <exception cref="Amazon.KinesisFirehose.Model.ResourceInUseException">
 /// The resource is already in use and not available for this operation.
 /// </exception>
 /// <exception cref="Amazon.KinesisFirehose.Model.ResourceNotFoundException">
 /// The specified resource could not be found.
 /// </exception>
 public Task<DeleteDeliveryStreamResponse> DeleteDeliveryStreamAsync(string deliveryStreamName, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new DeleteDeliveryStreamRequest();
     request.DeliveryStreamName = deliveryStreamName;
     return DeleteDeliveryStreamAsync(request, cancellationToken);
 }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteDeliveryStream operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteDeliveryStream operation on AmazonKinesisFirehoseClient.</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 EndDeleteDeliveryStream
        ///         operation.</returns>
        public IAsyncResult BeginDeleteDeliveryStream(DeleteDeliveryStreamRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DeleteDeliveryStreamRequestMarshaller();
            var unmarshaller = DeleteDeliveryStreamResponseUnmarshaller.Instance;

            return BeginInvoke<DeleteDeliveryStreamRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 /// <summary>
 /// Deletes a delivery stream and its data.
 /// 
 ///  
 /// <para>
 /// You can delete a delivery stream only if it is in <code>ACTIVE</code> or <code>DELETING</code>
 /// state, and not in the <code>CREATING</code> state. While the deletion request is in
 /// process, the delivery stream is in the <code>DELETING</code> state.
 /// </para>
 ///  
 /// <para>
 /// To check the state of a delivery stream, use <a>DescribeDeliveryStream</a>.
 /// </para>
 ///  
 /// <para>
 /// While the delivery stream is <code>DELETING</code> state, the service may continue
 /// to accept the records, but the service doesn't make any guarantees with respect to
 /// delivering the data. Therefore, as a best practice, you should first stop any applications
 /// that are sending records before deleting a delivery stream.
 /// </para>
 /// </summary>
 /// <param name="deliveryStreamName">The name of the delivery stream.</param>
 /// 
 /// <returns>The response from the DeleteDeliveryStream service method, as returned by KinesisFirehose.</returns>
 /// <exception cref="Amazon.KinesisFirehose.Model.ResourceInUseException">
 /// The resource is already in use and not available for this operation.
 /// </exception>
 /// <exception cref="Amazon.KinesisFirehose.Model.ResourceNotFoundException">
 /// The specified resource could not be found.
 /// </exception>
 public DeleteDeliveryStreamResponse DeleteDeliveryStream(string deliveryStreamName)
 {
     var request = new DeleteDeliveryStreamRequest();
     request.DeliveryStreamName = deliveryStreamName;
     return DeleteDeliveryStream(request);
 }
示例#7
0
 private Amazon.KinesisFirehose.Model.DeleteDeliveryStreamResponse CallAWSServiceOperation(IAmazonKinesisFirehose client, Amazon.KinesisFirehose.Model.DeleteDeliveryStreamRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Kinesis Firehose", "DeleteDeliveryStream");
     try
     {
         #if DESKTOP
         return(client.DeleteDeliveryStream(request));
         #elif CORECLR
         return(client.DeleteDeliveryStreamAsync(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;
     }
 }
 /// <summary>
 /// Initiates the asynchronous execution of the DeleteDeliveryStream operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the DeleteDeliveryStream operation on AmazonKinesisFirehoseClient.</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 DeleteDeliveryStreamAsync(DeleteDeliveryStreamRequest request, AmazonServiceCallback<DeleteDeliveryStreamRequest, DeleteDeliveryStreamResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new DeleteDeliveryStreamRequestMarshaller();
     var unmarshaller = DeleteDeliveryStreamResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<DeleteDeliveryStreamRequest,DeleteDeliveryStreamResponse> responseObject 
                     = new AmazonServiceResult<DeleteDeliveryStreamRequest,DeleteDeliveryStreamResponse>((DeleteDeliveryStreamRequest)req, (DeleteDeliveryStreamResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<DeleteDeliveryStreamRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
 /// <summary>
 /// Deletes a delivery stream and its data.
 /// 
 ///  
 /// <para>
 /// You can delete a delivery stream only if it is in <code>ACTIVE</code> or <code>DELETING</code>
 /// state, and not in the <code>CREATING</code> state. While the deletion request is in
 /// process, the delivery stream is in the <code>DELETING</code> state.
 /// </para>
 ///  
 /// <para>
 /// To check the state of a delivery stream, use <a>DescribeDeliveryStream</a>.
 /// </para>
 ///  
 /// <para>
 /// While the delivery stream is <code>DELETING</code> state, the service may continue
 /// to accept the records, but the service doesn't make any guarantees with respect to
 /// delivering the data. Therefore, as a best practice, you should first stop any applications
 /// that are sending records before deleting a delivery stream.
 /// </para>
 /// </summary>
 /// <param name="deliveryStreamName">The name of the delivery stream.</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>
 /// 
 /// <returns>The response from the DeleteDeliveryStream service method, as returned by KinesisFirehose.</returns>
 /// <exception cref="Amazon.KinesisFirehose.Model.ResourceInUseException">
 /// The resource is already in use and not available for this operation.
 /// </exception>
 /// <exception cref="Amazon.KinesisFirehose.Model.ResourceNotFoundException">
 /// The specified resource could not be found.
 /// </exception>
 public void DeleteDeliveryStreamAsync(string deliveryStreamName,  AmazonServiceCallback<DeleteDeliveryStreamRequest, DeleteDeliveryStreamResponse> callback, AsyncOptions options = null)
 {
     var request = new DeleteDeliveryStreamRequest();
     request.DeliveryStreamName = deliveryStreamName;
     DeleteDeliveryStreamAsync(request, callback, options);
 }