private Amazon.RDSDataService.Model.ExecuteStatementResponse CallAWSServiceOperation(IAmazonRDSDataService client, Amazon.RDSDataService.Model.ExecuteStatementRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS RDS DataService", "ExecuteStatement");
     try
     {
         #if DESKTOP
         return(client.ExecuteStatement(request));
         #elif CORECLR
         return(client.ExecuteStatementAsync(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.RDSDataService.Model.ExecuteStatementRequest();

            if (cmdletContext.ContinueAfterTimeout != null)
            {
                request.ContinueAfterTimeout = cmdletContext.ContinueAfterTimeout.Value;
            }
            if (cmdletContext.Database != null)
            {
                request.Database = cmdletContext.Database;
            }
            if (cmdletContext.IncludeResultMetadata != null)
            {
                request.IncludeResultMetadata = cmdletContext.IncludeResultMetadata.Value;
            }
            if (cmdletContext.Parameter != null)
            {
                request.Parameters = cmdletContext.Parameter;
            }
            if (cmdletContext.ResourceArn != null)
            {
                request.ResourceArn = cmdletContext.ResourceArn;
            }

            // populate ResultSetOptions
            var requestResultSetOptionsIsNull = true;

            request.ResultSetOptions = new Amazon.RDSDataService.Model.ResultSetOptions();
            Amazon.RDSDataService.DecimalReturnType requestResultSetOptions_resultSetOptions_DecimalReturnType = null;
            if (cmdletContext.ResultSetOptions_DecimalReturnType != null)
            {
                requestResultSetOptions_resultSetOptions_DecimalReturnType = cmdletContext.ResultSetOptions_DecimalReturnType;
            }
            if (requestResultSetOptions_resultSetOptions_DecimalReturnType != null)
            {
                request.ResultSetOptions.DecimalReturnType = requestResultSetOptions_resultSetOptions_DecimalReturnType;
                requestResultSetOptionsIsNull = false;
            }
            // determine if request.ResultSetOptions should be set to null
            if (requestResultSetOptionsIsNull)
            {
                request.ResultSetOptions = null;
            }
            if (cmdletContext.Schema != null)
            {
                request.Schema = cmdletContext.Schema;
            }
            if (cmdletContext.SecretArn != null)
            {
                request.SecretArn = cmdletContext.SecretArn;
            }
            if (cmdletContext.Sql != null)
            {
                request.Sql = cmdletContext.Sql;
            }
            if (cmdletContext.TransactionId != null)
            {
                request.TransactionId = cmdletContext.TransactionId;
            }

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