{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/if/json-schema/if-client-update-request-schema.json",
  "title": "ClientUpdateRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/if-clients-api-openapi.yml#/components/schemas/ClientUpdateRequest",
  "required": [
    "connect",
    "data",
    "metadata",
    "workflow"
  ],
  "type": "object",
  "properties": {
    "workflow": {
      "$ref": "#/$defs/ClientUpdateWorkflowContainer"
    },
    "data": {
      "$ref": "#/$defs/ClientUpdateDataContainer"
    },
    "connect": {
      "$ref": "#/$defs/ClientUpdateConnectContainer"
    },
    "metadata": {
      "$ref": "#/$defs/ClientUpdateMetadataContainer"
    }
  },
  "$defs": {
    "ClientUpdateConnect": {
      "type": "string",
      "description": "connect type",
      "enum": [
        "explicit",
        "explicit"
      ]
    },
    "ClientUpdateConnectContainer": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/ClientUpdateConnect"
        },
        "serviceProvider": {
          "type": "string",
          "description": "service provider that will be used to source the client data"
        }
      }
    },
    "ClientUpdateDataContainer": {
      "type": "object",
      "properties": {
        "client": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "description": "custom map including fields to update, required if workflow is direct"
          },
          "description": "custom map including fields to update, required if workflow is direct"
        },
        "sourceId": {
          "type": "string",
          "description": "id of the client to be migrated, required if workflow is migration",
          "writeOnly": true
        }
      }
    },
    "ClientUpdateMetadataContainer": {
      "type": "object"
    },
    "ClientUpdateWorkflow": {
      "type": "string",
      "description": "unique workflow code",
      "enum": [
        "direct",
        "migration"
      ]
    },
    "ClientUpdateWorkflowContainer": {
      "required": [
        "code"
      ],
      "type": "object",
      "properties": {
        "code": {
          "$ref": "#/$defs/ClientUpdateWorkflow"
        }
      }
    }
  }
}