{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aws-glue/json-schema/aws-glue-create-user-defined-function-request-schema.json",
  "title": "CreateUserDefinedFunctionRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aws-glue-aws-glue-x-amz-target-awsglue-createuserdefinedfunction-api-api-openapi.yml#/components/schemas/CreateUserDefinedFunctionRequest",
  "type": "object",
  "properties": {
    "CatalogId": {
      "type": "string",
      "description": "The ID of the Data Catalog in which to create the function. If none is provided, the Amazon Web Services account ID is used by default."
    },
    "DatabaseName": {
      "type": "string",
      "description": "The name of the catalog database in which to create the function."
    },
    "FunctionInput": {
      "$ref": "#/$defs/UserDefinedFunctionInput"
    }
  },
  "required": [
    "DatabaseName",
    "FunctionInput"
  ],
  "$defs": {
    "ResourceUri": {
      "type": "object",
      "properties": {
        "ResourceType": {
          "type": "string",
          "enum": [
            "JAR",
            "FILE",
            "ARCHIVE"
          ],
          "description": "The type of the resource."
        },
        "Uri": {
          "type": "string",
          "description": "The URI for accessing the resource."
        },
        "LastModified": {
          "type": "string",
          "format": "date-time",
          "description": "The time at which the resource was last modified in Amazon S3. Glue records this value when you create or update a function whose GovernanceMode is LAKE_FORMATION. Analytics engines use it to verify that the resource hasn't changed. This is an output-only field."
        }
      }
    },
    "UserDefinedFunctionInput": {
      "type": "object",
      "properties": {
        "FunctionName": {
          "type": "string",
          "description": "The name of the function."
        },
        "ClassName": {
          "type": "string",
          "description": "The Java class that contains the function code."
        },
        "OwnerName": {
          "type": "string",
          "description": "The owner of the function."
        },
        "FunctionType": {
          "type": "string",
          "enum": [
            "REGULAR_FUNCTION",
            "AGGREGATE_FUNCTION",
            "STORED_PROCEDURE"
          ],
          "description": "The type of the function."
        },
        "OwnerType": {
          "type": "string",
          "enum": [
            "USER",
            "ROLE",
            "GROUP"
          ],
          "description": "The owner type."
        },
        "ResourceUris": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ResourceUri"
          },
          "description": "The resource URIs for the function."
        },
        "ArtifactLocation": {
          "type": "string",
          "description": "The Amazon S3 location that contains the function's artifacts. Required when GovernanceMode is LAKE_FORMATION. You must register the location with Lake Formation, and every resource URI must be under this location."
        },
        "GovernanceMode": {
          "type": "string",
          "enum": [
            "IAM_ONLY",
            "LAKE_FORMATION"
          ],
          "description": "How access to the function is governed. Specify LAKE_FORMATION to manage access to the function with Lake Formation permissions. If you don't specify a value, the default is IAM_ONLY. You can't change the governance mode after the function is created. When GovernanceMode is LAKE_FORMATION: You must be a data lake administrator or have all permissions on the Data Catalog with the grant option. You must have the DATA_LOCATION_ACCESS permission on the ArtifactLocation, unless you're a data lake administrator. You must specify from 1 to 10 resource URIs, each under the ArtifactLocation. You can't "
        }
      }
    }
  }
}