# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: services/connect/v1/connect.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import (
    Dict,
    List,
    Optional,
)

import betterproto
from betterproto.grpc.grpclib_server import ServiceBase


class VerificationType(betterproto.Enum):
    """The type of verification to perform"""

    GOVERNMENT_ID = 0
    """Government-issued ID (driver's license, passport, etc)"""


class SessionOrdering(betterproto.Enum):
    """Controls how sessions are ordered in `ListSessions`"""

    CREATED = 0
    """Order sessions according to when they were created"""

    UPDATED = 1
    """Order sessions according to when they last changed state"""

    STATE = 2
    """Order sessions according to their numerical state"""


@dataclass(eq=False, repr=False)
class NormalizedGovernmentIdData(betterproto.Message):
    id_number: Optional[str] = betterproto.string_field(
        1, optional=True, group="_id_number"
    )
    """The ID number of the underlying identity document"""

    given_name: Optional[str] = betterproto.string_field(
        2, optional=True, group="_given_name"
    )
    """Given ("first") name of the document holder"""

    family_name: Optional[str] = betterproto.string_field(
        3, optional=True, group="_family_name"
    )
    """Family ("last") name of the document holder"""

    address: Optional[str] = betterproto.string_field(
        4, optional=True, group="_address"
    )
    """Full address of the document holder"""

    date_of_birth: Optional[str] = betterproto.string_field(
        5, optional=True, group="_date_of_birth"
    )
    """Date of birth of the document holder"""

    country: Optional[str] = betterproto.string_field(
        6, optional=True, group="_country"
    )
    """ISO3 country code of the document"""

    issue_date: Optional[str] = betterproto.string_field(
        7, optional=True, group="_issue_date"
    )
    """Issuance date of the document"""

    expiration_date: Optional[str] = betterproto.string_field(
        8, optional=True, group="_expiration_date"
    )
    """Expiration date date of the document"""


@dataclass(eq=False, repr=False)
class DemoRelyingParty(betterproto.Message):
    """Information about a Relying Party used for demo purposes"""

    display_name: str = betterproto.string_field(1)
    logo_url: str = betterproto.string_field(2)
    primary_color: str = betterproto.string_field(3)


@dataclass(eq=False, repr=False)
class CreateSessionRequest(betterproto.Message):
    """Request to create an Identity Verification Session"""

    verifications: List["RequestedVerification"] = betterproto.message_field(1)
    """Array of verifications to perform"""

    debug_information: Dict[str, str] = betterproto.map_field(
        2, betterproto.TYPE_STRING, betterproto.TYPE_STRING
    )
    """Debugging information used to help diagnose issues"""

    demo_rp: Optional["DemoRelyingParty"] = betterproto.message_field(
        3, optional=True, group="_demo_rp"
    )
    """
    Information about the Relying Party used for demo purposes. This is only to
    be used if the demo flag is set to true in the debug information.
    """


@dataclass(eq=False, repr=False)
class RequestedVerification(betterproto.Message):
    """A verification to perform in an IDV flow"""

    type: "VerificationType" = betterproto.enum_field(1)
    """The type of verification to perform"""

    government_id_options: "GovernmentIdOptions" = betterproto.message_field(
        2, group="options"
    )
    """Options for a Verification of type `GOVERNMENT_ID`"""


@dataclass(eq=False, repr=False)
class GovernmentIdOptions(betterproto.Message):
    """Options for a Verification of type `GOVERNMENT_ID`"""

    fields: "GovernmentIdFields" = betterproto.message_field(1)
    """
    The fields to retrieve from the Government ID. If this object is not set,
    all fields will be retrieved.
    """


@dataclass(eq=False, repr=False)
class GovernmentIdFields(betterproto.Message):
    """
    Selection of fields to retrieve from a Government ID. All fields default to
    `false` unless explicitly set to `true`.
    """

    id_number: bool = betterproto.bool_field(1)
    """ID number of the underlying identity document"""

    given_name: bool = betterproto.bool_field(2)
    """Given ("first") name of the document holder"""

    family_name: bool = betterproto.bool_field(3)
    """Family ("last") name of the document holder"""

    address: bool = betterproto.bool_field(4)
    """Full address of the document holder"""

    date_of_birth: bool = betterproto.bool_field(5)
    """Date of birth of the document holder"""

    country: bool = betterproto.bool_field(6)
    """ISO3 country code of the document"""

    issue_date: bool = betterproto.bool_field(7)
    """Issuance date of the document"""

    expiration_date: bool = betterproto.bool_field(8)
    """Expiration date date of the document"""

    document_front: bool = betterproto.bool_field(9)
    """The image of the front of the document"""

    document_back: bool = betterproto.bool_field(10)
    """The image of the back of the document"""

    document_portrait: bool = betterproto.bool_field(11)
    """The image of the holder portrait contained in the document"""

    selfie: bool = betterproto.bool_field(12)
    """The image of the face match selfie"""


@dataclass(eq=False, repr=False)
class CredentialRequestData(betterproto.Message):
    type: "VerificationType" = betterproto.enum_field(1)
    """The type of verification for which the credential can be used"""
