private Amazon.WellArchitected.Model.UpdateWorkloadResponse CallAWSServiceOperation(IAmazonWellArchitected client, Amazon.WellArchitected.Model.UpdateWorkloadRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Well-Architected Tool", "UpdateWorkload");
     try
     {
         #if DESKTOP
         return(client.UpdateWorkload(request));
         #elif CORECLR
         return(client.UpdateWorkloadAsync(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.WellArchitected.Model.UpdateWorkloadRequest();

            if (cmdletContext.AccountId != null)
            {
                request.AccountIds = cmdletContext.AccountId;
            }
            if (cmdletContext.ArchitecturalDesign != null)
            {
                request.ArchitecturalDesign = cmdletContext.ArchitecturalDesign;
            }
            if (cmdletContext.AwsRegion != null)
            {
                request.AwsRegions = cmdletContext.AwsRegion;
            }
            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.Environment != null)
            {
                request.Environment = cmdletContext.Environment;
            }
            if (cmdletContext.ImprovementStatus != null)
            {
                request.ImprovementStatus = cmdletContext.ImprovementStatus;
            }
            if (cmdletContext.Industry != null)
            {
                request.Industry = cmdletContext.Industry;
            }
            if (cmdletContext.IndustryType != null)
            {
                request.IndustryType = cmdletContext.IndustryType;
            }
            if (cmdletContext.IsReviewOwnerUpdateAcknowledged != null)
            {
                request.IsReviewOwnerUpdateAcknowledged = cmdletContext.IsReviewOwnerUpdateAcknowledged.Value;
            }
            if (cmdletContext.NonAwsRegion != null)
            {
                request.NonAwsRegions = cmdletContext.NonAwsRegion;
            }
            if (cmdletContext.Note != null)
            {
                request.Notes = cmdletContext.Note;
            }
            if (cmdletContext.PillarPriority != null)
            {
                request.PillarPriorities = cmdletContext.PillarPriority;
            }
            if (cmdletContext.ReviewOwner != null)
            {
                request.ReviewOwner = cmdletContext.ReviewOwner;
            }
            if (cmdletContext.WorkloadId != null)
            {
                request.WorkloadId = cmdletContext.WorkloadId;
            }
            if (cmdletContext.WorkloadName != null)
            {
                request.WorkloadName = cmdletContext.WorkloadName;
            }

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