{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/palo-alto-networks/main/json-schema/palo-alto-networks-services-schema.json",
  "title": "services",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/palo-alto-networks-services-api-openapi.yml#/components/schemas/services",
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "The UUID of the service",
      "readOnly": true
    },
    "name": {
      "type": "string",
      "pattern": "^[ a-zA-Z\\d.\\-_]+$",
      "description": "The name of the service",
      "maxLength": 63
    },
    "description": {
      "type": "string",
      "maxLength": 1023
    },
    "protocol": {
      "type": "object",
      "oneOf": [
        {
          "type": "object",
          "title": "tcp",
          "properties": {
            "tcp": {
              "type": "object",
              "properties": {
                "port": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1023
                },
                "source_port": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1023
                },
                "override": {
                  "type": "object",
                  "properties": {
                    "timeout": {
                      "type": "integer",
                      "description": "tcp session timeout value (in second)",
                      "minimum": 1,
                      "maximum": 604800,
                      "default": 3600
                    },
                    "halfclose_timeout": {
                      "type": "integer",
                      "description": "tcp session half-close timeout value (in second)",
                      "minimum": 1,
                      "maximum": 604800,
                      "default": 120
                    },
                    "timewait_timeout": {
                      "type": "integer",
                      "description": "tcp session time-wait timeout value (in second)",
                      "minimum": 1,
                      "maximum": 600,
                      "default": 15
                    }
                  }
                }
              },
              "required": [
                "port"
              ]
            }
          }
        },
        {
          "type": "object",
          "title": "udp",
          "properties": {
            "udp": {
              "type": "object",
              "properties": {
                "port": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1023
                },
                "source_port": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1023
                },
                "override": {
                  "type": "object",
                  "properties": {
                    "timeout": {
                      "type": "integer",
                      "description": "udp session timeout value (in second)",
                      "minimum": 1,
                      "maximum": 604800,
                      "default": 30
                    }
                  }
                }
              },
              "required": [
                "port"
              ]
            }
          }
        }
      ]
    },
    "tag": {
      "type": "array",
      "description": "Tags for service object",
      "maxItems": 64,
      "items": {
        "type": "string",
        "maxLength": 127
      }
    }
  },
  "oneOf": [
    {
      "type": "object",
      "title": "folder",
      "properties": {
        "folder": {
          "type": "string",
          "pattern": "^[a-zA-Z\\d\\-_\\. ]+$",
          "maxLength": 64,
          "description": "The folder in which the resource is defined"
        }
      },
      "required": [
        "folder"
      ]
    },
    {
      "type": "object",
      "title": "snippet",
      "properties": {
        "snippet": {
          "type": "string",
          "pattern": "^[a-zA-Z\\d\\-_\\. ]+$",
          "maxLength": 64,
          "description": "The snippet in which the resource is defined"
        }
      },
      "required": [
        "snippet"
      ]
    },
    {
      "type": "object",
      "title": "device",
      "properties": {
        "device": {
          "type": "string",
          "pattern": "^[a-zA-Z\\d\\-_\\. ]+$",
          "maxLength": 64,
          "description": "The device in which the resource is defined"
        }
      },
      "required": [
        "device"
      ]
    }
  ]
}