# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: secret.proto
# plugin: python-betterproto
# This file has been @generated

from dataclasses import dataclass
from datetime import datetime
from typing import (
    TYPE_CHECKING,
    Dict,
    List,
    Optional,
)

import betterproto
import grpc
from betterproto.grpcstub.grpcio_client import SyncServiceStub
from betterproto.grpcstub.grpclib_server import ServiceBase


if TYPE_CHECKING:
    import grpclib.server
    from betterproto.grpcstub.grpclib_client import MetadataLike
    from grpclib.metadata import Deadline


@dataclass(eq=False, repr=False)
class Secret(betterproto.Message):
    id: str = betterproto.string_field(1)
    name: str = betterproto.string_field(2)
    value: str = betterproto.string_field(3)
    last_updated_by: str = betterproto.string_field(5)
    created_at: datetime = betterproto.message_field(6)
    updated_at: datetime = betterproto.message_field(7)


@dataclass(eq=False, repr=False)
class CreateSecretRequest(betterproto.Message):
    name: str = betterproto.string_field(2)
    value: str = betterproto.string_field(3)


@dataclass(eq=False, repr=False)
class CreateSecretResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    err_msg: str = betterproto.string_field(2)
    id: str = betterproto.string_field(3)
    name: str = betterproto.string_field(4)


@dataclass(eq=False, repr=False)
class DeleteSecretRequest(betterproto.Message):
    name: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class DeleteSecretResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    err_msg: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class UpdateSecretRequest(betterproto.Message):
    name: str = betterproto.string_field(2)
    value: str = betterproto.string_field(3)


@dataclass(eq=False, repr=False)
class UpdateSecretResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    err_msg: str = betterproto.string_field(2)


@dataclass(eq=False, repr=False)
class GetSecretRequest(betterproto.Message):
    name: str = betterproto.string_field(1)


@dataclass(eq=False, repr=False)
class GetSecretResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    err_msg: str = betterproto.string_field(2)
    secret: "Secret" = betterproto.message_field(3)


@dataclass(eq=False, repr=False)
class ListSecretsRequest(betterproto.Message):
    pass


@dataclass(eq=False, repr=False)
class ListSecretsResponse(betterproto.Message):
    ok: bool = betterproto.bool_field(1)
    err_msg: str = betterproto.string_field(2)
    secrets: List["Secret"] = betterproto.message_field(3)


class SecretServiceStub(SyncServiceStub):
    def create_secret(
        self, create_secret_request: "CreateSecretRequest"
    ) -> "CreateSecretResponse":
        return self._unary_unary(
            "/secret.SecretService/CreateSecret",
            CreateSecretRequest,
            CreateSecretResponse,
        )(create_secret_request)

    def delete_secret(
        self, delete_secret_request: "DeleteSecretRequest"
    ) -> "DeleteSecretResponse":
        return self._unary_unary(
            "/secret.SecretService/DeleteSecret",
            DeleteSecretRequest,
            DeleteSecretResponse,
        )(delete_secret_request)

    def update_secret(
        self, update_secret_request: "UpdateSecretRequest"
    ) -> "UpdateSecretResponse":
        return self._unary_unary(
            "/secret.SecretService/UpdateSecret",
            UpdateSecretRequest,
            UpdateSecretResponse,
        )(update_secret_request)

    def get_secret(self, get_secret_request: "GetSecretRequest") -> "GetSecretResponse":
        return self._unary_unary(
            "/secret.SecretService/GetSecret",
            GetSecretRequest,
            GetSecretResponse,
        )(get_secret_request)

    def list_secrets(
        self, list_secrets_request: "ListSecretsRequest"
    ) -> "ListSecretsResponse":
        return self._unary_unary(
            "/secret.SecretService/ListSecrets",
            ListSecretsRequest,
            ListSecretsResponse,
        )(list_secrets_request)
