API version:
Show / Hide Table of Contents

Interface IPoliciesClient

A client that works with Okta Policy resources.

Namespace: Okta.Sdk
Assembly: Okta.Sdk.dll
Syntax
public interface IPoliciesClient

Methods

ActivatePolicyAsync(String, CancellationToken)

Activates a policy.

Declaration
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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

Back to top Copyright © 2021 Okta, Inc.
Generated with DocFx.