private UpdateSafetyRuleResponse updateSafetyRule()

in aws-route53recoverycontrol-safetyrule/src/main/java/software/amazon/route53recoverycontrol/safetyrule/UpdateHandler.java [62:86]


    private UpdateSafetyRuleResponse updateSafetyRule(
            UpdateSafetyRuleRequest request,
            ProxyClient<Route53RecoveryControlConfigClient> proxyClient
    ) {
        UpdateSafetyRuleResponse response;

        String safetyRuleArn = request.assertionRuleUpdate() != null ? request.assertionRuleUpdate().safetyRuleArn() :
                request.gatingRuleUpdate().safetyRuleArn();

        try {
            response = proxyClient.injectCredentialsAndInvokeV2(request, ClientBuilder.getClient()::updateSafetyRule);
        } catch (Route53RecoveryControlConfigException e) {
            if (e.statusCode() == 404) {
                throw new CfnNotFoundException(ResourceModel.TYPE_NAME,
                        safetyRuleArn, e);
            } else
                throw new CfnGeneralServiceException(ResourceModel.TYPE_NAME, e);
        } catch (AwsServiceException e) {
            throw new CfnGeneralServiceException(ResourceModel.TYPE_NAME, e);
        }

        logger.log(String.format("%s has successfully been updated.", ResourceModel.TYPE_NAME));

        return response;
    }