{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-communication-services/json-schema/microsoft-azure-communication-services-phone-number-search-request-schema.json",
  "title": "PhoneNumberSearchRequest",
  "description": "Represents a phone number search request to find phone numbers. Found phone numbers are temporarily held for a following purchase.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-communication-services-phonenumbers-api-openapi.yml#/components/schemas/PhoneNumberSearchRequest",
  "required": [
    "assignmentType",
    "capabilities",
    "phoneNumberType"
  ],
  "type": "object",
  "properties": {
    "phoneNumberType": {
      "description": "The type of phone numbers to search for, e.g. geographic, tollFree, mobile.",
      "enum": [
        "geographic",
        "tollFree",
        "mobile"
      ],
      "type": "string",
      "x-ms-enum": {
        "name": "PhoneNumberType",
        "modelAsString": true
      }
    },
    "assignmentType": {
      "description": "The assignment type of the phone numbers to search for. A phone number can be assigned to a person, or to an application.",
      "enum": [
        "person",
        "application"
      ],
      "type": "string",
      "x-ms-enum": {
        "name": "PhoneNumberAssignmentType",
        "modelAsString": true
      }
    },
    "capabilities": {
      "$ref": "#/$defs/PhoneNumberCapabilities"
    },
    "areaCode": {
      "description": "The area code of the desired phone number, e.g. 425.",
      "type": "string"
    },
    "quantity": {
      "format": "int32",
      "description": "The quantity of desired phone numbers. The default value is 1.",
      "default": 1,
      "maximum": 2147483647,
      "minimum": 1,
      "type": "integer"
    }
  },
  "$defs": {
    "PhoneNumberCapabilities": {
      "description": "Capabilities of a phone number.",
      "required": [
        "calling",
        "sms"
      ],
      "type": "object",
      "properties": {
        "calling": {
          "description": "Capability value for calling.",
          "enum": [
            "none",
            "inbound",
            "outbound",
            "inbound+outbound"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "PhoneNumberCapabilityType",
            "modelAsString": true
          }
        },
        "sms": {
          "description": "Capability value for SMS.",
          "enum": [
            "none",
            "inbound",
            "outbound",
            "inbound+outbound"
          ],
          "type": "string",
          "x-ms-enum": {
            "name": "PhoneNumberCapabilityType",
            "modelAsString": true
          }
        }
      }
    }
  }
}