Skip to content

OptionsProvider

Utility that wraps the raw options provider data in a more convenient structure

This provider represents a snapshot of the options in time and should be fairly short-lived.

has(key): boolean

Parameter Type

key

string

boolean


lookup<T>(key): T

Lookup makes the assumption that the key request IS in the options. To make code less convoluted. If an option is optionally present the caller should check if the key is present first

The caller can optionally provide an expected type parameter to make usage more convenient

Type Parameter Default type

T extends AttributeValue

AttributeValue

Parameter Type Description

key

string

the key

T


refresh(): Promise<OptionsProvider>

Returns a new snapshot of this options provider

Promise<OptionsProvider>

the new snapshot

SDK 1.18.0


toArray(): [string, AttributeValue][]

Converts the options provider to an array (mainly for debugging purposes)

[string, AttributeValue][]


toString(): string

string


update(updates): Promise<string[]>

Applies updates for the given option keys to this options provider and returns a list of any invalid updates performed

NOTE: This does not modify this “snapshot” in place

Parameter Type Description

updates

Record<string, AttributeValue>

the updates to apply

Promise<string[]>

an updated

SDK 1.18.0 protocol 1.15.0