import datetime

from google.api import annotations_pb2 as _annotations_pb2
from google.api import field_behavior_pb2 as _field_behavior_pb2
from google.protobuf import timestamp_pb2 as _timestamp_pb2
from tars.auth.v1 import auth_options_pb2 as _auth_options_pb2
from tars.cli.v1 import cli_pb2 as _cli_pb2
from tars.docs.v1 import docs_pb2 as _docs_pb2
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from collections.abc import Iterable as _Iterable, Mapping as _Mapping
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union

DESCRIPTOR: _descriptor.FileDescriptor

class KeyVersionState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
    __slots__ = ()
    KEY_VERSION_STATE_UNSPECIFIED: _ClassVar[KeyVersionState]
    KEY_VERSION_STATE_ENABLED: _ClassVar[KeyVersionState]
    KEY_VERSION_STATE_DISABLED: _ClassVar[KeyVersionState]
    KEY_VERSION_STATE_DESTROYED: _ClassVar[KeyVersionState]
KEY_VERSION_STATE_UNSPECIFIED: KeyVersionState
KEY_VERSION_STATE_ENABLED: KeyVersionState
KEY_VERSION_STATE_DISABLED: KeyVersionState
KEY_VERSION_STATE_DESTROYED: KeyVersionState

class EnterpriseContext(_message.Message):
    __slots__ = ("customer_id", "workspace_id", "organization_unit")
    CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int]
    WORKSPACE_ID_FIELD_NUMBER: _ClassVar[int]
    ORGANIZATION_UNIT_FIELD_NUMBER: _ClassVar[int]
    customer_id: str
    workspace_id: str
    organization_unit: str
    def __init__(self, customer_id: _Optional[str] = ..., workspace_id: _Optional[str] = ..., organization_unit: _Optional[str] = ...) -> None: ...

class ClientKey(_message.Message):
    __slots__ = ("id", "name", "prefix", "key_hash", "key_address", "key_suffix", "is_active", "is_deleted", "state", "rotation_disable_at", "rotation_destroy_at", "destroyed_at")
    ID_FIELD_NUMBER: _ClassVar[int]
    NAME_FIELD_NUMBER: _ClassVar[int]
    PREFIX_FIELD_NUMBER: _ClassVar[int]
    KEY_HASH_FIELD_NUMBER: _ClassVar[int]
    KEY_ADDRESS_FIELD_NUMBER: _ClassVar[int]
    KEY_SUFFIX_FIELD_NUMBER: _ClassVar[int]
    IS_ACTIVE_FIELD_NUMBER: _ClassVar[int]
    IS_DELETED_FIELD_NUMBER: _ClassVar[int]
    STATE_FIELD_NUMBER: _ClassVar[int]
    ROTATION_DISABLE_AT_FIELD_NUMBER: _ClassVar[int]
    ROTATION_DESTROY_AT_FIELD_NUMBER: _ClassVar[int]
    DESTROYED_AT_FIELD_NUMBER: _ClassVar[int]
    id: str
    name: str
    prefix: str
    key_hash: str
    key_address: str
    key_suffix: str
    is_active: bool
    is_deleted: bool
    state: KeyVersionState
    rotation_disable_at: _timestamp_pb2.Timestamp
    rotation_destroy_at: _timestamp_pb2.Timestamp
    destroyed_at: _timestamp_pb2.Timestamp
    def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., prefix: _Optional[str] = ..., key_hash: _Optional[str] = ..., key_address: _Optional[str] = ..., key_suffix: _Optional[str] = ..., is_active: _Optional[bool] = ..., is_deleted: _Optional[bool] = ..., state: _Optional[_Union[KeyVersionState, str]] = ..., rotation_disable_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., rotation_destroy_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., destroyed_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ...

class Client(_message.Message):
    __slots__ = ("id", "user_id", "title", "customer_id", "project_id", "keys")
    ID_FIELD_NUMBER: _ClassVar[int]
    USER_ID_FIELD_NUMBER: _ClassVar[int]
    TITLE_FIELD_NUMBER: _ClassVar[int]
    CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int]
    PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
    KEYS_FIELD_NUMBER: _ClassVar[int]
    id: str
    user_id: str
    title: str
    customer_id: str
    project_id: str
    keys: _containers.RepeatedCompositeFieldContainer[ClientKey]
    def __init__(self, id: _Optional[str] = ..., user_id: _Optional[str] = ..., title: _Optional[str] = ..., customer_id: _Optional[str] = ..., project_id: _Optional[str] = ..., keys: _Optional[_Iterable[_Union[ClientKey, _Mapping]]] = ...) -> None: ...

