{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oracle/json-schema/oracle-create-budget-details-schema.json",
  "title": "CreateBudgetDetails",
  "description": "The create budget details.\n\nClients should use 'targetType' and 'targets' to specify the target type and list of targets on which the budget is applied.\n\nFor backwards compatibility, 'targetCompartmentId' is still supported for all existing clients.\nThis is considered deprecated, however, and all clients are upgraded to use 'targetType' and 'targets'.\n\nSpecifying both 'targetCompartmentId' and 'targets' causes a Bad Request.\n",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oracle-budget-api-openapi.yml#/components/schemas/CreateBudgetDetails",
  "properties": {
    "amount": {
      "description": "The amount of the budget expressed as a whole number in the currency of the customer's rate card.\n",
      "maximum": "1.0E12",
      "type": "number",
      "exclusiveMinimum": 0.0
    },
    "budgetProcessingPeriodStartOffset": {
      "default": 1,
      "description": "The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight.",
      "maximum": 31,
      "minimum": 1,
      "type": "integer"
    },
    "compartmentId": {
      "description": "The OCID of the compartment.",
      "type": "string"
    },
    "definedTags": {
      "additionalProperties": {
        "additionalProperties": {
          "description": "The value of the tag. Only the String type is supported.\n",
          "type": "object"
        },
        "description": "Key-value pair representing a defined tag key and value, scoped to a namespace.\nExample: `{\"CostCenter\": \"42\"}`\n",
        "type": "object"
      },
      "description": "Defined tags for this resource. Each key is predefined and scoped to a namespace.\nFor more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).\n\nExample: `{\"Operations\": {\"CostCenter\": \"42\"}}`\n",
      "type": "object"
    },
    "description": {
      "description": "The description of the budget.",
      "maxLength": 200,
      "type": "string"
    },
    "displayName": {
      "description": "The displayName of the budget. Avoid entering confidential information.",
      "maxLength": 200,
      "type": "string"
    },
    "endDate": {
      "description": "The date when the one-time budget concludes. For example, `2023-08-12T16:01:19.847222+05:30`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time.",
      "format": "date-time",
      "type": "string"
    },
    "freeformTags": {
      "additionalProperties": {
        "type": "string"
      },
      "description": "Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.\nFor more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).\n\nExample: `{\"Department\": \"Finance\"}`\n",
      "type": "object"
    },
    "processingPeriodType": {
      "description": "The type of the budget processing period. Valid values are INVOICE, MONTH, and SINGLE_USE.\n",
      "enum": [
        "INVOICE",
        "MONTH",
        "SINGLE_USE"
      ],
      "type": "string",
      "x-obmcs-top-level-enum": "#/definitions/ProcessingPeriodType"
    },
    "resetPeriod": {
      "description": "The reset period for the budget.\n",
      "enum": [
        "MONTHLY"
      ],
      "type": "string",
      "x-obmcs-top-level-enum": "#/definitions/ResetPeriod"
    },
    "startDate": {
      "description": "The date when the one-time budget begins. For example, `2023-07-12T16:01:19.847222+05:30`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time.",
      "format": "date-time",
      "type": "string"
    },
    "systemTags": {
      "additionalProperties": {
        "additionalProperties": {
          "description": "The value of the tag. Only string, integer and boolean types are supported.\n",
          "type": "object"
        },
        "description": "Key-value pair representing system tags' keys and values scoped to a namespace.\nExample: `{\"bar-key\": \"value\"}`\n",
        "type": "object"
      },
      "description": "Usage of system tag keys. These predefined keys are scoped to namespaces.\nExample: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}`\n",
      "type": "object"
    },
    "targetCompartmentId": {
      "description": "This is DEPRECATED. Set the target compartment ID in targets instead.\n",
      "type": "string"
    },
    "targetType": {
      "default": "COMPARTMENT",
      "description": "The type of target on which the budget is applied.\n",
      "enum": [
        "COMPARTMENT",
        "TAG"
      ],
      "type": "string",
      "x-obmcs-top-level-enum": "#/definitions/TargetType"
    },
    "targets": {
      "description": "The list of targets on which the budget is applied.\n  If targetType is \"COMPARTMENT\", the targets contain the list of compartment OCIDs.\n  If targetType is \"TAG\", the targets contain the list of cost tracking tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\".\nCurerntly, the array should contain exactly one item.\n",
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "compartmentId",
    "amount",
    "resetPeriod"
  ]
}