private Amazon.SecretsManager.Model.GetRandomPasswordResponse CallAWSServiceOperation(IAmazonSecretsManager client, Amazon.SecretsManager.Model.GetRandomPasswordRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Secrets Manager", "GetRandomPassword");
     try
     {
         #if DESKTOP
         return(client.GetRandomPassword(request));
         #elif CORECLR
         return(client.GetRandomPasswordAsync(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.SecretsManager.Model.GetRandomPasswordRequest();

            if (cmdletContext.ExcludeCharacter != null)
            {
                request.ExcludeCharacters = cmdletContext.ExcludeCharacter;
            }
            if (cmdletContext.ExcludeLowercase != null)
            {
                request.ExcludeLowercase = cmdletContext.ExcludeLowercase.Value;
            }
            if (cmdletContext.ExcludeNumber != null)
            {
                request.ExcludeNumbers = cmdletContext.ExcludeNumber.Value;
            }
            if (cmdletContext.ExcludePunctuation != null)
            {
                request.ExcludePunctuation = cmdletContext.ExcludePunctuation.Value;
            }
            if (cmdletContext.ExcludeUppercase != null)
            {
                request.ExcludeUppercase = cmdletContext.ExcludeUppercase.Value;
            }
            if (cmdletContext.IncludeSpace != null)
            {
                request.IncludeSpace = cmdletContext.IncludeSpace.Value;
            }
            if (cmdletContext.PasswordLength != null)
            {
                request.PasswordLength = cmdletContext.PasswordLength.Value;
            }
            if (cmdletContext.RequireEachIncludedType != null)
            {
                request.RequireEachIncludedType = cmdletContext.RequireEachIncludedType.Value;
            }

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