private Amazon.AuditManager.Model.UpdateSettingsResponse CallAWSServiceOperation(IAmazonAuditManager client, Amazon.AuditManager.Model.UpdateSettingsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Audit Manager", "UpdateSettings");
     try
     {
         #if DESKTOP
         return(client.UpdateSettings(request));
         #elif CORECLR
         return(client.UpdateSettingsAsync(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.AuditManager.Model.UpdateSettingsRequest();


            // populate DefaultAssessmentReportsDestination
            var requestDefaultAssessmentReportsDestinationIsNull = true;

            request.DefaultAssessmentReportsDestination = new Amazon.AuditManager.Model.AssessmentReportsDestination();
            System.String requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_Destination = null;
            if (cmdletContext.DefaultAssessmentReportsDestination_Destination != null)
            {
                requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_Destination = cmdletContext.DefaultAssessmentReportsDestination_Destination;
            }
            if (requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_Destination != null)
            {
                request.DefaultAssessmentReportsDestination.Destination = requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_Destination;
                requestDefaultAssessmentReportsDestinationIsNull        = false;
            }
            Amazon.AuditManager.AssessmentReportDestinationType requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_DestinationType = null;
            if (cmdletContext.DefaultAssessmentReportsDestination_DestinationType != null)
            {
                requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_DestinationType = cmdletContext.DefaultAssessmentReportsDestination_DestinationType;
            }
            if (requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_DestinationType != null)
            {
                request.DefaultAssessmentReportsDestination.DestinationType = requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_DestinationType;
                requestDefaultAssessmentReportsDestinationIsNull            = false;
            }
            // determine if request.DefaultAssessmentReportsDestination should be set to null
            if (requestDefaultAssessmentReportsDestinationIsNull)
            {
                request.DefaultAssessmentReportsDestination = null;
            }
            if (cmdletContext.DefaultProcessOwner != null)
            {
                request.DefaultProcessOwners = cmdletContext.DefaultProcessOwner;
            }
            if (cmdletContext.KmsKey != null)
            {
                request.KmsKey = cmdletContext.KmsKey;
            }
            if (cmdletContext.SnsTopic != null)
            {
                request.SnsTopic = cmdletContext.SnsTopic;
            }

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