class CreateClientWithKeyRequest(_message.Message):
    __slots__ = ("customer_id", "project_id", "title", "key_name", "enterprise_context")
    CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int]
    PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
    TITLE_FIELD_NUMBER: _ClassVar[int]
    KEY_NAME_FIELD_NUMBER: _ClassVar[int]
    ENTERPRISE_CONTEXT_FIELD_NUMBER: _ClassVar[int]
    customer_id: str
    project_id: str
    title: str
    key_name: str
    enterprise_context: EnterpriseContext
    def __init__(self, customer_id: _Optional[str] = ..., project_id: _Optional[str] = ..., title: _Optional[str] = ..., key_name: _Optional[str] = ..., enterprise_context: _Optional[_Union[EnterpriseContext, _Mapping]] = ...) -> None: ...

class CreateClientWithKeyResponse(_message.Message):
    __slots__ = ("client_id", "key_id", "api_key_once", "prefix", "key_hash", "key_address", "key_suffix")
    CLIENT_ID_FIELD_NUMBER: _ClassVar[int]
    KEY_ID_FIELD_NUMBER: _ClassVar[int]
    API_KEY_ONCE_FIELD_NUMBER: _ClassVar[int]
    PREFIX_FIELD_NUMBER: _ClassVar[int]
    KEY_HASH_FIELD_NUMBER: _ClassVar[int]
    KEY_ADDRESS_FIELD_NUMBER: _ClassVar[int]
    KEY_SUFFIX_FIELD_NUMBER: _ClassVar[int]
    client_id: str
    key_id: str
    api_key_once: str
    prefix: str
    key_hash: str
    key_address: str
    key_suffix: str
    def __init__(self, client_id: _Optional[str] = ..., key_id: _Optional[str] = ..., api_key_once: _Optional[str] = ..., prefix: _Optional[str] = ..., key_hash: _Optional[str] = ..., key_address: _Optional[str] = ..., key_suffix: _Optional[str] = ...) -> None: ...

class AddKeyToClientRequest(_message.Message):
    __slots__ = ("customer_id", "project_id", "client_id", "key_id")
    CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int]
    PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
    CLIENT_ID_FIELD_NUMBER: _ClassVar[int]
    KEY_ID_FIELD_NUMBER: _ClassVar[int]
    customer_id: str
    project_id: str
    client_id: str
    key_id: str
    def __init__(self, customer_id: _Optional[str] = ..., project_id: _Optional[str] = ..., client_id: _Optional[str] = ..., key_id: _Optional[str] = ...) -> None: ...

class AddKeyToClientResponse(_message.Message):
    __slots__ = ("success",)
    SUCCESS_FIELD_NUMBER: _ClassVar[int]
    success: bool
    def __init__(self, success: _Optional[bool] = ...) -> None: ...

class RotateKeyInClientRequest(_message.Message):
    __slots__ = ("customer_id", "project_id", "client_id", "user_key_address", "key_name", "enterprise_context", "old_key_id", "old_key_disable_at", "old_key_destroy_at", "disable_after", "destroy_after")
    CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int]
    PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
    CLIENT_ID_FIELD_NUMBER: _ClassVar[int]
    USER_KEY_ADDRESS_FIELD_NUMBER: _ClassVar[int]
    KEY_NAME_FIELD_NUMBER: _ClassVar[int]
    ENTERPRISE_CONTEXT_FIELD_NUMBER: _ClassVar[int]
    OLD_KEY_ID_FIELD_NUMBER: _ClassVar[int]
    OLD_KEY_DISABLE_AT_FIELD_NUMBER: _ClassVar[int]
    OLD_KEY_DESTROY_AT_FIELD_NUMBER: _ClassVar[int]
    DISABLE_AFTER_FIELD_NUMBER: _ClassVar[int]
    DESTROY_AFTER_FIELD_NUMBER: _ClassVar[int]
    customer_id: str
    project_id: str
    client_id: str
    user_key_address: str
    key_name: str
    enterprise_context: EnterpriseContext
    old_key_id: str
    old_key_disable_at: _timestamp_pb2.Timestamp
    old_key_destroy_at: _timestamp_pb2.Timestamp
    disable_after: str
    destroy_after: str
    def __init__(self, customer_id: _Optional[str] = ..., project_id: _Optional[str] = ..., client_id: _Optional[str] = ..., user_key_address: _Optional[str] = ..., key_name: _Optional[str] = ..., enterprise_context: _Optional[_Union[EnterpriseContext, _Mapping]] = ..., old_key_id: _Optional[str] = ..., old_key_disable_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., old_key_destroy_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., disable_after: _Optional[str] = ..., destroy_after: _Optional[str] = ...) -> None: ...

