private Amazon.CloudWatchEvidently.Model.CreateProjectResponse CallAWSServiceOperation(IAmazonCloudWatchEvidently client, Amazon.CloudWatchEvidently.Model.CreateProjectRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudWatch Evidently", "CreateProject");
     try
     {
         #if DESKTOP
         return(client.CreateProject(request));
         #elif CORECLR
         return(client.CreateProjectAsync(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.CloudWatchEvidently.Model.CreateProjectRequest();


            // populate DataDelivery
            var requestDataDeliveryIsNull = true;

            request.DataDelivery = new Amazon.CloudWatchEvidently.Model.ProjectDataDeliveryConfig();
            Amazon.CloudWatchEvidently.Model.CloudWatchLogsDestinationConfig requestDataDelivery_dataDelivery_CloudWatchLogs = null;

            // populate CloudWatchLogs
            var requestDataDelivery_dataDelivery_CloudWatchLogsIsNull = true;

            requestDataDelivery_dataDelivery_CloudWatchLogs = new Amazon.CloudWatchEvidently.Model.CloudWatchLogsDestinationConfig();
            System.String requestDataDelivery_dataDelivery_CloudWatchLogs_cloudWatchLogs_LogGroup = null;
            if (cmdletContext.CloudWatchLogs_LogGroup != null)
            {
                requestDataDelivery_dataDelivery_CloudWatchLogs_cloudWatchLogs_LogGroup = cmdletContext.CloudWatchLogs_LogGroup;
            }
            if (requestDataDelivery_dataDelivery_CloudWatchLogs_cloudWatchLogs_LogGroup != null)
            {
                requestDataDelivery_dataDelivery_CloudWatchLogs.LogGroup = requestDataDelivery_dataDelivery_CloudWatchLogs_cloudWatchLogs_LogGroup;
                requestDataDelivery_dataDelivery_CloudWatchLogsIsNull    = false;
            }
            // determine if requestDataDelivery_dataDelivery_CloudWatchLogs should be set to null
            if (requestDataDelivery_dataDelivery_CloudWatchLogsIsNull)
            {
                requestDataDelivery_dataDelivery_CloudWatchLogs = null;
            }
            if (requestDataDelivery_dataDelivery_CloudWatchLogs != null)
            {
                request.DataDelivery.CloudWatchLogs = requestDataDelivery_dataDelivery_CloudWatchLogs;
                requestDataDeliveryIsNull           = false;
            }
            Amazon.CloudWatchEvidently.Model.S3DestinationConfig requestDataDelivery_dataDelivery_S3Destination = null;

            // populate S3Destination
            var requestDataDelivery_dataDelivery_S3DestinationIsNull = true;

            requestDataDelivery_dataDelivery_S3Destination = new Amazon.CloudWatchEvidently.Model.S3DestinationConfig();
            System.String requestDataDelivery_dataDelivery_S3Destination_s3Destination_Bucket = null;
            if (cmdletContext.S3Destination_Bucket != null)
            {
                requestDataDelivery_dataDelivery_S3Destination_s3Destination_Bucket = cmdletContext.S3Destination_Bucket;
            }
            if (requestDataDelivery_dataDelivery_S3Destination_s3Destination_Bucket != null)
            {
                requestDataDelivery_dataDelivery_S3Destination.Bucket = requestDataDelivery_dataDelivery_S3Destination_s3Destination_Bucket;
                requestDataDelivery_dataDelivery_S3DestinationIsNull  = false;
            }
            System.String requestDataDelivery_dataDelivery_S3Destination_s3Destination_Prefix = null;
            if (cmdletContext.S3Destination_Prefix != null)
            {
                requestDataDelivery_dataDelivery_S3Destination_s3Destination_Prefix = cmdletContext.S3Destination_Prefix;
            }
            if (requestDataDelivery_dataDelivery_S3Destination_s3Destination_Prefix != null)
            {
                requestDataDelivery_dataDelivery_S3Destination.Prefix = requestDataDelivery_dataDelivery_S3Destination_s3Destination_Prefix;
                requestDataDelivery_dataDelivery_S3DestinationIsNull  = false;
            }
            // determine if requestDataDelivery_dataDelivery_S3Destination should be set to null
            if (requestDataDelivery_dataDelivery_S3DestinationIsNull)
            {
                requestDataDelivery_dataDelivery_S3Destination = null;
            }
            if (requestDataDelivery_dataDelivery_S3Destination != null)
            {
                request.DataDelivery.S3Destination = requestDataDelivery_dataDelivery_S3Destination;
                requestDataDeliveryIsNull          = false;
            }
            // determine if request.DataDelivery should be set to null
            if (requestDataDeliveryIsNull)
            {
                request.DataDelivery = null;
            }
            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

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