Skip to content

Latest commit

 

History

History
1107 lines (863 loc) · 37.1 KB

RolesApi.md

File metadata and controls

1107 lines (863 loc) · 37.1 KB

RolesApi

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

addRoleAdmins

List<CreateRole201ResponseInner> addRoleAdmins(roleId, requestBody)

Add Role Admins

Add Role Admins

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
roleId String Set to the id of the role you want to return.
requestBody List<Integer>

Return type

List<CreateRole201ResponseInner>

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -

addRoleUsers

List<CreateRole201ResponseInner> addRoleUsers(roleId, requestBody)

Add Role Users

Add Role Users

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
roleId String Set to the id of the role you want to return.
requestBody List<Integer>

Return type

List<CreateRole201ResponseInner>

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -
422 Unprocessable Entity -

createRole

List<CreateRole201ResponseInner> createRole(role)

Create Role

Create Role

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
role Role [optional]

Return type

List<CreateRole201ResponseInner>

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 CREATED -
401 Unauthorized -

deleteRole

deleteRole(roleId)

Delete Role by ID

Delete Role

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
roleId String Set to the id of the role you want to return.

Return type

null (empty response body)

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 NO CONTENT -
401 Unauthorized -
403 Forbidden -
404 Not Found -

getRole

Role getRole(roleId)

Get Role by ID

Get Role

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
roleId String Set to the id of the role you want to return.

Return type

Role

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -
404 Not Found -

getRoleAdmins

List<User> getRoleAdmins(roleId, limit, page, cursor, name, includeUnassigned)

Get Role Admins

Get Role Admins

Example

// 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();
    }
  }
}

Parameters

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]

Return type

List<User>

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: applcation/json, application/json

HTTP response details

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 -

getRoleApps

List<GetRoleApps200ResponseInner> getRoleApps(roleId, limit, page, cursor, assigned)

Get all Apps assigned to Role

Get Role Apps

Example

// 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();
    }
  }
}

Parameters

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]

Return type

List<GetRoleApps200ResponseInner>

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: applcation/json, application/json

HTTP response details

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 -

getRoleById

GetRoleById200Response getRoleById(roleId)

Get Role by ID

Get Role By ID

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
roleId String Set to the id of the role you want to return.

Return type

GetRoleById200Response

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -

getRoleByName

GetRoleByName200Response getRoleByName(name)

Get Role by Name

Get Role by Name

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
name String [optional]

Return type

GetRoleByName200Response

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad Request -
401 Unauthorized -

getRoleUsers

List<User> getRoleUsers(roleId, limit, page, cursor, name, includeUnassigned)

Get Role Users

Get Role Users

Example

// 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();
    }
  }
}

Parameters

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]

Return type

List<User>

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: applcation/json, application/json

HTTP response details

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 -

listRoles

List<Role> listRoles(limit, page, cursor, roleName, appId, appName, fields)

List Roles

List Roles

Example

// 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();
    }
  }
}

Parameters

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]

Return type

List<Role>

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK * Current-Page -
* Page-Items -
* Total-Count -
* Total-Pages -
* Link -
* Before-Cursor -
* After-Cursor -
401 Unauthorized -

removeRoleAdmins

removeRoleAdmins(roleId, removeRoleUsersRequest)

Remove Role Admins

Remove Role Admins

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
roleId String Set to the id of the role you want to return.
removeRoleUsersRequest RemoveRoleUsersRequest

Return type

null (empty response body)

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 NO CONTENT -
401 Unauthorized -
404 Not Found -

removeRoleUsers

removeRoleUsers(roleId, removeRoleUsersRequest)

Remove Role Users

Remove Role Users

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
roleId String Set to the id of the role you want to return.
removeRoleUsersRequest RemoveRoleUsersRequest

Return type

null (empty response body)

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 NO CONTENT -
401 Unauthorized -
404 Not Found -

setRoleApps

List<CreateRole201ResponseInner> setRoleApps(roleId, requestBody)

Set Role Apps

Set Role Apps

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
roleId String Set to the id of the role you want to return.
requestBody List<Integer>

Return type

List<CreateRole201ResponseInner>

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The response returns an array of app IDs sent in the request. -
401 Unauthorized -
404 Not Found -

updateRole

UpdateRole200Response updateRole(roleId, role)

Update Role

Update Role

Example

// 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();
    }
  }
}

Parameters

Name Type Description Notes
roleId String Set to the id of the role you want to return.
role Role [optional]

Return type

UpdateRole200Response

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
401 Unauthorized -
422 Unprocessable Entity -