コード例 #1
0
 private Amazon.CodeBuild.Model.CreateReportGroupResponse CallAWSServiceOperation(IAmazonCodeBuild client, Amazon.CodeBuild.Model.CreateReportGroupRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS CodeBuild", "CreateReportGroup");
     try
     {
         #if DESKTOP
         return(client.CreateReportGroup(request));
         #elif CORECLR
         return(client.CreateReportGroupAsync(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;
     }
 }
コード例 #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CodeBuild.Model.CreateReportGroupRequest();


            // 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;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }
            if (cmdletContext.Type != null)
            {
                request.Type = cmdletContext.Type;
            }

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