{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-clean-rooms/json-schema/amazon-clean-rooms-create-privacy-budget-template-input-schema.json",
  "title": "CreatePrivacyBudgetTemplateInput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-clean-rooms-privacybudgettemplates-api-openapi.yml#/components/schemas/CreatePrivacyBudgetTemplateInput",
  "type": "object",
  "properties": {
    "membershipIdentifier": {
      "type": "string",
      "description": "A unique identifier for one of your memberships for a collaboration. The privacy budget template is created in the collaboration that this membership belongs to. Accepts a membership ID."
    },
    "autoRefresh": {
      "type": "string",
      "enum": [
        "CALENDAR_MONTH",
        "NONE"
      ],
      "description": "How often the privacy budget refreshes. If you plan to regularly bring new data into the collaboration, you can use CALENDAR_MONTH to automatically get a new privacy budget for the collaboration every calendar month. Choosing this option allows arbitrary amounts of information to be revealed about rows of the data when repeatedly queries across refreshes. Avoid choosing this if the same rows will be repeatedly queried between privacy budget refreshes."
    },
    "privacyBudgetType": {
      "type": "string",
      "enum": [
        "DIFFERENTIAL_PRIVACY",
        "ACCESS_BUDGET"
      ],
      "description": "Specifies the type of the privacy budget template."
    },
    "parameters": {
      "$ref": "#/$defs/PrivacyBudgetTemplateParametersInput"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "An optional label that you can assign to a resource when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to this resource."
    }
  },
  "required": [
    "membershipIdentifier",
    "privacyBudgetType",
    "parameters"
  ],
  "$defs": {
    "AccessBudgetsPrivacyTemplateParametersInput": {
      "type": "object",
      "properties": {
        "budgetParameters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BudgetParameter"
          },
          "description": "An array of budget parameters that define the access budget configuration for the privacy template."
        },
        "resourceArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the resource associated with this privacy budget template."
        }
      },
      "required": [
        "budgetParameters",
        "resourceArn"
      ]
    },
    "BudgetParameter": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "CALENDAR_DAY",
            "CALENDAR_MONTH",
            "CALENDAR_WEEK",
            "LIFETIME"
          ],
          "description": "The type of budget parameter being configured."
        },
        "budget": {
          "type": "integer",
          "description": "The budget allocation amount for this specific parameter."
        },
        "autoRefresh": {
          "type": "string",
          "enum": [
            "ENABLED",
            "DISABLED"
          ],
          "description": "Whether this individual budget parameter automatically refreshes when the budget period resets."
        }
      },
      "required": [
        "type",
        "budget"
      ]
    },
    "DifferentialPrivacyTemplateParametersInput": {
      "type": "object",
      "properties": {
        "epsilon": {
          "type": "integer",
          "description": "The epsilon value that you want to use."
        },
        "usersNoisePerQuery": {
          "type": "integer",
          "description": "Noise added per query is measured in terms of the number of users whose contributions you want to obscure. This value governs the rate at which the privacy budget is depleted."
        }
      },
      "required": [
        "epsilon",
        "usersNoisePerQuery"
      ]
    },
    "PrivacyBudgetTemplateParametersInput": {
      "type": "object",
      "properties": {
        "differentialPrivacy": {
          "$ref": "#/$defs/DifferentialPrivacyTemplateParametersInput"
        },
        "accessBudget": {
          "$ref": "#/$defs/AccessBudgetsPrivacyTemplateParametersInput"
        }
      },
      "description": "Exactly one member is set."
    }
  }
}