private Amazon.CodeBuild.Model.UpdateReportGroupResponse CallAWSServiceOperation(IAmazonCodeBuild client, Amazon.CodeBuild.Model.UpdateReportGroupRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS CodeBuild", "UpdateReportGroup");
     try
     {
         #if DESKTOP
         return(client.UpdateReportGroup(request));
         #elif CORECLR
         return(client.UpdateReportGroupAsync(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.CodeBuild.Model.UpdateReportGroupRequest();

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

            // populate ExportConfig
            var requestExportConfigIsNull = true;

            request.ExportConfig = new Amazon.CodeBuild.Model.ReportExportConfig();
            Amazon.CodeBuild.ReportExportConfigType requestExportConfig_exportConfig_ExportConfigType = null;
            if (cmdletContext.ExportConfig_ExportConfigType != null)
            {
                requestExportConfig_exportConfig_ExportConfigType = cmdletContext.ExportConfig_ExportConfigType;
            }
            if (requestExportConfig_exportConfig_ExportConfigType != null)
            {
                request.ExportConfig.ExportConfigType = requestExportConfig_exportConfig_ExportConfigType;
                requestExportConfigIsNull             = false;
            }
            Amazon.CodeBuild.Model.S3ReportExportConfig requestExportConfig_exportConfig_S3Destination = null;

            // populate S3Destination
            var requestExportConfig_exportConfig_S3DestinationIsNull = true;

            requestExportConfig_exportConfig_S3Destination = new Amazon.CodeBuild.Model.S3ReportExportConfig();
            System.String requestExportConfig_exportConfig_S3Destination_s3Destination_Bucket = null;
            if (cmdletContext.S3Destination_Bucket != null)
            {
                requestExportConfig_exportConfig_S3Destination_s3Destination_Bucket = cmdletContext.S3Destination_Bucket;
            }
            if (requestExportConfig_exportConfig_S3Destination_s3Destination_Bucket != null)
            {
                requestExportConfig_exportConfig_S3Destination.Bucket = requestExportConfig_exportConfig_S3Destination_s3Destination_Bucket;
                requestExportConfig_exportConfig_S3DestinationIsNull  = false;
            }
            System.Boolean?requestExportConfig_exportConfig_S3Destination_s3Destination_EncryptionDisabled = null;
            if (cmdletContext.S3Destination_EncryptionDisabled != null)
            {
                requestExportConfig_exportConfig_S3Destination_s3Destination_EncryptionDisabled = cmdletContext.S3Destination_EncryptionDisabled.Value;
            }
            if (requestExportConfig_exportConfig_S3Destination_s3Destination_EncryptionDisabled != null)
            {
                requestExportConfig_exportConfig_S3Destination.EncryptionDisabled = requestExportConfig_exportConfig_S3Destination_s3Destination_EncryptionDisabled.Value;
                requestExportConfig_exportConfig_S3DestinationIsNull = false;
            }
            System.String requestExportConfig_exportConfig_S3Destination_s3Destination_EncryptionKey = null;
            if (cmdletContext.S3Destination_EncryptionKey != null)
            {
                requestExportConfig_exportConfig_S3Destination_s3Destination_EncryptionKey = cmdletContext.S3Destination_EncryptionKey;
            }
            if (requestExportConfig_exportConfig_S3Destination_s3Destination_EncryptionKey != null)
            {
                requestExportConfig_exportConfig_S3Destination.EncryptionKey = requestExportConfig_exportConfig_S3Destination_s3Destination_EncryptionKey;
                requestExportConfig_exportConfig_S3DestinationIsNull         = false;
            }
            Amazon.CodeBuild.ReportPackagingType requestExportConfig_exportConfig_S3Destination_s3Destination_Packaging = null;
            if (cmdletContext.S3Destination_Packaging != null)
            {
                requestExportConfig_exportConfig_S3Destination_s3Destination_Packaging = cmdletContext.S3Destination_Packaging;
            }
            if (requestExportConfig_exportConfig_S3Destination_s3Destination_Packaging != null)
            {
                requestExportConfig_exportConfig_S3Destination.Packaging = requestExportConfig_exportConfig_S3Destination_s3Destination_Packaging;
                requestExportConfig_exportConfig_S3DestinationIsNull     = false;
            }
            System.String requestExportConfig_exportConfig_S3Destination_s3Destination_Path = null;
            if (cmdletContext.S3Destination_Path != null)
            {
                requestExportConfig_exportConfig_S3Destination_s3Destination_Path = cmdletContext.S3Destination_Path;
            }
            if (requestExportConfig_exportConfig_S3Destination_s3Destination_Path != null)
            {
                requestExportConfig_exportConfig_S3Destination.Path  = requestExportConfig_exportConfig_S3Destination_s3Destination_Path;
                requestExportConfig_exportConfig_S3DestinationIsNull = false;
            }
            // determine if requestExportConfig_exportConfig_S3Destination should be set to null
            if (requestExportConfig_exportConfig_S3DestinationIsNull)
            {
                requestExportConfig_exportConfig_S3Destination = null;
            }
            if (requestExportConfig_exportConfig_S3Destination != null)
            {
                request.ExportConfig.S3Destination = requestExportConfig_exportConfig_S3Destination;
                requestExportConfigIsNull          = false;
            }
            // determine if request.ExportConfig should be set to null
            if (requestExportConfigIsNull)
            {
                request.ExportConfig = 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);
        }