# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
from spaceone.api.secret.v1 import trusted_secret_pb2 as spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2


class TrustedSecretStub(object):
    """Missing associated documentation comment in .proto file."""

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.create = channel.unary_unary(
                '/spaceone.api.secret.v1.TrustedSecret/create',
                request_serializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.CreateTrustedSecretRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretInfo.FromString,
                )
        self.update = channel.unary_unary(
                '/spaceone.api.secret.v1.TrustedSecret/update',
                request_serializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.UpdateTrustedSecretRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretInfo.FromString,
                )
        self.delete = channel.unary_unary(
                '/spaceone.api.secret.v1.TrustedSecret/delete',
                request_serializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.update_data = channel.unary_unary(
                '/spaceone.api.secret.v1.TrustedSecret/update_data',
                request_serializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.UpdateTrustedSecretDataRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.get = channel.unary_unary(
                '/spaceone.api.secret.v1.TrustedSecret/get',
                request_serializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.GetTrustedSecretRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretInfo.FromString,
                )
        self.list = channel.unary_unary(
                '/spaceone.api.secret.v1.TrustedSecret/list',
                request_serializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretQuery.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretsInfo.FromString,
                )
        self.stat = channel.unary_unary(
                '/spaceone.api.secret.v1.TrustedSecret/stat',
                request_serializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretStatQuery.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_struct__pb2.Struct.FromString,
                )


class TrustedSecretServicer(object):
    """Missing associated documentation comment in .proto file."""

    def create(self, request, context):
        """
        desc: Creates a new Trusted Secret. When creating the resource, external `data` is encrypted, and a `trusted_secret_id` is issued for data access by other microservices.
        request_example: >-
        {
        "name": "aws-dev",
        "data": "********",
        "schema": "aws_access_key",
        "service_account_id": "sa-123456789012",
        "tags": {},
        "domain_id": "domain-123456789012"
        }
        response_example: >-
        {
        "trusted_secret_id": "trusted-secret-123456789012",
        "name": "aws-dev",
        "tags": {},
        "schema": "aws_access_key",
        "provider": "aws",
        "service_account_id": "sa-123456789012",
        "domain_id": "domain-123456789012",
        "created_at": "2022-01-01T06:10:14.851Z"
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def update(self, request, context):
        """
        desc: Updates a specific Secret. You can make changes in Secret settings, including `name` and`tags`.
        request_example: >-
        {
        "trusted_secret_id": "trusted-secret-123456789012",
        "name": "aws-dev2",
        "tags": { "a": "b"},
        "domain_id": "domain-123456789012"
        }
        response_example: >-
        {
        "trusted_secret_id": "trusted-secret-123456789012",
        "name": "aws-dev2",
        "tags": { "a": "b"},
        "schema": "aws_access_key",
        "provider": "aws",
        "service_account_id": "sa-123456789012",
        "domain_id": "domain-123456789012",
        "created_at": "2022-01-01T06:10:14.851Z"
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def delete(self, request, context):
        """
        desc: Deletes a specific Secret. You must specify the `secret_id` of the Secret to delete.
        request_example: >-
        {
        "trusted_secret_id": "trusted-secret-123456789012",
        "domain_id": "domain-123456789012"
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def update_data(self, request, context):
        """
        desc: Updates encrypted data of a specific Secret resource. For example, to change the parameter `data`, external data to encrypt, you can use `update_data` to create new encrypted data based on the changed `data` and store it in the Secret resource.
        request_example: >-
        {
        "trusted_secret_id": "trusted-secret-123456789012",
        "data": "********",
        "domain_id": "domain-123456789012"
        }
        response_example: >-
        {
        "data": {
        "encrypted_data": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        },
        "encrypted": true,
        "encrypt_options": {
        "encrypted_data_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "encrypt_algorithm": "CloudForet_DEFAULT"
        }
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def get(self, request, context):
        """
        desc: Gets a specific Post. You must specify the `post_id` of the Post to get, and the `board_id` of the Board where the child Post to get belongs. Prints detailed information about the Post.
        request_example: >-
        {
        "trusted_secret_id": "trusted-secret-123456789012",
        "domain_id": "domain-123456789012"
        }
        response_example: >-
        {
        "trusted_secret_id": "trusted-secret-123456789012",
        "name": "aws-dev",
        "tags": {},
        "schema": "aws_access_key",
        "provider": "aws",
        "service_account_id": "sa-123456789012",
        "domain_id": "domain-123456789012",
        "created_at": "2022-01-01T06:10:14.851Z"
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def list(self, request, context):
        """
        desc: Gets a list of all Posts. You can use a query to get a filtered list of Posts.
        request_example: >-
        {
        "query": {},
        "domain_id": "domain-123456789012"
        }
        response_example: >-
        {
        "results": [
        {
        "trusted_secret_id": "trusted-secret-123456789012",
        "name": "aws-dev",
        "tags": {},
        "schema": "aws_access_key",
        "provider": "aws",
        "service_account_id": "sa-123456789012",
        "domain_id": "domain-123456789012",
        "created_at": "2022-01-01T06:10:14.851Z"
        },
        {
        "trusted_secret_id": "trusted-secret-987654321098",
        "name": "plugin-credentials",
        "tags": {},
        "domain_id": "domain-123456789012",
        "created_at": "2022-01-01T02:31:01.709Z"
        }
        ],
        "total_count": 2
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def stat(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_TrustedSecretServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.CreateTrustedSecretRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretInfo.SerializeToString,
            ),
            'update': grpc.unary_unary_rpc_method_handler(
                    servicer.update,
                    request_deserializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.UpdateTrustedSecretRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretInfo.SerializeToString,
            ),
            'delete': grpc.unary_unary_rpc_method_handler(
                    servicer.delete,
                    request_deserializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'update_data': grpc.unary_unary_rpc_method_handler(
                    servicer.update_data,
                    request_deserializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.UpdateTrustedSecretDataRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.GetTrustedSecretRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretInfo.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretQuery.FromString,
                    response_serializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretsInfo.SerializeToString,
            ),
            'stat': grpc.unary_unary_rpc_method_handler(
                    servicer.stat,
                    request_deserializer=spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretStatQuery.FromString,
                    response_serializer=google_dot_protobuf_dot_struct__pb2.Struct.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'spaceone.api.secret.v1.TrustedSecret', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class TrustedSecret(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def create(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/spaceone.api.secret.v1.TrustedSecret/create',
            spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.CreateTrustedSecretRequest.SerializeToString,
            spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def update(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/spaceone.api.secret.v1.TrustedSecret/update',
            spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.UpdateTrustedSecretRequest.SerializeToString,
            spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def delete(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/spaceone.api.secret.v1.TrustedSecret/delete',
            spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def update_data(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/spaceone.api.secret.v1.TrustedSecret/update_data',
            spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.UpdateTrustedSecretDataRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def get(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/spaceone.api.secret.v1.TrustedSecret/get',
            spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.GetTrustedSecretRequest.SerializeToString,
            spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def list(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/spaceone.api.secret.v1.TrustedSecret/list',
            spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretQuery.SerializeToString,
            spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretsInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def stat(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/spaceone.api.secret.v1.TrustedSecret/stat',
            spaceone_dot_api_dot_secret_dot_v1_dot_trusted__secret__pb2.TrustedSecretStatQuery.SerializeToString,
            google_dot_protobuf_dot_struct__pb2.Struct.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
