{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ivans/json-schema/ivans-patched-market-contract-code-create-request-schema.json",
  "title": "PatchedMarketContractCodeCreateRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ivans-market-contract-codes-api-openapi.yml#/components/schemas/PatchedMarketContractCodeCreateRequest",
  "type": "object",
  "properties": {
    "marketConfiguration": {
      "type": "string",
      "format": "uuid"
    },
    "parent": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "nickname": {
      "type": "string",
      "minLength": 1
    },
    "codeType": {
      "allOf": [
        {
          "$ref": "#/$defs/CodeTypeEnum"
        }
      ],
      "description": "[(1, 'Agency Id'), (2, 'Producer Id'), (3, 'Network Code')]",
      "minimum": -2147483648,
      "maximum": 2147483647
    },
    "code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "user": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "users": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "accessStructures": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MarketStructureRequest"
      }
    }
  },
  "$defs": {
    "CodeTypeEnum": {
      "enum": [
        1,
        2,
        3
      ],
      "type": "integer"
    },
    "MarketStructureRequest": {
      "type": "object",
      "properties": {
        "agency": {
          "type": "string",
          "format": "uuid"
        },
        "branch": {
          "type": "string",
          "format": "uuid"
        },
        "department": {
          "type": "string",
          "format": "uuid"
        },
        "businessUnit": {
          "type": "string",
          "format": "uuid"
        }
      },
      "required": [
        "agency"
      ]
    }
  }
}