private Amazon.Route53RecoveryControlConfig.Model.UpdateSafetyRuleResponse CallAWSServiceOperation(IAmazonRoute53RecoveryControlConfig client, Amazon.Route53RecoveryControlConfig.Model.UpdateSafetyRuleRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Route53 Recovery Control Config", "UpdateSafetyRule");
     try
     {
         #if DESKTOP
         return(client.UpdateSafetyRule(request));
         #elif CORECLR
         return(client.UpdateSafetyRuleAsync(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.Route53RecoveryControlConfig.Model.UpdateSafetyRuleRequest();


            // populate AssertionRuleUpdate
            var requestAssertionRuleUpdateIsNull = true;

            request.AssertionRuleUpdate = new Amazon.Route53RecoveryControlConfig.Model.AssertionRuleUpdate();
            System.String requestAssertionRuleUpdate_assertionRuleUpdate_Name = null;
            if (cmdletContext.AssertionRuleUpdate_Name != null)
            {
                requestAssertionRuleUpdate_assertionRuleUpdate_Name = cmdletContext.AssertionRuleUpdate_Name;
            }
            if (requestAssertionRuleUpdate_assertionRuleUpdate_Name != null)
            {
                request.AssertionRuleUpdate.Name = requestAssertionRuleUpdate_assertionRuleUpdate_Name;
                requestAssertionRuleUpdateIsNull = false;
            }
            System.String requestAssertionRuleUpdate_assertionRuleUpdate_SafetyRuleArn = null;
            if (cmdletContext.AssertionRuleUpdate_SafetyRuleArn != null)
            {
                requestAssertionRuleUpdate_assertionRuleUpdate_SafetyRuleArn = cmdletContext.AssertionRuleUpdate_SafetyRuleArn;
            }
            if (requestAssertionRuleUpdate_assertionRuleUpdate_SafetyRuleArn != null)
            {
                request.AssertionRuleUpdate.SafetyRuleArn = requestAssertionRuleUpdate_assertionRuleUpdate_SafetyRuleArn;
                requestAssertionRuleUpdateIsNull          = false;
            }
            System.Int32?requestAssertionRuleUpdate_assertionRuleUpdate_WaitPeriodMs = null;
            if (cmdletContext.AssertionRuleUpdate_WaitPeriodMs != null)
            {
                requestAssertionRuleUpdate_assertionRuleUpdate_WaitPeriodMs = cmdletContext.AssertionRuleUpdate_WaitPeriodMs.Value;
            }
            if (requestAssertionRuleUpdate_assertionRuleUpdate_WaitPeriodMs != null)
            {
                request.AssertionRuleUpdate.WaitPeriodMs = requestAssertionRuleUpdate_assertionRuleUpdate_WaitPeriodMs.Value;
                requestAssertionRuleUpdateIsNull         = false;
            }
            // determine if request.AssertionRuleUpdate should be set to null
            if (requestAssertionRuleUpdateIsNull)
            {
                request.AssertionRuleUpdate = null;
            }

            // populate GatingRuleUpdate
            var requestGatingRuleUpdateIsNull = true;

            request.GatingRuleUpdate = new Amazon.Route53RecoveryControlConfig.Model.GatingRuleUpdate();
            System.String requestGatingRuleUpdate_gatingRuleUpdate_Name = null;
            if (cmdletContext.GatingRuleUpdate_Name != null)
            {
                requestGatingRuleUpdate_gatingRuleUpdate_Name = cmdletContext.GatingRuleUpdate_Name;
            }
            if (requestGatingRuleUpdate_gatingRuleUpdate_Name != null)
            {
                request.GatingRuleUpdate.Name = requestGatingRuleUpdate_gatingRuleUpdate_Name;
                requestGatingRuleUpdateIsNull = false;
            }
            System.String requestGatingRuleUpdate_gatingRuleUpdate_SafetyRuleArn = null;
            if (cmdletContext.GatingRuleUpdate_SafetyRuleArn != null)
            {
                requestGatingRuleUpdate_gatingRuleUpdate_SafetyRuleArn = cmdletContext.GatingRuleUpdate_SafetyRuleArn;
            }
            if (requestGatingRuleUpdate_gatingRuleUpdate_SafetyRuleArn != null)
            {
                request.GatingRuleUpdate.SafetyRuleArn = requestGatingRuleUpdate_gatingRuleUpdate_SafetyRuleArn;
                requestGatingRuleUpdateIsNull          = false;
            }
            System.Int32?requestGatingRuleUpdate_gatingRuleUpdate_WaitPeriodMs = null;
            if (cmdletContext.GatingRuleUpdate_WaitPeriodMs != null)
            {
                requestGatingRuleUpdate_gatingRuleUpdate_WaitPeriodMs = cmdletContext.GatingRuleUpdate_WaitPeriodMs.Value;
            }
            if (requestGatingRuleUpdate_gatingRuleUpdate_WaitPeriodMs != null)
            {
                request.GatingRuleUpdate.WaitPeriodMs = requestGatingRuleUpdate_gatingRuleUpdate_WaitPeriodMs.Value;
                requestGatingRuleUpdateIsNull         = false;
            }
            // determine if request.GatingRuleUpdate should be set to null
            if (requestGatingRuleUpdateIsNull)
            {
                request.GatingRuleUpdate = 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);
        }