private Amazon.Macie2.Model.PutFindingsPublicationConfigurationResponse CallAWSServiceOperation(IAmazonMacie2 client, Amazon.Macie2.Model.PutFindingsPublicationConfigurationRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Macie 2", "PutFindingsPublicationConfiguration");
     try
     {
         #if DESKTOP
         return(client.PutFindingsPublicationConfiguration(request));
         #elif CORECLR
         return(client.PutFindingsPublicationConfigurationAsync(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.Macie2.Model.PutFindingsPublicationConfigurationRequest();

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

            // populate SecurityHubConfiguration
            var requestSecurityHubConfigurationIsNull = true;

            request.SecurityHubConfiguration = new Amazon.Macie2.Model.SecurityHubConfiguration();
            System.Boolean?requestSecurityHubConfiguration_securityHubConfiguration_PublishClassificationFinding = null;
            if (cmdletContext.SecurityHubConfiguration_PublishClassificationFinding != null)
            {
                requestSecurityHubConfiguration_securityHubConfiguration_PublishClassificationFinding = cmdletContext.SecurityHubConfiguration_PublishClassificationFinding.Value;
            }
            if (requestSecurityHubConfiguration_securityHubConfiguration_PublishClassificationFinding != null)
            {
                request.SecurityHubConfiguration.PublishClassificationFindings = requestSecurityHubConfiguration_securityHubConfiguration_PublishClassificationFinding.Value;
                requestSecurityHubConfigurationIsNull = false;
            }
            System.Boolean?requestSecurityHubConfiguration_securityHubConfiguration_PublishPolicyFinding = null;
            if (cmdletContext.SecurityHubConfiguration_PublishPolicyFinding != null)
            {
                requestSecurityHubConfiguration_securityHubConfiguration_PublishPolicyFinding = cmdletContext.SecurityHubConfiguration_PublishPolicyFinding.Value;
            }
            if (requestSecurityHubConfiguration_securityHubConfiguration_PublishPolicyFinding != null)
            {
                request.SecurityHubConfiguration.PublishPolicyFindings = requestSecurityHubConfiguration_securityHubConfiguration_PublishPolicyFinding.Value;
                requestSecurityHubConfigurationIsNull = false;
            }
            // determine if request.SecurityHubConfiguration should be set to null
            if (requestSecurityHubConfigurationIsNull)
            {
                request.SecurityHubConfiguration = 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);
        }