Class RoleAssignmentAUserApi

java.lang.Object
com.okta.sdk.resource.api.RoleAssignmentAUserApi

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2026-03-13T17:36:05.533634+05:30[Asia/Kolkata]", comments="Generator version: 7.15.0") public class RoleAssignmentAUserApi extends Object
  • Constructor Details

    • RoleAssignmentAUserApi

      public RoleAssignmentAUserApi()
    • RoleAssignmentAUserApi

      public RoleAssignmentAUserApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • assignRoleToUser

      public AssignRoleToUser201Response assignRoleToUser(String userId, AssignRoleToUserRequest assignRoleRequest, Boolean disableNotifications) throws ApiException
      Assign a user role Assigns a [standard role](/openapi/okta-management/guides/roles/#standard-roles) to a user. You can also assign a custom role to a user, but the preferred method to assign a custom role to a user is to create a binding between the custom role, the resource set, and the user. See [Create a role resource set binding](/openapi/okta-management/management/tag/RoleDResourceSetBinding/#tag/RoleDResourceSetBinding/operation/createResourceSetBinding). > **Notes:** > * The request payload is different for standard and custom role assignments. > * For IAM-based standard role assignments, use the request payload for standard roles. However, the response payload for IAM-based role assignments is similar to the custom role's assignment response.
      Parameters:
      userId - ID of an existing Okta user (required)
      assignRoleRequest - (required)
      disableNotifications - Setting this to `true` grants the user third-party admin status (optional, default to false)
      Returns:
      AssignRoleToUser201Response
      Throws:
      ApiException - if fails to make API call
    • assignRoleToUser

      public AssignRoleToUser201Response assignRoleToUser(String userId, AssignRoleToUserRequest assignRoleRequest, Boolean disableNotifications, Map<String,String> additionalHeaders) throws ApiException
      Assign a user role Assigns a [standard role](/openapi/okta-management/guides/roles/#standard-roles) to a user. You can also assign a custom role to a user, but the preferred method to assign a custom role to a user is to create a binding between the custom role, the resource set, and the user. See [Create a role resource set binding](/openapi/okta-management/management/tag/RoleDResourceSetBinding/#tag/RoleDResourceSetBinding/operation/createResourceSetBinding). > **Notes:** > * The request payload is different for standard and custom role assignments. > * For IAM-based standard role assignments, use the request payload for standard roles. However, the response payload for IAM-based role assignments is similar to the custom role's assignment response.
      Parameters:
      userId - ID of an existing Okta user (required)
      assignRoleRequest - (required)
      disableNotifications - Setting this to `true` grants the user third-party admin status (optional, default to false)
      additionalHeaders - additionalHeaders for this call
      Returns:
      AssignRoleToUser201Response
      Throws:
      ApiException - if fails to make API call
    • getRoleAssignmentGovernanceGrant

      public RoleGovernanceSource getRoleAssignmentGovernanceGrant(String userId, String roleAssignmentId, String grantId) throws ApiException
      Retrieve a user role governance source Retrieves a governance source (identified by `grantId`) for a role (identified by `roleAssignmentId`) that's assigned to a user (identified by `userId`)
      Parameters:
      userId - ID of an existing Okta user (required)
      roleAssignmentId - The `id` of the role assignment (required)
      grantId - Grant ID (required)
      Returns:
      RoleGovernanceSource
      Throws:
      ApiException - if fails to make API call
    • getRoleAssignmentGovernanceGrant

      public RoleGovernanceSource getRoleAssignmentGovernanceGrant(String userId, String roleAssignmentId, String grantId, Map<String,String> additionalHeaders) throws ApiException
      Retrieve a user role governance source Retrieves a governance source (identified by `grantId`) for a role (identified by `roleAssignmentId`) that's assigned to a user (identified by `userId`)
      Parameters:
      userId - ID of an existing Okta user (required)
      roleAssignmentId - The `id` of the role assignment (required)
      grantId - Grant ID (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      RoleGovernanceSource
      Throws:
      ApiException - if fails to make API call
    • getRoleAssignmentGovernanceGrantResources

      public RoleGovernanceResources getRoleAssignmentGovernanceGrantResources(String userId, String roleAssignmentId, String grantId) throws ApiException
      Retrieve the user role governance source resources Retrieves the resources of a governance source (identified by `grantId`) for a role (identified by `roleAssignmentId`) that's assigned to a user (identified by `userId`)
      Parameters:
      userId - ID of an existing Okta user (required)
      roleAssignmentId - The `id` of the role assignment (required)
      grantId - Grant ID (required)
      Returns:
      RoleGovernanceResources
      Throws:
      ApiException - if fails to make API call
    • getRoleAssignmentGovernanceGrantResources

      public RoleGovernanceResources getRoleAssignmentGovernanceGrantResources(String userId, String roleAssignmentId, String grantId, Map<String,String> additionalHeaders) throws ApiException
      Retrieve the user role governance source resources Retrieves the resources of a governance source (identified by `grantId`) for a role (identified by `roleAssignmentId`) that's assigned to a user (identified by `userId`)
      Parameters:
      userId - ID of an existing Okta user (required)
      roleAssignmentId - The `id` of the role assignment (required)
      grantId - Grant ID (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      RoleGovernanceResources
      Throws:
      ApiException - if fails to make API call
    • getUserAssignedRole

      public AssignRoleToGroup200Response getUserAssignedRole(String userId, String roleAssignmentId) throws ApiException
      Retrieve a user role assignment Retrieves a role assigned to a user (identified by `userId`). The `roleAssignmentId` parameter is the unique identifier for either a standard role assignment object or a custom role resource set binding object.
      Parameters:
      userId - ID of an existing Okta user (required)
      roleAssignmentId - The `id` of the role assignment (required)
      Returns:
      AssignRoleToGroup200Response
      Throws:
      ApiException - if fails to make API call
    • getUserAssignedRole

      public AssignRoleToGroup200Response getUserAssignedRole(String userId, String roleAssignmentId, Map<String,String> additionalHeaders) throws ApiException
      Retrieve a user role assignment Retrieves a role assigned to a user (identified by `userId`). The `roleAssignmentId` parameter is the unique identifier for either a standard role assignment object or a custom role resource set binding object.
      Parameters:
      userId - ID of an existing Okta user (required)
      roleAssignmentId - The `id` of the role assignment (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      AssignRoleToGroup200Response
      Throws:
      ApiException - if fails to make API call
    • getUserAssignedRoleGovernance

      public RoleGovernance getUserAssignedRoleGovernance(String userId, String roleAssignmentId) throws ApiException
      Retrieve all user role governance sources Retrieves the governance sources of a role (identified by `roleAssignmentId`) that's assigned to a user (identified by `userId`)
      Parameters:
      userId - ID of an existing Okta user (required)
      roleAssignmentId - The `id` of the role assignment (required)
      Returns:
      RoleGovernance
      Throws:
      ApiException - if fails to make API call
    • getUserAssignedRoleGovernance

      public RoleGovernance getUserAssignedRoleGovernance(String userId, String roleAssignmentId, Map<String,String> additionalHeaders) throws ApiException
      Retrieve all user role governance sources Retrieves the governance sources of a role (identified by `roleAssignmentId`) that's assigned to a user (identified by `userId`)
      Parameters:
      userId - ID of an existing Okta user (required)
      roleAssignmentId - The `id` of the role assignment (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      RoleGovernance
      Throws:
      ApiException - if fails to make API call
    • listAssignedRolesForUser

      public List<ListGroupAssignedRoles200ResponseInner> listAssignedRolesForUser(String userId, String expand) throws ApiException
      List all user role assignments Lists all roles assigned to a user (identified by `userId`)
      Parameters:
      userId - ID of an existing Okta user (required)
      expand - An optional parameter used to return targets configured for the standard role assignment in the `embedded` property. Supported values: `targets/groups` or `targets/catalog/apps` (optional)
      Returns:
      List<ListGroupAssignedRoles200ResponseInner>
      Throws:
      ApiException - if fails to make API call
    • listAssignedRolesForUser

      public List<ListGroupAssignedRoles200ResponseInner> listAssignedRolesForUser(String userId, String expand, Map<String,String> additionalHeaders) throws ApiException
      List all user role assignments Lists all roles assigned to a user (identified by `userId`)
      Parameters:
      userId - ID of an existing Okta user (required)
      expand - An optional parameter used to return targets configured for the standard role assignment in the `embedded` property. Supported values: `targets/groups` or `targets/catalog/apps` (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      List<ListGroupAssignedRoles200ResponseInner>
      Throws:
      ApiException - if fails to make API call
    • listAssignedRolesForUserPaged

      public Iterable<ListGroupAssignedRoles200ResponseInner> listAssignedRolesForUserPaged(String userId, String expand)
      List all user role assignments (Paginated) Lists all roles assigned to a user (identified by `userId`) This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks. Use this method in a for-each loop to automatically fetch all pages without manual cursor management.
      Parameters:
      userId - ID of an existing Okta user (required)
      expand - An optional parameter used to return targets configured for the standard role assignment in the `embedded` property. Supported values: `targets/groups` or `targets/catalog/apps` (optional)
      Returns:
      Iterable<ListGroupAssignedRoles200ResponseInner> lazy iterable over all pages
    • listAssignedRolesForUserPaged

      public Iterable<ListGroupAssignedRoles200ResponseInner> listAssignedRolesForUserPaged(String userId, String expand, Map<String,String> additionalHeaders)
      List all user role assignments (Paginated with additional headers) Lists all roles assigned to a user (identified by `userId`) This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.
      Parameters:
      userId - ID of an existing Okta user (required)
      expand - An optional parameter used to return targets configured for the standard role assignment in the `embedded` property. Supported values: `targets/groups` or `targets/catalog/apps` (optional)
      additionalHeaders - additional headers for this call
      Returns:
      Iterable<ListGroupAssignedRoles200ResponseInner> lazy iterable over all pages
    • listUsersWithRoleAssignments

      public RoleAssignedUsers listUsersWithRoleAssignments(String after, Integer limit) throws ApiException
      List all users with role assignments Lists all users with role assignments
      Parameters:
      after - Specifies the pagination cursor for the next page of targets (optional)
      limit - Specifies the number of results returned. Defaults to `100`. (optional, default to 100)
      Returns:
      RoleAssignedUsers
      Throws:
      ApiException - if fails to make API call
    • listUsersWithRoleAssignments

      public RoleAssignedUsers listUsersWithRoleAssignments(String after, Integer limit, Map<String,String> additionalHeaders) throws ApiException
      List all users with role assignments Lists all users with role assignments
      Parameters:
      after - Specifies the pagination cursor for the next page of targets (optional)
      limit - Specifies the number of results returned. Defaults to `100`. (optional, default to 100)
      additionalHeaders - additionalHeaders for this call
      Returns:
      RoleAssignedUsers
      Throws:
      ApiException - if fails to make API call
    • unassignRoleFromUser

      public void unassignRoleFromUser(String userId, String roleAssignmentId) throws ApiException
      Unassign a user role Unassigns a role assignment (identified by `roleAssignmentId`) from a user (identified by `userId`)
      Parameters:
      userId - ID of an existing Okta user (required)
      roleAssignmentId - The `id` of the role assignment (required)
      Throws:
      ApiException - if fails to make API call
    • unassignRoleFromUser

      public void unassignRoleFromUser(String userId, String roleAssignmentId, Map<String,String> additionalHeaders) throws ApiException
      Unassign a user role Unassigns a role assignment (identified by `roleAssignmentId`) from a user (identified by `userId`)
      Parameters:
      userId - ID of an existing Okta user (required)
      roleAssignmentId - The `id` of the role assignment (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • getObjectMapper

      protected static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()