{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudfront/json-schema/cloudfront-update-function-request-schema.json",
  "title": "UpdateFunctionRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudfront-functions-api-openapi.yml#/components/schemas/UpdateFunctionRequest",
  "type": "object",
  "properties": {
    "Name": {
      "type": "string",
      "description": "The name of the function that you are updating."
    },
    "IfMatch": {
      "type": "string",
      "description": "The current version (ETag value) of the function that you are updating, which you can get using DescribeFunction."
    },
    "FunctionConfig": {
      "$ref": "#/$defs/FunctionConfig"
    },
    "FunctionCode": {
      "type": "string",
      "format": "byte",
      "description": "The function code. For more information about writing a CloudFront function, see Writing function code for CloudFront Functions in the Amazon CloudFront Developer Guide."
    }
  },
  "required": [
    "Name",
    "IfMatch",
    "FunctionConfig",
    "FunctionCode"
  ],
  "$defs": {
    "FunctionConfig": {
      "type": "object",
      "properties": {
        "Comment": {
          "type": "string",
          "description": "A comment to describe the function."
        },
        "Runtime": {
          "type": "string",
          "enum": [
            "cloudfront-js-1.0",
            "cloudfront-js-2.0"
          ],
          "description": "The function's runtime environment version."
        },
        "KeyValueStoreAssociations": {
          "$ref": "#/$defs/KeyValueStoreAssociations"
        }
      },
      "required": [
        "Comment",
        "Runtime"
      ]
    },
    "KeyValueStoreAssociation": {
      "type": "object",
      "properties": {
        "KeyValueStoreARN": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the key value store association."
        }
      },
      "required": [
        "KeyValueStoreARN"
      ]
    },
    "KeyValueStoreAssociations": {
      "type": "object",
      "properties": {
        "Quantity": {
          "type": "integer",
          "description": "The quantity of key value store associations."
        },
        "Items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/KeyValueStoreAssociation"
          },
          "description": "The items of the key value store association."
        }
      },
      "required": [
        "Quantity"
      ]
    }
  }
}