Skip to content

Decorators

Identifies a ModelProperty as containing the final location for the operation result.

@Azure.Core.finalLocation(finalResult?: Model | void)

ModelProperty

NameTypeDescription
finalResultModel | voidSets the expected return value for the final result. Overrides
any value provided in the decorated property, if the property uses ResourceLocation.

Identifies that an operation is the final operation for an LRO.

@Azure.Core.finalOperation(linkedOperation: Operation, parameters?: {})

Operation

NameTypeDescription
linkedOperationOperationThe linked Operation
parameters{}Map of RequestParameter<Name> and/or ResponseProperty<Name> that will
be passed to the linked operation request.

Marks an Enum as being fixed since enums in Azure are assumed to be extensible.

@Azure.Core.fixed

Enum

None

Identifies the ModelProperty that contains the paged items. Can only be used on a Model marked with @pagedResult.

@Azure.Core.items

ModelProperty

None

Used for custom StatusMonitor implementation. Identifies an EnumMember as a long-running “Canceled” terminal state.

@Azure.Core.lroCanceled

EnumMember | UnionVariant

None

Used for custom StatusMonitor implementation. Identifies a model property of a StatusMonitor as containing the result of a long-running operation that terminates unsuccessfully (Failed).

@Azure.Core.lroErrorResult

ModelProperty

None

Used for custom StatusMonitor implementation. Identifies an enum member as a long-running “Failed” terminal state.

@Azure.Core.lroFailed

EnumMember | UnionVariant

None

Used for custom StatusMonitor implementation. Identifies a model property of a StatusMonitor as containing the result of a long-running operation that terminates successfully (Succeeded).

@Azure.Core.lroResult

ModelProperty

None

Used for custom StatusMonitor implementation. Identifies an Enum or ModelProperty as containing long-running operation status.

@Azure.Core.lroStatus

Enum | Union | ModelProperty

None

Used for custom StatusMonitor implementation. Identifies an EnumMember as a long-running “Succeeded” terminal state.

@Azure.Core.lroSucceeded

EnumMember | UnionVariant

None

Identifies that an operation is used to retrieve the next page for paged operations.

@Azure.Core.nextPageOperation(linkedOperation: Operation, parameters?: {})

Operation

NameTypeDescription
linkedOperationOperationThe linked Operation
parameters{}Map of RequestParameter<Name> and/or ResponseProperty<Name> that will
be passed to the linked operation request.

Identifies an operation that is linked to the target operation.

@Azure.Core.operationLink(linkedOperation: Operation, linkType: valueof string, parameters?: {})

Operation

NameTypeDescription
linkedOperationOperationThe linked Operation
linkTypevalueof stringA string indicating the role of the linked operation
parameters{}Map of RequestParameter<Name> and/or ResponseProperty<Name> that will
be passed to the linked operation request.

Marks a Model as a paged collection.

@Azure.Core.pagedResult

Model

None

Identifies a model property as containing the location to poll for operation state.

@Azure.Core.pollingLocation(options?: Azure.Core.PollingOptions)

ModelProperty

NameTypeDescription
optionsPollingOptionsPollingOptions for the poller pointed to by this link. Overrides
settings derived from property value it is decorating, if the value of the
property is ResourceLocation

Identifies that an operation is a polling operation for an LRO.

@Azure.Core.pollingOperation(linkedOperation: Operation, parameters?: {})

Operation

NameTypeDescription
linkedOperationOperationThe linked Operation
parameters{}Map of RequestParameter<Name> and/or ResponseProperty<Name> that will
be passed to the linked operation request.

Used to define how to call custom polling operations for long-running operations.

@Azure.Core.pollingOperationParameter(targetParameter?: ModelProperty | string)

ModelProperty

NameTypeDescription
targetParameterModelProperty | stringA reference to the polling operation parameter this parameter
provides a value for, or the name of that parameter. The default value is the name of
the decorated parameter or property.

Decorator that marks a Version EnumMember as a preview version. This is used to indicate that the version is not yet stable and may change in future releases.

@Azure.Core.previewVersion

The EnumMember that represents the preview version. EnumMember

None

@versioned(Versions)
@service(#{ title: "Widget Service" })
namespace DemoService;
enum Versions {
v1,
v2,
@previewVersion
v3Preview,
}

Overrides the final state value for an operation

@Azure.Core.useFinalStateVia(finalState: valueof "original-uri" | "operation-location" | "location" | "azure-async-operation")

Operation

NameTypeDescription
finalStatevalueof "original-uri" | "operation-location" | "location" | "azure-async-operation"The desired final state value

Deletes any key properties from the model.

@Azure.Core.Foundations.omitKeyProperties

Model

None

Identifies a property on a request model that serves as a linked operation parameter.

@Azure.Core.Foundations.requestParameter(name: valueof string)

Model

NameTypeDescription
namevalueof stringProperty name on the target

Identifies a property on all non-error response models that serve as a linked operation parameter.

@Azure.Core.Foundations.responseProperty(name: valueof string)

Model

NameTypeDescription
namevalueof stringProperty name on the target

@trait marks a model type as representing a ‘trait’ and performs basic validation checks.

@Azure.Core.Traits.trait(traitName?: valueof string)

The model type to mark as a trait. Model

NameTypeDescription
traitNamevalueof stringAn optional name to uniquely identify the trait. If unspecified,
the model type name is used.

Sets the version for when the trait was added to the specification. Can be applied to either a trait model type or its envelope property.

@Azure.Core.Traits.traitAdded(addedVersion: EnumMember | null)

Model | ModelProperty

NameTypeDescription
addedVersionEnumMember | nullThe enum member representing the service version.

@traitContext sets the applicable context for a trait on its envelope property.

@Azure.Core.Traits.traitContext(contexts: EnumMember | Union | unknown)

The trait envelope property where the context will be applied. ModelProperty

NameTypeDescription
contextsEnumMember | Union | unknownAn enum member or union of enum members representing the trait’s
applicable contexts.

@traitLocation sets the applicable location for a trait on its envelope property.

@Azure.Core.Traits.traitLocation(contexts: EnumMember)

The trait envelope property where the context will be applied. ModelProperty

NameTypeDescription
contextsEnumMemberAn enum member or union of enum members representing the trait’s
applicable contexts.