Interface IAMPolicyMasks

All Known Implementing Classes:
IAMPolicyMasksImpl

public interface IAMPolicyMasks
Client interface for project-scoped IAM policy masks (/v1/projects/{projectId}/policyMasks).

A policy mask constrains the permissions an underlying policy would otherwise grant. This interface provides the policy mask lifecycle - list / create / get / update / delete plus the enable/disable lifecycle toggles. All operations are scoped to a projectId.

  • Method Details

    • list

      PolicyMaskList list(String projectId)
      Lists the policy masks 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 policy masks
    • list

      PolicyMaskList list(String projectId, String pageToken, Integer pageSize)
      Lists the policy masks 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 policy masks
    • create

      PolicyMask create(String projectId, CreatePolicyMaskRequest request)
      Creates a new policy mask in a project.
      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))
      request - the policy mask to create
      Returns:
      the created policy mask
    • getByUuid

      PolicyMask getByUuid(String projectId, String policyMaskId)
      Retrieves a single policy mask by id.
      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))
      policyMaskId - the policy mask identifier
      Returns:
      the matching policy mask
    • update

      PolicyMask update(String projectId, String policyMaskId, UpdatePolicyMaskRequest request)
      Updates a policy mask.
      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))
      policyMaskId - the policy mask identifier
      request - the update (the request's lastRev guards against concurrent updates)
      Returns:
      the updated policy mask
    • delete

      Boolean delete(String projectId, String policyMaskId, String lastRev)
      Deletes a policy mask.

      The spec requires the policy mask's last-known revision in the request body for optimistic-concurrency-controlled deletion.

      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))
      policyMaskId - the policy mask identifier
      lastRev - the last-known revision of the mask (required; from PolicyMask.getRev())
      Returns:
      true if the deletion request was accepted
    • enable

      PolicyMask enable(String projectId, String policyMaskId, String lastRev)
      Enables a previously disabled policy mask.
      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))
      policyMaskId - the policy mask identifier
      lastRev - the last-known revision of the mask (for concurrency control), or null
      Returns:
      the updated policy mask
    • disable

      PolicyMask disable(String projectId, String policyMaskId, String lastRev)
      Disables a policy mask.
      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))
      policyMaskId - the policy mask identifier
      lastRev - the last-known revision of the mask (for concurrency control), or null
      Returns:
      the updated policy mask