Container for the parameters to the DeleteDeliveryChannel operation. Deletes the delivery channel.

Before you can delete the delivery channel, you must stop the configuration recorder by using the StopConfigurationRecorder action.

Inheritance: AmazonConfigServiceRequest
Ejemplo n.º 1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.ConfigService.Model.DeleteDeliveryChannelRequest();

            if (cmdletContext.DeliveryChannelName != null)
            {
                request.DeliveryChannelName = cmdletContext.DeliveryChannelName;
            }

            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 DeleteDeliveryChannel operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteDeliveryChannel 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<DeleteDeliveryChannelResponse> DeleteDeliveryChannelAsync(DeleteDeliveryChannelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DeleteDeliveryChannelRequestMarshaller();
            var unmarshaller = DeleteDeliveryChannelResponseUnmarshaller.Instance;

            return InvokeAsync<DeleteDeliveryChannelRequest,DeleteDeliveryChannelResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
 /// <summary>
 /// Deletes the specified delivery channel.
 /// 
 ///  
 /// <para>
 /// The delivery channel cannot be deleted if it is the only delivery channel and the
 /// configuration recorder is still running. To delete the delivery channel, stop the
 /// running configuration recorder using the <a>StopConfigurationRecorder</a> action.
 /// </para>
 /// </summary>
 /// <param name="deliveryChannelName">The name of the delivery channel to delete.</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 DeleteDeliveryChannel service method, as returned by ConfigService.</returns>
 /// <exception cref="Amazon.ConfigService.Model.LastDeliveryChannelDeleteFailedException">
 /// You cannot delete the delivery channel you specified because the configuration recorder
 /// is running.
 /// </exception>
 /// <exception cref="Amazon.ConfigService.Model.NoSuchDeliveryChannelException">
 /// You have specified a delivery channel that does not exist.
 /// </exception>
 public Task<DeleteDeliveryChannelResponse> DeleteDeliveryChannelAsync(string deliveryChannelName, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new DeleteDeliveryChannelRequest();
     request.DeliveryChannelName = deliveryChannelName;
     return DeleteDeliveryChannelAsync(request, cancellationToken);
 }
        internal DeleteDeliveryChannelResponse DeleteDeliveryChannel(DeleteDeliveryChannelRequest request)
        {
            var marshaller = new DeleteDeliveryChannelRequestMarshaller();
            var unmarshaller = DeleteDeliveryChannelResponseUnmarshaller.Instance;

            return Invoke<DeleteDeliveryChannelRequest,DeleteDeliveryChannelResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteDeliveryChannel operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteDeliveryChannel operation on AmazonConfigServiceClient.</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 EndDeleteDeliveryChannel
        ///         operation.</returns>
        public IAsyncResult BeginDeleteDeliveryChannel(DeleteDeliveryChannelRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DeleteDeliveryChannelRequestMarshaller();
            var unmarshaller = DeleteDeliveryChannelResponseUnmarshaller.Instance;

            return BeginInvoke<DeleteDeliveryChannelRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 /// <summary>
 /// Deletes the specified delivery channel.
 /// 
 ///  
 /// <para>
 /// The delivery channel cannot be deleted if it is the only delivery channel and the
 /// configuration recorder is still running. To delete the delivery channel, stop the
 /// running configuration recorder using the <a>StopConfigurationRecorder</a> action.
 /// </para>
 /// </summary>
 /// <param name="deliveryChannelName">The name of the delivery channel to delete.</param>
 /// 
 /// <returns>The response from the DeleteDeliveryChannel service method, as returned by ConfigService.</returns>
 /// <exception cref="Amazon.ConfigService.Model.LastDeliveryChannelDeleteFailedException">
 /// You cannot delete the delivery channel you specified because the configuration recorder
 /// is running.
 /// </exception>
 /// <exception cref="Amazon.ConfigService.Model.NoSuchDeliveryChannelException">
 /// You have specified a delivery channel that does not exist.
 /// </exception>
 public DeleteDeliveryChannelResponse DeleteDeliveryChannel(string deliveryChannelName)
 {
     var request = new DeleteDeliveryChannelRequest();
     request.DeliveryChannelName = deliveryChannelName;
     return DeleteDeliveryChannel(request);
 }
Ejemplo n.º 7
0
 private Amazon.ConfigService.Model.DeleteDeliveryChannelResponse CallAWSServiceOperation(IAmazonConfigService client, Amazon.ConfigService.Model.DeleteDeliveryChannelRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Config", "DeleteDeliveryChannel");
     try
     {
         #if DESKTOP
         return(client.DeleteDeliveryChannel(request));
         #elif CORECLR
         return(client.DeleteDeliveryChannelAsync(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;
     }
 }