/// <summary> /// Deletes an existing Channel. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteChannel service method.</param> /// /// <returns>The response from the DeleteChannel service method, as returned by MediaPackage.</returns> /// <exception cref="Amazon.MediaPackage.Model.ForbiddenException"> /// The client is not authorized to access the requested resource. /// </exception> /// <exception cref="Amazon.MediaPackage.Model.InternalServerErrorException"> /// An unexpected error occurred. /// </exception> /// <exception cref="Amazon.MediaPackage.Model.NotFoundException"> /// The requested resource does not exist. /// </exception> /// <exception cref="Amazon.MediaPackage.Model.ServiceUnavailableException"> /// An unexpected error occurred. /// </exception> /// <exception cref="Amazon.MediaPackage.Model.TooManyRequestsException"> /// The client has exceeded their resource or throttling limits. /// </exception> /// <exception cref="Amazon.MediaPackage.Model.UnprocessableEntityException"> /// The parameters sent in the request are not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DeleteChannel">REST API Reference for DeleteChannel Operation</seealso> public virtual DeleteChannelResponse DeleteChannel(DeleteChannelRequest request) { var marshaller = DeleteChannelRequestMarshaller.Instance; var unmarshaller = DeleteChannelResponseUnmarshaller.Instance; return(Invoke <DeleteChannelRequest, DeleteChannelResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// Deletes the specified Channel. /// </summary> /// <param name="request">The request object containing the details to send. Required.</param> /// <param name="retryConfiguration">The retry configuration that will be used by to send this request. Optional.</param> /// <param name="cancellationToken">The cancellation token to cancel this operation. Optional.</param> /// <returns>A response object containing details about the completed operation</returns> /// <example>Click <a href="https://docs.cloud.oracle.com/en-us/iaas/tools/dot-net-examples/latest/mysql/DeleteChannel.cs.html">here</a> to see an example of how to use DeleteChannel API.</example> public async Task <DeleteChannelResponse> DeleteChannel(DeleteChannelRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default) { logger.Trace("Called deleteChannel"); Uri uri = new Uri(this.restClient.GetEndpoint(), System.IO.Path.Combine(basePathWithoutHost, "/channels/{channelId}".Trim('/'))); HttpMethod method = new HttpMethod("DELETE"); HttpRequestMessage requestMessage = Converter.ToHttpRequestMessage(uri, method, request); requestMessage.Headers.Add("Accept", "application/json"); GenericRetrier retryingClient = Retrier.GetPreferredRetrier(retryConfiguration, this.retryConfiguration); HttpResponseMessage responseMessage; try { if (retryingClient != null) { responseMessage = await retryingClient.MakeRetryingCall(this.restClient.HttpSend, requestMessage, cancellationToken).ConfigureAwait(false); } else { responseMessage = await this.restClient.HttpSend(requestMessage).ConfigureAwait(false); } this.restClient.CheckHttpResponseMessage(requestMessage, responseMessage); return(Converter.FromHttpResponseMessage <DeleteChannelResponse>(responseMessage)); } catch (Exception e) { logger.Error($"DeleteChannel failed with error: {e.Message}"); throw; } }
protected override void ProcessRecord() { base.ProcessRecord(); if (!ConfirmDelete("OCIMysqlChannel", "Remove")) { return; } DeleteChannelRequest request; try { request = new DeleteChannelRequest { ChannelId = ChannelId, IfMatch = IfMatch, OpcRequestId = OpcRequestId }; response = client.DeleteChannel(request).GetAwaiter().GetResult(); WriteOutput(response, CreateWorkRequestObject(response.OpcWorkRequestId)); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }
/// <summary> /// Initiates the asynchronous execution of the DeleteChannel operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteChannel 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> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DeleteChannel">REST API Reference for DeleteChannel Operation</seealso> public virtual Task <DeleteChannelResponse> DeleteChannelAsync(DeleteChannelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = DeleteChannelRequestMarshaller.Instance; var unmarshaller = DeleteChannelResponseUnmarshaller.Instance; return(InvokeAsync <DeleteChannelRequest, DeleteChannelResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the DeleteChannel operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteChannel 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> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DeleteChannel">REST API Reference for DeleteChannel Operation</seealso> public virtual Task <DeleteChannelResponse> DeleteChannelAsync(DeleteChannelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteChannelRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteChannelResponseUnmarshaller.Instance; return(InvokeAsync <DeleteChannelResponse>(request, options, cancellationToken)); }
/// <summary> /// Deletes an existing Channel. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteChannel service method.</param> /// /// <returns>The response from the DeleteChannel service method, as returned by MediaPackage.</returns> /// <exception cref="Amazon.MediaPackage.Model.ForbiddenException"> /// The client is not authorized to access the requested resource. /// </exception> /// <exception cref="Amazon.MediaPackage.Model.InternalServerErrorException"> /// An unexpected error occurred. /// </exception> /// <exception cref="Amazon.MediaPackage.Model.NotFoundException"> /// The requested resource does not exist. /// </exception> /// <exception cref="Amazon.MediaPackage.Model.ServiceUnavailableException"> /// An unexpected error occurred. /// </exception> /// <exception cref="Amazon.MediaPackage.Model.TooManyRequestsException"> /// The client has exceeded their resource or throttling limits. /// </exception> /// <exception cref="Amazon.MediaPackage.Model.UnprocessableEntityException"> /// The parameters sent in the request are not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DeleteChannel">REST API Reference for DeleteChannel Operation</seealso> public virtual DeleteChannelResponse DeleteChannel(DeleteChannelRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteChannelRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteChannelResponseUnmarshaller.Instance; return(Invoke <DeleteChannelResponse>(request, options)); }