Class MClientFactory
Defines the M client factory.
Inheritance
Namespace: StylelabsStylelabs.MSdkWebClient
Assembly: Stylelabs.M.Sdk.WebClient.dll
Syntax
public static class MClientFactoryMethods
CreateMClient(string)
Creates a new instance of the IWebMClient implementation.
Declaration
public static IWebMClient CreateMClient(string connectionString)Parameters
| Type | Name | Description |
|---|---|---|
| string | connectionString |
Connection string to the instance. |
Returns
| Type | Description |
|---|---|
| IWebMClient |
A new IWebMClient instance. |
Examples
This example shows how to create a IWebMClient instance using the OAuthPasswordGrant.
MClientFactory.CreateMClient("Endpoint=http://url/;ClientId=clientId;ClientSecret=clientSecret;UserName=userName;Password=password");This example shows how to create a IWebMClient instance using the OAuthRefreshTokenGrant.
MClientFactory.CreateMClient("Endpoint=http://url/;ClientId=clientId;ClientSecret=clientSecret;RefreshToken=refreshToken");CreateMClient(Uri, OAuthPasswordGrant)
Creates a new instance of the IWebMClient implementation.
Declaration
public static IWebMClient CreateMClient(Uri endpoint, OAuthPasswordGrant passwordGrant)Parameters
| Type | Name | Description |
|---|---|---|
| Uri | endpoint |
Base URI of the Sitecore Content Hub instance to connect to. |
| OAuthPasswordGrant | passwordGrant |
OAuth authentication details. |
Returns
| Type | Description |
|---|---|
| IWebMClient |
A new IWebMClient instance. |
CreateMClient(Uri, OAuthRefreshTokenGrant)
Creates a new instance of the IWebMClient implementation.
Declaration
public static IWebMClient CreateMClient(Uri endpoint, OAuthRefreshTokenGrant refreshTokenGrant)Parameters
| Type | Name | Description |
|---|---|---|
| Uri | endpoint |
Base uri of the Sitecore Content Hub instance to connect to. |
| OAuthRefreshTokenGrant | refreshTokenGrant |
OAuth authentication details. |
Returns
| Type | Description |
|---|---|
| IWebMClient |
A new IWebMClient instance. |
CreateMClient(Uri)
Creates a new instance of the IWebMClient implementation.
Declaration
public static IWebMClient CreateMClient(Uri endpoint)Parameters
| Type | Name | Description |
|---|---|---|
| Uri | endpoint |
Base uri of the Sitecore Content Hub instance to connect to. |
Returns
| Type | Description |
|---|---|
| IWebMClient |
A new IWebMClient instance. |