{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-billing-and-cost-management/json-schema/amazon-billing-and-cost-management-get-cost-and-usage-with-resources-response-schema.json",
  "title": "GetCostAndUsageWithResourcesResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-billing-and-cost-management-cost-and-usage-api-openapi.yml#/components/schemas/GetCostAndUsageWithResourcesResponse",
  "type": "object",
  "properties": {
    "NextPageToken": {
      "type": "string",
      "description": "The token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size."
    },
    "GroupDefinitions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GroupDefinition"
      },
      "description": "The groups that are specified by the Filter or GroupBy parameters in the request."
    },
    "ResultsByTime": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ResultByTime"
      },
      "description": "The time period that's covered by the results in the response."
    },
    "DimensionValueAttributes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DimensionValuesWithAttributes"
      },
      "description": "The attributes that apply to a specific dimension value. For example, if the value is a linked account, the attribute is that account name."
    }
  },
  "$defs": {
    "DateInterval": {
      "type": "object",
      "properties": {
        "Start": {
          "type": "string",
          "description": "The beginning of the time period. The start date is inclusive. For example, if start is 2017-01-01, Amazon Web Services retrieves cost and usage data starting at 2017-01-01 up to the end date. The start date must be equal to or no later than the current date to avoid a validation error."
        },
        "End": {
          "type": "string",
          "description": "The end of the time period. The end date is exclusive. For example, if end is 2017-05-01, Amazon Web Services retrieves cost and usage data from the start date up to, but not including, 2017-05-01."
        }
      },
      "required": [
        "Start",
        "End"
      ]
    },
    "DimensionValuesWithAttributes": {
      "type": "object",
      "properties": {
        "Value": {
          "type": "string",
          "description": "The value of a dimension with a specific attribute."
        },
        "Attributes": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The attribute that applies to a specific Dimension."
        }
      }
    },
    "Group": {
      "type": "object",
      "properties": {
        "Keys": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The keys that are included in this group."
        },
        "Metrics": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/MetricValue"
          },
          "description": "The metrics that are included in this group."
        }
      }
    },
    "GroupDefinition": {
      "type": "object",
      "properties": {
        "Type": {
          "type": "string",
          "enum": [
            "DIMENSION",
            "TAG",
            "COST_CATEGORY",
            "PRODUCT_ATTRIBUTE"
          ],
          "description": "The string that represents the type of group."
        },
        "Key": {
          "type": "string",
          "description": "The string that represents a key for a specified group."
        }
      }
    },
    "MetricValue": {
      "type": "object",
      "properties": {
        "Amount": {
          "type": "string",
          "description": "The actual number that represents the metric."
        },
        "Unit": {
          "type": "string",
          "description": "The unit that the metric is given in."
        }
      }
    },
    "ResultByTime": {
      "type": "object",
      "properties": {
        "TimePeriod": {
          "$ref": "#/$defs/DateInterval"
        },
        "Total": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/MetricValue"
          },
          "description": "The total amount of cost or usage accrued during the time period."
        },
        "Groups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Group"
          },
          "description": "The groups that this time period includes."
        },
        "Estimated": {
          "type": "boolean",
          "description": "Determines whether the result is estimated."
        }
      }
    }
  }
}