static Map translateChecksFromCfnToIot()

in aws-iot-accountauditconfiguration/src/main/java/com/amazonaws/iot/accountauditconfiguration/Translator.java [65:133]


    static Map<String, software.amazon.awssdk.services.iot.model.AuditCheckConfiguration> translateChecksFromCfnToIot(ResourceModel model) {


        Map<String, software.amazon.awssdk.services.iot.model.AuditCheckConfiguration> iotMap = new HashMap<>();

        AuditCheckConfigurations auditCheckConfigurations = model.getAuditCheckConfigurations();
        if (auditCheckConfigurations == null) {
            return Collections.emptyMap();
        }

        if (auditCheckConfigurations.getAuthenticatedCognitoRoleOverlyPermissiveCheck() != null) {
            iotMap.put("AUTHENTICATED_COGNITO_ROLE_OVERLY_PERMISSIVE_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getAuthenticatedCognitoRoleOverlyPermissiveCheck()));
        }
        if (auditCheckConfigurations.getCaCertificateExpiringCheck() != null) {
            iotMap.put("CA_CERTIFICATE_EXPIRING_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getCaCertificateExpiringCheck()));
        }
        if (auditCheckConfigurations.getCaCertificateKeyQualityCheck() != null) {
            iotMap.put("CA_CERTIFICATE_KEY_QUALITY_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getCaCertificateKeyQualityCheck()));
        }
        if (auditCheckConfigurations.getConflictingClientIdsCheck() != null) {
            iotMap.put("CONFLICTING_CLIENT_IDS_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getConflictingClientIdsCheck()));
        }
        if (auditCheckConfigurations.getDeviceCertificateExpiringCheck() != null) {
            iotMap.put("DEVICE_CERTIFICATE_EXPIRING_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getDeviceCertificateExpiringCheck()));
        }
        if (auditCheckConfigurations.getDeviceCertificateKeyQualityCheck() != null) {
            iotMap.put("DEVICE_CERTIFICATE_KEY_QUALITY_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getDeviceCertificateKeyQualityCheck()));
        }
        if (auditCheckConfigurations.getDeviceCertificateSharedCheck() != null) {
            iotMap.put("DEVICE_CERTIFICATE_SHARED_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getDeviceCertificateSharedCheck()));
        }
        if (auditCheckConfigurations.getIotPolicyOverlyPermissiveCheck() != null) {
            iotMap.put("IOT_POLICY_OVERLY_PERMISSIVE_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getIotPolicyOverlyPermissiveCheck()));
        }
        if (auditCheckConfigurations.getIotRoleAliasAllowsAccessToUnusedServicesCheck() != null) {
            iotMap.put("IOT_ROLE_ALIAS_ALLOWS_ACCESS_TO_UNUSED_SERVICES_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getIotRoleAliasAllowsAccessToUnusedServicesCheck()));
        }
        if (auditCheckConfigurations.getIotRoleAliasOverlyPermissiveCheck() != null) {
            iotMap.put("IOT_ROLE_ALIAS_OVERLY_PERMISSIVE_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getIotRoleAliasOverlyPermissiveCheck()));
        }
        if (auditCheckConfigurations.getLoggingDisabledCheck() != null) {
            iotMap.put("LOGGING_DISABLED_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getLoggingDisabledCheck()));
        }
        if (auditCheckConfigurations.getRevokedCaCertificateStillActiveCheck() != null) {
            iotMap.put("REVOKED_CA_CERTIFICATE_STILL_ACTIVE_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getRevokedCaCertificateStillActiveCheck()));
        }
        if (auditCheckConfigurations.getRevokedDeviceCertificateStillActiveCheck() != null) {
            iotMap.put("REVOKED_DEVICE_CERTIFICATE_STILL_ACTIVE_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getRevokedDeviceCertificateStillActiveCheck()));
        }
        if (auditCheckConfigurations.getUnauthenticatedCognitoRoleOverlyPermissiveCheck() != null) {
            iotMap.put("UNAUTHENTICATED_COGNITO_ROLE_OVERLY_PERMISSIVE_CHECK", translateCheckConfigurationFromCfnToIot(
                    auditCheckConfigurations.getUnauthenticatedCognitoRoleOverlyPermissiveCheck()));
        }

        return iotMap;
    }