{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/safetyculture/json-schema/safetyculture-s12-contractors-v1-list-company-user-metadata-request-schema.json",
  "title": "s12.contractors.v1.ListCompanyUserMetadataRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/safetyculture-companies-api-openapi.yml#/components/schemas/s12.contractors.v1.ListCompanyUserMetadataRequest",
  "type": "object",
  "properties": {
    "company_id": {
      "type": "string",
      "description": "Required. The ID of the contractor company."
    },
    "filter": {
      "description": "Additional filters to apply to the request.",
      "allOf": [
        {
          "$ref": "#/$defs/s12.contractors.v1.ContractorCompanyUserFilter"
        }
      ]
    },
    "sort_field": {
      "description": "The field to sort by.",
      "allOf": [
        {
          "$ref": "#/$defs/s12.contractors.v1.ContractorCompanyUserSortField"
        }
      ]
    },
    "page_size": {
      "type": "integer",
      "format": "int32",
      "description": "The number of users to return in a single request."
    },
    "page_token": {
      "type": "string",
      "description": "If present, will fetch the next page of results. This must be the value of `next_page_token` from the response."
    },
    "sort_direction": {
      "description": "Optional. The sort order to apply. Defaults to ascending when unspecified.",
      "allOf": [
        {
          "$ref": "#/$defs/s12.common.SortDirection"
        }
      ]
    }
  },
  "required": [
    "company_id"
  ],
  "$defs": {
    "s12.common.SortDirection": {
      "type": "string",
      "enum": [
        "SORT_DIRECTION_UNSPECIFIED",
        "SORT_DIRECTION_ASC",
        "SORT_DIRECTION_DESC"
      ],
      "default": "SORT_DIRECTION_UNSPECIFIED",
      "title": "Common set of sorting directions as used by lists"
    },
    "s12.contractors.v1.ContractorCompanyUserFilter": {
      "type": "object",
      "properties": {
        "search": {
          "type": "string",
          "description": "Optional. The search string to filter by. If not provided, all unfiltered results will be returned."
        },
        "user_status": {
          "description": "Optional. The user status to filter by. If not provided, all statuses will be returned.",
          "allOf": [
            {
              "$ref": "#/$defs/s12.contractors.v1.ContractorCompanyUserFilter.UserStatus"
            }
          ]
        }
      },
      "description": "ContractorCompanyUserFilter is used to filter contractor company users."
    },
    "s12.contractors.v1.ContractorCompanyUserFilter.UserStatus": {
      "type": "string",
      "enum": [
        "USER_STATUS_ACTIVE",
        "USER_STATUS_DEACTIVATED"
      ],
      "description": " - USER_STATUS_ACTIVE: Include only active users.\n - USER_STATUS_DEACTIVATED: Include only deactivated users."
    },
    "s12.contractors.v1.ContractorCompanyUserSortField": {
      "type": "string",
      "enum": [
        "USER_SORT_FIELD_USER_NAME"
      ],
      "description": "ContractorCompanyUserSortField is used to define the sorting criteria of contractor company users.\n\n - USER_SORT_FIELD_USER_NAME: Sort by user name."
    }
  }
}