private Amazon.FraudDetector.Model.UpdateRuleVersionResponse CallAWSServiceOperation(IAmazonFraudDetector client, Amazon.FraudDetector.Model.UpdateRuleVersionRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Fraud Detector", "UpdateRuleVersion");
     try
     {
         #if DESKTOP
         return(client.UpdateRuleVersion(request));
         #elif CORECLR
         return(client.UpdateRuleVersionAsync(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.FraudDetector.Model.UpdateRuleVersionRequest();

            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.Expression != null)
            {
                request.Expression = cmdletContext.Expression;
            }
            if (cmdletContext.Language != null)
            {
                request.Language = cmdletContext.Language;
            }
            if (cmdletContext.Outcome != null)
            {
                request.Outcomes = cmdletContext.Outcome;
            }

            // populate Rule
            var requestRuleIsNull = true;

            request.Rule = new Amazon.FraudDetector.Model.Rule();
            System.String requestRule_rule_DetectorId = null;
            if (cmdletContext.Rule_DetectorId != null)
            {
                requestRule_rule_DetectorId = cmdletContext.Rule_DetectorId;
            }
            if (requestRule_rule_DetectorId != null)
            {
                request.Rule.DetectorId = requestRule_rule_DetectorId;
                requestRuleIsNull       = false;
            }
            System.String requestRule_rule_RuleId = null;
            if (cmdletContext.Rule_RuleId != null)
            {
                requestRule_rule_RuleId = cmdletContext.Rule_RuleId;
            }
            if (requestRule_rule_RuleId != null)
            {
                request.Rule.RuleId = requestRule_rule_RuleId;
                requestRuleIsNull   = false;
            }
            System.String requestRule_rule_RuleVersion = null;
            if (cmdletContext.Rule_RuleVersion != null)
            {
                requestRule_rule_RuleVersion = cmdletContext.Rule_RuleVersion;
            }
            if (requestRule_rule_RuleVersion != null)
            {
                request.Rule.RuleVersion = requestRule_rule_RuleVersion;
                requestRuleIsNull        = false;
            }
            // determine if request.Rule should be set to null
            if (requestRuleIsNull)
            {
                request.Rule = null;
            }
            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);
        }