---
title: "Interface IMClient"
slug: "sdk--stylelabs.m.sdk.imclient"
abstract: ""
---
# Interface IMClient

Client for the Marketing Content Hub.

## Namespace: StylelabsStylelabs.MSdk

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public interface IMClient
```

## Properties

### Assets

Gets the Assets client. Contains functionality for asset operations.

#### Declaration

```csharp
IAssetsClient Assets { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IAssetsClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.iassetsclient.html) |  |

### Commands

Gets the commands client. Contains functionality to execute commands in M.

#### Declaration

```csharp
ICommandsClient Commands { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ICommandsClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.icommandsclient.html) |  |

### Cultures

Gets the culture client. Allows fetching culture information from M.

#### Declaration

```csharp
ICultureClient Cultures { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ICultureClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.icultureclient.html) |  |

### DataSourceFactory

Gets the data source factory. Contains functionality to create [IDataSource](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.idatasource.html)s.

#### Declaration

```csharp
IDataSourceFactory DataSourceFactory { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IDataSourceFactory](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.factories.idatasourcefactory.html) |  |

### DataSources

Gets the data source client. Contains functionality to query, create and manipulate [IDataSource](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.idatasource.html)s.

#### Declaration

```csharp
IDataSourcesClient DataSources { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IDataSourcesClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.idatasourcesclient.html) |  |

### Entities

Gets the entities client. Contains functionality to query, create and manipulate [IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html) instances.

#### Declaration

```csharp
IEntitiesClient Entities { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IEntitiesClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.ientitiesclient.html) |  |

### EntityDefinitions

Gets the entity definitions client. Contains functionality to query, create and manipulate [IEntityDefinition](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientitydefinition.html)s.

#### Declaration

```csharp
IEntityDefinitionsClient EntityDefinitions { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IEntityDefinitionsClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.ientitydefinitionsclient.html) |  |

### EntityFactory

Gets the entity factory. Contains functionality to create [IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html) instances.

#### Declaration

```csharp
IEntityFactory EntityFactory { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IEntityFactory](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.factories.ientityfactory.html) |  |

### Jobs

Gets the jobs client. Contains functionality to create jobs.

#### Declaration

```csharp
IJobsclient Jobs { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IJobsclient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.ijobsclient.html) |  |

### Logger

Gets or sets the logger. Contains functionality to log messages.

#### Declaration

```csharp
ILogger Logger { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ILogger](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.logging.ilogger.html) |  |

### MassEdit

Gets the mass-edit client. Contains functionality to create mass-edit jobs.

#### Declaration

```csharp
IMassEditClient MassEdit { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IMassEditClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.imasseditclient.md) |  |

### Notifications

Gets the notifications client. Contains functionality to manage and send notifications.

#### Declaration

```csharp
INotificationsClient Notifications { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [INotificationsClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.inotificationsclient.html) |  |

### Permissions

Gets the permissions client. Contains functionality to get entity permissions.

#### Declaration

```csharp
IPermissionsClient Permissions { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IPermissionsClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.ipermissionsclient.html) |  |

### Policies

Gets the policies client. Contains functionality to get and update [IPolicy](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.policies.ipolicy.html) objects.

#### Declaration

```csharp
IPoliciesClient Policies { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IPoliciesClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.ipoliciesclient.html) |  |

### Querying

Gets the querying client. Contains functionality to query and scroll for [IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html).

#### Declaration

```csharp
IQueryingClient Querying { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IQueryingClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.iqueryingclient.html) |  |

### Scripts

Gets the scripts client. Contains functionality to execute scripts.

#### Declaration

```csharp
IScriptsClient Scripts { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IScriptsClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.iscriptsclient.html) |  |

### Settings

Gets the settings client. Contains functionality to get setting entities.

#### Declaration

```csharp
ISettingsClient Settings { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ISettingsClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.isettingsclient.html) |  |

### Translations

Gets the translations client. Contains functionality to manage translations.

#### Declaration

```csharp
ITranslationsClient Translations { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ITranslationsClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.itranslationsclient.html) |  |

### TypedEntityFactory

Gets the typed entity factory. Contains functionality to create typed [IEntity](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.ientity.html) instances.

#### Declaration

```csharp
ITypedEntityFactory TypedEntityFactory { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ITypedEntityFactory](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.factories.itypedentityfactory.html) |  |

### Users

Gets the users client. Contains functionality to get and interact with user entities.

#### Declaration

```csharp
IUsersClient Users { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IUsersClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.clients.iusersclient.html) |  |

## Methods

### ImpersonateAsync(string)

Creates a new [IMClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.imclient.html) that acts on behalf of the user with the specified `username`. The current logger will be copied to the new client.

#### Declaration

```csharp
Task<IMClient> ImpersonateAsync(string username)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | username | The username of the user to impersonate. |

#### Returns

| Type | Description |
| --- | --- |
| Task<>[IMClient](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.imclient.html) | A new client bound to specified user. |

#### Exceptions

| Type | Condition |
| --- | --- |
| [ForbiddenException](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.exceptions.forbiddenexception.html) | When the current user is not allowed to impersonate other users. |
