{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/snow-software/json-schema/snow-software-hateoas-collection-of-license-entitlement-schema.json",
  "title": "HateoasCollectionOfLicenseEntitlement",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/snow-software-entitlements-api-openapi.yml#/components/schemas/HateoasCollectionOfLicenseEntitlement",
  "allOf": [
    {
      "$ref": "#/$defs/FilteredResponseOfLicenseEntitlement"
    },
    {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "_links"
      ],
      "properties": {
        "_links": {
          "type": "array",
          "description": "A collection of links to related resources.",
          "items": {
            "$ref": "#/$defs/Link"
          }
        }
      }
    }
  ],
  "$defs": {
    "AssignmentType": {
      "type": "string",
      "description": "The assignment type.",
      "x-enumNames": [
        "Organization",
        "Computer",
        "User",
        "Site"
      ],
      "enum": [
        "Organization",
        "Computer",
        "User",
        "Site"
      ]
    },
    "FilteredResponseOfLicenseEntitlement": {
      "type": "object",
      "description": "Filtered response.",
      "additionalProperties": false,
      "required": [
        "items",
        "pagination"
      ],
      "properties": {
        "items": {
          "type": "array",
          "description": "A collection of items.",
          "items": {
            "$ref": "#/$defs/LicenseEntitlement"
          }
        },
        "pagination": {
          "description": "The pagination details.",
          "oneOf": [
            {
              "$ref": "#/$defs/Pagination"
            }
          ]
        }
      }
    },
    "HateoasResource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "_links"
      ],
      "properties": {
        "_links": {
          "type": "array",
          "description": "A collection of links to related resources.",
          "items": {
            "$ref": "#/$defs/Link"
          }
        }
      }
    },
    "LicenseEntitlement": {
      "allOf": [
        {
          "$ref": "#/$defs/HateoasResource"
        },
        {
          "type": "object",
          "description": "The license entitlement.",
          "additionalProperties": false,
          "properties": {
            "applicationId": {
              "type": "string",
              "description": "The unique ID of the application.",
              "format": "guid"
            },
            "organizationId": {
              "type": "string",
              "description": "The unique ID of the organization.",
              "format": "guid"
            },
            "metricId": {
              "type": "string",
              "description": "The unique ID of the metric.",
              "format": "guid"
            },
            "assignmentType": {
              "description": "The assignment type.",
              "oneOf": [
                {
                  "$ref": "#/$defs/AssignmentType"
                }
              ]
            },
            "quantity": {
              "type": "integer",
              "description": "The quantity.",
              "format": "int32"
            }
          }
        }
      ]
    },
    "Link": {
      "type": "object",
      "description": "Represents a hypermedia link referenced from a IResource, according to HATEOAS.",
      "additionalProperties": false,
      "properties": {
        "href": {
          "type": [
            "string",
            "null"
          ],
          "description": "The associated relative URL."
        },
        "rel": {
          "type": [
            "string",
            "null"
          ],
          "description": "Specifies the relationship between the current document and the linked document/resource."
        },
        "method": {
          "type": [
            "string",
            "null"
          ],
          "description": "The method to access related resources."
        }
      }
    },
    "Pagination": {
      "type": "object",
      "description": "The pagination details.",
      "additionalProperties": false,
      "required": [
        "page_size",
        "page_number"
      ],
      "properties": {
        "page_size": {
          "type": "integer",
          "description": "The page size you requested.",
          "format": "int32"
        },
        "page_number": {
          "type": "integer",
          "description": "The page number you requested.",
          "format": "int32"
        },
        "total_pages": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The total number of pages.",
          "format": "int32"
        },
        "total_items": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The total number of items.",
          "format": "int32"
        }
      }
    }
  }
}