{"record":{"id":"e533082704178784","repo":"floci-io/floci","slug":"validationexception-e53308","errorCode":"ValidationException","errorMessage":"1 validation error detected: Value at 'Granularity' failed to satisfy constraint: Member must not be null.","messagePattern":"1 validation error detected: Value at 'Granularity' failed to satisfy constraint: Member must not be null\\.","errorType":"error_code","errorClass":"AwsException","httpStatus":400,"severity":"error","filePath":"src/main/java/io/github/hectorvent/floci/services/ce/TimeBucketing.java","lineNumber":28,"sourceCode":"import java.time.ZoneOffset;\nimport java.time.format.DateTimeParseException;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Splits a Cost Explorer {@code TimePeriod} into AWS-shaped granularity buckets.\n * <p>\n * AWS truncates {@code Start}/{@code End} to whole-day boundaries for DAILY\n * and HOURLY, and to the first day of the month for MONTHLY. The window is\n * half-open: {@code Start} inclusive, {@code End} exclusive.\n */\nfinal class TimeBucketing {\n\n    enum Granularity { HOURLY, DAILY, MONTHLY }\n\n    static Granularity parseGranularity(String value) {\n        if (value == null || value.isEmpty()) {\n            throw new AwsException(\"ValidationException\",\n                    \"1 validation error detected: Value at 'Granularity' failed to satisfy constraint: Member must not be null.\", 400);\n        }\n        return switch (value) {\n            case \"HOURLY\" -> Granularity.HOURLY;\n            case \"DAILY\" -> Granularity.DAILY;\n            case \"MONTHLY\" -> Granularity.MONTHLY;\n            default -> throw new AwsException(\"ValidationException\",\n                    \"1 validation error detected: Value '\" + value + \"' at 'Granularity' failed to satisfy constraint: Member must satisfy enum value set: [DAILY, MONTHLY, HOURLY]\", 400);\n        };\n    }\n\n    static Instant parseDate(String value, String field) {\n        if (value == null || value.isEmpty()) {\n            throw new AwsException(\"ValidationException\",\n                    \"1 validation error detected: Value at '\" + field + \"' failed to satisfy constraint: Member must not be null.\", 400);\n        }\n        // AWS accepts \"YYYY-MM-DD\" (most common) and ISO-8601 timestamps.\n        try {","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/services/ce/TimeBucketing.java#L10-L46","documentation":"Error \"1 validation error detected: Value at 'Granularity' failed to satisfy constraint: Member must not be null.\" thrown in floci-io/floci.","triggerScenarios":"Thrown at src/main/java/io/github/hectorvent/floci/services/ce/TimeBucketing.java:28 when the library encounters an invalid state.","commonSituations":"Occurs when a Cost Explorer request omits the Granularity field. Set Granularity to DAILY, MONTHLY, or HOURLY.","solutions":["Set Granularity to DAILY, MONTHLY, or HOURLY in the request."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}