UNPKG

@azure/template

Version:
88 lines (82 loc) 3.24 kB
import { OperationOptions } from '@azure/core-http'; import { PipelineOptions } from '@azure/core-http'; import { TokenCredential } from '@azure/core-http'; /** * The client class used to interact with the App Configuration service. */ export declare class ConfigurationClient { private client; /** * Creates an instance of a ConfigurationClient. * * Example usage: * ```ts * import { ConfigurationClient} from "@azure/ai-text-analytics"; * import { DefaultAzureCredential} from "@azure/identity"; * * const client = new ConfigurationClient( * "<app configuration endpoint>", * new DefaultAzureCredential() * ); * ``` * @param endpointUrl - the URL to the App Configuration endpoint * @param credential - used to authenticate requests to the service * @param options - optional configuration used to send requests to the service */ constructor(endpointUrl: string, credential: TokenCredential, options?: ConfigurationClientOptions); /** * Retrieve the contents of an App Configuration setting by name (key). * * @param key - the unique name of the setting to get * @param options - optional configuration for the operation */ getConfigurationSetting(key: string, options?: GetConfigurationSettingOptions): Promise<ConfigurationSetting>; /** * Retrieve an updated value of an App Configuration setting, allowing for * the use of entity tags to request the new value only if it has changed. * * @param setting - the setting to retrieve from the service * @param options - optional configuration for the operation */ getConfigurationSetting(setting: ConfigurationSetting, options?: GetConfigurationSettingOptions): Promise<ConfigurationSetting>; } /** * Client options used to configure App Configuration API requests. */ export declare interface ConfigurationClientOptions extends PipelineOptions { } export declare interface ConfigurationSetting { /** The unique name of the key-value. */ key: string; /** The label of the key-value. */ label?: string; /** The content type of the key-value. */ contentType?: string; /** The value of the key-value. */ value?: string; /** The time the key-value was last modified. */ lastModified?: Date; /** Dictionary of <string> */ tags?: { [propertyName: string]: string; }; /** Indicates whether or not this key-value is readonly. */ isReadOnly?: boolean; /** The entity-tag of the key-value. */ etag?: string; } /** * Options for the `getConfigurationSetting` method of `ConfigurationClient`. */ export declare interface GetConfigurationSettingOptions extends OperationOptions { /** * If set to `true`, the method will use entity tags to instruct the service * to send an updated value only if the value has changed. * * NOTE: This option is only supported if passing a full * `ConfigurationSetting` object with an `etag` as the first parameter to * `getConfigurationSetting`. */ onlyIfChanged?: boolean; } export { }