API version:
Show / Hide Table of Contents

Class PoliciesClient

A client that communicates with the Okta management API.

Inheritance
System.Object
OktaClient
PoliciesClient
Implements
IOktaClient
IPoliciesClient
Inherited Members
OktaClient.Configuration
OktaClient.CreateScoped(RequestContext)
OktaClient.UserTypes
OktaClient.Users
OktaClient.UserFactors
OktaClient.Groups
OktaClient.Applications
OktaClient.Sessions
OktaClient.AuthorizationServers
OktaClient.Logs
OktaClient.Policies
OktaClient.EventHooks
OktaClient.InlineHooks
OktaClient.LinkedObjects
OktaClient.TrustedOrigins
OktaClient.Features
OktaClient.Templates
OktaClient.NetworkZones
OktaClient.Domains
OktaClient.IdentityProviders
OktaClient.UserSchemas
OktaClient.GetCollectionClient<T>(HttpRequest)
OktaClient.GetAsync<T>(String, CancellationToken)
OktaClient.GetAsync<T>(HttpRequest, CancellationToken)
OktaClient.GetCollection<T>(String)
OktaClient.GetCollection<T>(HttpRequest)
OktaClient.PostAsync(String, Object, CancellationToken)
OktaClient.PostAsync<TResponse>(String, Object, CancellationToken)
OktaClient.PostAsync(HttpRequest, CancellationToken)
OktaClient.PostAsync<TResponse>(HttpRequest, CancellationToken)
OktaClient.PutAsync(String, Object, CancellationToken)
OktaClient.PutAsync<TResponse>(String, Object, CancellationToken)
OktaClient.PutAsync(HttpRequest, CancellationToken)
OktaClient.PutAsync<TResponse>(HttpRequest, CancellationToken)
OktaClient.DeleteAsync(String, CancellationToken)
OktaClient.DeleteAsync(HttpRequest, CancellationToken)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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

Implements

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