{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.0.1/brand/get-rights-response.json",
  "title": "Get Rights Response",
  "description": "Licensable rights matching the search criteria, with pricing options. Each result is a complete snapshot of current availability (stateless, DDEX PIE pattern). Excluded results explain why they were filtered out.",
  "x-status": "experimental",
  "type": "object",
  "oneOf": [
    {
      "title": "GetRightsSuccess",
      "properties": {
        "rights": {
          "type": "array",
          "description": "Matching rights with pricing options, ranked by relevance",
          "items": {
            "type": "object",
            "properties": {
              "rights_id": {
                "type": "string",
                "description": "Identifier for this rights offering. Referenced in acquire_rights.",
                "x-entity": "rights_grant"
              },
              "brand_id": {
                "type": "string",
                "description": "Brand identifier from the agent's roster",
                "x-entity": "rights_holder_brand"
              },
              "name": {
                "type": "string",
                "description": "Display name of the rights subject"
              },
              "description": {
                "type": "string",
                "description": "Description of the rights subject"
              },
              "right_type": {
                "$ref": "/schemas/3.0.1/enums/right-type.json"
              },
              "match_score": {
                "type": "number",
                "minimum": 0,
                "maximum": 1,
                "description": "Relevance score from 0 to 1"
              },
              "match_reasons": {
                "type": "array",
                "description": "Human-readable reasons for the match",
                "items": { "type": "string" }
              },
              "available_uses": {
                "type": "array",
                "description": "Rights uses available for licensing",
                "items": { "$ref": "/schemas/3.0.1/enums/right-use.json" }
              },
              "countries": {
                "type": "array",
                "description": "Countries where rights are available (ISO 3166-1 alpha-2). When both countries and excluded_countries are present, the effective set is countries minus excluded_countries. If neither is present, all countries are available.",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Z]{2}$"
                }
              },
              "excluded_countries": {
                "type": "array",
                "description": "Countries excluded from availability",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Z]{2}$"
                }
              },
              "exclusivity_status": {
                "type": "object",
                "description": "Current exclusivity availability",
                "properties": {
                  "available": {
                    "type": "boolean",
                    "description": "Whether exclusivity is available"
                  },
                  "existing_exclusives": {
                    "type": "array",
                    "description": "Active exclusivity commitments that may affect availability. Implementers should use vague descriptions ('exclusive commitment in this category') rather than specific deal terms to protect confidential business relationships.",
                    "items": { "type": "string" }
                  }
                },
                "additionalProperties": true
              },
              "pricing_options": {
                "type": "array",
                "description": "Available pricing options for these rights",
                "items": {
                  "$ref": "/schemas/3.0.1/brand/rights-pricing-option.json"
                },
                "minItems": 1
              },
              "content_restrictions": {
                "type": "array",
                "description": "Content restrictions or approval requirements",
                "items": { "type": "string" }
              },
              "preview_assets": {
                "type": "array",
                "description": "Preview-only assets for evaluation",
                "items": {
                  "type": "object",
                  "properties": {
                    "url": { "type": "string", "format": "uri" },
                    "usage": { "type": "string" }
                  },
                  "required": ["url"],
                  "additionalProperties": true
                }
              }
            },
            "required": ["rights_id", "brand_id", "name", "available_uses", "pricing_options"],
            "additionalProperties": true
          }
        },
        "excluded": {
          "type": "array",
          "description": "Results that matched but were filtered out, with reasons",
          "items": {
            "type": "object",
            "properties": {
              "brand_id": { "type": "string", "x-entity": "rights_holder_brand" },
              "name": { "type": "string" },
              "reason": {
                "type": "string",
                "description": "Why this result was excluded. May be sanitized to protect confidential brand rules."
              },
              "suggestions": {
                "type": "array",
                "description": "Actionable alternatives if the exclusion is fixable (e.g., 'Available in BE and DE markets'). Absent if the exclusion is final.",
                "items": { "type": "string" }
              }
            },
            "required": ["brand_id", "reason"],
            "additionalProperties": true
          }
        },
        "context": {
          "$ref": "/schemas/3.0.1/core/context.json"
        },
        "ext": {
          "$ref": "/schemas/3.0.1/core/ext.json"
        }
      },
      "required": ["rights"],
      "additionalProperties": true,
      "not": { "required": ["errors"] }
    },
    {
      "title": "GetRightsError",
      "properties": {
        "errors": {
          "type": "array",
          "items": { "$ref": "/schemas/3.0.1/core/error.json" },
          "minItems": 1
        },
        "context": {
          "$ref": "/schemas/3.0.1/core/context.json"
        },
        "ext": {
          "$ref": "/schemas/3.0.1/core/ext.json"
        }
      },
      "required": ["errors"],
      "additionalProperties": true,
      "not": {
        "anyOf": [
          { "required": ["rights"] }
        ]
      }
    }
  ]
}
