public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.IdentityManagement.Model.ChangePasswordRequest(); if (cmdletContext.NewPassword != null) { request.NewPassword = cmdletContext.NewPassword; } if (cmdletContext.OldPassword != null) { request.OldPassword = cmdletContext.OldPassword; } 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); }
private Amazon.IdentityManagement.Model.ChangePasswordResponse CallAWSServiceOperation(IAmazonIdentityManagementService client, Amazon.IdentityManagement.Model.ChangePasswordRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Identity and Access Management", "ChangePassword"); try { #if DESKTOP return(client.ChangePassword(request)); #elif CORECLR return(client.ChangePasswordAsync(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 ChangePassword operation. /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ChangePassword 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<ChangePasswordResponse> ChangePasswordAsync(ChangePasswordRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ChangePasswordRequestMarshaller(); var unmarshaller = ChangePasswordResponseUnmarshaller.Instance; return InvokeAsync<ChangePasswordRequest,ChangePasswordResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeChangePassword(ChangePasswordRequest changePasswordRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ChangePasswordRequestMarshaller().Marshall(changePasswordRequest); var unmarshaller = ChangePasswordResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
internal ChangePasswordResponse ChangePassword(ChangePasswordRequest request) { var marshaller = new ChangePasswordRequestMarshaller(); var unmarshaller = ChangePasswordResponseUnmarshaller.Instance; return Invoke<ChangePasswordRequest,ChangePasswordResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para>Changes the password of the IAM user calling <c>ChangePassword</c> . The root account password is not affected by this action. For /// information about modifying passwords, see Managing Passwords.</para> /// </summary> /// /// <param name="changePasswordRequest">Container for the necessary parameters to execute the ChangePassword service method on /// AmazonIdentityManagementService.</param> /// /// <exception cref="NoSuchEntityException"/> /// <exception cref="InvalidUserTypeException"/> public ChangePasswordResponse ChangePassword(ChangePasswordRequest changePasswordRequest) { IAsyncResult asyncResult = invokeChangePassword(changePasswordRequest, null, null, true); return EndChangePassword(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the ChangePassword operation. /// <seealso cref="Amazon.IdentityManagement.AmazonIdentityManagementService.ChangePassword"/> /// </summary> /// /// <param name="changePasswordRequest">Container for the necessary parameters to execute the ChangePassword 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 BeginChangePassword(ChangePasswordRequest changePasswordRequest, AsyncCallback callback, object state) { return invokeChangePassword(changePasswordRequest, callback, state, false); }
/// <summary> /// Initiates the asynchronous execution of the ChangePassword operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ChangePassword 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 ChangePasswordAsync(ChangePasswordRequest request, AmazonServiceCallback<ChangePasswordRequest, ChangePasswordResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new ChangePasswordRequestMarshaller(); var unmarshaller = ChangePasswordResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<ChangePasswordRequest,ChangePasswordResponse> responseObject = new AmazonServiceResult<ChangePasswordRequest,ChangePasswordResponse>((ChangePasswordRequest)req, (ChangePasswordResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<ChangePasswordRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Initiates the asynchronous execution of the ChangePassword operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ChangePassword 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 EndChangePassword /// operation.</returns> public IAsyncResult BeginChangePassword(ChangePasswordRequest request, AsyncCallback callback, object state) { var marshaller = new ChangePasswordRequestMarshaller(); var unmarshaller = ChangePasswordResponseUnmarshaller.Instance; return BeginInvoke<ChangePasswordRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the ChangePassword operation. /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService.ChangePassword"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ChangePassword 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<ChangePasswordResponse> ChangePasswordAsync(ChangePasswordRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ChangePasswordRequestMarshaller(); var unmarshaller = ChangePasswordResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, ChangePasswordRequest, ChangePasswordResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para>Changes the password of the IAM user calling <c>ChangePassword</c> . The root account password is not affected by this action. For /// information about modifying passwords, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html">Managing /// Passwords</a> .</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ChangePassword service method on /// AmazonIdentityManagementService.</param> /// /// <exception cref="T:Amazon.IdentityManagement.Model.EntityTemporarilyUnmodifiableException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.LimitExceededException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.InvalidUserTypeException" /> public ChangePasswordResponse ChangePassword(ChangePasswordRequest request) { var task = ChangePasswordAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// <para>Changes the password of the IAM user calling <c>ChangePassword</c> . The root account password is not affected by this action. For /// information about modifying passwords, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html">Managing /// Passwords</a> .</para> /// </summary> /// /// <param name="changePasswordRequest">Container for the necessary parameters to execute the ChangePassword service method on /// AmazonIdentityManagementService.</param> /// /// <exception cref="T:Amazon.IdentityManagement.Model.EntityTemporarilyUnmodifiableException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.LimitExceededException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.InvalidUserTypeException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<ChangePasswordResponse> ChangePasswordAsync(ChangePasswordRequest changePasswordRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ChangePasswordRequestMarshaller(); var unmarshaller = ChangePasswordResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ChangePasswordRequest, ChangePasswordResponse>(changePasswordRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal ChangePasswordResponse ChangePassword(ChangePasswordRequest request) { var task = ChangePasswordAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeChangePassword(ChangePasswordRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new ChangePasswordRequestMarshaller(); var unmarshaller = ChangePasswordResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }