{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure/json-schema/microsoft-azure-account-with-status-response-schema.json",
  "title": "AccountWithStatusResponse",
  "description": "Details of the account and its DNS provisioning status as returned on a GET request.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-account-api-openapi.yml#/components/schemas/AccountWithStatusResponse",
  "additionalProperties": false,
  "properties": {
    "etag": {
      "type": "string",
      "description": "ETag for use with If-Match headers for optimistic concurrency."
    },
    "name": {
      "minLength": 1,
      "type": "string",
      "description": "Name of the account."
    },
    "details": {
      "$ref": "#/$defs/AccountDetails"
    },
    "directRoutingProvisioningState": {
      "$ref": "#/$defs/SubdomainProvisioningState"
    }
  },
  "required": [
    "name"
  ],
  "type": "object",
  "$defs": {
    "AccountDetails": {
      "additionalProperties": false,
      "properties": {
        "directRouting": {
          "$ref": "#/$defs/TeamsDrConfig"
        }
      },
      "type": "object",
      "description": "Details of the account."
    },
    "SubdomainProvisioningState": {
      "additionalProperties": false,
      "properties": {
        "subdomainTokens": {
          "$ref": "#/$defs/TeamsDrSubdomainTokens"
        },
        "subdomainStatus": {
          "$ref": "#/$defs/SubdomainProvisioningStatus"
        }
      },
      "required": [
        "subdomainStatus"
      ],
      "type": "object",
      "description": "Status of DNS configuration and the DNS TXT values for the DNS records"
    },
    "SubdomainProvisioningStatus": {
      "enum": [
        "Provisioned",
        "NotProvisioned",
        "Inconsistent"
      ],
      "type": "string",
      "description": "Status of DNS configuration. Azure Communications Gateway generates DNS records to Microsoft 365 to verify that the customer-specific domain name is associated with the correct customer tenant.",
      "x-ms-enum": {
        "name": "SubdomainProvisioningStatus",
        "modelAsString": true,
        "values": [
          {
            "value": "Provisioned",
            "description": "DNS state is provisioned.",
            "name": "Provisioned"
          },
          {
            "value": "NotProvisioned",
            "description": "DNS state has not been provisioned.",
            "name": "NotProvisioned"
          },
          {
            "value": "Inconsistent",
            "description": "The programmed DNS state doesn't match the requested programming.",
            "name": "Inconsistent"
          }
        ]
      }
    },
    "TeamsDrConfig": {
      "additionalProperties": false,
      "properties": {
        "callScreening": {
          "type": "boolean",
          "description": "Enables/disables caller ID screening for the account. Caller ID screening is enabled by default."
        },
        "subdomain": {
          "pattern": "^([A-Za-z0-9_-]+)$",
          "minLength": 1,
          "maxLength": 10,
          "type": "string",
          "description": "Customer-specific domain name label. Can only contain letters, numbers, underscores and dashes. Can be up to 10 characters in length."
        },
        "subdomainTokens": {
          "$ref": "#/$defs/TeamsDrSubdomainTokens"
        }
      },
      "required": [
        "callScreening",
        "subdomain",
        "subdomainTokens"
      ],
      "type": "object",
      "description": "Account configuration relating to Microsoft Teams Direct Routing."
    },
    "TeamsDrSubdomainTokens": {
      "additionalProperties": false,
      "properties": {
        "region1Token": {
          "pattern": "^([A-Za-z0-9=_-]+)$",
          "minLength": 1,
          "maxLength": 100,
          "type": "string",
          "description": "DNS TXT value for the first region, as provided by the customer from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length."
        },
        "region2Token": {
          "pattern": "^([A-Za-z0-9=_-]+)$",
          "minLength": 1,
          "maxLength": 100,
          "type": "string",
          "description": "DNS TXT value for the first region, as provided by the customer from their Microsoft 365 Admin Center. Can only contain letters, numbers, underscores and dashes. Can be up to 100 characters in length."
        }
      },
      "required": [
        "region1Token",
        "region2Token"
      ],
      "type": "object",
      "description": "DNS TXT values (tokens) for the account."
    }
  }
}