Class GroupRuleApi

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

@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 GroupRuleApi extends Object
  • Constructor Details

    • GroupRuleApi

      public GroupRuleApi()
    • GroupRuleApi

      public GroupRuleApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • activateGroupRule

      public void activateGroupRule(String groupRuleId) throws ApiException
      Activate a group rule Activates a specific group rule by ID from your org
      Parameters:
      groupRuleId - The `id` of the group rule (required)
      Throws:
      ApiException - if fails to make API call
    • activateGroupRule

      public void activateGroupRule(String groupRuleId, Map<String,String> additionalHeaders) throws ApiException
      Activate a group rule Activates a specific group rule by ID from your org
      Parameters:
      groupRuleId - The `id` of the group rule (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • createGroupRule

      public GroupRule createGroupRule(CreateGroupRuleRequest groupRule) throws ApiException
      Create a group rule Creates a group rule to dynamically add users to the specified group if they match the condition. > **Note:** Group rules are created with the status set to `'INACTIVE'`.
      Parameters:
      groupRule - (required)
      Returns:
      GroupRule
      Throws:
      ApiException - if fails to make API call
    • createGroupRule

      public GroupRule createGroupRule(CreateGroupRuleRequest groupRule, Map<String,String> additionalHeaders) throws ApiException
      Create a group rule Creates a group rule to dynamically add users to the specified group if they match the condition. > **Note:** Group rules are created with the status set to `'INACTIVE'`.
      Parameters:
      groupRule - (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GroupRule
      Throws:
      ApiException - if fails to make API call
    • deactivateGroupRule

      public void deactivateGroupRule(String groupRuleId) throws ApiException
      Deactivate a group rule Deactivates a specific group rule by ID from your org
      Parameters:
      groupRuleId - The `id` of the group rule (required)
      Throws:
      ApiException - if fails to make API call
    • deactivateGroupRule

      public void deactivateGroupRule(String groupRuleId, Map<String,String> additionalHeaders) throws ApiException
      Deactivate a group rule Deactivates a specific group rule by ID from your org
      Parameters:
      groupRuleId - The `id` of the group rule (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • deleteGroupRule

      public void deleteGroupRule(String groupRuleId, Boolean removeUsers) throws ApiException
      Delete a group rule Deletes a specific group rule by `groupRuleId`
      Parameters:
      groupRuleId - The `id` of the group rule (required)
      removeUsers - If set to `true`, removes users from groups assigned by this rule (optional, default to false)
      Throws:
      ApiException - if fails to make API call
    • deleteGroupRule

      public void deleteGroupRule(String groupRuleId, Boolean removeUsers, Map<String,String> additionalHeaders) throws ApiException
      Delete a group rule Deletes a specific group rule by `groupRuleId`
      Parameters:
      groupRuleId - The `id` of the group rule (required)
      removeUsers - If set to `true`, removes users from groups assigned by this rule (optional, default to false)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • getGroupRule

      public GroupRule getGroupRule(String groupRuleId, String expand) throws ApiException
      Retrieve a group rule Retrieves a specific group rule by ID from your org
      Parameters:
      groupRuleId - The `id` of the group rule (required)
      expand - If specified as `groupIdToGroupNameMap`, then show group names (optional)
      Returns:
      GroupRule
      Throws:
      ApiException - if fails to make API call
    • getGroupRule

      public GroupRule getGroupRule(String groupRuleId, String expand, Map<String,String> additionalHeaders) throws ApiException
      Retrieve a group rule Retrieves a specific group rule by ID from your org
      Parameters:
      groupRuleId - The `id` of the group rule (required)
      expand - If specified as `groupIdToGroupNameMap`, then show group names (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GroupRule
      Throws:
      ApiException - if fails to make API call
    • listGroupRules

      public List<GroupRule> listGroupRules(Integer limit, String after, String search, String expand) throws ApiException
      List all group rules Lists all group rules for your org
      Parameters:
      limit - Specifies the number of rule results in a page (optional, default to 50)
      after - Specifies the pagination cursor for the next page of rules (optional)
      search - Specifies the keyword to search rules for (optional)
      expand - If specified as `groupIdToGroupNameMap`, then displays group names (optional)
      Returns:
      List<GroupRule>
      Throws:
      ApiException - if fails to make API call
    • listGroupRules

      public List<GroupRule> listGroupRules(Integer limit, String after, String search, String expand, Map<String,String> additionalHeaders) throws ApiException
      List all group rules Lists all group rules for your org
      Parameters:
      limit - Specifies the number of rule results in a page (optional, default to 50)
      after - Specifies the pagination cursor for the next page of rules (optional)
      search - Specifies the keyword to search rules for (optional)
      expand - If specified as `groupIdToGroupNameMap`, then displays group names (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      List<GroupRule>
      Throws:
      ApiException - if fails to make API call
    • listGroupRulesPaged

      public Iterable<GroupRule> listGroupRulesPaged(Integer limit, String after, String search, String expand)
      List all group rules (Paginated) Lists all group rules for your org 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:
      limit - Specifies the number of rule results in a page (optional, default to 50)
      after - Specifies the pagination cursor for the next page of rules (optional)
      search - Specifies the keyword to search rules for (optional)
      expand - If specified as `groupIdToGroupNameMap`, then displays group names (optional)
      Returns:
      Iterable<GroupRule> lazy iterable over all pages
    • listGroupRulesPaged

      public Iterable<GroupRule> listGroupRulesPaged(Integer limit, String after, String search, String expand, Map<String,String> additionalHeaders)
      List all group rules (Paginated with additional headers) Lists all group rules for your org This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.
      Parameters:
      limit - Specifies the number of rule results in a page (optional, default to 50)
      after - Specifies the pagination cursor for the next page of rules (optional)
      search - Specifies the keyword to search rules for (optional)
      expand - If specified as `groupIdToGroupNameMap`, then displays group names (optional)
      additionalHeaders - additional headers for this call
      Returns:
      Iterable<GroupRule> lazy iterable over all pages
    • replaceGroupRule

      public GroupRule replaceGroupRule(String groupRuleId, GroupRule groupRule) throws ApiException
      Replace a group rule Replaces a group rule > **Notes:** You can only update rules with a group whose status is set to `INACTIVE`. > > You currently can't update the `actions` section.
      Parameters:
      groupRuleId - The `id` of the group rule (required)
      groupRule - (required)
      Returns:
      GroupRule
      Throws:
      ApiException - if fails to make API call
    • replaceGroupRule

      public GroupRule replaceGroupRule(String groupRuleId, GroupRule groupRule, Map<String,String> additionalHeaders) throws ApiException
      Replace a group rule Replaces a group rule > **Notes:** You can only update rules with a group whose status is set to `INACTIVE`. > > You currently can't update the `actions` section.
      Parameters:
      groupRuleId - The `id` of the group rule (required)
      groupRule - (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      GroupRule
      Throws:
      ApiException - if fails to make API call
    • getObjectMapper

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