Delete an origin access identity.
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.CloudFront.Model.DeleteCloudFrontOriginAccessIdentityRequest(); if (cmdletContext.Id != null) { request.Id = cmdletContext.Id; } if (cmdletContext.IfMatch != null) { request.IfMatch = cmdletContext.IfMatch; } 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 DeleteCloudFrontOriginAccessIdentity operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCloudFrontOriginAccessIdentity operation on AmazonCloudFrontClient.</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 EndDeleteCloudFrontOriginAccessIdentity /// operation.</returns> public IAsyncResult BeginDeleteCloudFrontOriginAccessIdentity(DeleteCloudFrontOriginAccessIdentityRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteCloudFrontOriginAccessIdentityRequestMarshaller(); var unmarshaller = DeleteCloudFrontOriginAccessIdentityResponseUnmarshaller.Instance; return BeginInvoke<DeleteCloudFrontOriginAccessIdentityRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Delete an origin access identity. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteCloudFrontOriginAccessIdentity service method.</param> /// /// <returns>The response from the DeleteCloudFrontOriginAccessIdentity service method, as returned by CloudFront.</returns> /// <exception cref="Amazon.CloudFront.Model.AccessDeniedException"> /// Access denied. /// </exception> /// <exception cref="Amazon.CloudFront.Model.CloudFrontOriginAccessIdentityInUseException"> /// /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidIfMatchVersionException"> /// The If-Match version is missing or not valid for the distribution. /// </exception> /// <exception cref="Amazon.CloudFront.Model.NoSuchCloudFrontOriginAccessIdentityException"> /// The specified origin access identity does not exist. /// </exception> /// <exception cref="Amazon.CloudFront.Model.PreconditionFailedException"> /// The precondition given in one or more of the request-header fields evaluated to false. /// </exception> public DeleteCloudFrontOriginAccessIdentityResponse DeleteCloudFrontOriginAccessIdentity(DeleteCloudFrontOriginAccessIdentityRequest request) { var marshaller = new DeleteCloudFrontOriginAccessIdentityRequestMarshaller(); var unmarshaller = DeleteCloudFrontOriginAccessIdentityResponseUnmarshaller.Instance; return Invoke<DeleteCloudFrontOriginAccessIdentityRequest,DeleteCloudFrontOriginAccessIdentityResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DeleteCloudFrontOriginAccessIdentity operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCloudFrontOriginAccessIdentity 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<DeleteCloudFrontOriginAccessIdentityResponse> DeleteCloudFrontOriginAccessIdentityAsync(DeleteCloudFrontOriginAccessIdentityRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteCloudFrontOriginAccessIdentityRequestMarshaller(); var unmarshaller = DeleteCloudFrontOriginAccessIdentityResponseUnmarshaller.Instance; return InvokeAsync<DeleteCloudFrontOriginAccessIdentityRequest,DeleteCloudFrontOriginAccessIdentityResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Delete an origin access identity. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteCloudFrontOriginAccessIdentity service method.</param> /// /// <returns>The response from the DeleteCloudFrontOriginAccessIdentity service method, as returned by CloudFront.</returns> /// <exception cref="AccessDeniedException"> /// Access denied. /// </exception> /// <exception cref="CloudFrontOriginAccessIdentityInUseException"> /// /// </exception> /// <exception cref="InvalidIfMatchVersionException"> /// The If-Match version is missing or not valid for the distribution. /// </exception> /// <exception cref="NoSuchCloudFrontOriginAccessIdentityException"> /// The specified origin access identity does not exist. /// </exception> /// <exception cref="PreconditionFailedException"> /// The precondition given in one or more of the request-header fields evaluated to false. /// </exception> public DeleteCloudFrontOriginAccessIdentityResponse DeleteCloudFrontOriginAccessIdentity(DeleteCloudFrontOriginAccessIdentityRequest request) { var task = DeleteCloudFrontOriginAccessIdentityAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Delete an origin access identity. </para> /// </summary> /// /// <param name="deleteCloudFrontOriginAccessIdentityRequest">Container for the necessary parameters to execute the /// DeleteCloudFrontOriginAccessIdentity service method on AmazonCloudFront.</param> /// /// <exception cref="InvalidIfMatchVersionException"/> /// <exception cref="CloudFrontOriginAccessIdentityInUseException"/> /// <exception cref="NoSuchCloudFrontOriginAccessIdentityException"/> /// <exception cref="PreconditionFailedException"/> /// <exception cref="AccessDeniedException"/> public DeleteCloudFrontOriginAccessIdentityResponse DeleteCloudFrontOriginAccessIdentity(DeleteCloudFrontOriginAccessIdentityRequest deleteCloudFrontOriginAccessIdentityRequest) { IAsyncResult asyncResult = invokeDeleteCloudFrontOriginAccessIdentity(deleteCloudFrontOriginAccessIdentityRequest, null, null, true); return EndDeleteCloudFrontOriginAccessIdentity(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DeleteCloudFrontOriginAccessIdentity operation. /// <seealso cref="Amazon.CloudFront.AmazonCloudFront.DeleteCloudFrontOriginAccessIdentity"/> /// </summary> /// /// <param name="deleteCloudFrontOriginAccessIdentityRequest">Container for the necessary parameters to execute the /// DeleteCloudFrontOriginAccessIdentity operation on AmazonCloudFront.</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 BeginDeleteCloudFrontOriginAccessIdentity(DeleteCloudFrontOriginAccessIdentityRequest deleteCloudFrontOriginAccessIdentityRequest, AsyncCallback callback, object state) { return invokeDeleteCloudFrontOriginAccessIdentity(deleteCloudFrontOriginAccessIdentityRequest, callback, state, false); }
IAsyncResult invokeDeleteCloudFrontOriginAccessIdentity(DeleteCloudFrontOriginAccessIdentityRequest deleteCloudFrontOriginAccessIdentityRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteCloudFrontOriginAccessIdentityRequestMarshaller().Marshall(deleteCloudFrontOriginAccessIdentityRequest); var unmarshaller = DeleteCloudFrontOriginAccessIdentityResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Delete an origin access identity. </para> /// </summary> /// /// <param name="deleteCloudFrontOriginAccessIdentityRequest">Container for the necessary parameters to execute the /// DeleteCloudFrontOriginAccessIdentity service method on AmazonCloudFront.</param> /// /// <exception cref="T:Amazon.CloudFront.Model.InvalidIfMatchVersionException" /> /// <exception cref="T:Amazon.CloudFront.Model.CloudFrontOriginAccessIdentityInUseException" /> /// <exception cref="T:Amazon.CloudFront.Model.NoSuchCloudFrontOriginAccessIdentityException" /> /// <exception cref="T:Amazon.CloudFront.Model.PreconditionFailedException" /> /// <exception cref="T:Amazon.CloudFront.Model.AccessDeniedException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<DeleteCloudFrontOriginAccessIdentityResponse> DeleteCloudFrontOriginAccessIdentityAsync(DeleteCloudFrontOriginAccessIdentityRequest deleteCloudFrontOriginAccessIdentityRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteCloudFrontOriginAccessIdentityRequestMarshaller(); var unmarshaller = DeleteCloudFrontOriginAccessIdentityResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteCloudFrontOriginAccessIdentityRequest, DeleteCloudFrontOriginAccessIdentityResponse>(deleteCloudFrontOriginAccessIdentityRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal DeleteCloudFrontOriginAccessIdentityResponse DeleteCloudFrontOriginAccessIdentity(DeleteCloudFrontOriginAccessIdentityRequest request) { var task = DeleteCloudFrontOriginAccessIdentityAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
IAsyncResult invokeDeleteCloudFrontOriginAccessIdentity(DeleteCloudFrontOriginAccessIdentityRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DeleteCloudFrontOriginAccessIdentityRequestMarshaller(); var unmarshaller = DeleteCloudFrontOriginAccessIdentityResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the DeleteCloudFrontOriginAccessIdentity operation. /// <seealso cref="Amazon.CloudFront.IAmazonCloudFront.DeleteCloudFrontOriginAccessIdentity"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCloudFrontOriginAccessIdentity 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 async Task<DeleteCloudFrontOriginAccessIdentityResponse> DeleteCloudFrontOriginAccessIdentityAsync(DeleteCloudFrontOriginAccessIdentityRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteCloudFrontOriginAccessIdentityRequestMarshaller(); var unmarshaller = DeleteCloudFrontOriginAccessIdentityResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteCloudFrontOriginAccessIdentityRequest, DeleteCloudFrontOriginAccessIdentityResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
private Amazon.CloudFront.Model.DeleteCloudFrontOriginAccessIdentityResponse CallAWSServiceOperation(IAmazonCloudFront client, Amazon.CloudFront.Model.DeleteCloudFrontOriginAccessIdentityRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudFront", "DeleteCloudFrontOriginAccessIdentity"); try { #if DESKTOP return(client.DeleteCloudFrontOriginAccessIdentity(request)); #elif CORECLR return(client.DeleteCloudFrontOriginAccessIdentityAsync(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; } }