{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mail.hsimc.tech/schemas/mail-address-registration-request.schema.json",
  "title": "HSIMC Mail Address Registration Request",
  "type": "object",
  "required": [
    "request_id",
    "address_class",
    "requested_local_part",
    "canonical_binding_ref",
    "requested_transport",
    "authority_ref",
    "state",
    "requested_at"
  ],
  "properties": {
    "request_id": {
      "type": "string"
    },
    "address_class": {
      "enum": [
        "EPERSON_ADDRESS",
        "CAPABILITY_ADDRESS"
      ]
    },
    "requested_local_part": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]{1,62}$"
    },
    "requested_email_address": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]{1,62}@hsimc\\.tech$"
    },
    "canonical_binding_ref": {
      "type": "string",
      "minLength": 1
    },
    "subject_refs": {
      "type": "array"
    },
    "work_refs": {
      "type": "array"
    },
    "requested_transport": {
      "enum": [
        "MICROSOFT_365_SHARED_MAILBOX",
        "MICROSOFT_365_ALIAS_OR_ROUTE",
        "OTHER_TRANSPORT_ADAPTER"
      ]
    },
    "requested_visibility": {
      "enum": [
        "PRIVATE_INFRASTRUCTURE",
        "BOUNDED_PARTICIPANTS",
        "PUBLIC_ADDRESS"
      ]
    },
    "authority_ref": {
      "type": "string",
      "minLength": 1
    },
    "privacy_profile": {
      "type": "string"
    },
    "state": {
      "const": "REQUESTED"
    },
    "requested_at": {
      "type": "string"
    }
  },
  "additionalProperties": false
}
