private Amazon.ComputeOptimizer.Model.ExportAutoScalingGroupRecommendationsResponse CallAWSServiceOperation(IAmazonComputeOptimizer client, Amazon.ComputeOptimizer.Model.ExportAutoScalingGroupRecommendationsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Compute Optimizer", "ExportAutoScalingGroupRecommendations");
     try
     {
         #if DESKTOP
         return(client.ExportAutoScalingGroupRecommendations(request));
         #elif CORECLR
         return(client.ExportAutoScalingGroupRecommendationsAsync(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.ComputeOptimizer.Model.ExportAutoScalingGroupRecommendationsRequest();

            if (cmdletContext.AccountId != null)
            {
                request.AccountIds = cmdletContext.AccountId;
            }
            if (cmdletContext.FieldsToExport != null)
            {
                request.FieldsToExport = cmdletContext.FieldsToExport;
            }
            if (cmdletContext.FileFormat != null)
            {
                request.FileFormat = cmdletContext.FileFormat;
            }
            if (cmdletContext.Filter != null)
            {
                request.Filters = cmdletContext.Filter;
            }
            if (cmdletContext.IncludeMemberAccount != null)
            {
                request.IncludeMemberAccounts = cmdletContext.IncludeMemberAccount.Value;
            }

            // populate S3DestinationConfig
            var requestS3DestinationConfigIsNull = true;

            request.S3DestinationConfig = new Amazon.ComputeOptimizer.Model.S3DestinationConfig();
            System.String requestS3DestinationConfig_s3DestinationConfig_Bucket = null;
            if (cmdletContext.S3DestinationConfig_Bucket != null)
            {
                requestS3DestinationConfig_s3DestinationConfig_Bucket = cmdletContext.S3DestinationConfig_Bucket;
            }
            if (requestS3DestinationConfig_s3DestinationConfig_Bucket != null)
            {
                request.S3DestinationConfig.Bucket = requestS3DestinationConfig_s3DestinationConfig_Bucket;
                requestS3DestinationConfigIsNull   = false;
            }
            System.String requestS3DestinationConfig_s3DestinationConfig_KeyPrefix = null;
            if (cmdletContext.S3DestinationConfig_KeyPrefix != null)
            {
                requestS3DestinationConfig_s3DestinationConfig_KeyPrefix = cmdletContext.S3DestinationConfig_KeyPrefix;
            }
            if (requestS3DestinationConfig_s3DestinationConfig_KeyPrefix != null)
            {
                request.S3DestinationConfig.KeyPrefix = requestS3DestinationConfig_s3DestinationConfig_KeyPrefix;
                requestS3DestinationConfigIsNull      = false;
            }
            // determine if request.S3DestinationConfig should be set to null
            if (requestS3DestinationConfigIsNull)
            {
                request.S3DestinationConfig = null;
            }

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