# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from google.cloud.iam_credentials_v1.proto import (
    common_pb2 as google_dot_iam_dot_credentials_dot_v1_dot_common__pb2,
)


class IAMCredentialsStub(object):
    """A service account is a special type of Google account that belongs to your
  application or a virtual machine (VM), instead of to an individual end user.
  Your application assumes the identity of the service account to call Google
  APIs, so that the users aren't directly involved.

  Service account credentials are used to temporarily assume the identity
  of the service account. Supported credential types include OAuth 2.0 access
  tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and
  more.
  """

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

    Args:
      channel: A grpc.Channel.
    """
        self.GenerateAccessToken = channel.unary_unary(
            "/google.iam.credentials.v1.IAMCredentials/GenerateAccessToken",
            request_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateAccessTokenRequest.SerializeToString,
            response_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateAccessTokenResponse.FromString,
        )
        self.GenerateIdToken = channel.unary_unary(
            "/google.iam.credentials.v1.IAMCredentials/GenerateIdToken",
            request_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateIdTokenRequest.SerializeToString,
            response_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateIdTokenResponse.FromString,
        )
        self.SignBlob = channel.unary_unary(
            "/google.iam.credentials.v1.IAMCredentials/SignBlob",
            request_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignBlobRequest.SerializeToString,
            response_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignBlobResponse.FromString,
        )
        self.SignJwt = channel.unary_unary(
            "/google.iam.credentials.v1.IAMCredentials/SignJwt",
            request_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignJwtRequest.SerializeToString,
            response_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignJwtResponse.FromString,
        )


class IAMCredentialsServicer(object):
    """A service account is a special type of Google account that belongs to your
  application or a virtual machine (VM), instead of to an individual end user.
  Your application assumes the identity of the service account to call Google
  APIs, so that the users aren't directly involved.

  Service account credentials are used to temporarily assume the identity
  of the service account. Supported credential types include OAuth 2.0 access
  tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and
  more.
  """

    def GenerateAccessToken(self, request, context):
        """Generates an OAuth 2.0 access token for a service account.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def GenerateIdToken(self, request, context):
        """Generates an OpenID Connect ID token for a service account.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def SignBlob(self, request, context):
        """Signs a blob using a service account's system-managed private key.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def SignJwt(self, request, context):
        """Signs a JWT using a service account's system-managed private key.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_IAMCredentialsServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "GenerateAccessToken": grpc.unary_unary_rpc_method_handler(
            servicer.GenerateAccessToken,
            request_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateAccessTokenRequest.FromString,
            response_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateAccessTokenResponse.SerializeToString,
        ),
        "GenerateIdToken": grpc.unary_unary_rpc_method_handler(
            servicer.GenerateIdToken,
            request_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateIdTokenRequest.FromString,
            response_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateIdTokenResponse.SerializeToString,
        ),
        "SignBlob": grpc.unary_unary_rpc_method_handler(
            servicer.SignBlob,
            request_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignBlobRequest.FromString,
            response_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignBlobResponse.SerializeToString,
        ),
        "SignJwt": grpc.unary_unary_rpc_method_handler(
            servicer.SignJwt,
            request_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignJwtRequest.FromString,
            response_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignJwtResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "google.iam.credentials.v1.IAMCredentials", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))
