{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-fraud-detector/json-schema/amazon-fraud-detector-put-external-model-request-schema.json",
  "title": "PutExternalModelRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-fraud-detector-external-model-api-openapi.yml#/components/schemas/PutExternalModelRequest",
  "type": "object",
  "properties": {
    "modelEndpoint": {
      "type": "string",
      "description": "The model endpoints name."
    },
    "modelSource": {
      "type": "string",
      "enum": [
        "SAGEMAKER"
      ],
      "description": "The source of the model."
    },
    "invokeModelEndpointRoleArn": {
      "type": "string",
      "description": "The IAM role used to invoke the model endpoint."
    },
    "inputConfiguration": {
      "$ref": "#/$defs/ModelInputConfiguration"
    },
    "outputConfiguration": {
      "$ref": "#/$defs/ModelOutputConfiguration"
    },
    "modelEndpointStatus": {
      "type": "string",
      "enum": [
        "ASSOCIATED",
        "DISSOCIATED"
      ],
      "description": "The model endpoint’s status in Amazon Fraud Detector."
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "A collection of key and value pairs."
    }
  },
  "required": [
    "modelEndpoint",
    "modelSource",
    "invokeModelEndpointRoleArn",
    "inputConfiguration",
    "outputConfiguration",
    "modelEndpointStatus"
  ],
  "$defs": {
    "ModelInputConfiguration": {
      "type": "object",
      "properties": {
        "eventTypeName": {
          "type": "string",
          "description": "The event type name."
        },
        "format": {
          "type": "string",
          "enum": [
            "TEXT_CSV",
            "APPLICATION_JSON"
          ],
          "description": "The format of the model input configuration. The format differs depending on if it is passed through to SageMaker or constructed by Amazon Fraud Detector."
        },
        "useEventVariables": {
          "type": "boolean",
          "description": "The event variables."
        },
        "jsonInputTemplate": {
          "type": "string",
          "description": "Template for constructing the JSON input-data sent to SageMaker. At event-evaluation, the placeholders for variable names in the template will be replaced with the variable values before being sent to SageMaker."
        },
        "csvInputTemplate": {
          "type": "string",
          "description": "Template for constructing the CSV input-data sent to SageMaker. At event-evaluation, the placeholders for variable-names in the template will be replaced with the variable values before being sent to SageMaker."
        }
      },
      "required": [
        "useEventVariables"
      ]
    },
    "ModelOutputConfiguration": {
      "type": "object",
      "properties": {
        "format": {
          "type": "string",
          "enum": [
            "TEXT_CSV",
            "APPLICATION_JSONLINES"
          ],
          "description": "The format of the model output configuration."
        },
        "jsonKeyToVariableMap": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "A map of JSON keys in response from SageMaker to the Amazon Fraud Detector variables."
        },
        "csvIndexToVariableMap": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "A map of CSV index values in the SageMaker response to the Amazon Fraud Detector variables."
        }
      },
      "required": [
        "format"
      ]
    },
    "Tag": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "A tag key."
        },
        "value": {
          "type": "string",
          "description": "A value assigned to a tag key."
        }
      },
      "required": [
        "key",
        "value"
      ]
    }
  }
}