Decorators
Azure.ResourceManager
Section titled “Azure.ResourceManager”@armCommonTypesVersion
Section titled “@armCommonTypesVersion”This decorator is used either on a namespace or a version enum value to indicate the version of the Azure Resource Manager common-types to use for refs in emitted Swagger files.
@Azure.ResourceManager.armCommonTypesVersion(version: valueof string | EnumMember)Namespace | EnumMember
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| version | valueof string | EnumMember | The Azure.ResourceManager.CommonTypes.Versions for the desired common-types version or an equivalent string value like “v5”. |
@armLibraryNamespace
Section titled “@armLibraryNamespace”@armLibraryNamespace designates a namespace as containign Azure Resource Manager Provider information.
@Azure.ResourceManager.armLibraryNamespaceNamespace
Parameters
Section titled “Parameters”None
Examples
Section titled “Examples”@armLibraryNamespacenamespace Microsoft.Contoso;@armProviderNamespace
Section titled “@armProviderNamespace”@armProviderNamespace sets the Azure Resource Manager provider name. It will default to use the
Namespace element value unless an override value is specified.
@Azure.ResourceManager.armProviderNamespace(providerNamespace?: valueof string)Namespace
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| providerNamespace | valueof string | Provider namespace |
Examples
Section titled “Examples”@armProviderNamespacenamespace Microsoft.Contoso;@armProviderNamespace("Microsoft.Contoso")namespace Microsoft.ContosoService;@armProviderNameValue
Section titled “@armProviderNameValue”@armResourceType sets the value fo the decorated string
property to the type of the Azure Resource Manager resource.
@Azure.ResourceManager.armProviderNameValueOperation
Parameters
Section titled “Parameters”None
@armResourceAction
Section titled “@armResourceAction”@Azure.ResourceManager.armResourceAction(resourceModel: Model, resourceName?: valueof string)Operation
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| resourceModel | Model | Resource model |
| resourceName | valueof string | Optional. The name of the resource. If not provided, the name of the resource model will be used. |
@armResourceCheckExistence
Section titled “@armResourceCheckExistence”Marks the operation as being a check existence (HEAD) operation
@Azure.ResourceManager.armResourceCheckExistence(resourceModel: Model, resourceName?: valueof string)Operation
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| resourceModel | Model | Resource model |
| resourceName | valueof string | Optional. The name of the resource. If not provided, the name of the resource model will be used. |
@armResourceCollectionAction
Section titled “@armResourceCollectionAction”Marks the operation as being a collection action
@Azure.ResourceManager.armResourceCollectionActionOperation
Parameters
Section titled “Parameters”None
@armResourceCreateOrUpdate
Section titled “@armResourceCreateOrUpdate”@Azure.ResourceManager.armResourceCreateOrUpdate(resourceModel: Model, resourceName?: valueof string)Operation
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| resourceModel | Model | Resource model |
| resourceName | valueof string | Optional. The name of the resource. If not provided, the name of the resource model will be used. |
@armResourceDelete
Section titled “@armResourceDelete”@Azure.ResourceManager.armResourceDelete(resourceModel: Model, resourceName?: valueof string)Operation
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| resourceModel | Model | Resource model |
| resourceName | valueof string | Optional. The name of the resource. If not provided, the name of the resource model will be used. |
@armResourceList
Section titled “@armResourceList”@Azure.ResourceManager.armResourceList(resourceModel: Model, resourceName?: valueof string)Operation
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| resourceModel | Model | Resource model |
| resourceName | valueof string | Optional. The name of the resource. If not provided, the name of the resource model will be used. |
@armResourceOperations
Section titled “@armResourceOperations”This decorator is used to identify interfaces containing resource operations.
By default, it marks the interface with the @autoRoute decorator so that
all of its contained operations will have their routes generated
automatically.
The decorator also adds a @tag decorator bearing the name of the interface so that all
of the operations will be grouped based on the interface name in generated
clients.
The optional resourceOperationOptions parameter provides additional options.
allowStaticRoutes turns off autoRout for the interface, so individual operations can
choose static (@route) or automatic (@autoRoute) routing.
resourceType: Model specifies the resource type for the operations in the interface
omitTags: true: turns off the default tagging of operations in the interface, so that individual operations must be
individually tagged
@Azure.ResourceManager.armResourceOperations(resourceOperationOptions?: unknown | valueof Azure.ResourceManager.ResourceOperationOptions)Interface
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| resourceOperationOptions | unknown | valueof ResourceOperationOptions | Options for routing the operations in the interface and associating them with a specific resource |
@armResourceRead
Section titled “@armResourceRead”@Azure.ResourceManager.armResourceRead(resourceModel: Model, resourceName?: valueof string)Operation
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| resourceModel | Model | Resource model |
| resourceName | valueof string | Optional. The name of the resource. If not provided, the name of the resource model will be used. |
@armResourceUpdate
Section titled “@armResourceUpdate”@Azure.ResourceManager.armResourceUpdate(resourceModel: Model, resourceName?: valueof string)Operation
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| resourceModel | Model | Resource model |
| resourceName | valueof string | Optional. The name of the resource. If not provided, the name of the resource model will be used. |
@armVirtualResource
Section titled “@armVirtualResource”This decorator is used on Azure Resource Manager resources that are not based on Azure.ResourceManager common types.
@Azure.ResourceManager.armVirtualResource(provider?: valueof string)Model
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| provider | valueof string | Optional. The resource provider namespace for the virtual resource. |
@extensionResource
Section titled “@extensionResource”@extensionResource marks an Azure Resource Manager resource model as an Extension resource.
Extension resource extends other resource types. URL path is appended
to another segment {scope} which refers to another Resource URL.
{resourceUri}/providers/Microsoft.Contoso/accessPermissions
See more details on different Azure Resource Manager resource type here.
@Azure.ResourceManager.extensionResourceModel
Parameters
Section titled “Parameters”None
@identifiers
Section titled “@identifiers”This decorator is used to indicate the identifying properties of objects in the array, e.g. size The properties that are used as identifiers for the object needs to be provided as a list of strings.
@Azure.ResourceManager.identifiers(properties: valueof string[])ModelProperty | unknown[]
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| properties | valueof string[] | The list of properties that are used as identifiers for the object. This needs to be provided as a list of strings. |
Examples
Section titled “Examples”model Pet { @identifiers(#["size"]) dog: Dog;}@locationResource
Section titled “@locationResource”@locationResource marks an Azure Resource Manager resource model as a location based resource.
Location based resources have REST API paths like
/subscriptions/{subscriptionId}/locations/{location}/providers/Microsoft.Contoso/employees
See more details on different Azure Resource Manager resource type here.
@Azure.ResourceManager.locationResourceModel
Parameters
Section titled “Parameters”None
@resourceBaseType
Section titled “@resourceBaseType”This decorator sets the base type of the given resource.
@Azure.ResourceManager.resourceBaseType(baseTypeIt: "Tenant" | "Subscription" | "ResourceGroup" | "Location" | "Extension")Model
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| baseTypeIt | "Tenant" | "Subscription" | "ResourceGroup" | "Location" | "Extension" | The built-in parent of the resource, this can be “Tenant”, “Subscription”, “ResourceGroup”, “Location”, or “Extension” |
@resourceGroupResource
Section titled “@resourceGroupResource”@resourceGroupResource marks an Azure Resource Manager resource model as a resource group level resource.
This is the default option for Azure Resource Manager resources. It is provided for symmetry and clarity, and
you typically do not need to specify it.
/subscription/{id}/resourcegroups/{rg}/providers/Microsoft.Contoso/employees
See more details on different Azure Resource Manager resource type here.
@Azure.ResourceManager.resourceGroupResourceModel
Parameters
Section titled “Parameters”None
@singleton
Section titled “@singleton”@singleton marks an Azure Resource Manager resource model as a singleton resource.
Singleton resources only have a single instance with a fixed key name.
.../providers/Microsoft.Contoso/monthlyReports/default
See more details on different Azure Resource Manager resource type here.
@Azure.ResourceManager.singleton(keyValue?: valueof string | "default")Model
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| keyValue | valueof string | "default" | The name of the singleton resource. Default name is “default”. |
@subscriptionResource
Section titled “@subscriptionResource”@subscriptionResource marks an Azure Resource Manager resource model as a subscription resource.
Subscription resources have REST API paths like:
/subscription/{id}/providers/Microsoft.Contoso/employees
See more details on different Azure Resource Manager resource type here.
@Azure.ResourceManager.subscriptionResourceModel
Parameters
Section titled “Parameters”None
@tenantResource
Section titled “@tenantResource”@tenantResource marks an Azure Resource Manager resource model as a Tenant resource/Root resource/Top-Level resource.
Tenant resources have REST API paths like:
/provider/Microsoft.Contoso/FooResources
See more details on different Azure Resource Manager resource type here.
@Azure.ResourceManager.tenantResourceModel
Parameters
Section titled “Parameters”None
@useLibraryNamespace
Section titled “@useLibraryNamespace”Declare the Azure Resource Manager library namespaces used in this provider. This allows sharing Azure Resource Manager resource types across specifications
@Azure.ResourceManager.useLibraryNamespace(...namespaces: Namespace[])Namespace
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| namespaces | Namespace[] | The namespaces of Azure Resource Manager libraries used in this provider |
Azure.ResourceManager.Legacy
Section titled “Azure.ResourceManager.Legacy”@armExternalType
Section titled “@armExternalType”Signifies that a Resource is represented using a library type in generated SDKs.
@Azure.ResourceManager.Legacy.armExternalTypeThe model to that is an external resource
Model
Parameters
Section titled “Parameters”None
@armOperationRoute
Section titled “@armOperationRoute”Signifies that an operation is an Azure Resource Manager operation and optionally associates the operation with a route template.
@Azure.ResourceManager.Legacy.armOperationRoute(route?: valueof Azure.ResourceManager.Legacy.ArmOperationOptions)The operation to associate the model with
Operation
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| route | valueof ArmOperationOptions | Optional route to associate with the operation |
@customAzureResource
Section titled “@customAzureResource”This decorator is used on resources that do not satisfy the definition of a resource but need to be identified as such.
@Azure.ResourceManager.Legacy.customAzureResource(options?: valueof Azure.ResourceManager.Legacy.CustomResourceOptions)Model
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| options | valueof CustomResourceOptions | Options for customizing the behavior of the resource |
@externalTypeRef
Section titled “@externalTypeRef”Specify an external reference that should be used when emitting this type.
@Azure.ResourceManager.Legacy.externalTypeRef(jsonRef: valueof string)Model | ModelProperty
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| jsonRef | valueof string | External reference(e.g. ”../../common.json#/definitions/Foo”) |
@renamePathParameter
Section titled “@renamePathParameter”Renames a path parameter in an Azure Resource Manager operation.
@Azure.ResourceManager.Legacy.renamePathParameter(sourceParameterName: valueof string, targetParameterName: valueof string)The operation or interface to modify
Operation
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| sourceParameterName | valueof string | The name of the parameter to rename |
| targetParameterName | valueof string | The new name for the parameter |