{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/eagle-eye-networks/main/json-schema/eagle-eye-networks-api-layout-for-single-schema.json",
  "title": "ApiLayoutForSingle",
  "x-generated": "2026-10-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eagle-eye-networks-grouping-openapi.yml#/components/schemas/ApiLayoutForSingle",
  "allOf": [
    {
      "$ref": "#/$defs/ApiLayoutCreate"
    }
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique layout identifier"
    },
    "accountId": {
      "type": "string",
      "description": "Account ID specified in as an ESN Type.",
      "pattern": "^[a-fA-F0-9]{8}$"
    },
    "effectivePermissions": {
      "$ref": "#/$defs/EffectiveLayoutPermissions"
    },
    "resourceCounts": {
      "$ref": "#/$defs/ResourceCounts"
    },
    "resourceStatusCounts": {
      "$ref": "#/$defs/ResourceStatusCounts"
    },
    "resourceStatusV2Counts": {
      "$ref": "#/$defs/ResourceStatusV2Counts"
    },
    "panes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApiPaneGet"
      }
    }
  },
  "required": [
    "id",
    "panes",
    "accountId"
  ],
  "$defs": {
    "ApiLayoutCreate": {
      "allOf": [
        {
          "$ref": "#/$defs/ApiLayoutUpdate"
        },
        {
          "properties": {
            "settings": {
              "$ref": "#/$defs/ApiLayoutSettings"
            }
          }
        }
      ],
      "required": [
        "name",
        "settings"
      ]
    },
    "ApiLayoutSettings": {
      "allOf": [
        {
          "$ref": "#/$defs/ApiLayoutSettingsUpdate"
        },
        {
          "required": [
            "showCameraBorder",
            "showCameraName",
            "cameraAspectRatio",
            "paneColumns"
          ]
        }
      ]
    },
    "ApiLayoutSettingsUpdate": {
      "description": "Object identifying the layout settings",
      "properties": {
        "showCameraBorder": {
          "type": "boolean",
          "description": "This flag if enabled, shows pane borders."
        },
        "showCameraName": {
          "type": "boolean",
          "description": "This flag if enabled, shows camera name"
        },
        "cameraAspectRatio": {
          "type": "string",
          "description": "Aspect ratio of image",
          "enum": [
            "16x9",
            "4x3"
          ]
        },
        "paneColumns": {
          "type": "integer",
          "minimum": 1,
          "maximum": 6,
          "description": "Max number of cameras to show per row"
        }
      }
    },
    "ApiLayoutUpdate": {
      "properties": {
        "panes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ApiPane"
          }
        },
        "settings": {
          "$ref": "#/$defs/ApiLayoutSettingsUpdate"
        },
        "name": {
          "type": "string",
          "description": "Name of the layout.",
          "minLength": 1,
          "maxLength": 126
        }
      }
    },
    "ApiPane": {
      "properties": {
        "id": {
          "type": "integer",
          "description": "Unique identifier of pane in layout assigned to each pane. This determines the location indexing of panes in layout.",
          "minimum": 0
        },
        "name": {
          "type": "string",
          "description": "Name of the pane in layout",
          "maxLength": 126
        },
        "type": {
          "type": "string",
          "enum": [
            "preview",
            "compositePreview"
          ],
          "description": "Possible values:\n* `preview` - show the view for a single camera using \"preview\" images which are lower resolution and lower frequency than the real stream. * `compositePreview` - show the composite of a de-warped camera view.\n"
        },
        "size": {
          "type": "integer",
          "description": "Size of displayed image in pane. Size 1 shows the smallest size",
          "minimum": 1,
          "maximum": 3
        },
        "cameraId": {
          "type": "string",
          "description": "Unique identifier of the camera."
        },
        "compositeId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Unique identifier of the composite of a de-warped camera view."
        }
      },
      "required": [
        "id",
        "name",
        "type",
        "size",
        "cameraId"
      ]
    },
    "ApiPaneGet": {
      "allOf": [
        {
          "$ref": "#/$defs/ApiPane"
        }
      ],
      "required": [
        "id",
        "name",
        "type",
        "size",
        "cameraId",
        "compositeId"
      ]
    },
    "CameraStatusCounts": {
      "type": "object",
      "properties": {
        "online": {
          "type": "integer"
        },
        "deviceOffline": {
          "type": "integer"
        },
        "off": {
          "type": "integer"
        },
        "bridgeOffline": {
          "type": "integer"
        },
        "invalidCredentials": {
          "type": "integer"
        },
        "error": {
          "type": "integer"
        },
        "unknown": {
          "type": "integer"
        }
      }
    },
    "CameraStatusV2Counts": {
      "type": "object",
      "properties": {
        "cloudConnectionStatus": {
          "$ref": "#/$defs/CloudConnectionStatusCounts"
        },
        "edgeReportedDeviceStatus": {
          "$ref": "#/$defs/EdgeReportedDeviceStatusCounts"
        }
      }
    },
    "CloudConnectionStatusCounts": {
      "type": "object",
      "properties": {
        "connected": {
          "type": "integer"
        },
        "disconnected": {
          "type": "integer"
        }
      }
    },
    "EdgeReportedDeviceStatusCounts": {
      "type": "object",
      "properties": {
        "operational": {
          "type": "integer"
        },
        "disabled": {
          "type": "integer"
        },
        "unreachable": {
          "type": "integer"
        },
        "error": {
          "type": "integer"
        },
        "unknown": {
          "type": "integer"
        },
        "initializing": {
          "type": "integer"
        }
      }
    },
    "EffectiveLayoutPermissions": {
      "readOnly": true,
      "type": "object",
      "x-jsoninclude-nonnull-annotation": true,
      "properties": {
        "delete": {
          "type": "boolean"
        },
        "read": {
          "type": "boolean"
        },
        "edit": {
          "type": "boolean"
        }
      }
    },
    "ResourceCounts": {
      "description": "Count of resources.",
      "type": "object",
      "readOnly": true,
      "x-jsoninclude-nonnull-annotation": true,
      "properties": {
        "cameras": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "ResourceStatusCounts": {
      "description": "Count of resources by status.",
      "type": "object",
      "readOnly": true,
      "x-jsoninclude-nonnull-annotation": true,
      "properties": {
        "cameras": {
          "$ref": "#/$defs/CameraStatusCounts"
        }
      }
    },
    "ResourceStatusV2Counts": {
      "description": "Count of resources by cloud connection status and edge-reported device status.",
      "type": "object",
      "readOnly": true,
      "x-jsoninclude-nonnull-annotation": true,
      "properties": {
        "cameras": {
          "$ref": "#/$defs/CameraStatusV2Counts"
        }
      }
    }
  }
}