I'm trying to access the IAM permissions for the artifact registry of one of my projects through artifactregistry_v1 python API fro GCP.
name_val = "projects/" + REGISTRY_NAME
artifact_registry_client = artifactregistry_v1.ArtifactRegistryClient(
credentials=credentials
)
req = iam_policy_pb2.GetIamPolicyRequest(resource=name_val)
policy = artifact_registry_client.get_iam_policy(request=req)
print(policy)
When I try this code, I get an error: 400 requests contain an invalid argument for the line request=req.
But if I just pass the resource into the get_iam_policy function, I get an error saying it got an unexpected keyword argument 'resource'.