{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dpf-it-com/json-schema/dpf-it-com-create-connection-response-schema.json",
  "title": "CreateConnectionResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dpf-it-com-connections-api-openapi.yml#/components/schemas/CreateConnectionResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "data": {
      "allOf": [
        {
          "$ref": "#/$defs/Connection"
        },
        {
          "type": "object",
          "properties": {
            "message": {
              "type": "string"
            },
            "trustPolicy": {
              "type": "object",
              "description": "aws_s3 only. Ready-to-paste IAM trust policy naming dpfPrincipalArn as principal, gated by externalId."
            }
          }
        }
      ]
    }
  },
  "$defs": {
    "Connection": {
      "type": "object",
      "description": "A workspace connection. The private key is never included.",
      "properties": {
        "connectionId": {
          "type": "string",
          "format": "uuid"
        },
        "workspaceId": {
          "type": "string",
          "format": "uuid"
        },
        "type": {
          "type": "string",
          "enum": [
            "sftp",
            "aws_s3"
          ]
        },
        "hostname": {
          "type": "string",
          "description": "sftp only."
        },
        "username": {
          "type": "string",
          "description": "sftp only."
        },
        "publicKey": {
          "type": "string",
          "description": "sftp only. OpenSSH public key to install in the remote server's authorized_keys."
        },
        "roleArn": {
          "type": "string",
          "description": "aws_s3 only. The customer's IAM role ARN."
        },
        "externalId": {
          "type": "string",
          "description": "aws_s3 only. DPF-generated; required in the customer's trust policy."
        },
        "dpfPrincipalArn": {
          "type": "string",
          "description": "aws_s3 only. The DPF connector role ARN the customer's trust policy must name as principal."
        },
        "createdBy": {
          "type": "string",
          "format": "uuid"
        },
        "createdAt": {
          "type": "integer",
          "format": "int64",
          "description": "Unix timestamp in milliseconds"
        },
        "updatedAt": {
          "type": "integer",
          "format": "int64",
          "description": "Unix timestamp in milliseconds"
        },
        "lastTestStatus": {
          "type": "string",
          "enum": [
            "passed",
            "failed"
          ],
          "description": "Outcome of the most recent test-connection call, if any test has been run."
        },
        "lastTestedAt": {
          "type": "integer",
          "format": "int64",
          "description": "Unix timestamp in milliseconds of the most recent test-connection call, if any."
        }
      }
    }
  }
}