The Hetzner DNS API returns a default TTL field for every zone.
Based on this, records that use a non-custom TTL will not include the ttl field at all in their JSON representation and thus result in a libdns.Record object with a TTL of 0 seconds.
This PR solves this by enhancing the existent getZoneID (renamed to getZoneData) to not only return the zone's ID but also its default TTL.
It also updates the unmarshalling step of a JSON record returned by the Hetzner API to use this default TTL when the ttl field does not exist.
The Hetzner DNS API returns a default TTL field for every zone. Based on this, records that use a non-custom TTL will not include the
ttl
field at all in their JSON representation and thus result in alibdns.Record
object with a TTL of 0 seconds.This PR solves this by enhancing the existent
getZoneID
(renamed togetZoneData
) to not only return the zone's ID but also its default TTL. It also updates the unmarshalling step of a JSON record returned by the Hetzner API to use this default TTL when thettl
field does not exist.