class RotateKeyInClientResponse(_message.Message):
    __slots__ = ("client_id", "key_id", "api_key_once", "prefix", "key_hash", "key_address", "key_suffix", "old_key_lifecycle_scheduled")
    CLIENT_ID_FIELD_NUMBER: _ClassVar[int]
    KEY_ID_FIELD_NUMBER: _ClassVar[int]
    API_KEY_ONCE_FIELD_NUMBER: _ClassVar[int]
    PREFIX_FIELD_NUMBER: _ClassVar[int]
    KEY_HASH_FIELD_NUMBER: _ClassVar[int]
    KEY_ADDRESS_FIELD_NUMBER: _ClassVar[int]
    KEY_SUFFIX_FIELD_NUMBER: _ClassVar[int]
    OLD_KEY_LIFECYCLE_SCHEDULED_FIELD_NUMBER: _ClassVar[int]
    client_id: str
    key_id: str
    api_key_once: str
    prefix: str
    key_hash: str
    key_address: str
    key_suffix: str
    old_key_lifecycle_scheduled: bool
    def __init__(self, client_id: _Optional[str] = ..., key_id: _Optional[str] = ..., api_key_once: _Optional[str] = ..., prefix: _Optional[str] = ..., key_hash: _Optional[str] = ..., key_address: _Optional[str] = ..., key_suffix: _Optional[str] = ..., old_key_lifecycle_scheduled: _Optional[bool] = ...) -> None: ...

class DisableKeyVersionInClientRequest(_message.Message):
    __slots__ = ("customer_id", "project_id", "client_id", "key_version")
    CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int]
    PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
    CLIENT_ID_FIELD_NUMBER: _ClassVar[int]
    KEY_VERSION_FIELD_NUMBER: _ClassVar[int]
    customer_id: str
    project_id: str
    client_id: str
    key_version: str
    def __init__(self, customer_id: _Optional[str] = ..., project_id: _Optional[str] = ..., client_id: _Optional[str] = ..., key_version: _Optional[str] = ...) -> None: ...

class DisableKeyVersionInClientResponse(_message.Message):
    __slots__ = ("success",)
    SUCCESS_FIELD_NUMBER: _ClassVar[int]
    success: bool
    def __init__(self, success: _Optional[bool] = ...) -> None: ...

class EnableKeyVersionInClientRequest(_message.Message):
    __slots__ = ("customer_id", "project_id", "client_id", "key_version")
    CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int]
    PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
    CLIENT_ID_FIELD_NUMBER: _ClassVar[int]
    KEY_VERSION_FIELD_NUMBER: _ClassVar[int]
    customer_id: str
    project_id: str
    client_id: str
    key_version: str
    def __init__(self, customer_id: _Optional[str] = ..., project_id: _Optional[str] = ..., client_id: _Optional[str] = ..., key_version: _Optional[str] = ...) -> None: ...

class EnableKeyVersionInClientResponse(_message.Message):
    __slots__ = ("success",)
    SUCCESS_FIELD_NUMBER: _ClassVar[int]
    success: bool
    def __init__(self, success: _Optional[bool] = ...) -> None: ...

class DestroyKeyVersionInClientRequest(_message.Message):
    __slots__ = ("customer_id", "project_id", "client_id", "key_version")
    CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int]
    PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
    CLIENT_ID_FIELD_NUMBER: _ClassVar[int]
    KEY_VERSION_FIELD_NUMBER: _ClassVar[int]
    customer_id: str
    project_id: str
    client_id: str
    key_version: str
    def __init__(self, customer_id: _Optional[str] = ..., project_id: _Optional[str] = ..., client_id: _Optional[str] = ..., key_version: _Optional[str] = ...) -> None: ...

