Class PoliciesClient
A client that communicates with the Okta management API.
Inherited Members
Namespace: Okta.Sdk
Assembly: Okta.Sdk.dll
Syntax
public sealed class PoliciesClient : OktaClient, IOktaClient, IPoliciesClient
Methods
ActivatePolicyAsync(String, CancellationToken)
Activates a policy.
Declaration
public Task ActivatePolicyAsync(string policyId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | policyId | |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task that represents the asynchronous operation. |
ActivatePolicyRuleAsync(String, String, CancellationToken)
Activates a policy rule.
Declaration
public Task ActivatePolicyRuleAsync(string policyId, string ruleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | policyId | |
System.String | ruleId | |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task that represents the asynchronous operation. |
AddPolicyRuleAsync(AddPasswordPolicyRuleOptions, CancellationToken)
Creates a password policy rule
Declaration
public Task<IPasswordPolicyRule> AddPolicyRuleAsync(AddPasswordPolicyRuleOptions options, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
AddPasswordPolicyRuleOptions | options | The password policy rule options. Instance of AddPasswordPolicyRuleOptions. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IPasswordPolicyRule> | The IPasswordPolicyRule response. |
AddPolicyRuleAsync(AddSignOnPolicyRuleOptions, CancellationToken)
Creates a password policy rule
Declaration
public Task<IOktaSignOnPolicyRule> AddPolicyRuleAsync(AddSignOnPolicyRuleOptions options, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
AddSignOnPolicyRuleOptions | options | The sign on policy rule options. Instance of AddSignOnPolicyRuleOptions. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IOktaSignOnPolicyRule> | The IOktaSignOnPolicyRule response. |
AddPolicyRuleAsync<T>(IPolicyRule, String, CancellationToken)
Creates a policy rule
Declaration
public Task<T> AddPolicyRuleAsync<T>(IPolicyRule policyRule, string policyId, CancellationToken cancellationToken = default(CancellationToken))
where T : class, IPolicyRule
Parameters
Type | Name | Description |
---|---|---|
IPolicyRule | policyRule | The IPolicyRule resource. |
System.String | policyId | The policy ID |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | The IPolicyRule response. |
Type Parameters
Name | Description |
---|---|
T | The policy Rule type |
CreatePolicyAsync(IPolicy, Nullable<Boolean>, CancellationToken)
Creates a policy.
Declaration
public Task<IPolicy> CreatePolicyAsync(IPolicy policy, bool? activate, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IPolicy | policy | The IPolicy resource. |
System.Nullable<System.Boolean> | activate | |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IPolicy> | The IPolicy response. |
CreatePolicyAsync<T>(IPolicy, Nullable<Boolean>, CancellationToken)
Creates a policy
Declaration
public Task<T> CreatePolicyAsync<T>(IPolicy policy, bool? activate, CancellationToken cancellationToken = default(CancellationToken))
where T : class, IPolicy
Parameters
Type | Name | Description |
---|---|---|
IPolicy | policy | The IPolicy resource. |
System.Nullable<System.Boolean> | activate | The activate flag |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | The IPolicy response. |
Type Parameters
Name | Description |
---|---|
T | The policy type |
CreatePolicyRuleAsync(IPolicyRule, String, CancellationToken)
Creates a policy rule.
Declaration
public Task<IPolicyRule> CreatePolicyRuleAsync(IPolicyRule policyRule, string policyId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IPolicyRule | policyRule | The IPolicyRule resource. |
System.String | policyId | |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IPolicyRule> | The IPolicyRule response. |
DeactivatePolicyAsync(String, CancellationToken)
Deactivates a policy.
Declaration
public Task DeactivatePolicyAsync(string policyId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | policyId | |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task that represents the asynchronous operation. |
DeactivatePolicyRuleAsync(String, String, CancellationToken)
Deactivates a policy rule.
Declaration
public Task DeactivatePolicyRuleAsync(string policyId, string ruleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | policyId | |
System.String | ruleId | |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task that represents the asynchronous operation. |
DeletePolicyAsync(String, CancellationToken)
Removes a policy.
Declaration
public Task DeletePolicyAsync(string policyId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | policyId | |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task that represents the asynchronous operation. |
DeletePolicyRuleAsync(String, String, CancellationToken)
Removes a policy rule.
Declaration
public Task DeletePolicyRuleAsync(string policyId, string ruleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | policyId | |
System.String | ruleId | |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task that represents the asynchronous operation. |
GetPolicyAsync(String, String, CancellationToken)
Gets a policy.
Declaration
public Task<IPolicy> GetPolicyAsync(string policyId, string expand = "", CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | policyId | |
System.String | expand | |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IPolicy> | The IPolicy response. |
GetPolicyAsync<T>(String, CancellationToken)
Gets a policy by id
Declaration
public Task<T> GetPolicyAsync<T>(string policyId, CancellationToken cancellationToken = default(CancellationToken))
where T : class, IPolicy
Parameters
Type | Name | Description |
---|---|---|
System.String | policyId | The policy id |
System.Threading.CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | The IPolicy response. |
Type Parameters
Name | Description |
---|---|
T | The policy type |
GetPolicyRuleAsync(String, String, CancellationToken)
Gets a policy rule.
Declaration
public Task<IPolicyRule> GetPolicyRuleAsync(string policyId, string ruleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | policyId | |
System.String | ruleId | |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IPolicyRule> | The IPolicyRule response. |
GetPolicyRuleAsync<T>(String, String, CancellationToken)
Gets a Policy Rule
Declaration
public Task<T> GetPolicyRuleAsync<T>(string policyId, string ruleId, CancellationToken cancellationToken = default(CancellationToken))
where T : class, IPolicyRule
Parameters
Type | Name | Description |
---|---|---|
System.String | policyId | The policy ID |
System.String | ruleId | The rule ID |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | The IPolicyRule response. |
Type Parameters
Name | Description |
---|---|
T | The policy Rule type |
ListPolicies(String, String, String)
Gets all policies with the specified type.
Declaration
public ICollectionClient<IPolicy> ListPolicies(string type, string status = null, string expand = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | type | |
System.String | status | |
System.String | expand |
Returns
Type | Description |
---|---|
ICollectionClient<IPolicy> | A collection of IPolicy that can be enumerated asynchronously. |
ListPolicyRules(String)
Enumerates all policy rules.
Declaration
public ICollectionClient<IPolicyRule> ListPolicyRules(string policyId)
Parameters
Type | Name | Description |
---|---|---|
System.String | policyId |
Returns
Type | Description |
---|---|
ICollectionClient<IPolicyRule> | A collection of IPolicyRule that can be enumerated asynchronously. |
UpdatePolicyAsync(IPolicy, String, CancellationToken)
Updates a policy.
Declaration
public Task<IPolicy> UpdatePolicyAsync(IPolicy policy, string policyId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IPolicy | policy | The IPolicy resource. |
System.String | policyId | |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IPolicy> | The IPolicy response. |
UpdatePolicyAsync<T>(IPolicy, String, CancellationToken)
Updates a policy
Declaration
public Task<T> UpdatePolicyAsync<T>(IPolicy policy, string policyId, CancellationToken cancellationToken = default(CancellationToken))
where T : class, IPolicy
Parameters
Type | Name | Description |
---|---|---|
IPolicy | policy | The IPolicy resource. |
System.String | policyId | The policy ID |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | The IPolicy response. |
Type Parameters
Name | Description |
---|---|
T | The policy type |
UpdatePolicyAsync<T>(IPolicy, CancellationToken)
Updates a policy
Declaration
public Task<T> UpdatePolicyAsync<T>(IPolicy policy, CancellationToken cancellationToken = default(CancellationToken))
where T : class, IPolicy
Parameters
Type | Name | Description |
---|---|---|
IPolicy | policy | The IPolicy resource. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | The IPolicy response. |
Type Parameters
Name | Description |
---|---|
T | The policy type |
UpdatePolicyRuleAsync(IPolicyRule, String, String, CancellationToken)
Updates a policy rule.
Declaration
public Task<IPolicyRule> UpdatePolicyRuleAsync(IPolicyRule policyRule, string policyId, string ruleId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IPolicyRule | policyRule | The IPolicyRule resource. |
System.String | policyId | |
System.String | ruleId | |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IPolicyRule> | The IPolicyRule response. |
UpdatePolicyRuleAsync<T>(IPolicyRule, String, String, CancellationToken)
Updates a policy rule
Declaration
public Task<T> UpdatePolicyRuleAsync<T>(IPolicyRule policyRule, string policyId, string ruleId, CancellationToken cancellationToken = default(CancellationToken))
where T : class, IPolicyRule
Parameters
Type | Name | Description |
---|---|---|
IPolicyRule | policyRule | The IPolicyRule resource. |
System.String | policyId | The policy ID |
System.String | ruleId | The rule ID |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | The IPolicyRule response. |
Type Parameters
Name | Description |
---|---|
T | The policy Rule type |