code: def register_service(cls, primary_key_type):
      
      view_func = cls.as_view(cls.__name__.lower())  # pylint: disable=no-member
      methods = set(cls.__model__.__methods__)  # pylint: disable=no-member
  
      if 'GET' in methods:  # pylint: disable=no-member
          current_app.add_url_rule(
              cls.__model__.__url__ + '/', defaults={'resource_id': None},
              view_func=view_func,
              methods=['GET'])
          current_app.add_url_rule(
              '{resource}/meta'.format(resource=cls.__model__.__url__),
              view_func=view_func,
              methods=['GET'])
      if 'POST' in methods:  # pylint: disable=no-member
          current_app.add_url_rule(
              cls.__model__.__url__ + '/', view_func=view_func, methods=['POST', ])
      current_app.add_url_rule(
          '{resource}/<{pk_type}:{pk}>'.format(
              resource=cls.__model__.__url__,
              pk='resource_id', pk_type=primary_key_type),
          view_func=view_func,
          methods=methods - {'POST'})
      current_app.classes.append(cls)
docs: Register an API service endpoint.
  
      :param cls: The class to register
      :param str primary_key_type: The type (as a string) of the primary_key
                                   field