Class PolicyApi

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

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2024-09-23T08:35:59.300824-05:00[America/Chicago]", comments="Generator version: 7.8.0") public class PolicyApi extends Object
  • Constructor Details

    • PolicyApi

      public PolicyApi()
    • PolicyApi

      public PolicyApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • activatePolicy

      public void activatePolicy(String policyId) throws ApiException
      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 ApiException
      Activate 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

      public void activatePolicyRule(String policyId, String ruleId) throws ApiException
      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 ApiException
      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)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • clonePolicy

      public Policy clonePolicy(String policyId) throws ApiException
      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 ApiException
      Clone 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

      public Policy createPolicy(Policy policy, Boolean activate) throws ApiException
      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 then 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 ApiException
      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 then 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 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)
      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 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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      List<SimulatePolicyEvaluations>
      Throws:
      ApiException - if fails to make API call
    • deactivatePolicy

      public void deactivatePolicy(String policyId) throws ApiException
      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 ApiException
      Deactivate 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

      public void deactivatePolicyRule(String policyId, String ruleId) throws ApiException
      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 ApiException
      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)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • deletePolicy

      public void deletePolicy(String policyId) throws ApiException
      Delete a Policy Deletes a policy
      Parameters:
      policyId - `id` of the Policy (required)
      Throws:
      ApiException - if fails to make API call
    • deletePolicy

      public void deletePolicy(String policyId, Map<String,String> additionalHeaders) throws ApiException
      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

      public void deletePolicyResourceMapping(String policyId, String mappingId) throws ApiException
      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 ApiException
      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)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • deletePolicyRule

      public void deletePolicyRule(String policyId, String ruleId) throws ApiException
      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 ApiException
      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)
      additionalHeaders - additionalHeaders for this call
      Throws:
      ApiException - if fails to make API call
    • getPolicy

      public Policy getPolicy(String policyId, String expand) throws ApiException
      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 ApiException
      Retrieve 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

      public PolicyMapping getPolicyMapping(String policyId, String mappingId) throws ApiException
      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 ApiException
      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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      PolicyMapping
      Throws:
      ApiException - if fails to make API call
    • getPolicyRule

      public PolicyRule getPolicyRule(String policyId, String ruleId) throws ApiException
      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 ApiException
      Retrieve 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`, `PROFILE_ENROLLMENT`, `POST_AUTH_SESSION`, and `ENTITY_RISK`. The `POST_AUTH_SESSION` and `ENTITY_RISK` policy types are in <x-lifecycle class=\"ea\"></x-lifecycle>. Contact your Okta account team to enable these features. (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 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`, `PROFILE_ENROLLMENT`, `POST_AUTH_SESSION`, and `ENTITY_RISK`. The `POST_AUTH_SESSION` and `ENTITY_RISK` policy types are in <x-lifecycle class=\"ea\"></x-lifecycle>. Contact your Okta account team to enable these features. (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
    • listPolicyApps

      @Deprecated public List<Application> listPolicyApps(String policyId) throws ApiException
      Deprecated.
      List all Applications 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 ApiException
      Deprecated.
      List all Applications 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
    • listPolicyMappings

      public List<PolicyMapping> listPolicyMappings(String policyId) throws ApiException
      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 ApiException
      List 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
    • listPolicyRules

      public List<PolicyRule> listPolicyRules(String policyId, String limit) throws ApiException
      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 ApiException
      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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      List<PolicyRule>
      Throws:
      ApiException - if fails to make API call
    • 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`
      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 ApiException
      Map a resource to a Policy Maps a resource to a Policy identified by `policyId`
      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

      public Policy replacePolicy(String policyId, Policy policy) throws ApiException
      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 ApiException
      Replace 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 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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      PolicyRule
      Throws:
      ApiException - if fails to make API call
    • getObjectMapper

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