Skip to content

[F] getClientOptions

function getClientOptions<T>(type, key): unknown;

Get the value of a client option by key from a decorated SDK type.

Type Parameter
T extends DecoratedType
ParameterTypeDescription
typeTA decorated SDK type (model, enum, operation, property, client, namespace, etc.)
keystringThe name of the client option to look up

unknown

The option value, or undefined if the option is not set

const sdkModel = context.sdkPackage.models.find(m => m.name === "MyModel");
const value = getClientOptions(sdkModel, "enableFeatureFoo");