Fix interpretation of Hetzner DNS response
While trying out the Hetzner Plugin I discovered, that my response from the API looks slightly different from that, what the plugin actually accepts.
Instead of retrieving the zone details like id, til and name directly, for me they were wrapped in an extra "zone" object, like:
{ "zone" : { "id" : "..." }}
This caused an exception that the required fields like id, ttl and name couldn't be found. So I covered that case and added a fallback to work with the response presented to me. Successfully requested a certificate with this approach.
Reading the Hetzner documentation (https://dns.hetzner.com/api-docs#operation/GetZone) it seems like the response I'm getting is actually the default, but I didn't want to break behavior if it is actually working for others the way it is implemented.
Hetzner is also migrating everyone to HetznerCloud, so I think this version of the API is going away.
It's not going away, it's replaced and interface wise it looks similar if not the same: https://docs.hetzner.cloud/reference/cloud#zones-get-a-zone