Deletes the specified policy that is associated with the specified group.
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.IdentityManagement.Model.DeleteGroupPolicyRequest(); if (cmdletContext.GroupName != null) { request.GroupName = cmdletContext.GroupName; } if (cmdletContext.PolicyName != null) { request.PolicyName = cmdletContext.PolicyName; } 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 DeleteGroupPolicy operation. /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteGroupPolicy 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<DeleteGroupPolicyResponse> DeleteGroupPolicyAsync(DeleteGroupPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteGroupPolicyRequestMarshaller(); var unmarshaller = DeleteGroupPolicyResponseUnmarshaller.Instance; return InvokeAsync<DeleteGroupPolicyRequest,DeleteGroupPolicyResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal DeleteGroupPolicyResponse DeleteGroupPolicy(DeleteGroupPolicyRequest request) { var marshaller = new DeleteGroupPolicyRequestMarshaller(); var unmarshaller = DeleteGroupPolicyResponseUnmarshaller.Instance; return Invoke<DeleteGroupPolicyRequest,DeleteGroupPolicyResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DeleteGroupPolicy operation. /// <seealso cref="Amazon.IdentityManagement.AmazonIdentityManagementService.DeleteGroupPolicy"/> /// </summary> /// /// <param name="deleteGroupPolicyRequest">Container for the necessary parameters to execute the DeleteGroupPolicy operation on /// AmazonIdentityManagementService.</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 BeginDeleteGroupPolicy(DeleteGroupPolicyRequest deleteGroupPolicyRequest, AsyncCallback callback, object state) { return invokeDeleteGroupPolicy(deleteGroupPolicyRequest, callback, state, false); }
IAsyncResult invokeDeleteGroupPolicy(DeleteGroupPolicyRequest deleteGroupPolicyRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteGroupPolicyRequestMarshaller().Marshall(deleteGroupPolicyRequest); var unmarshaller = DeleteGroupPolicyResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Deletes the specified policy that is associated with the specified group.</para> /// </summary> /// /// <param name="deleteGroupPolicyRequest">Container for the necessary parameters to execute the DeleteGroupPolicy service method on /// AmazonIdentityManagementService.</param> /// /// <exception cref="NoSuchEntityException"/> public DeleteGroupPolicyResponse DeleteGroupPolicy(DeleteGroupPolicyRequest deleteGroupPolicyRequest) { IAsyncResult asyncResult = invokeDeleteGroupPolicy(deleteGroupPolicyRequest, null, null, true); return EndDeleteGroupPolicy(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DeleteGroupPolicy operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteGroupPolicy operation on AmazonIdentityManagementServiceClient.</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 EndDeleteGroupPolicy /// operation.</returns> public IAsyncResult BeginDeleteGroupPolicy(DeleteGroupPolicyRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteGroupPolicyRequestMarshaller(); var unmarshaller = DeleteGroupPolicyResponseUnmarshaller.Instance; return BeginInvoke<DeleteGroupPolicyRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para>Deletes the specified policy that is associated with the /// specified group.</para> /// </summary> /// /// <param name="deleteGroupPolicyRequest">Container for the necessary /// parameters to execute the DeleteGroupPolicy service method on /// AmazonIdentityManagementService.</param> /// /// <exception cref="NoSuchEntityException"/> public DeleteGroupPolicyResponse DeleteGroupPolicy(DeleteGroupPolicyRequest deleteGroupPolicyRequest) { IRequest<DeleteGroupPolicyRequest> request = new DeleteGroupPolicyRequestMarshaller().Marshall(deleteGroupPolicyRequest); DeleteGroupPolicyResponse response = Invoke<DeleteGroupPolicyRequest, DeleteGroupPolicyResponse> (request, this.signer, DeleteGroupPolicyResponseUnmarshaller.GetInstance()); return response; }
private Amazon.IdentityManagement.Model.DeleteGroupPolicyResponse CallAWSServiceOperation(IAmazonIdentityManagementService client, Amazon.IdentityManagement.Model.DeleteGroupPolicyRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Identity and Access Management", "DeleteGroupPolicy"); try { #if DESKTOP return(client.DeleteGroupPolicy(request)); #elif CORECLR return(client.DeleteGroupPolicyAsync(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 DeleteGroupPolicy operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteGroupPolicy operation on AmazonIdentityManagementServiceClient.</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 DeleteGroupPolicyAsync(DeleteGroupPolicyRequest request, AmazonServiceCallback<DeleteGroupPolicyRequest, DeleteGroupPolicyResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new DeleteGroupPolicyRequestMarshaller(); var unmarshaller = DeleteGroupPolicyResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<DeleteGroupPolicyRequest,DeleteGroupPolicyResponse> responseObject = new AmazonServiceResult<DeleteGroupPolicyRequest,DeleteGroupPolicyResponse>((DeleteGroupPolicyRequest)req, (DeleteGroupPolicyResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<DeleteGroupPolicyRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Initiates the asynchronous execution of the DeleteGroupPolicy operation. /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService.DeleteGroupPolicy"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteGroupPolicy 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<DeleteGroupPolicyResponse> DeleteGroupPolicyAsync(DeleteGroupPolicyRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteGroupPolicyRequestMarshaller(); var unmarshaller = DeleteGroupPolicyResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteGroupPolicyRequest, DeleteGroupPolicyResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para>Deletes the specified policy that is associated with the specified group.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteGroupPolicy service method on /// AmazonIdentityManagementService.</param> /// /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.LimitExceededException" /> public DeleteGroupPolicyResponse DeleteGroupPolicy(DeleteGroupPolicyRequest request) { var task = DeleteGroupPolicyAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para>Deletes the specified policy that is associated with the specified group.</para> /// </summary> /// /// <param name="deleteGroupPolicyRequest">Container for the necessary parameters to execute the DeleteGroupPolicy service method on /// AmazonIdentityManagementService.</param> /// /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.LimitExceededException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<DeleteGroupPolicyResponse> DeleteGroupPolicyAsync(DeleteGroupPolicyRequest deleteGroupPolicyRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteGroupPolicyRequestMarshaller(); var unmarshaller = DeleteGroupPolicyResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteGroupPolicyRequest, DeleteGroupPolicyResponse>(deleteGroupPolicyRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal DeleteGroupPolicyResponse DeleteGroupPolicy(DeleteGroupPolicyRequest request) { var task = DeleteGroupPolicyAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeDeleteGroupPolicy(DeleteGroupPolicyRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DeleteGroupPolicyRequestMarshaller(); var unmarshaller = DeleteGroupPolicyResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }