Table of Contents

Class ConsumerConfiguration

Namespace
OpenSettings.Configurations
Assembly
OpenSettings.dll

Represents the configuration settings for the consumer service.

public class ConsumerConfiguration
Inheritance
ConsumerConfiguration
Inherited Members

Properties

IsRedisActive

Gets or sets a flag indicating whether Redis is active for the consumer configuration.

public bool IsRedisActive { get; set; }

Property Value

bool

A bool indicating whether Redis is active. The default value is false.

Remarks

Redis connection details and status are sent by the provider. The truthfulness of this value depends on the provider.

PollingSettingsWorker

Gets or sets the configuration for the polling settings worker.

public PollingSettingsWorkerConfiguration PollingSettingsWorker { get; set; }

Property Value

PollingSettingsWorkerConfiguration

A PollingSettingsWorkerConfiguration object that defines the polling settings for the worker.

ProviderUrl

Gets or sets the Url of the provider for fetching and syncing data. This Url is required by the consumer to connect to the provider and retrieve data.

public string ProviderUrl { get; set; }

Property Value

string

A string representing the Url of the settings provider service. Any trailing slashes will be trimmed automatically when setting the value.

Remarks

This Url should point to the endpoint for the api. e.g. 'https://.../api/settings'

RequestEncodings

Gets the set of encodings requested from the provider service. These encodings are specified in the HTTP header for Accept-Encoding. However, the final decision on which encoding to use is made by the provider.

public HashSet<CompressionType> RequestEncodings { get; }

Property Value

HashSet<CompressionType>

A HashSet<T> representing the encodings that the consumer requests from the provider service. This collection is initialized with a default size (6)

SkipInitialSyncAppData

Gets or sets a value indicating whether the initial sync of app data should be skipped.

public bool SkipInitialSyncAppData { get; set; }

Property Value

bool

true to skip the initial sync; otherwise, false.

Remarks

When set to true, the initial sync of data will not occur. If set to false, the sync will take place as part of the application's initial setup. This property can be used to control whether the app should skip syncing data during the initial run.

Methods

ConfigureHttpClient(HttpClient, ClientInfo)

Configures the provided httpClient with the settings for the consumer. This method sets the base address, authorization headers, and encodings for the HTTP client.

public void ConfigureHttpClient(HttpClient httpClient, ClientInfo clientInfo)

Parameters

httpClient HttpClient

The HttpClient to configure with the consumer's settings.

clientInfo ClientInfo

The ClientInfo object containing the information for creating authentication headers.