{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-guardduty/json-schema/amazon-guardduty-get-usage-statistics-request-schema.json",
  "title": "GetUsageStatisticsRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-guardduty-operations-api-openapi.yml#/components/schemas/GetUsageStatisticsRequest",
  "type": "object",
  "properties": {
    "DetectorId": {
      "type": "string",
      "description": "The ID of the detector that specifies the GuardDuty service whose usage statistics you want to retrieve. To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API."
    },
    "UsageStatisticType": {
      "type": "string",
      "enum": [
        "SUM_BY_ACCOUNT",
        "SUM_BY_DATA_SOURCE",
        "SUM_BY_RESOURCE",
        "TOP_RESOURCES",
        "SUM_BY_FEATURES",
        "TOP_ACCOUNTS_BY_FEATURE"
      ],
      "description": "The type of usage statistics to retrieve."
    },
    "UsageCriteria": {
      "$ref": "#/$defs/UsageCriteria"
    },
    "Unit": {
      "type": "string",
      "description": "The currency unit you would like to view your usage statistics in. Current valid values are USD."
    },
    "MaxResults": {
      "type": "integer",
      "description": "The maximum number of results to return in the response."
    },
    "NextToken": {
      "type": "string",
      "description": "A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request to a list action. For subsequent calls, use the NextToken value returned from the previous request to continue listing results after the first page."
    }
  },
  "required": [
    "DetectorId",
    "UsageStatisticType",
    "UsageCriteria"
  ],
  "$defs": {
    "UsageCriteria": {
      "type": "object",
      "properties": {
        "AccountIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The account IDs to aggregate usage statistics from."
        },
        "DataSources": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "FLOW_LOGS",
              "CLOUD_TRAIL",
              "DNS_LOGS",
              "S3_LOGS",
              "KUBERNETES_AUDIT_LOGS",
              "EC2_MALWARE_SCAN"
            ]
          },
          "description": "The data sources to aggregate usage statistics from."
        },
        "Resources": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The resources to aggregate usage statistics from. Only accepts exact resource names."
        },
        "Features": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "FLOW_LOGS",
              "CLOUD_TRAIL",
              "DNS_LOGS",
              "S3_DATA_EVENTS",
              "EKS_AUDIT_LOGS",
              "EBS_MALWARE_PROTECTION",
              "RDS_LOGIN_EVENTS",
              "LAMBDA_NETWORK_LOGS",
              "EKS_RUNTIME_MONITORING",
              "EC2_RUNTIME_MONITORING",
              "FARGATE_RUNTIME_MONITORING",
              "RDS_DBI_PROTECTION_PROVISIONED",
              "RDS_DBI_PROTECTION_SERVERLESS",
              "RDS_DBI_PROTECTION_LIMITLESS",
              "RDS_DATA_ACTIVITY_DBI_PROTECTION_PROVISIONED",
              "RDS_DATA_ACTIVITY_DBI_PROTECTION_SERVERLESS",
              "RDS_DATA_ACTIVITY_DBI_PROTECTION_LIMITLESS",
              "AI_PROTECTION"
            ]
          },
          "description": "The features to aggregate usage statistics from."
        }
      }
    }
  }
}