Decorators
Azure.Core
Section titled “Azure.Core”@finalLocation
Section titled “@finalLocation”Identifies a ModelProperty as containing the final location for the operation result.
@Azure.Core.finalLocation(finalResult?: Model | void)
Target
Section titled “Target”ModelProperty
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
finalResult | Model | void | Sets the expected return value for the final result. Overrides any value provided in the decorated property, if the property uses ResourceLocation |
@finalOperation
Section titled “@finalOperation”Identifies that an operation is the final operation for an LRO.
@Azure.Core.finalOperation(linkedOperation: Operation, parameters?: {})
Target
Section titled “Target”Operation
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
linkedOperation | Operation | The linked Operation |
parameters | {} | Map of RequestParameter<Name> and/or ResponseProperty<Name> that willbe passed to the linked operation request. |
@fixed
Section titled “@fixed”Marks an Enum as being fixed since enums in Azure are assumed to be extensible.
@Azure.Core.fixed
Target
Section titled “Target”Enum
Parameters
Section titled “Parameters”None
@items
Section titled “@items”Identifies the ModelProperty that contains the paged items. Can only be used on a Model marked with @pagedResult
.
@Azure.Core.items
Target
Section titled “Target”ModelProperty
Parameters
Section titled “Parameters”None
@lroCanceled
Section titled “@lroCanceled”Used for custom StatusMonitor implementation. Identifies an EnumMember as a long-running “Canceled” terminal state.
@Azure.Core.lroCanceled
Target
Section titled “Target”EnumMember | UnionVariant
Parameters
Section titled “Parameters”None
@lroErrorResult
Section titled “@lroErrorResult”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
Target
Section titled “Target”ModelProperty
Parameters
Section titled “Parameters”None
@lroFailed
Section titled “@lroFailed”Used for custom StatusMonitor implementation. Identifies an enum member as a long-running “Failed” terminal state.
@Azure.Core.lroFailed
Target
Section titled “Target”EnumMember | UnionVariant
Parameters
Section titled “Parameters”None
@lroResult
Section titled “@lroResult”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
Target
Section titled “Target”ModelProperty
Parameters
Section titled “Parameters”None
@lroStatus
Section titled “@lroStatus”Used for custom StatusMonitor implementation. Identifies an Enum or ModelProperty as containing long-running operation status.
@Azure.Core.lroStatus
Target
Section titled “Target”Enum | Union | ModelProperty
Parameters
Section titled “Parameters”None
@lroSucceeded
Section titled “@lroSucceeded”Used for custom StatusMonitor implementation. Identifies an EnumMember as a long-running “Succeeded” terminal state.
@Azure.Core.lroSucceeded
Target
Section titled “Target”EnumMember | UnionVariant
Parameters
Section titled “Parameters”None
@nextPageOperation
Section titled “@nextPageOperation”Identifies that an operation is used to retrieve the next page for paged operations.
@Azure.Core.nextPageOperation(linkedOperation: Operation, parameters?: {})
Target
Section titled “Target”Operation
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
linkedOperation | Operation | The linked Operation |
parameters | {} | Map of RequestParameter<Name> and/or ResponseProperty<Name> that willbe passed to the linked operation request. |
@operationLink
Section titled “@operationLink”Identifies an operation that is linked to the target operation.
@Azure.Core.operationLink(linkedOperation: Operation, linkType: valueof string, parameters?: {})
Target
Section titled “Target”Operation
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
linkedOperation | Operation | The linked Operation |
linkType | valueof string | A string indicating the role of the linked operation |
parameters | {} | Map of RequestParameter<Name> and/or ResponseProperty<Name> that willbe passed to the linked operation request. |
@pagedResult
Section titled “@pagedResult”Marks a Model as a paged collection.
@Azure.Core.pagedResult
Target
Section titled “Target”Model
Parameters
Section titled “Parameters”None
@pollingLocation
Section titled “@pollingLocation”Identifies a model property as containing the location to poll for operation state.
@Azure.Core.pollingLocation(options?: Azure.Core.PollingOptions)
Target
Section titled “Target”ModelProperty
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
options | PollingOptions | PollingOptions 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 |
@pollingOperation
Section titled “@pollingOperation”Identifies that an operation is a polling operation for an LRO.
@Azure.Core.pollingOperation(linkedOperation: Operation, parameters?: {})
Target
Section titled “Target”Operation
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
linkedOperation | Operation | The linked Operation |
parameters | {} | Map of RequestParameter<Name> and/or ResponseProperty<Name> that willbe passed to the linked operation request. |
@pollingOperationParameter
Section titled “@pollingOperationParameter”Used to define how to call custom polling operations for long-running operations.
@Azure.Core.pollingOperationParameter(targetParameter?: ModelProperty | string)
Target
Section titled “Target”ModelProperty
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
targetParameter | ModelProperty | string | A 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. |
@previewVersion
Section titled “@previewVersion”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
Target
Section titled “Target”The EnumMember that represents the preview version.
EnumMember
Parameters
Section titled “Parameters”None
Examples
Section titled “Examples”@versioned(Versions)@service(#{ title: "Widget Service" })namespace DemoService;
enum Versions { v1, v2,
@previewVersion v3Preview,}
@useFinalStateVia
Section titled “@useFinalStateVia”Overrides the final state value for an operation
@Azure.Core.useFinalStateVia(finalState: valueof "original-uri" | "operation-location" | "location" | "azure-async-operation")
Target
Section titled “Target”Operation
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
finalState | valueof "original-uri" | "operation-location" | "location" | "azure-async-operation" | The desired final state value |
Azure.Core.Foundations
Section titled “Azure.Core.Foundations”@omitKeyProperties
Section titled “@omitKeyProperties”Deletes any key properties from the model.
@Azure.Core.Foundations.omitKeyProperties
Target
Section titled “Target”Model
Parameters
Section titled “Parameters”None
@requestParameter
Section titled “@requestParameter”Identifies a property on a request model that serves as a linked operation parameter.
@Azure.Core.Foundations.requestParameter(name: valueof string)
Target
Section titled “Target”Model
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
name | valueof string | Property name on the target |
@responseProperty
Section titled “@responseProperty”Identifies a property on all non-error response models that serve as a linked operation parameter.
@Azure.Core.Foundations.responseProperty(name: valueof string)
Target
Section titled “Target”Model
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
name | valueof string | Property name on the target |
Azure.Core.Traits
Section titled “Azure.Core.Traits”@trait
Section titled “@trait”@trait
marks a model type as representing a ‘trait’ and performs basic validation
checks.
@Azure.Core.Traits.trait(traitName?: valueof string)
Target
Section titled “Target”The model type to mark as a trait.
Model
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
traitName | valueof string | An optional name to uniquely identify the trait. If unspecified, the model type name is used. |
@traitAdded
Section titled “@traitAdded”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)
Target
Section titled “Target”Model | ModelProperty
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
addedVersion | EnumMember | null | The enum member representing the service version. |
@traitContext
Section titled “@traitContext”@traitContext
sets the applicable context for a trait on its envelope property.
@Azure.Core.Traits.traitContext(contexts: EnumMember | Union | unknown)
Target
Section titled “Target”The trait envelope property where the context will be applied.
ModelProperty
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
contexts | EnumMember | Union | unknown | An enum member or union of enum members representing the trait’s applicable contexts. |
@traitLocation
Section titled “@traitLocation”@traitLocation
sets the applicable location for a trait on its envelope property.
@Azure.Core.Traits.traitLocation(contexts: EnumMember)
Target
Section titled “Target”The trait envelope property where the context will be applied.
ModelProperty
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
contexts | EnumMember | An enum member or union of enum members representing the trait’s applicable contexts. |