{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "allOf": [
        {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "description": "Describes the foundations of all NMOS resources",
            "properties": {
                "description": {
                    "description": "Detailed description of the resource",
                    "type": "string"
                },
                "id": {
                    "description": "Globally unique identifier for the resource",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                    "type": "string"
                },
                "label": {
                    "description": "Freeform string label for the resource",
                    "type": "string"
                },
                "tags": {
                    "description": "Key value set of freeform string tags to aid in filtering resources. Values should be represented as an array of strings. Can be empty.",
                    "patternProperties": {
                        "": {
                            "items": {
                                "type": "string"
                            },
                            "type": "array"
                        }
                    },
                    "type": "object"
                },
                "version": {
                    "description": "String formatted TAI timestamp (<seconds>:<nanoseconds>) indicating precisely when an attribute of the resource last changed",
                    "pattern": "^[0-9]+:[0-9]+$",
                    "type": "string"
                }
            },
            "required": [
                "id",
                "version",
                "label",
                "description",
                "tags"
            ],
            "title": "Base resource",
            "type": "object"
        },
        {
            "properties": {
                "caps": {
                    "description": "Capabilities of this sender",
                    "properties": {},
                    "type": "object"
                },
                "device_id": {
                    "description": "Device ID which this Sender forms part of. This attribute is used to ensure referential integrity by registry implementations.",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                    "type": "string"
                },
                "flow_id": {
                    "default": null,
                    "description": "ID of the Flow currently passing via this Sender. Set to null when a Flow is not currently internally routed to the Sender.",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "interface_bindings": {
                    "description": "Binding of Sender egress ports to interfaces on the parent Node.",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "manifest_href": {
                    "description": "HTTP(S) accessible URL to a file describing how to connect to the Sender. Set to null when the transport type used by the Sender does not require a transport file.",
                    "format": "uri",
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "subscription": {
                    "description": "Object indicating how this Sender is currently configured to send data.",
                    "properties": {
                        "active": {
                            "default": false,
                            "description": "Sender is enabled and configured to send data",
                            "type": "boolean"
                        },
                        "receiver_id": {
                            "default": null,
                            "description": "UUID of the Receiver to which this Sender is currently configured to send data. Only set if it is active, uses a unicast push-based transport and is sending to an NMOS Receiver; otherwise null.",
                            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    },
                    "required": [
                        "receiver_id",
                        "active"
                    ],
                    "type": "object"
                },
                "transport": {
                    "description": "Transport type used by the Sender in URN format",
                    "format": "uri",
                    "oneOf": [
                        {
                            "pattern": "^urn:x-nmos:transport:"
                        },
                        {
                            "not": {
                                "pattern": "^urn:x-nmos:"
                            }
                        }
                    ],
                    "type": "string"
                }
            },
            "required": [
                "flow_id",
                "transport",
                "device_id",
                "manifest_href",
                "interface_bindings",
                "subscription"
            ],
            "type": "object"
        }
    ],
    "description": "Describes a sender",
    "title": "Sender resource",
    "type": "object"
}
