# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: temporal/api/namespace/v1/message.proto
# plugin: python-betterproto
from dataclasses import dataclass
from datetime import datetime, timedelta
from typing import Dict

import betterproto

from temporal.api.enums import v1 as v1enums


@dataclass
class NamespaceInfo(betterproto.Message):
    name: str = betterproto.string_field(1)
    state: v1enums.NamespaceState = betterproto.enum_field(2)
    description: str = betterproto.string_field(3)
    owner_email: str = betterproto.string_field(4)
    # A key-value map for any customized purpose.
    data: Dict[str, str] = betterproto.map_field(
        5, betterproto.TYPE_STRING, betterproto.TYPE_STRING
    )
    id: str = betterproto.string_field(6)


@dataclass
class NamespaceConfig(betterproto.Message):
    workflow_execution_retention_ttl: timedelta = betterproto.message_field(1)
    bad_binaries: "BadBinaries" = betterproto.message_field(2)
    # If unspecified (ARCHIVAL_STATE_UNSPECIFIED) then default server
    # configuration is used.
    history_archival_state: v1enums.ArchivalState = betterproto.enum_field(3)
    history_archival_uri: str = betterproto.string_field(4)
    # If unspecified (ARCHIVAL_STATE_UNSPECIFIED) then default server
    # configuration is used.
    visibility_archival_state: v1enums.ArchivalState = betterproto.enum_field(5)
    visibility_archival_uri: str = betterproto.string_field(6)


@dataclass
class BadBinaries(betterproto.Message):
    binaries: Dict[str, "BadBinaryInfo"] = betterproto.map_field(
        1, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
    )


@dataclass
class BadBinaryInfo(betterproto.Message):
    reason: str = betterproto.string_field(1)
    operator: str = betterproto.string_field(2)
    create_time: datetime = betterproto.message_field(3)


@dataclass
class UpdateNamespaceInfo(betterproto.Message):
    description: str = betterproto.string_field(1)
    owner_email: str = betterproto.string_field(2)
    # A key-value map for any customized purpose.
    data: Dict[str, str] = betterproto.map_field(
        3, betterproto.TYPE_STRING, betterproto.TYPE_STRING
    )
