Interface IAMPrincipalPolicies

All Known Implementing Classes:
IAMPrincipalPoliciesImpl

public interface IAMPrincipalPolicies
Client interface for project-scoped IAM principal policies (/v1/projects/{projectId}/principalPolicies).

A principal policy binds a user principal to the policy that governs their access within a project. Principal policies are not created or deleted directly - instead they are listed, retrieved, updated, and toggled via the enable/disable lifecycle. All operations are scoped to a projectId.

  • Method Details

    • list

      PrincipalPolicyList list(String projectId)
      Lists the principal policies of a project (first page).
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      Returns:
      the first page of principal policies
    • list

      PrincipalPolicyList list(String projectId, String pageToken, Integer pageSize)
      Lists the principal policies of a project, controlling pagination.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      pageToken - the opaque page token from a prior response, or null for the first page
      pageSize - the maximum number of results per page, or null for the server default
      Returns:
      the requested page of principal policies
    • getByUuid

      PrincipalPolicy getByUuid(String projectId, String userPrincipal)
      Retrieves the principal policy for a single user principal.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      userPrincipal - the user principal identifier
      Returns:
      the matching principal policy
    • update

      PrincipalPolicy update(String projectId, String userPrincipal, UpdatePrincipalPolicyRequest request)
      Updates a principal policy.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      userPrincipal - the user principal identifier
      request - the update (the request's lastRev guards against concurrent updates)
      Returns:
      the updated principal policy
    • enable

      PrincipalPolicy enable(String projectId, String userPrincipal, String lastRev)
      Enables a previously disabled principal policy.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      userPrincipal - the user principal identifier
      lastRev - the last-known revision of the policy (for concurrency control), or null
      Returns:
      the updated principal policy
    • disable

      PrincipalPolicy disable(String projectId, String userPrincipal, String lastRev)
      Disables a principal policy.
      Parameters:
      projectId - the IAM project id, project:<id> (for example project:abc-123); a bare Resource Manager UUID is rejected, convert it with ProjectIds.of(String). Project-scoped endpoints need an STS access-policy token (new IAM(BearerTokenProvider))
      userPrincipal - the user principal identifier
      lastRev - the last-known revision of the policy (for concurrency control), or null
      Returns:
      the updated principal policy