code: def from_api_repr(cls, resource):
          
          version = resource.get("version")
          etag = resource.get("etag")
          policy = cls(etag, version)
          for binding in resource.get("bindings", ()):
              role = binding["role"]
              members = sorted(binding["members"])
              policy[role] = members
          return policy
docs: Factory: create a policy from a JSON resource.
  
          Args:
              resource (dict): policy resource returned by ``getIamPolicy`` API.
  
          Returns:
              :class:`Policy`: the parsed policy