[F] getClientOptions
function getClientOptions<T>(type, key): unknown;Get the value of a client option by key from a decorated SDK type.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends DecoratedType |
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
type | T | A decorated SDK type (model, enum, operation, property, client, namespace, etc.) |
key | string | The name of the client option to look up |
Returns
Section titled “Returns”unknown
The option value, or undefined if the option is not set
Example
Section titled “Example”const sdkModel = context.sdkPackage.models.find(m => m.name === "MyModel");const value = getClientOptions(sdkModel, "enableFeatureFoo");