{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-deadline-cloud/json-schema/amazon-deadline-cloud-create-budget-request-schema.json",
  "title": "CreateBudgetRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-deadline-cloud-budgets-api-openapi.yml#/components/schemas/CreateBudgetRequest",
  "type": "object",
  "properties": {
    "farmId": {
      "type": "string",
      "description": "The farm ID to include in this budget."
    },
    "displayName": {
      "type": "string",
      "description": "The display name of the budget. This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field."
    },
    "description": {
      "type": "string",
      "description": "The description of the budget. This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field."
    },
    "clientToken": {
      "type": "string",
      "description": "The unique token which the server uses to recognize retries of the same request."
    },
    "usageTrackingResource": {
      "$ref": "#/$defs/UsageTrackingResource"
    },
    "approximateDollarLimit": {
      "type": "number",
      "description": "The dollar limit based on consumed usage."
    },
    "actions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BudgetActionToAdd"
      },
      "description": "The budget actions to specify what happens when the budget runs out."
    },
    "schedule": {
      "$ref": "#/$defs/BudgetSchedule"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings."
    }
  },
  "required": [
    "farmId",
    "displayName",
    "usageTrackingResource",
    "approximateDollarLimit",
    "actions",
    "schedule"
  ],
  "$defs": {
    "BudgetActionToAdd": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "STOP_SCHEDULING_AND_COMPLETE_TASKS",
            "STOP_SCHEDULING_AND_CANCEL_TASKS"
          ],
          "description": "The type of budget action to add."
        },
        "thresholdPercentage": {
          "type": "number",
          "description": "The percentage threshold for the budget action to add."
        },
        "description": {
          "type": "string",
          "description": "A description for the budget action to add. This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field."
        }
      },
      "required": [
        "type",
        "thresholdPercentage"
      ]
    },
    "BudgetSchedule": {
      "type": "object",
      "properties": {
        "fixed": {
          "$ref": "#/$defs/FixedBudgetSchedule"
        }
      },
      "description": "Exactly one member is set."
    },
    "FixedBudgetSchedule": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "string",
          "format": "date-time",
          "description": "When the budget starts."
        },
        "endTime": {
          "type": "string",
          "format": "date-time",
          "description": "When the budget ends."
        }
      },
      "required": [
        "startTime",
        "endTime"
      ]
    },
    "UsageTrackingResource": {
      "type": "object",
      "properties": {
        "queueId": {
          "type": "string",
          "description": "The queue ID."
        }
      },
      "description": "Exactly one member is set."
    }
  }
}