cask "paperspace" do
  version "13.0.3.494"
  sha256 "c1c7227ae3a734617184372d36eb996cb4b6c82208f5bf12373638a1f0ead10f"

  url "https://assets.paperspace.com/native-app/prod/darwin/Paperspace-#{version}.dmg"
  name "Paperspace"
  desc "Desktop app for the Paperspace cloud computing platform"
  homepage "https://www.paperspace.com/app/"

  livecheck do
    url "https://api.paperspace.io/receivers/latestVersion", post_json: {
      component: "paperspaceInstaller",
      os:        "mac",
    }
    strategy :json do |json|
      json["version"]
    end
  end

  depends_on :macos

  app "Paperspace.app"

  zap trash: [
    "~/Library/Application Support/Paperspace",
    "~/Library/Caches/Paperspace",
    "~/Library/Preferences/com.paperspace.Paperspace.plist",
    "~/Library/Preferences/paperspace.Paperspace.plist",
    "~/Library/Saved Application State/paperspace.Paperspace.savedState",
  ]
end
