{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/mongodb/main/json-schema/mongodb-paginated-group-user-view-schema.json",
  "title": "PaginatedGroupUserView",
  "x-generated": "2026-10-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mongodb-mongodb-cloud-users-api-openapi.yml#/components/schemas/PaginatedGroupUserView",
  "properties": {
    "links": {
      "description": "List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships.",
      "items": {
        "$ref": "#/$defs/Link"
      },
      "readOnly": true,
      "type": "array"
    },
    "results": {
      "description": "List of returned documents that MongoDB Cloud provides when completing this request.",
      "items": {
        "$ref": "#/$defs/GroupUserResponse"
      },
      "readOnly": true,
      "type": "array"
    },
    "totalCount": {
      "description": "Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact.",
      "format": "int32",
      "minimum": 0,
      "readOnly": true,
      "type": "integer"
    }
  },
  "required": [
    "results"
  ],
  "type": "object",
  "$defs": {
    "GroupActiveUserResponse": {
      "allOf": [
        {
          "$ref": "#/$defs/GroupUserResponse"
        },
        {
          "properties": {
            "country": {
              "description": "Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format.",
              "pattern": "^([A-Z]{2})$",
              "readOnly": true,
              "type": "string"
            },
            "createdAt": {
              "description": "Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC.",
              "format": "date-time",
              "readOnly": true,
              "type": "string"
            },
            "firstName": {
              "description": "First or given name that belongs to the MongoDB Cloud user.",
              "readOnly": true,
              "type": "string"
            },
            "lastAuth": {
              "description": "Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC.",
              "format": "date-time",
              "readOnly": true,
              "type": "string"
            },
            "lastName": {
              "description": "Last name, family name, or surname that belongs to the MongoDB Cloud user.",
              "readOnly": true,
              "type": "string"
            },
            "mobileNumber": {
              "description": "Mobile phone number that belongs to the MongoDB Cloud user.",
              "pattern": "(?:(?:\\\\+?1\\\\s*(?:[.-]\\\\s*)?)?(?:(\\\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\\\s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\\\s*(?:[.-]\\\\s*)?)([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\\\s*(?:[.-]\\\\s*)?([0-9]{4})$",
              "readOnly": true,
              "type": "string"
            }
          },
          "type": "object"
        }
      ],
      "required": [
        "createdAt",
        "firstName",
        "id",
        "lastName",
        "orgMembershipStatus",
        "roles",
        "username"
      ],
      "type": "object"
    },
    "GroupPendingUserResponse": {
      "allOf": [
        {
          "$ref": "#/$defs/GroupUserResponse"
        },
        {
          "properties": {
            "invitationCreatedAt": {
              "description": "Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.",
              "format": "date-time",
              "readOnly": true,
              "type": "string"
            },
            "invitationExpiresAt": {
              "description": "Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC.",
              "format": "date-time",
              "readOnly": true,
              "type": "string"
            },
            "inviterUsername": {
              "description": "Username of the MongoDB Cloud user who sent the invitation to join the organization.",
              "format": "email",
              "readOnly": true,
              "type": "string"
            }
          },
          "type": "object"
        }
      ],
      "required": [
        "id",
        "invitationCreatedAt",
        "invitationExpiresAt",
        "inviterUsername",
        "orgMembershipStatus",
        "roles",
        "username"
      ],
      "type": "object"
    },
    "GroupUserResponse": {
      "oneOf": [
        {
          "$ref": "#/$defs/GroupPendingUserResponse"
        },
        {
          "$ref": "#/$defs/GroupActiveUserResponse"
        }
      ],
      "properties": {
        "id": {
          "description": "Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user.",
          "pattern": "^([a-f0-9]{24})$",
          "readOnly": true,
          "type": "string"
        },
        "orgMembershipStatus": {
          "description": "String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization.",
          "enum": [
            "PENDING",
            "ACTIVE"
          ],
          "readOnly": true,
          "type": "string"
        },
        "roles": {
          "description": "One or more project-level roles assigned to the MongoDB Cloud user.",
          "items": {
            "type": "string"
          },
          "readOnly": true,
          "type": "array",
          "uniqueItems": true
        },
        "username": {
          "description": "Email address that represents the username of the MongoDB Cloud user.",
          "format": "email",
          "readOnly": true,
          "type": "string"
        }
      },
      "required": [
        "id",
        "orgMembershipStatus",
        "roles",
        "username"
      ],
      "type": "object"
    },
    "Link": {
      "properties": {
        "href": {
          "description": "Uniform Resource Locator (URL) that points another API resource to which this response has some relationship. This URL often begins with `https://cloud.mongodb.com/api/atlas`.",
          "type": "string"
        },
        "rel": {
          "description": "Uniform Resource Locator (URL) that defines the semantic relationship between this resource and another API resource. This URL often begins with `https://cloud.mongodb.com/api/atlas`.",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}