All URIs are relative to https://your-api-subdomain.onelogin.com
Method | HTTP request | Description |
---|---|---|
addRoleAdmins | POST /api/2/roles/{role_id}/admins | Add Role Admins |
addRoleUsers | POST /api/2/roles/{role_id}/users | Add Role Users |
createRole | POST /api/2/roles | Create Role |
deleteRole | DELETE /api/2/roles/{role_id} | Delete Role by ID |
getRole | GET /api/2/roles/{role_id} | Get Role by ID |
getRoleAdmins | GET /api/2/roles/{role_id}/admins | Get Role Admins |
getRoleApps | GET /api/2/roles/{role_id}/apps | Get all Apps assigned to Role |
getRoleById | GET /api/1/roles/{role_id} | Get Role by ID |
getRoleByName | GET /api/1/roles | Get Role by Name |
getRoleUsers | GET /api/2/roles/{role_id}/users | Get Role Users |
listRoles | GET /api/2/roles | List Roles |
removeRoleAdmins | DELETE /api/2/roles/{role_id}/admins | Remove Role Admins |
removeRoleUsers | DELETE /api/2/roles/{role_id}/users | Remove Role Users |
setRoleApps | PUT /api/2/roles/{role_id}/apps | Set Role Apps |
updateRole | PUT /api/2/roles/{role_id} | Update Role |
List<CreateRole201ResponseInner> addRoleAdmins(roleId, requestBody)
Add Role Admins
Add Role Admins
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
List<Integer> requestBody = Arrays.asList(); // List<Integer> |
try {
List<CreateRole201ResponseInner> result = apiInstance.addRoleAdmins(roleId, requestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#addRoleAdmins");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
roleId | String | Set to the id of the role you want to return. | |
requestBody | List<Integer> |
List<CreateRole201ResponseInner>
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
List<CreateRole201ResponseInner> addRoleUsers(roleId, requestBody)
Add Role Users
Add Role Users
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
List<Integer> requestBody = Arrays.asList(); // List<Integer> |
try {
List<CreateRole201ResponseInner> result = apiInstance.addRoleUsers(roleId, requestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#addRoleUsers");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
roleId | String | Set to the id of the role you want to return. | |
requestBody | List<Integer> |
List<CreateRole201ResponseInner>
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
422 | Unprocessable Entity | - |
List<CreateRole201ResponseInner> createRole(role)
Create Role
Create Role
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
Role role = new Role(); // Role |
try {
List<CreateRole201ResponseInner> result = apiInstance.createRole(role);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#createRole");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
role | Role | [optional] |
List<CreateRole201ResponseInner>
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | CREATED | - |
401 | Unauthorized | - |
deleteRole(roleId)
Delete Role by ID
Delete Role
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
try {
apiInstance.deleteRole(roleId);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#deleteRole");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
roleId | String | Set to the id of the role you want to return. |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | NO CONTENT | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
Role getRole(roleId)
Get Role by ID
Get Role
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
try {
Role result = apiInstance.getRole(roleId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#getRole");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
roleId | String | Set to the id of the role you want to return. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
404 | Not Found | - |
List<User> getRoleAdmins(roleId, limit, page, cursor, name, includeUnassigned)
Get Role Admins
Get Role Admins
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
Integer limit = 56; // Integer | How many items to return at one time (max 100)
Integer page = 56; // Integer | The page number of results to return.
String cursor = "cursor_example"; // String | Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.
String name = "name_example"; // String | Allows you to filter on first name, last name, username, and email address.
Boolean includeUnassigned = true; // Boolean | Optional. Defaults to false. Include users that aren’t assigned to the role.
try {
List<User> result = apiInstance.getRoleAdmins(roleId, limit, page, cursor, name, includeUnassigned);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#getRoleAdmins");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
roleId | String | Set to the id of the role you want to return. | |
limit | Integer | How many items to return at one time (max 100) | [optional] |
page | Integer | The page number of results to return. | [optional] |
cursor | String | Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page. | [optional] |
name | String | Allows you to filter on first name, last name, username, and email address. | [optional] |
includeUnassigned | Boolean | Optional. Defaults to false. Include users that aren’t assigned to the role. | [optional] |
- Content-Type: Not defined
- Accept: applcation/json, application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | * Current-Page - * Page-Items - * Total-Count - * Total-Pages - * Link - * Before-Cursor - * After-Cursor - |
401 | Unauthorized | - |
404 | Not Found | - |
List<GetRoleApps200ResponseInner> getRoleApps(roleId, limit, page, cursor, assigned)
Get all Apps assigned to Role
Get Role Apps
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
Integer limit = 56; // Integer | How many items to return at one time (max 100)
Integer page = 56; // Integer | The page number of results to return.
String cursor = "cursor_example"; // String | Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.
Boolean assigned = true; // Boolean | Optional. Defaults to true. Returns all apps not yet assigned to the role.
try {
List<GetRoleApps200ResponseInner> result = apiInstance.getRoleApps(roleId, limit, page, cursor, assigned);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#getRoleApps");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
roleId | String | Set to the id of the role you want to return. | |
limit | Integer | How many items to return at one time (max 100) | [optional] |
page | Integer | The page number of results to return. | [optional] |
cursor | String | Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page. | [optional] |
assigned | Boolean | Optional. Defaults to true. Returns all apps not yet assigned to the role. | [optional] |
List<GetRoleApps200ResponseInner>
- Content-Type: Not defined
- Accept: applcation/json, application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | * Current-Page - * Page-Items - * Total-Count - * Total-Pages - * Link - * Before-Cursor - * After-Cursor - |
401 | Unauthorized | - |
404 | Not Found | - |
GetRoleById200Response getRoleById(roleId)
Get Role by ID
Get Role By ID
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
try {
GetRoleById200Response result = apiInstance.getRoleById(roleId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#getRoleById");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
roleId | String | Set to the id of the role you want to return. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
400 | Bad Request | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
GetRoleByName200Response getRoleByName(name)
Get Role by Name
Get Role by Name
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String name = "name_example"; // String |
try {
GetRoleByName200Response result = apiInstance.getRoleByName(name);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#getRoleByName");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
name | String | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
400 | Bad Request | - |
401 | Unauthorized | - |
List<User> getRoleUsers(roleId, limit, page, cursor, name, includeUnassigned)
Get Role Users
Get Role Users
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
Integer limit = 56; // Integer | How many items to return at one time (max 100)
Integer page = 56; // Integer | The page number of results to return.
String cursor = "cursor_example"; // String | Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.
String name = "name_example"; // String | Allows you to filter on first name, last name, username, and email address.
Boolean includeUnassigned = true; // Boolean | Optional. Defaults to false. Include users that aren’t assigned to the role.
try {
List<User> result = apiInstance.getRoleUsers(roleId, limit, page, cursor, name, includeUnassigned);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#getRoleUsers");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
roleId | String | Set to the id of the role you want to return. | |
limit | Integer | How many items to return at one time (max 100) | [optional] |
page | Integer | The page number of results to return. | [optional] |
cursor | String | Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page. | [optional] |
name | String | Allows you to filter on first name, last name, username, and email address. | [optional] |
includeUnassigned | Boolean | Optional. Defaults to false. Include users that aren’t assigned to the role. | [optional] |
- Content-Type: Not defined
- Accept: applcation/json, application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | * Current-Page - * Page-Items - * Total-Count - * Total-Pages - * Link - * Before-Cursor - * After-Cursor - |
401 | Unauthorized | - |
404 | Not Found | - |
List<Role> listRoles(limit, page, cursor, roleName, appId, appName, fields)
List Roles
List Roles
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
Integer limit = 56; // Integer | How many items to return at one time (max 100)
Integer page = 56; // Integer | The page number of results to return.
String cursor = "cursor_example"; // String | Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page.
String roleName = "roleName_example"; // String | Optional. Filters by role name.
Integer appId = 56; // Integer |
String appName = "appName_example"; // String | Optional. Returns roles that contain this app name.
String fields = "apps"; // String | Optional. Comma delimited list of fields to return.
try {
List<Role> result = apiInstance.listRoles(limit, page, cursor, roleName, appId, appName, fields);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#listRoles");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
limit | Integer | How many items to return at one time (max 100) | [optional] |
page | Integer | The page number of results to return. | [optional] |
cursor | String | Set to the value extracted from Before-Cursor or After-Cursor headers to return the previous or next page. | [optional] |
roleName | String | Optional. Filters by role name. | [optional] |
appId | Integer | [optional] | |
appName | String | Optional. Returns roles that contain this app name. | [optional] |
fields | String | Optional. Comma delimited list of fields to return. | [optional] [enum: apps, users, admins] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | * Current-Page - * Page-Items - * Total-Count - * Total-Pages - * Link - * Before-Cursor - * After-Cursor - |
401 | Unauthorized | - |
removeRoleAdmins(roleId, removeRoleUsersRequest)
Remove Role Admins
Remove Role Admins
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
RemoveRoleUsersRequest removeRoleUsersRequest = new RemoveRoleUsersRequest(); // RemoveRoleUsersRequest |
try {
apiInstance.removeRoleAdmins(roleId, removeRoleUsersRequest);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#removeRoleAdmins");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
roleId | String | Set to the id of the role you want to return. | |
removeRoleUsersRequest | RemoveRoleUsersRequest |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | NO CONTENT | - |
401 | Unauthorized | - |
404 | Not Found | - |
removeRoleUsers(roleId, removeRoleUsersRequest)
Remove Role Users
Remove Role Users
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
RemoveRoleUsersRequest removeRoleUsersRequest = new RemoveRoleUsersRequest(); // RemoveRoleUsersRequest |
try {
apiInstance.removeRoleUsers(roleId, removeRoleUsersRequest);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#removeRoleUsers");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
roleId | String | Set to the id of the role you want to return. | |
removeRoleUsersRequest | RemoveRoleUsersRequest |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | NO CONTENT | - |
401 | Unauthorized | - |
404 | Not Found | - |
List<CreateRole201ResponseInner> setRoleApps(roleId, requestBody)
Set Role Apps
Set Role Apps
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
List<Integer> requestBody = Arrays.asList(); // List<Integer> |
try {
List<CreateRole201ResponseInner> result = apiInstance.setRoleApps(roleId, requestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#setRoleApps");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
roleId | String | Set to the id of the role you want to return. | |
requestBody | List<Integer> |
List<CreateRole201ResponseInner>
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | The response returns an array of app IDs sent in the request. | - |
401 | Unauthorized | - |
404 | Not Found | - |
UpdateRole200Response updateRole(roleId, role)
Update Role
Update Role
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.RolesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
RolesApi apiInstance = new RolesApi(defaultClient);
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
Role role = new Role(); // Role |
try {
UpdateRole200Response result = apiInstance.updateRole(roleId, role);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RolesApi#updateRole");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
roleId | String | Set to the id of the role you want to return. | |
role | Role | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
422 | Unprocessable Entity | - |