---
title: "Interface IPoliciesClient"
slug: "sdk--stylelabs.m.sdk.clients.ipoliciesclient"
abstract: ""
---
# Interface IPoliciesClient

Contains functionality to get and update policies.

## Namespace: StylelabsStylelabs.MSdkClients

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public interface IPoliciesClient
```

## Methods

### GetUserGroupPolicyAsync(long)

Gets the policy from specified user group.

#### Declaration

```csharp
Task<IUserGroupPolicy> GetUserGroupPolicyAsync(long userGroupId)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| long | userGroupId | Id of the user group to get the policy from. |

#### Returns

| Type | Description |
| --- | --- |
| Task<>[IUserGroupPolicy](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.policies.iusergrouppolicy.html) | The policy or null when it was not found. |

### GetUserPolicyAsync(long)

Gets the policy from specified user.

#### Declaration

```csharp
Task<IUserPolicy> GetUserPolicyAsync(long userId)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| long | userId | Id of the user to get the policy from. |

#### Returns

| Type | Description |
| --- | --- |
| Task<>[IUserPolicy](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.policies.iuserpolicy.html) | The policy or null when it was not found. |

### UpdateAsync(IPolicy)

Updates the specified policy.

#### Declaration

```csharp
Task UpdateAsync(IPolicy policy)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [IPolicy](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.policies.ipolicy.html) | policy | The policy to update. |

#### Returns

| Type | Description |
| --- | --- |
| Task | An awaitable . |

#### Exceptions

| Type | Condition |
| --- | --- |
| [ValidationException](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.exceptions.validationexception.html) | Thrown when the policy could not be saved because a validation error occurred. |
