private Amazon.MemoryDB.Model.UpdateUserResponse CallAWSServiceOperation(IAmazonMemoryDB client, Amazon.MemoryDB.Model.UpdateUserRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon MemoryDB", "UpdateUser");
     try
     {
         #if DESKTOP
         return(client.UpdateUser(request));
         #elif CORECLR
         return(client.UpdateUserAsync(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;
     }
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.MemoryDB.Model.UpdateUserRequest();

            if (cmdletContext.AccessString != null)
            {
                request.AccessString = cmdletContext.AccessString;
            }

            // populate AuthenticationMode
            var requestAuthenticationModeIsNull = true;

            request.AuthenticationMode = new Amazon.MemoryDB.Model.AuthenticationMode();
            List <System.String> requestAuthenticationMode_authenticationMode_Password = null;

            if (cmdletContext.AuthenticationMode_Password != null)
            {
                requestAuthenticationMode_authenticationMode_Password = cmdletContext.AuthenticationMode_Password;
            }
            if (requestAuthenticationMode_authenticationMode_Password != null)
            {
                request.AuthenticationMode.Passwords = requestAuthenticationMode_authenticationMode_Password;
                requestAuthenticationModeIsNull      = false;
            }
            Amazon.MemoryDB.InputAuthenticationType requestAuthenticationMode_authenticationMode_Type = null;
            if (cmdletContext.AuthenticationMode_Type != null)
            {
                requestAuthenticationMode_authenticationMode_Type = cmdletContext.AuthenticationMode_Type;
            }
            if (requestAuthenticationMode_authenticationMode_Type != null)
            {
                request.AuthenticationMode.Type = requestAuthenticationMode_authenticationMode_Type;
                requestAuthenticationModeIsNull = false;
            }
            // determine if request.AuthenticationMode should be set to null
            if (requestAuthenticationModeIsNull)
            {
                request.AuthenticationMode = null;
            }
            if (cmdletContext.UserName != null)
            {
                request.UserName = cmdletContext.UserName;
            }

            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);
        }