aws-route53recoveryreadiness-resourceset/src/main/java/software/amazon/route53recoveryreadiness/resourceset/CreateHandler.java [117:188]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private void validateScopes(
            List<String> readinessScopes,
            ProxyClient<Route53RecoveryReadinessClient> proxyClient
    ) {

        if (readinessScopes.size() != 0) {
            List<String> cellNames = new ArrayList<>();
            List<String> recoveryGroupNames = new ArrayList<>();

            for (String scope : readinessScopes) {
                if (scope.contains("cell")) {
                    String cellName = scope.split("/")[1];
                    cellNames.add(cellName);
                } else {
                    String recoveryGroupName = scope.split("/")[1];
                    recoveryGroupNames.add(recoveryGroupName);
                }
            }

            if (cellNames.size() != 0) {
                for (String cellName : cellNames) {
                    GetCellRequest cellRequest = GetCellRequest.builder().cellName(cellName).build();
                    getCell(cellRequest, proxyClient);
                }
            }

            if (recoveryGroupNames.size() != 0) {
                for (String rgName : recoveryGroupNames) {
                    GetRecoveryGroupRequest rgRequest = GetRecoveryGroupRequest.builder().recoveryGroupName(rgName).build();
                    getRecoveryGroup(rgRequest, proxyClient);
                }
            }
        }
    }

    private void getCell(
            GetCellRequest awsRequest,
            ProxyClient<Route53RecoveryReadinessClient> proxyClient
    ) {

        try {
            proxyClient.injectCredentialsAndInvokeV2(awsRequest, proxyClient.client()::getCell);
        } catch (final Route53RecoveryReadinessException e) {
            if (e.statusCode() == 404) {
                throw new CfnNotFoundException(ResourceModel.TYPE_NAME,
                        awsRequest.cellName(), e);
            } else
                throw new CfnGeneralServiceException(awsRequest.cellName(), e);
        } catch (final AwsServiceException e) {
            throw new CfnGeneralServiceException(awsRequest.cellName(), e);
        }

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

    private void getRecoveryGroup(
            final GetRecoveryGroupRequest request,
            final ProxyClient<Route53RecoveryReadinessClient> proxyClient
    ) {

        try {
            proxyClient.injectCredentialsAndInvokeV2(request, proxyClient.client()::getRecoveryGroup);
        } catch (final Route53RecoveryReadinessException e) {
            if (e.statusCode() == 404) {
                throw new CfnNotFoundException(ResourceModel.TYPE_NAME,
                        request.recoveryGroupName(), e);
            } else
                throw new CfnGeneralServiceException(request.recoveryGroupName(), e);
        } catch (final AwsServiceException e) {
            throw new CfnGeneralServiceException(ResourceModel.TYPE_NAME, e);
        }
        logger.log(String.format("%s has successfully been read.", ResourceModel.TYPE_NAME));
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-route53recoveryreadiness-resourceset/src/main/java/software/amazon/route53recoveryreadiness/resourceset/UpdateHandler.java [123:193]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private void validateScopes(
            List<String> readinessScopes,
            ProxyClient<Route53RecoveryReadinessClient> proxyClient
    ) {
        if (readinessScopes.size() != 0) {
            List<String> cellNames = new ArrayList<>();
            List<String> recoveryGroupNames = new ArrayList<>();

            for (String scope : readinessScopes) {
                if (scope.contains("cell")) {
                    String cellName = scope.split("/")[1];
                    cellNames.add(cellName);
                } else {
                    String recoveryGroupName = scope.split("/")[1];
                    recoveryGroupNames.add(recoveryGroupName);
                }
            }

            if (cellNames.size() != 0) {
                for (String cellName : cellNames) {
                    GetCellRequest cellRequest = GetCellRequest.builder().cellName(cellName).build();
                    getCell(cellRequest, proxyClient);
                }
            }

            if (recoveryGroupNames.size() != 0) {
                for (String rgName : recoveryGroupNames) {
                    GetRecoveryGroupRequest rgRequest = GetRecoveryGroupRequest.builder().recoveryGroupName(rgName).build();
                    getRecoveryGroup(rgRequest, proxyClient);
                }
            }
        }
    }

    private void getCell(
            GetCellRequest awsRequest,
            ProxyClient<Route53RecoveryReadinessClient> proxyClient
    ) {

        try {
            proxyClient.injectCredentialsAndInvokeV2(awsRequest, proxyClient.client()::getCell);
        } catch (final Route53RecoveryReadinessException e) {
            if (e.statusCode() == 404) {
                throw new CfnNotFoundException(ResourceModel.TYPE_NAME,
                        awsRequest.cellName(), e);
            } else
                throw new CfnGeneralServiceException(awsRequest.cellName(), e);
        } catch (final AwsServiceException e) {
            throw new CfnGeneralServiceException(awsRequest.cellName(), e);
        }

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

    private void getRecoveryGroup(
            final GetRecoveryGroupRequest request,
            final ProxyClient<Route53RecoveryReadinessClient> proxyClient
    ) {

        try {
            proxyClient.injectCredentialsAndInvokeV2(request, proxyClient.client()::getRecoveryGroup);
        } catch (final Route53RecoveryReadinessException e) {
            if (e.statusCode() == 404) {
                throw new CfnNotFoundException(ResourceModel.TYPE_NAME,
                        request.recoveryGroupName(), e);
            } else
                throw new CfnGeneralServiceException(request.recoveryGroupName(), e);
        } catch (final AwsServiceException e) {
            throw new CfnGeneralServiceException(ResourceModel.TYPE_NAME, e);
        }
        logger.log(String.format("%s has successfully been read.", ResourceModel.TYPE_NAME));
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



