Class Blue5Client
Entry point for the Bluestone PIM Public API. Thread-safe; create one per HttpClient and use WithContext(string) for other languages/publications.
Inherited Members
Namespace: Activout.Blue5
Assembly: Activout.Blue5.dll
Syntax
public sealed class Blue5Client
Constructors
| Edit this page View SourceBlue5Client(HttpClient, Blue5Options)
Creates a client. Blue5 does not change httpClient's settings, so it can be shared.
Declaration
public Blue5Client(HttpClient httpClient, Blue5Options options)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpClient | httpClient | |
| Blue5Options | options |
Properties
| Edit this page View SourceContext
The PAPI context this client reads from.
Declaration
public string Context { get; }
Property Value
| Type | Description |
|---|---|
| string |
Products
Product operations.
Declaration
public ProductClient Products { get; }
Property Value
| Type | Description |
|---|---|
| ProductClient |
Methods
| Edit this page View SourceGetContexts(CancellationToken)
Lists the contexts (languages/publications) published to PAPI and available to this API key.
Declaration
public Task<IReadOnlyList<ContextInfo>> GetContexts(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<IReadOnlyList<ContextInfo>> |
GetDictionaryValues(string, CancellationToken)
Streams every value defined for a dictionary attribute, using PAPI's cursor API in pages of 100.
Pages are fetched only as enumeration needs them.
Declaration
public IAsyncEnumerable<SelectOption> GetDictionaryValues(string attributeDefinitionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attributeDefinitionId | The attribute's id (Id), not its number. |
| CancellationToken | cancellationToken | Cancellation. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<SelectOption> |
WithContext(string)
Returns a client for another PAPI context that shares this client's HttpClient.
Declaration
public Blue5Client WithContext(string context)
Parameters
| Type | Name | Description |
|---|---|---|
| string | context |
Returns
| Type | Description |
|---|---|
| Blue5Client |