def METHOD_NAME(self, instance):
    """Plugin entry point."""
    self_name = self.__class__.__name__
    result = harmony.send(
        {
            "function": f"PypeHarmony.Publish.{self_name}.getPalette",
            "args": instance.data["id"]
        })["result"]
    if not isinstance(result, list):
        self.log.error(f"Invalid reply: {result}")
        raise AssertionError("Invalid reply from server.")
    palette_name = result[0]
    palette_file = result[1]
    self.log.info(f"Got palette named {palette_name} "
                  f"and file {palette_file}.")
    tmp_thumb_path = os.path.join(os.path.dirname(palette_file),
                                  os.path.basename(palette_file)
                                  .split(".plt")[0] + "_swatches.png"
                                  )
    self.log.info(f"Temporary thumbnail path {tmp_thumb_path}")
    palette_version = str(instance.data.get("version")).zfill(3)
    self.log.info(f"Palette version {palette_version}")
    if not instance.data.get("representations"):
        instance.data["representations"] = []
    try:
        thumbnail_path = self.create_palette_thumbnail(palette_name,
                                                       palette_version,
                                                       palette_file,
                                                       tmp_thumb_path)
    except OSError as e:
        # FIXME: this happens on Mac where PIL cannot access fonts
        # for some reason.
        self.log.warning("Thumbnail generation failed")
        self.log.warning(e)
    except ValueError:
        self.log.error("Unsupported palette type for thumbnail.")
    else:
        thumbnail = {
            "name": "thumbnail",
            "ext": "png",
            "files": os.path.basename(thumbnail_path),
            "stagingDir": os.path.dirname(thumbnail_path),
            "tags": ["thumbnail"]
        }
        instance.data["representations"].append(thumbnail)
    representation = {
        "name": "plt",
        "ext": "plt",
        "files": os.path.basename(palette_file),
        "stagingDir": os.path.dirname(palette_file)
    }
    instance.data["representations"].append(representation)