code: def from_api_repr(cls, resource, client):
          
          name = resource.get("name")
          dns_name = resource.get("dnsName")
          if name is None or dns_name is None:
              raise KeyError(
                  "Resource lacks required identity information:" '["name"]["dnsName"]'
              )
          zone = cls(name, dns_name, client=client)
          zone._set_properties(resource)
          return zone
docs: Factory:  construct a zone given its API representation
  
          :type resource: dict
          :param resource: zone resource representation returned from the API
  
          :type client: :class:`google.cloud.dns.client.Client`
          :param client: Client which holds credentials and project
                         configuration for the zone.
  
          :rtype: :class:`google.cloud.dns.zone.ManagedZone`
          :returns: Zone parsed from ``resource``.