class_docstr: This class constructs a protocol service class using a service descriptor.
  
  Given a service descriptor, this class constructs a class that represents
  the specified service descriptor. One service builder instance constructs
  exactly one service class. That means all instances of that class share the
  same builder.
class_docstr_tok: ["This","class","constructs","a","protocol","service","class","using","a","service","descriptor",".","Given","a","service","descriptor",",","this","class","constructs","a","class","that","represents","the","specified","service","descriptor",".","One","service","builder","instance","constructs","exactly","one","service","class",".","That","means","all","instances","of","that","class","share","the","same","builder","."]
docstr: Constructs the service class.
  
  Args:
    cls: The class that will be constructed.
docstr_tok: ["Constructs","the","service","class",".","Args",":","cls",":","The","class","that","will","be","constructed","."]
code: def BuildService(self, cls):
      """Constructs the service class.
  
      Args:
        cls: The class that will be constructed.
      """
  
      # CallMethod needs to operate with an instance of the Service class. This
      # internal wrapper function exists only to be able to pass the service
      # instance to the method that does the real CallMethod work.
      def _WrapCallMethod(
          srvc, method_descriptor, rpc_controller, request, callback
      ):
          return self._CallMethod(
              srvc, method_descriptor, rpc_controller, request, callback
          )
  
      self.cls = cls
      cls.CallMethod = _WrapCallMethod
      cls.GetDescriptor = staticmethod(lambda: self.descriptor)
      cls.GetDescriptor.__doc__ = "Returns the service descriptor."
      cls.GetRequestClass = self._GetRequestClass
      cls.GetResponseClass = self._GetResponseClass
      for method in self.descriptor.methods:
          setattr(
              cls,
              method.name,
              self._GenerateNonImplementedMethod(method),
          )
  
label_desc: Use image node_id 2 for calling the _ServiceBuilder obj's underlying member method code with example usage: obj.BuildService(cls) and returns: self