public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.IdentityManagement.Model.UpdateGroupRequest(); if (cmdletContext.GroupName != null) { request.GroupName = cmdletContext.GroupName; } if (cmdletContext.NewGroupName != null) { request.NewGroupName = cmdletContext.NewGroupName; } if (cmdletContext.NewPath != null) { request.NewPath = cmdletContext.NewPath; } 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 UpdateGroup operation. /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateGroup 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<UpdateGroupResponse> UpdateGroupAsync(UpdateGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateGroupRequestMarshaller(); var unmarshaller = UpdateGroupResponseUnmarshaller.Instance; return InvokeAsync<UpdateGroupRequest,UpdateGroupResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal UpdateGroupResponse UpdateGroup(UpdateGroupRequest request) { var marshaller = new UpdateGroupRequestMarshaller(); var unmarshaller = UpdateGroupResponseUnmarshaller.Instance; return Invoke<UpdateGroupRequest,UpdateGroupResponse>(request, marshaller, unmarshaller); }
IAsyncResult invokeUpdateGroup(UpdateGroupRequest updateGroupRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new UpdateGroupRequestMarshaller().Marshall(updateGroupRequest); var unmarshaller = UpdateGroupResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>Updates the name and/or the path of the specified group.</para> <para><b>IMPORTANT:</b> You should understand the implications of /// changing a group's path or name. For more information, see Renaming Users and Groups in Using AWS Identity and Access Management. </para> /// <para><b>NOTE:</b>To change a group name the requester must have appropriate permissions on both the source object and the target object. /// For example, to change Managers to MGRs, the entity making the request must have permission on Managers and MGRs, or must have permission on /// all (*). For more information about permissions, see Permissions and Policies. </para> /// </summary> /// /// <param name="updateGroupRequest">Container for the necessary parameters to execute the UpdateGroup service method on /// AmazonIdentityManagementService.</param> /// /// <exception cref="NoSuchEntityException"/> /// <exception cref="EntityAlreadyExistsException"/> public UpdateGroupResponse UpdateGroup(UpdateGroupRequest updateGroupRequest) { IAsyncResult asyncResult = invokeUpdateGroup(updateGroupRequest, null, null, true); return EndUpdateGroup(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the UpdateGroup operation. /// <seealso cref="Amazon.IdentityManagement.AmazonIdentityManagementService.UpdateGroup"/> /// </summary> /// /// <param name="updateGroupRequest">Container for the necessary parameters to execute the UpdateGroup 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 BeginUpdateGroup(UpdateGroupRequest updateGroupRequest, AsyncCallback callback, object state) { return invokeUpdateGroup(updateGroupRequest, callback, state, false); }
/// <summary> /// Initiates the asynchronous execution of the UpdateGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateGroup 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 EndUpdateGroup /// operation.</returns> public IAsyncResult BeginUpdateGroup(UpdateGroupRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateGroupRequestMarshaller(); var unmarshaller = UpdateGroupResponseUnmarshaller.Instance; return BeginInvoke<UpdateGroupRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para>Updates the name and/or the path of the specified group.</para> /// <para><b>IMPORTANT:</b> You should understand the implications of /// changing a group's path or name. For more information, see Renaming /// Users and Groups in Using AWS Identity and Access Management. </para> /// <para><b>NOTE:</b>To change a group name the requester must have /// appropriate permissions on both the source object and the target /// object. For example, to change Managers to MGRs, the entity making /// the request must have permission on Managers and MGRs, or must have /// permission on all (*). For more information about permissions, see /// Permissions and Policies. </para> /// </summary> /// /// <param name="updateGroupRequest">Container for the necessary /// parameters to execute the UpdateGroup service method on /// AmazonIdentityManagementService.</param> /// /// <exception cref="NoSuchEntityException"/> /// <exception cref="EntityAlreadyExistsException"/> public UpdateGroupResponse UpdateGroup(UpdateGroupRequest updateGroupRequest) { IRequest<UpdateGroupRequest> request = new UpdateGroupRequestMarshaller().Marshall(updateGroupRequest); UpdateGroupResponse response = Invoke<UpdateGroupRequest, UpdateGroupResponse> (request, this.signer, UpdateGroupResponseUnmarshaller.GetInstance()); return response; }
/// <summary> /// Initiates the asynchronous execution of the UpdateGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateGroup 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 UpdateGroupAsync(UpdateGroupRequest request, AmazonServiceCallback<UpdateGroupRequest, UpdateGroupResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new UpdateGroupRequestMarshaller(); var unmarshaller = UpdateGroupResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<UpdateGroupRequest,UpdateGroupResponse> responseObject = new AmazonServiceResult<UpdateGroupRequest,UpdateGroupResponse>((UpdateGroupRequest)req, (UpdateGroupResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<UpdateGroupRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Initiates the asynchronous execution of the UpdateGroup operation. /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService.UpdateGroup"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateGroup 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<UpdateGroupResponse> UpdateGroupAsync(UpdateGroupRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateGroupRequestMarshaller(); var unmarshaller = UpdateGroupResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, UpdateGroupRequest, UpdateGroupResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para>Updates the name and/or the path of the specified group.</para> <para><b>IMPORTANT:</b> You should understand the implications of /// changing a group's path or name. For more information, see Renaming Users and Groups in Using AWS Identity and Access Management. </para> /// <para><b>NOTE:</b>To change a group name the requester must have appropriate permissions on both the source object and the target object. /// For example, to change Managers to MGRs, the entity making the request must have permission on Managers and MGRs, or must have permission on /// all (*). For more information about permissions, see Permissions and Policies. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateGroup service method on /// AmazonIdentityManagementService.</param> /// /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.LimitExceededException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.EntityAlreadyExistsException" /> public UpdateGroupResponse UpdateGroup(UpdateGroupRequest request) { var task = UpdateGroupAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private async Task UpdateExternalIdentifier( IResourceIdentifier resourceIdentifier, string correlationIdentifier, string value = null) { if (null == resourceIdentifier) { throw new ArgumentNullException(AmazonWebServicesProvider.ArgumentNameResourceIdentifier); } if (string.IsNullOrWhiteSpace(correlationIdentifier)) { throw new ArgumentNullException(AmazonWebServicesProvider.ArgumentNameCorrelationIdentifier); } if (string.IsNullOrWhiteSpace(resourceIdentifier.Identifier)) { throw new ArgumentException(ProvisioningAgentResources.ExceptionInvalidResourceIdentifier); } if (string.IsNullOrWhiteSpace(resourceIdentifier.SchemaIdentifier)) { throw new ArgumentException(ProvisioningAgentResources.ExceptionInvalidResourceIdentifier); } IAmazonIdentityManagementService proxy = null; try { proxy = AWSClientFactory.CreateAmazonIdentityManagementServiceClient(this.credentials); switch (resourceIdentifier.SchemaIdentifier) { case SchemaIdentifiers.Core2EnterpriseUser: Amazon.IdentityManagement.Model.User user = await this.RetrieveUser(resourceIdentifier.Identifier, proxy); if (null == user) { return; } UpdateUserRequest updateUserRequest = new UpdateUserRequest(user.UserName) { NewUserName = value }; await proxy.UpdateUserAsync(updateUserRequest); break; case SchemaIdentifiers.WindowsAzureActiveDirectoryGroup: Group group = await this.RetrieveGroup(resourceIdentifier.Identifier, proxy); if (null == group) { return; } UpdateGroupRequest updateGroupRequest = new UpdateGroupRequest(group.GroupName) { NewGroupName = group.GroupName }; await proxy.UpdateGroupAsync(updateGroupRequest); break; default: throw new NotSupportedException(resourceIdentifier.SchemaIdentifier); } } finally { if (proxy != null) { proxy.Dispose(); proxy = null; } } }
/// <summary> /// <para>Updates the name and/or the path of the specified group.</para> <para><b>IMPORTANT:</b> You should understand the implications of /// changing a group's path or name. For more information, see Renaming Users and Groups in Using AWS Identity and Access Management. </para> /// <para><b>NOTE:</b>To change a group name the requester must have appropriate permissions on both the source object and the target object. /// For example, to change Managers to MGRs, the entity making the request must have permission on Managers and MGRs, or must have permission on /// all (*). For more information about permissions, see Permissions and Policies. </para> /// </summary> /// /// <param name="updateGroupRequest">Container for the necessary parameters to execute the UpdateGroup service method on /// AmazonIdentityManagementService.</param> /// /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.LimitExceededException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.EntityAlreadyExistsException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<UpdateGroupResponse> UpdateGroupAsync(UpdateGroupRequest updateGroupRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateGroupRequestMarshaller(); var unmarshaller = UpdateGroupResponseUnmarshaller.GetInstance(); return Invoke<IRequest, UpdateGroupRequest, UpdateGroupResponse>(updateGroupRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal UpdateGroupResponse UpdateGroup(UpdateGroupRequest request) { var task = UpdateGroupAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeUpdateGroup(UpdateGroupRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new UpdateGroupRequestMarshaller(); var unmarshaller = UpdateGroupResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
private Amazon.IdentityManagement.Model.UpdateGroupResponse CallAWSServiceOperation(IAmazonIdentityManagementService client, Amazon.IdentityManagement.Model.UpdateGroupRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Identity and Access Management", "UpdateGroup"); try { #if DESKTOP return(client.UpdateGroup(request)); #elif CORECLR return(client.UpdateGroupAsync(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; } }