# !!!
# WARNING: This file is autogenerated
# Only modify code within MANUAL() sections
# or your changes may be overwritten later!
# !!!

from __future__ import annotations

import enum
from typing import Any, Dict, List, Optional

import pydantic


class M2MSearchQueryOperator(enum.Enum):
    OR = "OR"
    AND = "AND"


class M2MClient(pydantic.BaseModel):
    """
    Fields:
      - client_id: The ID of the client.
      - client_name: A human-readable name for the client.
      - client_description: A human-readable description for the client.
      - status: The status of the client - either `active` or `inactive`.
      - scopes: An array of scopes assigned to the client.
      - client_secret_last_four: The last four characters of the client secret.
      - trusted_metadata: An arbitrary JSON object for storing application-specific data.
      - next_client_secret_last_four: The last four characters of the `next_client_secret`. Null if no `next_client_secret` exists.
    """  # noqa

    client_id: str
    client_name: str
    client_description: str
    status: str
    scopes: List[str]
    client_secret_last_four: str
    trusted_metadata: Optional[Dict[str, Any]] = None
    next_client_secret_last_four: Optional[str] = None


class M2MClientWithClientSecret(pydantic.BaseModel):
    """
    Fields:
      - client_id: The ID of the client.
      - client_secret: The secret of the client. **Important:** this is the only time you will be able to view the `client_secret`. Be sure to persist the `client_secret` in a secure location. If the `client_secret` is lost, you will need to trigger a secret rotation flow to receive another one.
      - client_name: A human-readable name for the client.
      - client_description: A human-readable description for the client.
      - status: The status of the client - either `active` or `inactive`.
      - scopes: An array of scopes assigned to the client.
      - client_secret_last_four: The last four characters of the client secret.
      - trusted_metadata: An arbitrary JSON object for storing application-specific data.
      - next_client_secret_last_four: The last four characters of the `next_client_secret`. Null if no `next_client_secret` exists.
    """  # noqa

    client_id: str
    client_secret: str
    client_name: str
    client_description: str
    status: str
    scopes: List[str]
    client_secret_last_four: str
    trusted_metadata: Optional[Dict[str, Any]] = None
    next_client_secret_last_four: Optional[str] = None


class M2MClientWithNextClientSecret(pydantic.BaseModel):
    """
    Fields:
      - client_id: The ID of the client.
      - next_client_secret: The newly created secret that's next in rotation for the client. **Important:** this is the only time you will be able to view the `next_client_secret`. Be sure to persist the `next_client_secret` in a secure location. If the `next_client_secret` is lost, you will need to trigger a secret rotation flow to receive another one.
      - client_name: A human-readable name for the client.
      - client_description: A human-readable description for the client.
      - status: The status of the client - either `active` or `inactive`.
      - scopes: An array of scopes assigned to the client.
      - client_secret_last_four: The last four characters of the client secret.
      - trusted_metadata: An arbitrary JSON object for storing application-specific data.
      - next_client_secret_last_four: The last four characters of the `next_client_secret`. Null if no `next_client_secret` exists.
    """  # noqa

    client_id: str
    next_client_secret: str
    client_name: str
    client_description: str
    status: str
    scopes: List[str]
    client_secret_last_four: str
    trusted_metadata: Optional[Dict[str, Any]] = None
    next_client_secret_last_four: Optional[str] = None


class M2MSearchQuery(pydantic.BaseModel):
    """
    Fields:
      - operator: The action to perform on the operands. The accepted value are:

      `AND` – all the operand values provided must match.

      `OR` – the operator will return any matches to at least one of the operand values you supply.
      - operands: An array of operand objects that contains all of the filters and values to apply to your search search query.
    """  # noqa

    operator: M2MSearchQueryOperator
    operands: List[Dict[str, Any]]

    class Config:
        use_enum_values = True


class ResultsMetadata(pydantic.BaseModel):
    """
    Fields:
      - total: The total number of results returned by your search query.
      - next_cursor: The `next_cursor` string is returned when your search result contains more than one page of results. This value is passed into your next search call in the `cursor` field.
    """  # noqa

    total: int
    next_cursor: Optional[str] = None
