Class GroupApi

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

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2024-09-23T16:19:57.008753975Z[Etc/UTC]", comments="Generator version: 7.8.0") public class GroupApi extends Object
  • Constructor Details

    • GroupApi

      public GroupApi()
    • GroupApi

      public GroupApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • addGroup

      public Group addGroup(AddGroupRequest group) throws ApiException
      Add a Group Adds a new Group with the `OKTA_GROUP` type to your org > **Note:** App import operations are responsible for syncing Groups with `APP_GROUP` type such as Active Directory Groups. See [About groups](https://help.okta.com/okta_help.htm?id=Directory_Groups).
      Parameters:
      group - (required)
      Returns:
      Group
      Throws:
      ApiException - if fails to make API call
    • addGroup

      public Group addGroup(AddGroupRequest group, Map<String,String> additionalHeaders) throws ApiException
      Add a Group Adds a new Group with the `OKTA_GROUP` type to your org > **Note:** App import operations are responsible for syncing Groups with `APP_GROUP` type such as Active Directory Groups. See [About groups](https://help.okta.com/okta_help.htm?id=Directory_Groups).
      Parameters:
      group - (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Group
      Throws:
      ApiException - if fails to make API call
    • assignUserToGroup

      public void assignUserToGroup(String groupId, String userId) throws ApiException
      Assign a User to a Group Assigns a User to a Group with the `OKTA_GROUP` type > **Note:** You only can modify memberships for Groups of the `OKTA_GROUP` type. App imports are responsible for managing group memberships for Groups of the `APP_GROUP` type, such as Active Directory groups.
      Parameters:
      groupId - The `id` of the group (required)
      userId - ID of an existing Okta user (required)
      Throws:
      ApiException - if fails to make API call
    • assignUserToGroup

      public void assignUserToGroup(String groupId, String userId, Map<String,String> additionalHeaders) throws ApiException
      Assign a User to a Group Assigns a User to a Group with the `OKTA_GROUP` type > **Note:** You only can modify memberships for Groups of the `OKTA_GROUP` type. App imports are responsible for managing group memberships for Groups of the `APP_GROUP` type, such as Active Directory groups.
      Parameters:
      groupId - The `id` of the group (required)
      userId - ID of an existing Okta user (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • deleteGroup

      public void deleteGroup(String groupId) throws ApiException
      Delete a Group Deletes a Group of the `OKTA_GROUP` or `APP_GROUP` type from your org > **Note:** You can't remove Groups of type `APP_GROUP` if they are used in a group push mapping.
      Parameters:
      groupId - The `id` of the group (required)
      Throws:
      ApiException - if fails to make API call
    • deleteGroup

      public void deleteGroup(String groupId, Map<String,String> additionalHeaders) throws ApiException
      Delete a Group Deletes a Group of the `OKTA_GROUP` or `APP_GROUP` type from your org > **Note:** You can't remove Groups of type `APP_GROUP` if they are used in a group push mapping.
      Parameters:
      groupId - The `id` of the group (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • getGroup

      public Group getGroup(String groupId) throws ApiException
      Retrieve a Group Retrieves a specific Group by `id` from your org
      Parameters:
      groupId - The `id` of the group (required)
      Returns:
      Group
      Throws:
      ApiException - if fails to make API call
    • getGroup

      public Group getGroup(String groupId, Map<String,String> additionalHeaders) throws ApiException
      Retrieve a Group Retrieves a specific Group by `id` from your org
      Parameters:
      groupId - The `id` of the group (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Group
      Throws:
      ApiException - if fails to make API call
    • listAssignedApplicationsForGroup

      public List<Application> listAssignedApplicationsForGroup(String groupId, String after, Integer limit) throws ApiException
      List all Assigned Applications Lists all apps that are assigned to a Group. See [Application Groups API](/openapi/okta-management/management/tag/ApplicationGroups/).
      Parameters:
      groupId - The `id` of the group (required)
      after - Specifies the pagination cursor for the next page of apps (optional)
      limit - Specifies the number of app results for a page (optional, default to 20)
      Returns:
      List<Application>
      Throws:
      ApiException - if fails to make API call
    • listAssignedApplicationsForGroup

      public List<Application> listAssignedApplicationsForGroup(String groupId, String after, Integer limit, Map<String,String> additionalHeaders) throws ApiException
      List all Assigned Applications Lists all apps that are assigned to a Group. See [Application Groups API](/openapi/okta-management/management/tag/ApplicationGroups/).
      Parameters:
      groupId - The `id` of the group (required)
      after - Specifies the pagination cursor for the next page of apps (optional)
      limit - Specifies the number of app results for a page (optional, default to 20)
      additionalHeaders - additionalHeaders for this call
      Returns:
      List<Application>
      Throws:
      ApiException - if fails to make API call
    • listGroupUsers

      public List<User> listGroupUsers(String groupId, String after, Integer limit) throws ApiException
      List all Member Users Lists all users that are a member of a Group. The default user limit is set to a very high number due to historical reasons that are no longer valid for most orgs. This will change in a future version of this API. The recommended page limit is now `limit=200`.
      Parameters:
      groupId - The `id` of the group (required)
      after - The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)
      limit - Specifies the number of user results in a page (optional, default to 1000)
      Returns:
      List<User>
      Throws:
      ApiException - if fails to make API call
    • listGroupUsers

      public List<User> listGroupUsers(String groupId, String after, Integer limit, Map<String,String> additionalHeaders) throws ApiException
      List all Member Users Lists all users that are a member of a Group. The default user limit is set to a very high number due to historical reasons that are no longer valid for most orgs. This will change in a future version of this API. The recommended page limit is now `limit=200`.
      Parameters:
      groupId - The `id` of the group (required)
      after - The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)
      limit - Specifies the number of user results in a page (optional, default to 1000)
      additionalHeaders - additionalHeaders for this call
      Returns:
      List<User>
      Throws:
      ApiException - if fails to make API call
    • listGroups

      public List<Group> listGroups(String q, String filter, String after, Integer limit, String expand, String search, String sortBy, String sortOrder) throws ApiException
      List all Groups Lists all Groups with pagination support. The number of Groups returned depends on the specified [`limit`](/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!in=query&path=limit&t=request), if you have a search, filter, and/or query parameter set, and if that parameter is not null. We recommend using a limit less than or equal to 200. A subset of Groups can be returned that match a supported filter expression, query, or search criteria. > **Note:** Results from the filter or query parameter are driven from an eventually consistent datasource. The synchronization lag is typically less than one second. See [Filtering](https://developer.okta.com/docs/api/#filter) for more information on expressions.
      Parameters:
      q - Finds a Group that matches the `name` property > **Note:** Paging and searching are currently mutually exclusive. You can't page a query. The default limit for a query is 300 results. Query is intended for an auto-complete picker use case where users refine their search string to constrain the results. (optional)
      filter - [Filter expression](https://developer.okta.com/docs/reference/core-okta-api/#filter) for Groups > **Note:** All filters must be [URL encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). For example, `filter=lastUpdated gt \"2013-06-01T00:00:00.000Z\"` is encoded as `filter=lastUpdated%20gt%20%222013-06-01T00:00:00.000Z%22`. (optional)
      after - Specifies the pagination cursor for the next page of Groups. The `after` cursor should be treated as an opaque value and obtained through the next link relation. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)
      limit - Specifies the number of Group results in a page. Don't write code that depends on the default or maximum value, as it might change. If you receive an `HTTP 500` status code, you likely exceeded the request timeout. Retry your request with a smaller `limit` and [page the results](https://developer.okta.com/docs/api/#pagination). The Okta default Everyone group isn't returned for users with a Group Admin role. >**Note:** We strongly encourage using a limit that's less than or equal to 200. Any number greater than 200 affects performance and accuracy. (optional)
      expand - If specified, additional metadata is included in the response. Possible values are `stats` and `app`. (optional)
      search - Searches for groups with a supported [filtering](https://developer.okta.com/docs/reference/core-okta-api/#filter) expression for all attributes except for `_embedded`, `_links`, and `objectClass`. Search currently performs a `startsWith` match but it should be considered an implementation detail and might change without notice in the future. This operation supports [pagination](https://developer.okta.com/docs/api/#pagination). Using search requires [URL encoding](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding), for example, `search=type eq \"OKTA_GROUP\"` is encoded as `search=type+eq+%22OKTA_GROUP%22`. This operation searches many properties: * Any group profile property, including imported app group profile properties. * The top-level properties `id`, `created`, `lastMembershipUpdated`, `lastUpdated`, and `type`. * The [source](/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!c=200&path=_links/source&t=response) of groups with type of `APP_GROUP`, accessed as `source.id`. You can also use `sortBy` and `sortOrder` parameters. (optional)
      sortBy - Specifies field to sort by **(for search queries only)**. `sortBy` can be any single property, for example `sortBy=profile.name`. (optional)
      sortOrder - Specifies sort order: `asc` or `desc` (for search queries only). This parameter is ignored if if `sortBy` is not present. Groups with the same value for the `sortBy` property will be ordered by `id` (optional, default to asc)
      Returns:
      List<Group>
      Throws:
      ApiException - if fails to make API call
    • listGroups

      public List<Group> listGroups(String q, String filter, String after, Integer limit, String expand, String search, String sortBy, String sortOrder, Map<String,String> additionalHeaders) throws ApiException
      List all Groups Lists all Groups with pagination support. The number of Groups returned depends on the specified [`limit`](/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!in=query&path=limit&t=request), if you have a search, filter, and/or query parameter set, and if that parameter is not null. We recommend using a limit less than or equal to 200. A subset of Groups can be returned that match a supported filter expression, query, or search criteria. > **Note:** Results from the filter or query parameter are driven from an eventually consistent datasource. The synchronization lag is typically less than one second. See [Filtering](https://developer.okta.com/docs/api/#filter) for more information on expressions.
      Parameters:
      q - Finds a Group that matches the `name` property > **Note:** Paging and searching are currently mutually exclusive. You can't page a query. The default limit for a query is 300 results. Query is intended for an auto-complete picker use case where users refine their search string to constrain the results. (optional)
      filter - [Filter expression](https://developer.okta.com/docs/reference/core-okta-api/#filter) for Groups > **Note:** All filters must be [URL encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). For example, `filter=lastUpdated gt \"2013-06-01T00:00:00.000Z\"` is encoded as `filter=lastUpdated%20gt%20%222013-06-01T00:00:00.000Z%22`. (optional)
      after - Specifies the pagination cursor for the next page of Groups. The `after` cursor should be treated as an opaque value and obtained through the next link relation. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)
      limit - Specifies the number of Group results in a page. Don't write code that depends on the default or maximum value, as it might change. If you receive an `HTTP 500` status code, you likely exceeded the request timeout. Retry your request with a smaller `limit` and [page the results](https://developer.okta.com/docs/api/#pagination). The Okta default Everyone group isn't returned for users with a Group Admin role. >**Note:** We strongly encourage using a limit that's less than or equal to 200. Any number greater than 200 affects performance and accuracy. (optional)
      expand - If specified, additional metadata is included in the response. Possible values are `stats` and `app`. (optional)
      search - Searches for groups with a supported [filtering](https://developer.okta.com/docs/reference/core-okta-api/#filter) expression for all attributes except for `_embedded`, `_links`, and `objectClass`. Search currently performs a `startsWith` match but it should be considered an implementation detail and might change without notice in the future. This operation supports [pagination](https://developer.okta.com/docs/api/#pagination). Using search requires [URL encoding](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding), for example, `search=type eq \"OKTA_GROUP\"` is encoded as `search=type+eq+%22OKTA_GROUP%22`. This operation searches many properties: * Any group profile property, including imported app group profile properties. * The top-level properties `id`, `created`, `lastMembershipUpdated`, `lastUpdated`, and `type`. * The [source](/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!c=200&path=_links/source&t=response) of groups with type of `APP_GROUP`, accessed as `source.id`. You can also use `sortBy` and `sortOrder` parameters. (optional)
      sortBy - Specifies field to sort by **(for search queries only)**. `sortBy` can be any single property, for example `sortBy=profile.name`. (optional)
      sortOrder - Specifies sort order: `asc` or `desc` (for search queries only). This parameter is ignored if if `sortBy` is not present. Groups with the same value for the `sortBy` property will be ordered by `id` (optional, default to asc)
      additionalHeaders - additionalHeaders for this call
      Returns:
      List<Group>
      Throws:
      ApiException - if fails to make API call
    • replaceGroup

      public Group replaceGroup(String groupId, AddGroupRequest group) throws ApiException
      Replace a Group Replaces the profile for a Group of `OKTA_GROUP` type from your org > **Note :** You only can modify profiles for groups of the `OKTA_GROUP` type. > > App imports are responsible for updating profiles for groups of the `APP_GROUP` type, such as Active Directory groups.
      Parameters:
      groupId - The `id` of the group (required)
      group - (required)
      Returns:
      Group
      Throws:
      ApiException - if fails to make API call
    • replaceGroup

      public Group replaceGroup(String groupId, AddGroupRequest group, Map<String,String> additionalHeaders) throws ApiException
      Replace a Group Replaces the profile for a Group of `OKTA_GROUP` type from your org > **Note :** You only can modify profiles for groups of the `OKTA_GROUP` type. > > App imports are responsible for updating profiles for groups of the `APP_GROUP` type, such as Active Directory groups.
      Parameters:
      groupId - The `id` of the group (required)
      group - (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Group
      Throws:
      ApiException - if fails to make API call
    • unassignUserFromGroup

      public void unassignUserFromGroup(String groupId, String userId) throws ApiException
      Unassign a User from a Group Unassigns a User from a Group with the `OKTA_GROUP` type > **Note:** You only can modify memberships for groups of the `OKTA_GROUP` type. > > App imports are responsible for managing group memberships for groups of the `APP_GROUP` type, such as Active Directory groups.
      Parameters:
      groupId - The `id` of the group (required)
      userId - ID of an existing Okta user (required)
      Throws:
      ApiException - if fails to make API call
    • unassignUserFromGroup

      public void unassignUserFromGroup(String groupId, String userId, Map<String,String> additionalHeaders) throws ApiException
      Unassign a User from a Group Unassigns a User from a Group with the `OKTA_GROUP` type > **Note:** You only can modify memberships for groups of the `OKTA_GROUP` type. > > App imports are responsible for managing group memberships for groups of the `APP_GROUP` type, such as Active Directory groups.
      Parameters:
      groupId - The `id` of the group (required)
      userId - ID of an existing Okta user (required)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • getObjectMapper

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