docs: def _render_resource(self, resource):
          """Renders a resource's top level members based on json-api spec.
  
          Top level members include:
              'id', 'type', 'attributes', 'relationships'
          """
          if not resource:
              return None
          # Must not render a resource that has same named
          # attributes as different model.
          if not isinstance(resource, self.model):
              raise TypeError(
                  'Resource(s) type must be the same as the serializer model type.')
  
          top_level_members = {}
          try:
              top_level_members['id'] = str(getattr(resource, self.primary_key))
          except AttributeError:
              raise
          top_level_members['type'] = resource.__tablename__
          top_level_members['attributes'] = self._render_attributes(resource)
          top_level_members['relationships'] = self._render_relationships(
                                                  resource)
          return top_level_members