Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ParameterResource

Handle
📦 Aspire.Hosting v17.0.0

Represents a parameter resource.

type ParameterResource interface {
ExpressionValue
Resource
}

Methods

methodAsOptionalbuilder
Marks the parameter resource as optional.
AsOptional() ParameterResource
ParameterResource

The configured resource builder.

Returns a handle; failures surface later via Err().

methodAsRequiredbuilder
Marks the parameter resource as required.
AsRequired() ParameterResource
ParameterResource

The configured resource builder.

Returns a handle; failures surface later via Err().

Sets or replaces the value for this parameter.
SetValueAsync(options ...*SetValueAsyncOptions) error
options...*SetValueAsyncOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*SetValueAsyncOptions argument.

Value*stringThe value to use for this parameter.
CancellationToken*CancellationTokenThe cancellation token to observe while applying the value.
error

A task that completes when the value has been applied and observers have processed the change.

Returns error.

Gets the current value for this parameter without waiting for unresolved input.
TryGetCurrentValue() (*string, error)
(*string, error)

The current parameter value, or null if the parameter does not currently have a non-empty value.

Returns (*string, error).

methodWithCustomInputbuilder
Sets a custom input for the parameter resource from a polyglot AppHost.
WithCustomInput(options *ParameterCustomInputOptions) ParameterResource
options*ParameterCustomInputOptionsOptions used to customize the input for the parameter.
ParameterResource

Resource builder for the parameter.

Returns a handle; failures surface later via Err().

methodWithDescriptionbuilder
Sets the description of the parameter resource.
WithDescription(
description string,
options ...*WithDescriptionOptions,
) ParameterResource
descriptionstringThe parameter description.
options...*WithDescriptionOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithDescriptionOptions argument.

EnableMarkdown*boolA value indicating whether the description should be rendered as Markdown. true allows the description to contain Markdown elements such as links, text decoration and lists.
ParameterResource

Resource builder for the parameter.

Returns a handle; failures surface later via Err().