class DestroyKeyVersionInClientResponse(_message.Message):
    __slots__ = ("success",)
    SUCCESS_FIELD_NUMBER: _ClassVar[int]
    success: bool
    def __init__(self, success: _Optional[bool] = ...) -> None: ...

class EmergencyRevokeKeyVersionRequest(_message.Message):
    __slots__ = ("customer_id", "project_id", "client_id", "key_version", "generate_replacement", "replacement_key_name", "replacement_user_key_address", "replacement_enterprise_context")
    CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int]
    PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
    CLIENT_ID_FIELD_NUMBER: _ClassVar[int]
    KEY_VERSION_FIELD_NUMBER: _ClassVar[int]
    GENERATE_REPLACEMENT_FIELD_NUMBER: _ClassVar[int]
    REPLACEMENT_KEY_NAME_FIELD_NUMBER: _ClassVar[int]
    REPLACEMENT_USER_KEY_ADDRESS_FIELD_NUMBER: _ClassVar[int]
    REPLACEMENT_ENTERPRISE_CONTEXT_FIELD_NUMBER: _ClassVar[int]
    customer_id: str
    project_id: str
    client_id: str
    key_version: str
    generate_replacement: bool
    replacement_key_name: str
    replacement_user_key_address: str
    replacement_enterprise_context: EnterpriseContext
    def __init__(self, customer_id: _Optional[str] = ..., project_id: _Optional[str] = ..., client_id: _Optional[str] = ..., key_version: _Optional[str] = ..., generate_replacement: _Optional[bool] = ..., replacement_key_name: _Optional[str] = ..., replacement_user_key_address: _Optional[str] = ..., replacement_enterprise_context: _Optional[_Union[EnterpriseContext, _Mapping]] = ...) -> None: ...

class EmergencyRevokeKeyVersionResponse(_message.Message):
    __slots__ = ("success", "replacement")
    SUCCESS_FIELD_NUMBER: _ClassVar[int]
    REPLACEMENT_FIELD_NUMBER: _ClassVar[int]
    success: bool
    replacement: RotateKeyInClientResponse
    def __init__(self, success: _Optional[bool] = ..., replacement: _Optional[_Union[RotateKeyInClientResponse, _Mapping]] = ...) -> None: ...

class GetClientRequest(_message.Message):
    __slots__ = ("customer_id", "project_id", "client_id")
    CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int]
    PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
    CLIENT_ID_FIELD_NUMBER: _ClassVar[int]
    customer_id: str
    project_id: str
    client_id: str
    def __init__(self, customer_id: _Optional[str] = ..., project_id: _Optional[str] = ..., client_id: _Optional[str] = ...) -> None: ...

class GetClientResponse(_message.Message):
    __slots__ = ("client",)
    CLIENT_FIELD_NUMBER: _ClassVar[int]
    client: Client
    def __init__(self, client: _Optional[_Union[Client, _Mapping]] = ...) -> None: ...

class ListClientsRequest(_message.Message):
    __slots__ = ("customer_id", "project_id")
    CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int]
    PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
    customer_id: str
    project_id: str
    def __init__(self, customer_id: _Optional[str] = ..., project_id: _Optional[str] = ...) -> None: ...

class ListClientsResponse(_message.Message):
    __slots__ = ("clients",)
    CLIENTS_FIELD_NUMBER: _ClassVar[int]
    clients: _containers.RepeatedCompositeFieldContainer[Client]
    def __init__(self, clients: _Optional[_Iterable[_Union[Client, _Mapping]]] = ...) -> None: ...

class UpdateClientTitleRequest(_message.Message):
    __slots__ = ("customer_id", "project_id", "client_id", "title")
    CUSTOMER_ID_FIELD_NUMBER: _ClassVar[int]
    PROJECT_ID_FIELD_NUMBER: _ClassVar[int]
    CLIENT_ID_FIELD_NUMBER: _ClassVar[int]
    TITLE_FIELD_NUMBER: _ClassVar[int]
    customer_id: str
    project_id: str
    client_id: str
    title: str
    def __init__(self, customer_id: _Optional[str] = ..., project_id: _Optional[str] = ..., client_id: _Optional[str] = ..., title: _Optional[str] = ...) -> None: ...

class UpdateClientTitleResponse(_message.Message):
    __slots__ = ("client",)
    CLIENT_FIELD_NUMBER: _ClassVar[int]
    client: Client
    def __init__(self, client: _Optional[_Union[Client, _Mapping]] = ...) -> None: ...
