def _MakeGetUriFunc(registry):
  """Return a transformation function from a guest policy resource to an URI."""

  def UriFunc(resource):
    parent_type = resource.name.split('/')[0]
    ref = registry.Parse(
        resource.name,
        collection='osconfig.{}.guestPolicies'.format(parent_type))
    return ref.SelfLink()

  return UriFunc