Package com.okta.sdk.resource.api
Class PolicyApi
java.lang.Object
com.okta.sdk.resource.api.PolicyApi
@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 PolicyApi
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivatePolicy(String policyId) Activate a policy Activates a policyvoidactivatePolicy(String policyId, Map<String, String> additionalHeaders) Activate a policy Activates a policyvoidactivatePolicyRule(String policyId, String ruleId) Activate a policy rule Activates a policy rule identified by `policyId` and `ruleId`voidActivate a policy rule Activates a policy rule identified by `policyId` and `ruleId`clonePolicy(String policyId) Clone an existing policy Clones an existing policyclonePolicy(String policyId, Map<String, String> additionalHeaders) Clone an existing policy Clones an existing policycreatePolicy(Policy policy, Boolean activate) Create a policy Creates a policy.Create a policy Creates a policy.createPolicyRule(String policyId, PolicyRule policyRule, String limit, Boolean activate) Create a policy rule Creates a policy rule > **Note:** You can't create additional rules for the `PROFILE_ENROLLMENT` or `POST_AUTH_SESSION` policies.createPolicyRule(String policyId, PolicyRule policyRule, String limit, Boolean activate, Map<String, String> additionalHeaders) Create a policy rule Creates a policy rule > **Note:** You can't create additional rules for the `PROFILE_ENROLLMENT` or `POST_AUTH_SESSION` policies.createPolicySimulation(List<SimulatePolicyBody> simulatePolicy, String expand) Create a policy simulation Creates a policy or policy rule simulation.createPolicySimulation(List<SimulatePolicyBody> simulatePolicy, String expand, Map<String, String> additionalHeaders) Create a policy simulation Creates a policy or policy rule simulation.createPolicySimulationPaged(List<SimulatePolicyBody> simulatePolicy, String expand) Create a policy simulation (Paginated) Creates a policy or policy rule simulation.createPolicySimulationPaged(List<SimulatePolicyBody> simulatePolicy, String expand, Map<String, String> additionalHeaders) Create a policy simulation (Paginated with additional headers) Creates a policy or policy rule simulation.voiddeactivatePolicy(String policyId) Deactivate a policy Deactivates a policyvoiddeactivatePolicy(String policyId, Map<String, String> additionalHeaders) Deactivate a policy Deactivates a policyvoiddeactivatePolicyRule(String policyId, String ruleId) Deactivate a policy rule Deactivates a policy rule identified by `policyId` and `ruleId`voidDeactivate a policy rule Deactivates a policy rule identified by `policyId` and `ruleId`voiddeletePolicy(String policyId) Delete a policy Deletes a policyvoiddeletePolicy(String policyId, Map<String, String> additionalHeaders) Delete a policy Deletes a policyvoiddeletePolicyResourceMapping(String policyId, String mappingId) Delete a policy resource mapping Deletes the resource mapping for a policy identified by `policyId` and `mappingId`voiddeletePolicyResourceMapping(String policyId, String mappingId, Map<String, String> additionalHeaders) Delete a policy resource mapping Deletes the resource mapping for a policy identified by `policyId` and `mappingId`voiddeletePolicyRule(String policyId, String ruleId) Delete a policy rule Deletes a policy rule identified by `policyId` and `ruleId`voidDelete a policy rule Deletes a policy rule identified by `policyId` and `ruleId`protected static com.fasterxml.jackson.databind.ObjectMapperRetrieve a policy Retrieves a policyRetrieve a policy Retrieves a policygetPolicyMapping(String policyId, String mappingId) Retrieve a policy resource mapping Retrieves a resource mapping for a policy identified by `policyId` and `mappingId`Retrieve a policy resource mapping Retrieves a resource mapping for a policy identified by `policyId` and `mappingId`getPolicyRule(String policyId, String ruleId) Retrieve a policy rule Retrieves a policy ruleRetrieve a policy rule Retrieves a policy rulelistPolicies(String type, String status, String q, String expand, String sortBy, String limit, String resourceId, String after) List all policies Lists all policies with the specified typelistPolicies(String type, String status, String q, String expand, String sortBy, String limit, String resourceId, String after, Map<String, String> additionalHeaders) List all policies Lists all policies with the specified typelistPoliciesPaged(String type, String status, String q, String expand, String sortBy, String limit, String resourceId, String after) List all policies (Paginated) Lists all policies with the specified type This method returns a lazy, paginated iterable that automatically handles pagination.listPoliciesPaged(String type, String status, String q, String expand, String sortBy, String limit, String resourceId, String after, Map<String, String> additionalHeaders) List all policies (Paginated with additional headers) Lists all policies with the specified type This method returns a lazy, paginated iterable that automatically handles pagination.listPolicyApps(String policyId) Deprecated.listPolicyApps(String policyId, Map<String, String> additionalHeaders) Deprecated.listPolicyAppsPaged(String policyId) List all apps mapped to a policy (Paginated) Lists all applications mapped to a policy identified by `policyId` > **Note:** Use [List all resources mapped to a Policy](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Policy/#tag/Policy/operation/listPolicyMappings) to list all applications mapped to a policy.listPolicyAppsPaged(String policyId, Map<String, String> additionalHeaders) List all apps mapped to a policy (Paginated with additional headers) Lists all applications mapped to a policy identified by `policyId` > **Note:** Use [List all resources mapped to a Policy](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Policy/#tag/Policy/operation/listPolicyMappings) to list all applications mapped to a policy.listPolicyMappings(String policyId) List all resources mapped to a policy Lists all resources mapped to a policy identified by `policyId`listPolicyMappings(String policyId, Map<String, String> additionalHeaders) List all resources mapped to a policy Lists all resources mapped to a policy identified by `policyId`listPolicyMappingsPaged(String policyId) List all resources mapped to a policy (Paginated) Lists all resources mapped to a policy identified by `policyId` This method returns a lazy, paginated iterable that automatically handles pagination.listPolicyMappingsPaged(String policyId, Map<String, String> additionalHeaders) List all resources mapped to a policy (Paginated with additional headers) Lists all resources mapped to a policy identified by `policyId` This method returns a lazy, paginated iterable that automatically handles pagination.listPolicyRules(String policyId, String limit) List all policy rules Lists all policy rulesList all policy rules Lists all policy ruleslistPolicyRulesPaged(String policyId, String limit) List all policy rules (Paginated) Lists all policy rules This method returns a lazy, paginated iterable that automatically handles pagination.List all policy rules (Paginated with additional headers) Lists all policy rules This method returns a lazy, paginated iterable that automatically handles pagination.mapResourceToPolicy(String policyId, PolicyMappingRequest policyMappingRequest) Map a resource to a policy Maps a resource to a policy identified by `policyId` > **Note:** Use the [Assign an app sign-in policy](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/ApplicationPolicies/#tag/ApplicationPolicies/operation/assignApplicationPolicy) endpoint to assign an app sign-in policy to an app.mapResourceToPolicy(String policyId, PolicyMappingRequest policyMappingRequest, Map<String, String> additionalHeaders) Map a resource to a policy Maps a resource to a policy identified by `policyId` > **Note:** Use the [Assign an app sign-in policy](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/ApplicationPolicies/#tag/ApplicationPolicies/operation/assignApplicationPolicy) endpoint to assign an app sign-in policy to an app.replacePolicy(String policyId, Policy policy) Replace a policy Replaces the properties of a policy identified by `policyId`Replace a policy Replaces the properties of a policy identified by `policyId`replacePolicyRule(String policyId, String ruleId, PolicyRule policyRule) Replace a policy rule Replaces the properties for a policy rule identified by `policyId` and `ruleId`replacePolicyRule(String policyId, String ruleId, PolicyRule policyRule, Map<String, String> additionalHeaders) Replace a policy rule Replaces the properties for a policy rule identified by `policyId` and `ruleId`voidsetApiClient(ApiClient apiClient)
-
Constructor Details
-
PolicyApi
public PolicyApi() -
PolicyApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
activatePolicy
Activate a policy Activates a policy- Parameters:
policyId- `id` of the Policy (required)- Throws:
ApiException- if fails to make API call
-
activatePolicy
public void activatePolicy(String policyId, Map<String, String> additionalHeaders) throws ApiExceptionActivate a policy Activates a policy- Parameters:
policyId- `id` of the Policy (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
activatePolicyRule
Activate a policy rule Activates a policy rule identified by `policyId` and `ruleId`- Parameters:
policyId- `id` of the Policy (required)ruleId- `id` of the policy rule (required)- Throws:
ApiException- if fails to make API call
-
activatePolicyRule
public void activatePolicyRule(String policyId, String ruleId, Map<String, String> additionalHeaders) throws ApiExceptionActivate a policy rule Activates a policy rule identified by `policyId` and `ruleId`- Parameters:
policyId- `id` of the Policy (required)ruleId- `id` of the policy rule (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
clonePolicy
Clone an existing policy Clones an existing policy- Parameters:
policyId- `id` of the Policy (required)- Returns:
- Policy
- Throws:
ApiException- if fails to make API call
-
clonePolicy
public Policy clonePolicy(String policyId, Map<String, String> additionalHeaders) throws ApiExceptionClone an existing policy Clones an existing policy- Parameters:
policyId- `id` of the Policy (required)additionalHeaders- additionalHeaders for this call- Returns:
- Policy
- Throws:
ApiException- if fails to make API call
-
createPolicy
Create a policy Creates a policy. There are many types of policies that you can create. See [Policies](https://developer.okta.com/docs/concepts/policies/) for an overview of the types of policies available and links to more indepth information.- Parameters:
policy- (required)activate- This query parameter is only valid for Classic Engine orgs. (optional, default to true)- Returns:
- Policy
- Throws:
ApiException- if fails to make API call
-
createPolicy
public Policy createPolicy(Policy policy, Boolean activate, Map<String, String> additionalHeaders) throws ApiExceptionCreate a policy Creates a policy. There are many types of policies that you can create. See [Policies](https://developer.okta.com/docs/concepts/policies/) for an overview of the types of policies available and links to more indepth information.- Parameters:
policy- (required)activate- This query parameter is only valid for Classic Engine orgs. (optional, default to true)additionalHeaders- additionalHeaders for this call- Returns:
- Policy
- Throws:
ApiException- if fails to make API call
-
createPolicyRule
public PolicyRule createPolicyRule(String policyId, PolicyRule policyRule, String limit, Boolean activate) throws ApiException Create a policy rule Creates a policy rule > **Note:** You can't create additional rules for the `PROFILE_ENROLLMENT` or `POST_AUTH_SESSION` policies.- Parameters:
policyId- `id` of the Policy (required)policyRule- (required)limit- Defines the number of policy rules returned. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)activate- Set this parameter to `false` to create an `INACTIVE` rule. (optional, default to true)- Returns:
- PolicyRule
- Throws:
ApiException- if fails to make API call
-
createPolicyRule
public PolicyRule createPolicyRule(String policyId, PolicyRule policyRule, String limit, Boolean activate, Map<String, String> additionalHeaders) throws ApiExceptionCreate a policy rule Creates a policy rule > **Note:** You can't create additional rules for the `PROFILE_ENROLLMENT` or `POST_AUTH_SESSION` policies.- Parameters:
policyId- `id` of the Policy (required)policyRule- (required)limit- Defines the number of policy rules returned. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)activate- Set this parameter to `false` to create an `INACTIVE` rule. (optional, default to true)additionalHeaders- additionalHeaders for this call- Returns:
- PolicyRule
- Throws:
ApiException- if fails to make API call
-
createPolicySimulation
public List<SimulatePolicyEvaluations> createPolicySimulation(List<SimulatePolicyBody> simulatePolicy, String expand) throws ApiException Create a policy simulation Creates a policy or policy rule simulation. The access simulation evaluates policy and policy rules based on the existing policy rule configuration. The evaluation result simulates what the real-world authentication flow is and what policy rules have been applied or matched to the authentication flow.- Parameters:
simulatePolicy- (required)expand- Use `expand=EVALUATED` to include a list of evaluated but not matched policies and policy rules. Use `expand=RULE` to include details about why a rule condition wasn't matched. (optional)- Returns:
- List<SimulatePolicyEvaluations>
- Throws:
ApiException- if fails to make API call
-
createPolicySimulation
public List<SimulatePolicyEvaluations> createPolicySimulation(List<SimulatePolicyBody> simulatePolicy, String expand, Map<String, String> additionalHeaders) throws ApiExceptionCreate a policy simulation Creates a policy or policy rule simulation. The access simulation evaluates policy and policy rules based on the existing policy rule configuration. The evaluation result simulates what the real-world authentication flow is and what policy rules have been applied or matched to the authentication flow.- Parameters:
simulatePolicy- (required)expand- Use `expand=EVALUATED` to include a list of evaluated but not matched policies and policy rules. Use `expand=RULE` to include details about why a rule condition wasn't matched. (optional)additionalHeaders- additionalHeaders for this call- Returns:
- List<SimulatePolicyEvaluations>
- Throws:
ApiException- if fails to make API call
-
createPolicySimulationPaged
public Iterable<SimulatePolicyEvaluations> createPolicySimulationPaged(List<SimulatePolicyBody> simulatePolicy, String expand) Create a policy simulation (Paginated) Creates a policy or policy rule simulation. The access simulation evaluates policy and policy rules based on the existing policy rule configuration. The evaluation result simulates what the real-world authentication flow is and what policy rules have been applied or matched to the authentication flow. 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:
simulatePolicy- (required)expand- Use `expand=EVALUATED` to include a list of evaluated but not matched policies and policy rules. Use `expand=RULE` to include details about why a rule condition wasn't matched. (optional)- Returns:
- Iterable<SimulatePolicyEvaluations> lazy iterable over all pages
-
createPolicySimulationPaged
public Iterable<SimulatePolicyEvaluations> createPolicySimulationPaged(List<SimulatePolicyBody> simulatePolicy, String expand, Map<String, String> additionalHeaders) Create a policy simulation (Paginated with additional headers) Creates a policy or policy rule simulation. The access simulation evaluates policy and policy rules based on the existing policy rule configuration. The evaluation result simulates what the real-world authentication flow is and what policy rules have been applied or matched to the authentication flow. This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.- Parameters:
simulatePolicy- (required)expand- Use `expand=EVALUATED` to include a list of evaluated but not matched policies and policy rules. Use `expand=RULE` to include details about why a rule condition wasn't matched. (optional)additionalHeaders- additional headers for this call- Returns:
- Iterable<SimulatePolicyEvaluations> lazy iterable over all pages
-
deactivatePolicy
Deactivate a policy Deactivates a policy- Parameters:
policyId- `id` of the Policy (required)- Throws:
ApiException- if fails to make API call
-
deactivatePolicy
public void deactivatePolicy(String policyId, Map<String, String> additionalHeaders) throws ApiExceptionDeactivate a policy Deactivates a policy- Parameters:
policyId- `id` of the Policy (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
deactivatePolicyRule
Deactivate a policy rule Deactivates a policy rule identified by `policyId` and `ruleId`- Parameters:
policyId- `id` of the Policy (required)ruleId- `id` of the policy rule (required)- Throws:
ApiException- if fails to make API call
-
deactivatePolicyRule
public void deactivatePolicyRule(String policyId, String ruleId, Map<String, String> additionalHeaders) throws ApiExceptionDeactivate a policy rule Deactivates a policy rule identified by `policyId` and `ruleId`- Parameters:
policyId- `id` of the Policy (required)ruleId- `id` of the policy rule (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
deletePolicy
Delete a policy Deletes a policy- Parameters:
policyId- `id` of the Policy (required)- Throws:
ApiException- if fails to make API call
-
deletePolicy
Delete a policy Deletes a policy- Parameters:
policyId- `id` of the Policy (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
deletePolicyResourceMapping
Delete a policy resource mapping Deletes the resource mapping for a policy identified by `policyId` and `mappingId`- Parameters:
policyId- `id` of the Policy (required)mappingId- `id` of the policy resource Mapping (required)- Throws:
ApiException- if fails to make API call
-
deletePolicyResourceMapping
public void deletePolicyResourceMapping(String policyId, String mappingId, Map<String, String> additionalHeaders) throws ApiExceptionDelete a policy resource mapping Deletes the resource mapping for a policy identified by `policyId` and `mappingId`- Parameters:
policyId- `id` of the Policy (required)mappingId- `id` of the policy resource Mapping (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
deletePolicyRule
Delete a policy rule Deletes a policy rule identified by `policyId` and `ruleId`- Parameters:
policyId- `id` of the Policy (required)ruleId- `id` of the policy rule (required)- Throws:
ApiException- if fails to make API call
-
deletePolicyRule
public void deletePolicyRule(String policyId, String ruleId, Map<String, String> additionalHeaders) throws ApiExceptionDelete a policy rule Deletes a policy rule identified by `policyId` and `ruleId`- Parameters:
policyId- `id` of the Policy (required)ruleId- `id` of the policy rule (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
getPolicy
Retrieve a policy Retrieves a policy- Parameters:
policyId- `id` of the Policy (required)expand- (optional, default to )- Returns:
- Policy
- Throws:
ApiException- if fails to make API call
-
getPolicy
public Policy getPolicy(String policyId, String expand, Map<String, String> additionalHeaders) throws ApiExceptionRetrieve a policy Retrieves a policy- Parameters:
policyId- `id` of the Policy (required)expand- (optional, default to )additionalHeaders- additionalHeaders for this call- Returns:
- Policy
- Throws:
ApiException- if fails to make API call
-
getPolicyMapping
Retrieve a policy resource mapping Retrieves a resource mapping for a policy identified by `policyId` and `mappingId`- Parameters:
policyId- `id` of the Policy (required)mappingId- `id` of the policy resource Mapping (required)- Returns:
- PolicyMapping
- Throws:
ApiException- if fails to make API call
-
getPolicyMapping
public PolicyMapping getPolicyMapping(String policyId, String mappingId, Map<String, String> additionalHeaders) throws ApiExceptionRetrieve a policy resource mapping Retrieves a resource mapping for a policy identified by `policyId` and `mappingId`- Parameters:
policyId- `id` of the Policy (required)mappingId- `id` of the policy resource Mapping (required)additionalHeaders- additionalHeaders for this call- Returns:
- PolicyMapping
- Throws:
ApiException- if fails to make API call
-
getPolicyRule
Retrieve a policy rule Retrieves a policy rule- Parameters:
policyId- `id` of the Policy (required)ruleId- `id` of the policy rule (required)- Returns:
- PolicyRule
- Throws:
ApiException- if fails to make API call
-
getPolicyRule
public PolicyRule getPolicyRule(String policyId, String ruleId, Map<String, String> additionalHeaders) throws ApiExceptionRetrieve a policy rule Retrieves a policy rule- Parameters:
policyId- `id` of the Policy (required)ruleId- `id` of the policy rule (required)additionalHeaders- additionalHeaders for this call- Returns:
- PolicyRule
- Throws:
ApiException- if fails to make API call
-
listPolicies
public List<Policy> listPolicies(String type, String status, String q, String expand, String sortBy, String limit, String resourceId, String after) throws ApiException List all policies Lists all policies with the specified type- Parameters:
type- Specifies the type of policy to return. The following policy types are available only with the Okta Identity Engine - `ACCESS_POLICY`, <x-lifecycle class=\"ea\"></x-lifecycle> `DEVICE_SIGNAL_COLLECTION`, `PROFILE_ENROLLMENT`, `POST_AUTH_SESSION` and `ENTITY_RISK`. (required)status- Refines the query by the `status` of the policy - `ACTIVE` or `INACTIVE` (optional)q- Refines the query by policy name prefix (startWith method) passed in as `q=string` (optional)expand- (optional, default to )sortBy- Refines the query by sorting on the policy `name` in ascending order (optional)limit- Defines the number of policies returned, see [Pagination](https://developer.okta.com/docs/api/#pagination) (optional)resourceId- Reference to the associated authorization server (optional)after- End page cursor for pagination, see [Pagination](https://developer.okta.com/docs/api/#pagination) (optional)- Returns:
- List<Policy>
- Throws:
ApiException- if fails to make API call
-
listPolicies
public List<Policy> listPolicies(String type, String status, String q, String expand, String sortBy, String limit, String resourceId, String after, Map<String, String> additionalHeaders) throws ApiExceptionList all policies Lists all policies with the specified type- Parameters:
type- Specifies the type of policy to return. The following policy types are available only with the Okta Identity Engine - `ACCESS_POLICY`, <x-lifecycle class=\"ea\"></x-lifecycle> `DEVICE_SIGNAL_COLLECTION`, `PROFILE_ENROLLMENT`, `POST_AUTH_SESSION` and `ENTITY_RISK`. (required)status- Refines the query by the `status` of the policy - `ACTIVE` or `INACTIVE` (optional)q- Refines the query by policy name prefix (startWith method) passed in as `q=string` (optional)expand- (optional, default to )sortBy- Refines the query by sorting on the policy `name` in ascending order (optional)limit- Defines the number of policies returned, see [Pagination](https://developer.okta.com/docs/api/#pagination) (optional)resourceId- Reference to the associated authorization server (optional)after- End page cursor for pagination, see [Pagination](https://developer.okta.com/docs/api/#pagination) (optional)additionalHeaders- additionalHeaders for this call- Returns:
- List<Policy>
- Throws:
ApiException- if fails to make API call
-
listPoliciesPaged
public Iterable<Policy> listPoliciesPaged(String type, String status, String q, String expand, String sortBy, String limit, String resourceId, String after) List all policies (Paginated) Lists all policies with the specified type 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:
type- Specifies the type of policy to return. The following policy types are available only with the Okta Identity Engine - `ACCESS_POLICY`, <x-lifecycle class=\"ea\"></x-lifecycle> `DEVICE_SIGNAL_COLLECTION`, `PROFILE_ENROLLMENT`, `POST_AUTH_SESSION` and `ENTITY_RISK`. (required)status- Refines the query by the `status` of the policy - `ACTIVE` or `INACTIVE` (optional)q- Refines the query by policy name prefix (startWith method) passed in as `q=string` (optional)expand- (optional, default to )sortBy- Refines the query by sorting on the policy `name` in ascending order (optional)limit- Defines the number of policies returned, see [Pagination](https://developer.okta.com/docs/api/#pagination) (optional)resourceId- Reference to the associated authorization server (optional)after- End page cursor for pagination, see [Pagination](https://developer.okta.com/docs/api/#pagination) (optional)- Returns:
- Iterable<Policy> lazy iterable over all pages
-
listPoliciesPaged
public Iterable<Policy> listPoliciesPaged(String type, String status, String q, String expand, String sortBy, String limit, String resourceId, String after, Map<String, String> additionalHeaders) List all policies (Paginated with additional headers) Lists all policies with the specified type This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.- Parameters:
type- Specifies the type of policy to return. The following policy types are available only with the Okta Identity Engine - `ACCESS_POLICY`, <x-lifecycle class=\"ea\"></x-lifecycle> `DEVICE_SIGNAL_COLLECTION`, `PROFILE_ENROLLMENT`, `POST_AUTH_SESSION` and `ENTITY_RISK`. (required)status- Refines the query by the `status` of the policy - `ACTIVE` or `INACTIVE` (optional)q- Refines the query by policy name prefix (startWith method) passed in as `q=string` (optional)expand- (optional, default to )sortBy- Refines the query by sorting on the policy `name` in ascending order (optional)limit- Defines the number of policies returned, see [Pagination](https://developer.okta.com/docs/api/#pagination) (optional)resourceId- Reference to the associated authorization server (optional)after- End page cursor for pagination, see [Pagination](https://developer.okta.com/docs/api/#pagination) (optional)additionalHeaders- additional headers for this call- Returns:
- Iterable<Policy> lazy iterable over all pages
-
listPolicyApps
Deprecated.List all apps mapped to a policy Lists all applications mapped to a policy identified by `policyId` > **Note:** Use [List all resources mapped to a Policy](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Policy/#tag/Policy/operation/listPolicyMappings) to list all applications mapped to a policy.- Parameters:
policyId- `id` of the Policy (required)- Returns:
- List<Application>
- Throws:
ApiException- if fails to make API call
-
listPolicyApps
@Deprecated public List<Application> listPolicyApps(String policyId, Map<String, String> additionalHeaders) throws ApiExceptionDeprecated.List all apps mapped to a policy Lists all applications mapped to a policy identified by `policyId` > **Note:** Use [List all resources mapped to a Policy](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Policy/#tag/Policy/operation/listPolicyMappings) to list all applications mapped to a policy.- Parameters:
policyId- `id` of the Policy (required)additionalHeaders- additionalHeaders for this call- Returns:
- List<Application>
- Throws:
ApiException- if fails to make API call
-
listPolicyAppsPaged
List all apps mapped to a policy (Paginated) Lists all applications mapped to a policy identified by `policyId` > **Note:** Use [List all resources mapped to a Policy](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Policy/#tag/Policy/operation/listPolicyMappings) to list all applications mapped to a policy. 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:
policyId- `id` of the Policy (required)- Returns:
- Iterable<Application> lazy iterable over all pages
-
listPolicyAppsPaged
public Iterable<Application> listPolicyAppsPaged(String policyId, Map<String, String> additionalHeaders) List all apps mapped to a policy (Paginated with additional headers) Lists all applications mapped to a policy identified by `policyId` > **Note:** Use [List all resources mapped to a Policy](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Policy/#tag/Policy/operation/listPolicyMappings) to list all applications mapped to a policy. This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.- Parameters:
policyId- `id` of the Policy (required)additionalHeaders- additional headers for this call- Returns:
- Iterable<Application> lazy iterable over all pages
-
listPolicyMappings
List all resources mapped to a policy Lists all resources mapped to a policy identified by `policyId`- Parameters:
policyId- `id` of the Policy (required)- Returns:
- List<PolicyMapping>
- Throws:
ApiException- if fails to make API call
-
listPolicyMappings
public List<PolicyMapping> listPolicyMappings(String policyId, Map<String, String> additionalHeaders) throws ApiExceptionList all resources mapped to a policy Lists all resources mapped to a policy identified by `policyId`- Parameters:
policyId- `id` of the Policy (required)additionalHeaders- additionalHeaders for this call- Returns:
- List<PolicyMapping>
- Throws:
ApiException- if fails to make API call
-
listPolicyMappingsPaged
List all resources mapped to a policy (Paginated) Lists all resources mapped to a policy identified by `policyId` 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:
policyId- `id` of the Policy (required)- Returns:
- Iterable<PolicyMapping> lazy iterable over all pages
-
listPolicyMappingsPaged
public Iterable<PolicyMapping> listPolicyMappingsPaged(String policyId, Map<String, String> additionalHeaders) List all resources mapped to a policy (Paginated with additional headers) Lists all resources mapped to a policy identified by `policyId` This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.- Parameters:
policyId- `id` of the Policy (required)additionalHeaders- additional headers for this call- Returns:
- Iterable<PolicyMapping> lazy iterable over all pages
-
listPolicyRules
List all policy rules Lists all policy rules- Parameters:
policyId- `id` of the Policy (required)limit- Defines the number of policy rules returned. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)- Returns:
- List<PolicyRule>
- Throws:
ApiException- if fails to make API call
-
listPolicyRules
public List<PolicyRule> listPolicyRules(String policyId, String limit, Map<String, String> additionalHeaders) throws ApiExceptionList all policy rules Lists all policy rules- Parameters:
policyId- `id` of the Policy (required)limit- Defines the number of policy rules returned. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)additionalHeaders- additionalHeaders for this call- Returns:
- List<PolicyRule>
- Throws:
ApiException- if fails to make API call
-
listPolicyRulesPaged
List all policy rules (Paginated) Lists all policy rules 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:
policyId- `id` of the Policy (required)limit- Defines the number of policy rules returned. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)- Returns:
- Iterable<PolicyRule> lazy iterable over all pages
-
listPolicyRulesPaged
public Iterable<PolicyRule> listPolicyRulesPaged(String policyId, String limit, Map<String, String> additionalHeaders) List all policy rules (Paginated with additional headers) Lists all policy rules This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.- Parameters:
policyId- `id` of the Policy (required)limit- Defines the number of policy rules returned. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)additionalHeaders- additional headers for this call- Returns:
- Iterable<PolicyRule> lazy iterable over all pages
-
mapResourceToPolicy
public PolicyMapping mapResourceToPolicy(String policyId, PolicyMappingRequest policyMappingRequest) throws ApiException Map a resource to a policy Maps a resource to a policy identified by `policyId` > **Note:** Use the [Assign an app sign-in policy](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/ApplicationPolicies/#tag/ApplicationPolicies/operation/assignApplicationPolicy) endpoint to assign an app sign-in policy to an app.- Parameters:
policyId- `id` of the Policy (required)policyMappingRequest- (required)- Returns:
- PolicyMapping
- Throws:
ApiException- if fails to make API call
-
mapResourceToPolicy
public PolicyMapping mapResourceToPolicy(String policyId, PolicyMappingRequest policyMappingRequest, Map<String, String> additionalHeaders) throws ApiExceptionMap a resource to a policy Maps a resource to a policy identified by `policyId` > **Note:** Use the [Assign an app sign-in policy](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/ApplicationPolicies/#tag/ApplicationPolicies/operation/assignApplicationPolicy) endpoint to assign an app sign-in policy to an app.- Parameters:
policyId- `id` of the Policy (required)policyMappingRequest- (required)additionalHeaders- additionalHeaders for this call- Returns:
- PolicyMapping
- Throws:
ApiException- if fails to make API call
-
replacePolicy
Replace a policy Replaces the properties of a policy identified by `policyId`- Parameters:
policyId- `id` of the Policy (required)policy- (required)- Returns:
- Policy
- Throws:
ApiException- if fails to make API call
-
replacePolicy
public Policy replacePolicy(String policyId, Policy policy, Map<String, String> additionalHeaders) throws ApiExceptionReplace a policy Replaces the properties of a policy identified by `policyId`- Parameters:
policyId- `id` of the Policy (required)policy- (required)additionalHeaders- additionalHeaders for this call- Returns:
- Policy
- Throws:
ApiException- if fails to make API call
-
replacePolicyRule
public PolicyRule replacePolicyRule(String policyId, String ruleId, PolicyRule policyRule) throws ApiException Replace a policy rule Replaces the properties for a policy rule identified by `policyId` and `ruleId`- Parameters:
policyId- `id` of the Policy (required)ruleId- `id` of the policy rule (required)policyRule- (required)- Returns:
- PolicyRule
- Throws:
ApiException- if fails to make API call
-
replacePolicyRule
public PolicyRule replacePolicyRule(String policyId, String ruleId, PolicyRule policyRule, Map<String, String> additionalHeaders) throws ApiExceptionReplace a policy rule Replaces the properties for a policy rule identified by `policyId` and `ruleId`- Parameters:
policyId- `id` of the Policy (required)ruleId- `id` of the policy rule (required)policyRule- (required)additionalHeaders- additionalHeaders for this call- Returns:
- PolicyRule
- Throws:
ApiException- if fails to make API call
-
getObjectMapper
protected static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-