Functions
Function | Description |
---|---|
defineBoolean(name, options) | Declare a boolean parameter. |
defineInt(name, options) | Declare an integer parameter. |
defineList(name, options) | Declare a list parameter. |
defineSecret(name) | Declares a secret param, that will persist values only in Cloud Secret Manager. Secrets are stored internally as bytestrings. Use ParamOptions.as to provide type hinting during parameter resolution. |
defineString(name, options) | Declare a string parameter. |
multiSelect(options) | Create a multi-select input from a series of values. |
multiSelect(options) | Create a multi-select input from map of labels to values. |
select(options) | Create a select input from a series of values. |
select(optionsWithLabels) | Create a select input from a map of labels to values. |
Classes
Class | Description |
---|---|
Expression |
Interfaces
Interface | Description |
---|---|
MultiSelectInput | Specifies that a parameter's value should be determined by having the user select a subset from a list of pre-canned options interactively at deploy time. Will result in errors if used on parameters of type other than string[] . |
SelectInput | Specifies that a parameter's value should be determined by having the user select from a list of pre-canned options interactively at deploy time. |
SelectOptions | One of the options provided to a SelectInput , containing a value and optionally a human-readable label to display in the selection interface. |
TextInput | Specifies that a parameter's value should be determined by prompting the user to type it in interactively at deploy time. Input that does not match the provided validationRegex, if present, will be retried. |
Variables
Variable | Description |
---|---|
BUCKET_PICKER | Autogenerate a list of buckets in a project that a user can select from. |
databaseURL | A built-in parameter that resolves to the default RTDB database URL associated with the project, without prompting the deployer. Empty string if none exists. |
declaredParams | |
gcloudProject | A built-in parameter that resolves to the Cloud project ID, without prompting the deployer. |
projectID | A built-in parameter that resolves to the Cloud project ID associated with the project, without prompting the deployer. |
storageBucket | A builtin parameter that resolves to the Cloud storage bucket associated with the function, without prompting the deployer. Empty string if not defined. |
Type Aliases
Type Alias | Description |
---|---|
ParamOptions | Configuration options which can be used to customize the prompting behavior of a parameter. |
params.defineBoolean()
Declare a boolean parameter.
Signature:
export declare function defineBoolean(name: string, options?: ParamOptions<boolean>): BooleanParam;
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the environment variable to use to load the parameter. |
options | ParamOptions<boolean> | Configuration options for the parameter. |
Returns:
BooleanParam
A parameter with a boolean
return type for .value
.
params.defineInt()
Declare an integer parameter.
Signature:
export declare function defineInt(name: string, options?: ParamOptions<number>): IntParam;
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the environment variable to use to load the parameter. |
options | ParamOptions<number> | Configuration options for the parameter. |
Returns:
IntParam
A parameter with a number
return type for .value
.
params.defineList()
Declare a list parameter.
Signature:
export declare function defineList(name: string, options?: ParamOptions<string[]>): ListParam;
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the environment variable to use to load the parameter. |
options | ParamOptions<string[]> | Configuration options for the parameter. |
Returns:
ListParam
A parameter with a string[]
return type for .value
.
params.defineSecret()
Declares a secret param, that will persist values only in Cloud Secret Manager. Secrets are stored internally as bytestrings. Use ParamOptions.as
to provide type hinting during parameter resolution.
Signature:
export declare function defineSecret(name: string): SecretParam;
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the environment variable to use to load the parameter. |
Returns:
SecretParam
A parameter with a string
return type for .value
.
params.defineString()
Declare a string parameter.
Signature:
export declare function defineString(name: string, options?: ParamOptions<string>): StringParam;
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the environment variable to use to load the parameter. |
options | ParamOptions<string> | Configuration options for the parameter. |
Returns:
StringParam
A parameter with a string
return type for .value
.
params.multiSelect()
Create a multi-select input from a series of values.
Signature:
export declare function multiSelect(options: string[]): MultiSelectInput;
Parameters
Parameter | Type | Description |
---|---|---|
options | string[] |
Returns:
params.multiSelect()
Create a multi-select input from map of labels to values.
Signature:
export declare function multiSelect(options: Record<string, string>): MultiSelectInput;
Parameters
Parameter | Type | Description |
---|---|---|
options | Record<string, string> |
Returns:
params.select()
Create a select input from a series of values.
Signature:
export declare function select<T>(options: T[]): SelectInput<T>;
Parameters
Parameter | Type | Description |
---|---|---|
options | T[] |
Returns:
SelectInput<T>
params.select()
Create a select input from a map of labels to values.
Signature:
export declare function select<T>(optionsWithLabels: Record<string, T>): SelectInput<T>;
Parameters
Parameter | Type | Description |
---|---|---|
optionsWithLabels | Record<string, T> |
Returns:
SelectInput<T>
params.BUCKET_PICKER
Autogenerate a list of buckets in a project that a user can select from.
Signature:
BUCKET_PICKER: ResourceInput
params.databaseURL
A built-in parameter that resolves to the default RTDB database URL associated with the project, without prompting the deployer. Empty string if none exists.
Signature:
databaseURL: Param<string>
params.declaredParams
Signature:
declaredParams: SecretOrExpr[]
params.gcloudProject
A built-in parameter that resolves to the Cloud project ID, without prompting the deployer.
Signature:
gcloudProject: Param<string>
params.projectID
A built-in parameter that resolves to the Cloud project ID associated with the project, without prompting the deployer.
Signature:
projectID: Param<string>
params.storageBucket
A builtin parameter that resolves to the Cloud storage bucket associated with the function, without prompting the deployer. Empty string if not defined.
Signature:
storageBucket: Param<string>
params.ParamOptions
Configuration options which can be used to customize the prompting behavior of a parameter.
Signature:
export type ParamOptions<T extends string | number | boolean | string[]> = Omit<ParamSpec<T>, "name" | "type">;