patent-dev/epo-ops ? reverse-engineered prompt

Reverse engineered prompt

Build me a Go library for working with the European Patent Office OPS API so I can look up patent data easily from code.

I want it to handle login with OAuth, keep the token fresh, and retry requests when the API is flaky. It should let me fetch patent bibliographic data, claims, descriptions, abstracts, full text, family data, legal status, register details, classifications, images, and search results. For the common things, give me nice typed Go structs, but I also want a way to get the raw XML when I need it.

Please include helpers for patent number formatting and validation, quota tracking, and converting patent image files into something usable like PNG. A small demo or example showing how to search for a patent and print the title would be great. If you need to check the latest OPS docs or edge cases, look them up online.