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

from google.firebase.fcm.connection.v1alpha1 import connection_api_pb2 as google_dot_firebase_dot_fcm_dot_connection_dot_v1alpha1_dot_connection__api__pb2


class ConnectionApiStub(object):
  """FCM's service to create client connections to send/receive messages.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.Connect = channel.stream_stream(
        '/google.firebase.fcm.connection.v1alpha1.ConnectionApi/Connect',
        request_serializer=google_dot_firebase_dot_fcm_dot_connection_dot_v1alpha1_dot_connection__api__pb2.UpstreamRequest.SerializeToString,
        response_deserializer=google_dot_firebase_dot_fcm_dot_connection_dot_v1alpha1_dot_connection__api__pb2.DownstreamResponse.FromString,
        )


class ConnectionApiServicer(object):
  """FCM's service to create client connections to send/receive messages.
  """

  def Connect(self, request_iterator, context):
    """Creates a streaming connection with FCM to send messages and their
    respective ACKs.

    The client credentials need to be passed in the [gRPC
    Metadata](https://grpc.io/docs/guides/concepts.html#metadata). The Format
    of the header is:
    Key: "authorization"
    Value: "Checkin [client_id:secret]"


    The project's API key also needs to be sent to authorize the project.
    That can be set in the X-Goog-Api-Key Metadata header.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_ConnectionApiServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Connect': grpc.stream_stream_rpc_method_handler(
          servicer.Connect,
          request_deserializer=google_dot_firebase_dot_fcm_dot_connection_dot_v1alpha1_dot_connection__api__pb2.UpstreamRequest.FromString,
          response_serializer=google_dot_firebase_dot_fcm_dot_connection_dot_v1alpha1_dot_connection__api__pb2.DownstreamResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'google.firebase.fcm.connection.v1alpha1.ConnectionApi', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
