{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudtruth/json-schema/cloudtruth-paginated-service-account-list-schema.json",
  "title": "PaginatedServiceAccountList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudtruth-service-accounts-api-openapi.yml#/components/schemas/PaginatedServiceAccountList",
  "type": "object",
  "required": [
    "count",
    "results"
  ],
  "properties": {
    "count": {
      "type": "integer"
    },
    "next": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "previous": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ServiceAccount"
      }
    }
  },
  "$defs": {
    "ServiceAccount": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "readOnly": true
        },
        "id": {
          "type": "string",
          "readOnly": true
        },
        "owner": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "user": {
          "allOf": [
            {
              "$ref": "#/$defs/User"
            }
          ],
          "readOnly": true
        },
        "description": {
          "type": "string",
          "description": "An optional description of the process or system using the service account."
        },
        "keys": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ServiceAccountAPIKey"
          },
          "readOnly": true
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "modified_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true
        },
        "last_used_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true,
          "description": "The most recent date and time the service account was used.  It will be null if the service account has not been used."
        }
      },
      "required": [
        "created_at",
        "id",
        "keys",
        "last_used_at",
        "modified_at",
        "url",
        "user"
      ]
    },
    "ServiceAccountAPIKey": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "A free-form name for the API key. Need not be unique. 50 characters max.",
          "maxLength": 50
        },
        "prefix": {
          "type": "string",
          "readOnly": true
        },
        "revoked": {
          "type": "boolean",
          "description": "If the API key is revoked, clients cannot use it anymore. (This cannot be undone.)"
        },
        "has_expired": {
          "type": "boolean",
          "readOnly": true
        },
        "created": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "expiry_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "title": "Expires",
          "description": "Once API key expires, clients cannot use it anymore."
        }
      },
      "required": [
        "created",
        "has_expired",
        "prefix"
      ]
    },
    "User": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "readOnly": true
        },
        "id": {
          "type": "string",
          "description": "The unique identifier of a user.",
          "maxLength": 256
        },
        "type": {
          "type": "string",
          "description": "The type of user record.",
          "maxLength": 12
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "organization_name": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "The user's organization name."
        },
        "membership_id": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "Membership identifier for user."
        },
        "chatgpt_threads": {
          "type": "object",
          "additionalProperties": {},
          "readOnly": true,
          "description": "The threads this user is participating in with ChatGPT."
        },
        "role": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "The user's role in the current organization (defined by the request authorization header)."
        },
        "email": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "picture_url": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "modified_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true
        }
      },
      "required": [
        "chatgpt_threads",
        "created_at",
        "email",
        "id",
        "membership_id",
        "modified_at",
        "name",
        "organization_name",
        "picture_url",
        "role",
        "url"
      ]
    }
  }
}