diff --git a/.chronus/changes/azhang_ArmReorg-2024-4-31-18-40-39.md b/.chronus/changes/azhang_ArmReorg-2024-4-31-18-40-39.md new file mode 100644 index 0000000000..958652c9f0 --- /dev/null +++ b/.chronus/changes/azhang_ArmReorg-2024-4-31-18-40-39.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@azure-tools/typespec-azure-resource-manager" +--- + +Reorganize ARM library internal models into fully version controlled `Azure.ResourceManager.CommontTypes` namespace. \ No newline at end of file diff --git a/docs/libraries/azure-resource-manager/reference/data-types.md b/docs/libraries/azure-resource-manager/reference/data-types.md index 4b8edd2901..178430fad5 100644 --- a/docs/libraries/azure-resource-manager/reference/data-types.md +++ b/docs/libraries/azure-resource-manager/reference/data-types.md @@ -8,20 +8,6 @@ toc_max_heading_level: 3 ## Azure.ResourceManager -### `ApiVersionParameter` {#Azure.ResourceManager.ApiVersionParameter} - -The default api-version parameter type. - -```typespec -model Azure.ResourceManager.ApiVersionParameter -``` - -#### Properties - -| Name | Type | Description | -| ---------- | -------- | ------------------------------------------ | -| apiVersion | `string` | The API version to use for this operation. | - ### `ArmAcceptedLroResponse` {#Azure.ResourceManager.ArmAcceptedLroResponse} ```typespec @@ -201,9 +187,9 @@ model Azure.ResourceManager.ArmLocationResource #### Properties -| Name | Type | Description | -| -------- | -------- | ------------------ | -| location | `string` | The location name. | +| Name | Type | Description | +| -------- | -------- | ----------------------------- | +| location | `string` | The name of the Azure region. | ### `ArmLroLocationHeader` {#Azure.ResourceManager.ArmLroLocationHeader} @@ -273,7 +259,7 @@ model Azure.ResourceManager.ArmOperationStatus | startTime? | `utcDateTime` | Operation start time | | endTime? | `utcDateTime` | Operation complete time | | percentComplete? | `float64` | The progress made toward completing the operation | -| error? | [`ErrorDetail`](./data-types.md#Azure.ResourceManager.Foundations.ErrorDetail) | Errors that occurred if the operation ended with Canceled or Failed status | +| error? | [`ErrorDetail`](./data-types.md#Azure.ResourceManager.CommonTypes.ErrorDetail) | Errors that occurred if the operation ended with Canceled or Failed status | ### `ArmResourceCreatedResponse` {#Azure.ResourceManager.ArmResourceCreatedResponse} @@ -378,23 +364,6 @@ model Azure.ResourceManager.ArmResponse | statusCode | `200` | The status code. | | body | `ResponseBody` | | -### `CustomerManagedKeyEncryption` {#Azure.ResourceManager.CustomerManagedKeyEncryption} - -Customer-managed key encryption properties for the resource. - -```typespec -model Azure.ResourceManager.CustomerManagedKeyEncryption -``` - -#### Properties - -| Name | Type | Description | -| ------------------------------- | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| keyEncryptionKeyIdentity? | [`KeyEncryptionKeyIdentity`](./data-types.md#Azure.ResourceManager.KeyEncryptionKeyIdentity) | The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity. | -| userAssignedIdentityResourceId? | `Core.armResourceIdentifier` | User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity. | -| federatedClientId? | `Core.uuid` | application client identity to use for accessing key encryption key Url in a different tenant. Ex: f83c6b1b-4d34-47e4-bb34-9d83df58b540 | -| delegatedIdentityClientId? | `Core.uuid` | delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only. | - ### `DefaultProvisioningStateProperty` {#Azure.ResourceManager.DefaultProvisioningStateProperty} Standard resource provisioning state model. If you do not have any custom provisioning state, @@ -419,12 +388,13 @@ model FooProperties { | ------------------ | ---------------------------------------------------------------------------------------------- | --------------------------------------- | | provisioningState? | [`ResourceProvisioningState`](./data-types.md#Azure.ResourceManager.ResourceProvisioningState) | The provisioning state of the resource. | -### `Encryption` {#Azure.ResourceManager.Encryption} +### `EncryptionProperty` {#Azure.ResourceManager.EncryptionProperty} Model used only to spread in the `encryption` envelope property for a resource. +All encryption configuration for a resource. ```typespec -model Azure.ResourceManager.Encryption +model Azure.ResourceManager.EncryptionProperty ``` #### Examples @@ -437,25 +407,9 @@ model Foo is TrackedResource { #### Properties -| Name | Type | Description | -| ---------- | ------------------------------------------------------------------------------------------ | -------------------------------------------- | -| encryption | [`EncryptionConfiguration`](./data-types.md#Azure.ResourceManager.EncryptionConfiguration) | All encryption configuration for a resource. | - -### `EncryptionConfiguration` {#Azure.ResourceManager.EncryptionConfiguration} - -All encryption configuration for a resource. - -```typespec -model Azure.ResourceManager.EncryptionConfiguration -``` - -#### Properties - -| Name | Type | Description | -| ----------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| infrastructureEncryption? | [`InfrastructureEncryption`](./data-types.md#Azure.ResourceManager.InfrastructureEncryption) | Indicates if infrastructure encryption is enabled or disabled. | -| customerManagedKeyEncryption? | [`CustomerManagedKeyEncryption`](./data-types.md#Azure.ResourceManager.CustomerManagedKeyEncryption) | All customer-managed key encryption properties for the resource. | -| keyEncryptionKeyUrl? | `string` | key encryption key Url, versioned or unversioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek. | +| Name | Type | Description | +| ---------- | ---------------------------------------------------------------------------- | -------------------------------------------- | +| encryption | [`Encryption`](./data-types.md#Azure.ResourceManager.CommonTypes.Encryption) | All encryption configuration for a resource. | ### `EntityTagProperty` {#Azure.ResourceManager.EntityTagProperty} @@ -480,20 +434,6 @@ model Foo is TrackedResource { | ----- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | eTag? | `string` | If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. | -### `ErrorResponse` {#Azure.ResourceManager.ErrorResponse} - -The standard Azure Resource Manager error response - -```typespec -model Azure.ResourceManager.ErrorResponse -``` - -#### Properties - -| Name | Type | Description | -| ------ | ------------------------------------------------------------------------------ | ----------------- | -| error? | [`ErrorDetail`](./data-types.md#Azure.ResourceManager.Foundations.ErrorDetail) | The error object. | - ### `ExtendedLocationProperty` {#Azure.ResourceManager.ExtendedLocationProperty} Model representing the standard `extendedLocation` envelope property for a resource. @@ -516,7 +456,7 @@ model Employee is TrackedResource { | Name | Type | Description | | ----------------- | ---------------------------------------------------------------------------------------- | ----------- | -| extendedLocation? | [`ExtendedLocation`](./data-types.md#Azure.ResourceManager.Foundations.ExtendedLocation) | | +| extendedLocation? | [`ExtendedLocation`](./data-types.md#Azure.ResourceManager.CommonTypes.ExtendedLocation) | | ### `ExtensionResource` {#Azure.ResourceManager.ExtensionResource} @@ -573,20 +513,6 @@ model Azure.ResourceManager.LocationParameter | -------- | -------- | ------------------ | | location | `string` | The location name. | -### `LocationResourceParameter` {#Azure.ResourceManager.LocationResourceParameter} - -The default location parameter type. - -```typespec -model Azure.ResourceManager.LocationResourceParameter -``` - -#### Properties - -| Name | Type | Description | -| -------- | -------- | ------------------ | -| location | `string` | The location name. | - ### `ManagedByProperty` {#Azure.ResourceManager.ManagedByProperty} Model representing the standard `managedBy` envelope property for a resource. @@ -633,7 +559,7 @@ model Foo is TrackedResource { | Name | Type | Description | | --------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | -| identity? | [`ManagedServiceIdentity`](./data-types.md#Azure.ResourceManager.Foundations.ManagedServiceIdentity) | The managed service identities assigned to this resource. | +| identity? | [`ManagedServiceIdentity`](./data-types.md#Azure.ResourceManager.CommonTypes.ManagedServiceIdentity) | The managed service identities assigned to this resource. | ### `ManagedSystemAssignedIdentityProperty` {#Azure.ResourceManager.ManagedSystemAssignedIdentityProperty} @@ -658,7 +584,7 @@ model Foo is TrackedResource { | Name | Type | Description | | --------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------- | -| identity? | [`SystemAssignedServiceIdentity`](./data-types.md#Azure.ResourceManager.Foundations.SystemAssignedServiceIdentity) | The managed service identities assigned to this resource. | +| identity? | [`SystemAssignedServiceIdentity`](./data-types.md#Azure.ResourceManager.CommonTypes.SystemAssignedServiceIdentity) | The managed service identities assigned to this resource. | ### `ParentKeysOf` {#Azure.ResourceManager.ParentKeysOf} @@ -678,163 +604,6 @@ model Azure.ResourceManager.ParentKeysOf None -### `PrivateEndpoint` {#Azure.ResourceManager.PrivateEndpoint} - -The private endpoint resource - -```typespec -model Azure.ResourceManager.PrivateEndpoint -``` - -#### Properties - -| Name | Type | Description | -| ---- | ---------------------------- | -------------------------------------------- | -| id? | `Core.armResourceIdentifier` | The resource identifier for private endpoint | - -### `PrivateEndpointConnection` {#Azure.ResourceManager.PrivateEndpointConnection} - -The private endpoint connection resource - -```typespec -model Azure.ResourceManager.PrivateEndpointConnection -``` - -#### Properties - -| Name | Type | Description | -| ----------- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------ | -| properties? | [`PrivateEndpointConnectionProperties`](./data-types.md#Azure.ResourceManager.PrivateEndpointConnectionProperties) | The private endpoint connection properties | - -### `PrivateEndpointConnectionParameter` {#Azure.ResourceManager.PrivateEndpointConnectionParameter} - -The name of the private endpoint connection associated with the Azure resource. - -```typespec -model Azure.ResourceManager.PrivateEndpointConnectionParameter -``` - -#### Template Parameters - -| Name | Description | -| ------- | ----------------------------------------------------------------------------------------------- | -| Segment | The resource type name for private endpoint connections (default is privateEndpointConnections) | - -#### Properties - -| Name | Type | Description | -| ---- | -------- | ------------------------------------------------------------------------------- | -| name | `string` | The name of the private endpoint connection associated with the Azure resource. | - -### `PrivateEndpointConnectionProperties` {#Azure.ResourceManager.PrivateEndpointConnectionProperties} - -Properties of he private endpoint connection resource - -```typespec -model Azure.ResourceManager.PrivateEndpointConnectionProperties -``` - -#### Properties - -| Name | Type | Description | -| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| groupIds? | `string[]` | The group identifiers for the private endpoint resource | -| privateEndpoint? | [`PrivateEndpoint`](./data-types.md#Azure.ResourceManager.PrivateEndpoint) | The private endpoint resource | -| privateLinkServiceConnectionState | [`PrivateLinkServiceConnectionState`](./data-types.md#Azure.ResourceManager.PrivateLinkServiceConnectionState) | A collection of information about the state of the connection between service consumer and provider. | -| provisioningState? | [`PrivateEndpointConnectionProvisioningState`](./data-types.md#Azure.ResourceManager.PrivateEndpointConnectionProvisioningState) | The provisioning state of the private endpoint connection resource. | - -### `PrivateEndpointConnectionResourceListResult` {#Azure.ResourceManager.PrivateEndpointConnectionResourceListResult} - -List of private endpoint connections associated with the specified resource. - -```typespec -model Azure.ResourceManager.PrivateEndpointConnectionResourceListResult -``` - -#### Properties - -| Name | Type | Description | -| ------ | --------------------------------------------- | ------------------------------------- | -| value? | `ResourceManager.PrivateEndpointConnection[]` | Array of private endpoint connections | - -### `PrivateLinkResource` {#Azure.ResourceManager.PrivateLinkResource} - -```typespec -model Azure.ResourceManager.PrivateLinkResource -``` - -#### Properties - -| Name | Type | Description | -| ----------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------- | -| properties? | [`PrivateLinkResourceProperties`](./data-types.md#Azure.ResourceManager.PrivateLinkResourceProperties) | Properties of the private link resource. | - -### `PrivateLinkResourceListResult` {#Azure.ResourceManager.PrivateLinkResourceListResult} - -A list of private link resources. - -```typespec -model Azure.ResourceManager.PrivateLinkResourceListResult -``` - -#### Properties - -| Name | Type | Description | -| ------ | --------------------------------------- | ------------------------------- | -| value? | `ResourceManager.PrivateLinkResource[]` | Array of private link resources | - -### `PrivateLinkResourceParameter` {#Azure.ResourceManager.PrivateLinkResourceParameter} - -The name of the private link associated with the Azure resource. - -```typespec -model Azure.ResourceManager.PrivateLinkResourceParameter -``` - -#### Template Parameters - -| Name | Description | -| ------- | -------------------------------------------------------------------------- | -| Segment | The resource type name for private links (default is privateLinkResources) | - -#### Properties - -| Name | Type | Description | -| ---- | -------- | ---------------------------------------------------------------- | -| name | `string` | The name of the private link associated with the Azure resource. | - -### `PrivateLinkResourceProperties` {#Azure.ResourceManager.PrivateLinkResourceProperties} - -Properties of a private link resource. - -```typespec -model Azure.ResourceManager.PrivateLinkResourceProperties -``` - -#### Properties - -| Name | Type | Description | -| ------------------ | ---------- | ----------------------------------------------------- | -| groupId? | `string` | The private link resource group id. | -| requiredMembers? | `string[]` | The private link resource required member names. | -| requiredZoneNames? | `string[]` | The private link resource private link DNS zone name. | - -### `PrivateLinkServiceConnectionState` {#Azure.ResourceManager.PrivateLinkServiceConnectionState} - -A collection of information about the state of the connection between service consumer and provider. - -```typespec -model Azure.ResourceManager.PrivateLinkServiceConnectionState -``` - -#### Properties - -| Name | Type | Description | -| ---------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| status? | [`PrivateEndpointServiceConnectionStatus`](./data-types.md#Azure.ResourceManager.PrivateEndpointServiceConnectionStatus) | Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. | -| description? | `string` | The reason for approval/rejection of the connection. | -| actionsRequired? | `string` | A message indicating if changes on the service provider require any updates on the consumer. | - ### `ProviderNamespace` {#Azure.ResourceManager.ProviderNamespace} Model describing the provider namespace. @@ -888,23 +657,9 @@ model Azure.ResourceManager.ResourceGroupLocationResource #### Properties -| Name | Type | Description | -| -------- | -------- | ------------------ | -| location | `string` | The location name. | - -### `ResourceGroupParameter` {#Azure.ResourceManager.ResourceGroupParameter} - -The default resource group parameter type. - -```typespec -model Azure.ResourceManager.ResourceGroupParameter -``` - -#### Properties - -| Name | Type | Description | -| ----------------- | -------- | ------------------------------------------------------------- | -| resourceGroupName | `string` | The name of the resource group. The name is case insensitive. | +| Name | Type | Description | +| -------- | -------- | ----------------------------- | +| location | `string` | The name of the Azure region. | ### `ResourceInstanceParameters` {#Azure.ResourceManager.ResourceInstanceParameters} @@ -1045,7 +800,7 @@ model Foo is TrackedResource { | Name | Type | Description | | ----- | ---------------------------------------------------------------- | ----------------------------- | -| plan? | [`Plan`](./data-types.md#Azure.ResourceManager.Foundations.Plan) | Details of the resource plan. | +| plan? | [`Plan`](./data-types.md#Azure.ResourceManager.CommonTypes.Plan) | Details of the resource plan. | ### `ResourceSkuProperty` {#Azure.ResourceManager.ResourceSkuProperty} @@ -1069,7 +824,7 @@ model Foo is TrackedResource { | Name | Type | Description | | ---- | -------------------------------------------------------------- | ------------------------------------------------------- | -| sku? | [`Sku`](./data-types.md#Azure.ResourceManager.Foundations.Sku) | The SKU (Stock Keeping Unit) assigned to this resource. | +| sku? | [`Sku`](./data-types.md#Azure.ResourceManager.CommonTypes.Sku) | The SKU (Stock Keeping Unit) assigned to this resource. | ### `ResourceUriParameter` {#Azure.ResourceManager.ResourceUriParameter} @@ -1085,20 +840,6 @@ model Azure.ResourceManager.ResourceUriParameter | ----------- | -------- | ---------------------------------------------------------------------- | | resourceUri | `string` | The fully qualified Azure Resource manager identifier of the resource. | -### `SubscriptionIdParameter` {#Azure.ResourceManager.SubscriptionIdParameter} - -The default subscriptionId parameter type. - -```typespec -model Azure.ResourceManager.SubscriptionIdParameter -``` - -#### Properties - -| Name | Type | Description | -| -------------- | -------- | ---------------------------------- | -| subscriptionId | `string` | The ID of the target subscription. | - ### `SubscriptionLocationResource` {#Azure.ResourceManager.SubscriptionLocationResource} The location resource for subscription-based locations. This can be used as a parent @@ -1110,9 +851,9 @@ model Azure.ResourceManager.SubscriptionLocationResource #### Properties -| Name | Type | Description | -| -------- | -------- | ------------------ | -| location | `string` | The location name. | +| Name | Type | Description | +| -------- | -------- | ----------------------------- | +| location | `string` | The name of the Azure region. | ### `TenantLocationResource` {#Azure.ResourceManager.TenantLocationResource} @@ -1125,9 +866,9 @@ model Azure.ResourceManager.TenantLocationResource #### Properties -| Name | Type | Description | -| -------- | -------- | ------------------ | -| location | `string` | The location name. | +| Name | Type | Description | +| -------- | -------- | ----------------------------- | +| location | `string` | The name of the Azure region. | ### `TrackedResource` {#Azure.ResourceManager.TrackedResource} @@ -1159,38 +900,6 @@ Supported versions of Azure.ResourceManager building blocks. enum Azure.ResourceManager.Versions ``` -### `InfrastructureEncryption` {#Azure.ResourceManager.InfrastructureEncryption} - -(Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. - -```typespec -union Azure.ResourceManager.InfrastructureEncryption -``` - -### `KeyEncryptionKeyIdentity` {#Azure.ResourceManager.KeyEncryptionKeyIdentity} - -The type of identity to use. - -```typespec -union Azure.ResourceManager.KeyEncryptionKeyIdentity -``` - -### `PrivateEndpointConnectionProvisioningState` {#Azure.ResourceManager.PrivateEndpointConnectionProvisioningState} - -The provisioning state of the connection - -```typespec -union Azure.ResourceManager.PrivateEndpointConnectionProvisioningState -``` - -### `PrivateEndpointServiceConnectionStatus` {#Azure.ResourceManager.PrivateEndpointServiceConnectionStatus} - -The private endpoint connection status - -```typespec -union Azure.ResourceManager.PrivateEndpointServiceConnectionStatus -``` - ### `ResourceProvisioningState` {#Azure.ResourceManager.ResourceProvisioningState} Standard terminal provisioning state of resource type. You can include in your @@ -1214,52 +923,40 @@ union FooProvisioningState { ## Azure.ResourceManager.CommonTypes -### `Versions` {#Azure.ResourceManager.CommonTypes.Versions} - -The Azure Resource Manager common-types versions. - -```typespec -enum Azure.ResourceManager.CommonTypes.Versions -``` - -## Azure.ResourceManager.Foundations - -### `ArmTagsProperty` {#Azure.ResourceManager.Foundations.ArmTagsProperty} - -Standard type definition for Azure Resource Manager Tags property. +### `ApiVersionParameter` {#Azure.ResourceManager.CommonTypes.ApiVersionParameter} -It is included in the TrackedResource template definition. +The default api-version parameter type. ```typespec -model Azure.ResourceManager.Foundations.ArmTagsProperty +model Azure.ResourceManager.CommonTypes.ApiVersionParameter ``` #### Properties -| Name | Type | Description | -| ----- | ---------------- | -------------- | -| tags? | `Record` | Resource tags. | +| Name | Type | Description | +| ---------- | -------- | ------------------------------------------ | +| apiVersion | `string` | The API version to use for this operation. | -### `AzureEntityResource` {#Azure.ResourceManager.Foundations.AzureEntityResource} +### `AzureEntityResource` {#Azure.ResourceManager.CommonTypes.AzureEntityResource} The resource model definition for an Azure Resource Manager resource with an etag. ```typespec -model Azure.ResourceManager.Foundations.AzureEntityResource +model Azure.ResourceManager.CommonTypes.AzureEntityResource ``` #### Properties -| Name | Type | Description | -| ---- | -------- | -------------- | -| etag | `string` | Resource Etag. | +| Name | Type | Description | +| ----- | -------- | -------------- | +| etag? | `string` | Resource Etag. | -### `CheckNameAvailabilityRequest` {#Azure.ResourceManager.Foundations.CheckNameAvailabilityRequest} +### `CheckNameAvailabilityRequest` {#Azure.ResourceManager.CommonTypes.CheckNameAvailabilityRequest} The check availability request body. ```typespec -model Azure.ResourceManager.Foundations.CheckNameAvailabilityRequest +model Azure.ResourceManager.CommonTypes.CheckNameAvailabilityRequest ``` #### Properties @@ -1269,12 +966,12 @@ model Azure.ResourceManager.Foundations.CheckNameAvailabilityRequest | name? | `string` | The name of the resource for which availability needs to be checked. | | type? | `string` | The resource type. | -### `CheckNameAvailabilityResponse` {#Azure.ResourceManager.Foundations.CheckNameAvailabilityResponse} +### `CheckNameAvailabilityResponse` {#Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse} The check availability result. ```typespec -model Azure.ResourceManager.Foundations.CheckNameAvailabilityResponse +model Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse ``` #### Properties @@ -1282,54 +979,75 @@ model Azure.ResourceManager.Foundations.CheckNameAvailabilityResponse | Name | Type | Description | | -------------- | -------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | | nameAvailable? | `boolean` | Indicates if the resource name is available. | -| reason? | [`CheckNameAvailabilityReason`](./data-types.md#Azure.ResourceManager.Foundations.CheckNameAvailabilityReason) | The reason why the given name is not available. | +| reason? | [`CheckNameAvailabilityReason`](./data-types.md#Azure.ResourceManager.CommonTypes.CheckNameAvailabilityReason) | The reason why the given name is not available. | | message? | `string` | Detailed reason why the given name is not available. | -### `DefaultBaseParameters` {#Azure.ResourceManager.Foundations.DefaultBaseParameters} +### `CustomerManagedKeyEncryption` {#Azure.ResourceManager.CommonTypes.CustomerManagedKeyEncryption} -Base parameters for a resource. +Customer-managed key encryption properties for the resource. ```typespec -model Azure.ResourceManager.Foundations.DefaultBaseParameters +model Azure.ResourceManager.CommonTypes.CustomerManagedKeyEncryption ``` -#### Template Parameters - -| Name | Description | -| -------- | ------------------------- | -| Resource | The type of the resource. | - #### Properties -| Name | Type | Description | -| ----------------- | -------- | ---------------------------------------------------------------------- | -| apiVersion | `string` | The API version to use for this operation. | -| subscriptionId | `string` | The ID of the target subscription. | -| location | `string` | The location name. | -| resourceGroupName | `string` | The name of the resource group. The name is case insensitive. | -| resourceUri | `string` | The fully qualified Azure Resource manager identifier of the resource. | +| Name | Type | Description | +| ------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| keyEncryptionKeyIdentity? | [`KeyEncryptionKeyIdentity`](./data-types.md#Azure.ResourceManager.CommonTypes.KeyEncryptionKeyIdentity) | All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. | +| keyEncryptionKeyUrl? | `string` | key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek. | -### `ErrorAdditionalInfo` {#Azure.ResourceManager.Foundations.ErrorAdditionalInfo} +### `Encryption` {#Azure.ResourceManager.CommonTypes.Encryption} -The resource management error additional info. +(Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. ```typespec -model Azure.ResourceManager.Foundations.ErrorAdditionalInfo +model Azure.ResourceManager.CommonTypes.Encryption ``` #### Properties -| Name | Type | Description | -| ----- | -------- | ------------------------- | +| Name | Type | Description | +| ----------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | +| infrastructureEncryption? | [`InfrastructureEncryption`](./data-types.md#Azure.ResourceManager.CommonTypes.InfrastructureEncryption) | Values are enabled and disabled. | +| customerManagedKeyEncryption? | [`CustomerManagedKeyEncryption`](./data-types.md#Azure.ResourceManager.CommonTypes.CustomerManagedKeyEncryption) | All Customer-managed key encryption properties for the resource. | + +### `EncryptionProperties` {#Azure.ResourceManager.CommonTypes.EncryptionProperties} + +Configuration of key for data encryption + +```typespec +model Azure.ResourceManager.CommonTypes.EncryptionProperties +``` + +#### Properties + +| Name | Type | Description | +| ------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| status? | [`EncryptionStatus`](./data-types.md#Azure.ResourceManager.CommonTypes.EncryptionStatus) | Indicates whether or not the encryption is enabled for container registry. | +| keyVaultProperties? | [`KeyVaultProperties`](./data-types.md#Azure.ResourceManager.CommonTypes.KeyVaultProperties) | Key vault properties. | + +### `ErrorAdditionalInfo` {#Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo} + +The resource management error additional info. + +```typespec +model Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo +``` + +#### Properties + +| Name | Type | Description | +| ----- | -------- | ------------------------- | | type? | `string` | The additional info type. | | info? | `{}` | The additional info. | -### `ErrorDetail` {#Azure.ResourceManager.Foundations.ErrorDetail} +### `ErrorDetail` {#Azure.ResourceManager.CommonTypes.ErrorDetail} The error detail. ```typespec -model Azure.ResourceManager.Foundations.ErrorDetail +model Azure.ResourceManager.CommonTypes.ErrorDetail ``` #### Properties @@ -1339,15 +1057,29 @@ model Azure.ResourceManager.Foundations.ErrorDetail | code? | `string` | The error code. | | message? | `string` | The error message. | | target? | `string` | The error target. | -| details? | `ResourceManager.Foundations.ErrorDetail[]` | The error details. | -| additionalInfo? | `ResourceManager.Foundations.ErrorAdditionalInfo[]` | The error additional info. | +| details? | `ResourceManager.CommonTypes.ErrorDetail[]` | The error details. | +| additionalInfo? | `ResourceManager.CommonTypes.ErrorAdditionalInfo[]` | The error additional info. | + +### `ErrorResponse` {#Azure.ResourceManager.CommonTypes.ErrorResponse} + +Common error response for all Azure Resource Manager APIs to return error details for failed operations. + +```typespec +model Azure.ResourceManager.CommonTypes.ErrorResponse +``` -### `ExtendedLocation` {#Azure.ResourceManager.Foundations.ExtendedLocation} +#### Properties + +| Name | Type | Description | +| ------ | ------------------------------------------------------------------------------ | ----------------- | +| error? | [`ErrorDetail`](./data-types.md#Azure.ResourceManager.CommonTypes.ErrorDetail) | The error object. | + +### `ExtendedLocation` {#Azure.ResourceManager.CommonTypes.ExtendedLocation} The complex type of the extended location. ```typespec -model Azure.ResourceManager.Foundations.ExtendedLocation +model Azure.ResourceManager.CommonTypes.ExtendedLocation ``` #### Properties @@ -1355,119 +1087,176 @@ model Azure.ResourceManager.Foundations.ExtendedLocation | Name | Type | Description | | ---- | ------------------------------------------------------------------------------------------------ | ---------------------------------- | | name | `string` | The name of the extended location. | -| type | [`ExtendedLocationType`](./data-types.md#Azure.ResourceManager.Foundations.ExtendedLocationType) | The type of the extended location. | +| type | [`ExtendedLocationType`](./data-types.md#Azure.ResourceManager.CommonTypes.ExtendedLocationType) | The type of the extended location. | -### `ExtensionBaseParameters` {#Azure.ResourceManager.Foundations.ExtensionBaseParameters} +### `ExtensionResource` {#Azure.ResourceManager.CommonTypes.ExtensionResource} -The static parameters for an extension resource +The base extension resource. ```typespec -model Azure.ResourceManager.Foundations.ExtensionBaseParameters +model Azure.ResourceManager.CommonTypes.ExtensionResource ``` #### Properties -| Name | Type | Description | -| ----------- | -------- | ---------------------------------------------------------------------- | -| apiVersion | `string` | The API version to use for this operation. | -| resourceUri | `string` | The fully qualified Azure Resource manager identifier of the resource. | +None -### `ExtensionResource` {#Azure.ResourceManager.Foundations.ExtensionResource} +### `Identity` {#Azure.ResourceManager.CommonTypes.Identity} -The base extension resource. +Identity for the resource. ```typespec -model Azure.ResourceManager.Foundations.ExtensionResource +model Azure.ResourceManager.CommonTypes.Identity ``` #### Properties -None +| Name | Type | Description | +| ------------ | ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------- | +| principalId? | `Core.uuid` | The principal ID of resource identity. The value must be an UUID. | +| tenantId? | `Core.uuid` | The tenant ID of resource. The value must be an UUID. | +| type? | [`ResourceIdentityType`](./data-types.md#Azure.ResourceManager.CommonTypes.ResourceIdentityType) | The identity type. | -### `ExtensionScope` {#Azure.ResourceManager.Foundations.ExtensionScope} +### `IfMatchHeader` {#Azure.ResourceManager.CommonTypes.IfMatchHeader} -Parameter model for listing an extension resource +The default ARM If-Match header type. ```typespec -model Azure.ResourceManager.Foundations.ExtensionScope +model Azure.ResourceManager.CommonTypes.IfMatchHeader ``` -#### Template Parameters +#### Properties -| Name | Description | -| -------- | ------------------------- | -| Resource | The type of the resource. | +| Name | Type | Description | +| ------- | -------- | ----------------------------------------------------- | +| ifMatch | `string` | The If-Match header that makes a request conditional. | + +### `IfNoneMatchHeader` {#Azure.ResourceManager.CommonTypes.IfNoneMatchHeader} + +The default ARM If-Match header type. + +```typespec +model Azure.ResourceManager.CommonTypes.IfNoneMatchHeader +``` #### Properties -| Name | Type | Description | -| ----------- | -------------------------------- | ---------------------------------------------------------------------- | -| apiVersion | `string` | The API version to use for this operation. | -| resourceUri | `string` | The fully qualified Azure Resource manager identifier of the resource. | -| provider | `"Microsoft.ThisWillBeReplaced"` | | +| Name | Type | Description | +| ----------- | -------- | ---------------------------------------------------------- | +| ifNoneMatch | `string` | The If-None-Match header that makes a request conditional. | -### `LocationBaseParameters` {#Azure.ResourceManager.Foundations.LocationBaseParameters} +### `KeyEncryptionKeyIdentity` {#Azure.ResourceManager.CommonTypes.KeyEncryptionKeyIdentity} -The static parameters for a location-based resource +All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. ```typespec -model Azure.ResourceManager.Foundations.LocationBaseParameters +model Azure.ResourceManager.CommonTypes.KeyEncryptionKeyIdentity ``` #### Properties -| Name | Type | Description | -| -------------- | -------- | ------------------------------------------ | -| apiVersion | `string` | The API version to use for this operation. | -| subscriptionId | `string` | The ID of the target subscription. | -| location | `string` | The location name. | +| Name | Type | Description | +| ------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| identityType? | [`KeyEncryptionKeyIdentityType`](./data-types.md#Azure.ResourceManager.CommonTypes.KeyEncryptionKeyIdentityType) | The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity. | +| userAssignedIdentityResourceId? | `Core.armResourceIdentifier` | User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity. | +| federatedClientId? | `Core.uuid` | application client identity to use for accessing key encryption key Url in a different tenant. Ex: f83c6b1b-4d34-47e4-bb34-9d83df58b540 | +| delegatedIdentityClientId? | `Core.uuid` | delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only. | -### `LocationScope` {#Azure.ResourceManager.Foundations.LocationScope} +### `KeyVaultProperties` {#Azure.ResourceManager.CommonTypes.KeyVaultProperties} -Parameter model for listing a resource at the location scope +```typespec +model Azure.ResourceManager.CommonTypes.KeyVaultProperties +``` + +#### Properties + +| Name | Type | Description | +| -------------- | -------- | --------------------------------------------------------------------- | +| keyIdentifier? | `string` | Key vault uri to access the encryption key. | +| identity? | `string` | The client ID of the identity which will be used to access key vault. | + +### `LocationData` {#Azure.ResourceManager.CommonTypes.LocationData} + +Metadata pertaining to the geographic location of the resource. ```typespec -model Azure.ResourceManager.Foundations.LocationScope +model Azure.ResourceManager.CommonTypes.LocationData ``` -#### Template Parameters +#### Properties -| Name | Description | -| -------- | ------------------------- | -| Resource | The type of the resource. | +| Name | Type | Description | +| ---------------- | -------- | --------------------------------------------------------------- | +| name | `string` | A canonical name for the geographic or physical location. | +| city? | `string` | The city or locality where the resource is located. | +| district? | `string` | The district, state, or province where the resource is located. | +| countryOrRegion? | `string` | The country or region where the resource is located | + +### `LocationParameter` {#Azure.ResourceManager.CommonTypes.LocationParameter} + +The default location parameter type. + +```typespec +model Azure.ResourceManager.CommonTypes.LocationParameter +``` + +#### Properties + +| Name | Type | Description | +| -------- | -------- | ------------------------- | +| location | `string` | The name of Azure region. | + +### `LocationResourceParameter` {#Azure.ResourceManager.CommonTypes.LocationResourceParameter} + +The default location parameter type. + +```typespec +model Azure.ResourceManager.CommonTypes.LocationResourceParameter +``` + +#### Properties + +| Name | Type | Description | +| -------- | -------- | ----------------------------- | +| location | `string` | The name of the Azure region. | + +### `ManagedServiceIdentity` {#Azure.ResourceManager.CommonTypes.ManagedServiceIdentity} + +Managed service identity (system assigned and/or user assigned identities) + +```typespec +model Azure.ResourceManager.CommonTypes.ManagedServiceIdentity +``` #### Properties -| Name | Type | Description | -| -------------- | -------------------------------- | ------------------------------------------ | -| apiVersion | `string` | The API version to use for this operation. | -| subscriptionId | `string` | The ID of the target subscription. | -| location | `string` | The location name. | -| provider | `"Microsoft.ThisWillBeReplaced"` | | +| Name | Type | Description | +| ----------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- | +| principalId? | `Core.uuid` | The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. | +| tenantId? | `Core.uuid` | The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. | +| type | [`ManagedServiceIdentityType`](./data-types.md#Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType) | The type of managed identity assigned to this resource. | +| userAssignedIdentities? | `Record \| null` | The identities assigned to this resource by the user. | -### `ManagedServiceIdentity` {#Azure.ResourceManager.Foundations.ManagedServiceIdentity} +### `ManagementGroupNameParameter` {#Azure.ResourceManager.CommonTypes.ManagementGroupNameParameter} -The properties of the managed service identities assigned to this resource. +The default ManagementGroupName parameter type. ```typespec -model Azure.ResourceManager.Foundations.ManagedServiceIdentity +model Azure.ResourceManager.CommonTypes.ManagementGroupNameParameter ``` #### Properties -| Name | Type | Description | -| ----------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------- | -| tenantId? | `string` | The Active Directory tenant id of the principal. | -| principalId? | `string` | The active directory identifier of this principal. | -| type | [`ManagedServiceIdentityType`](./data-types.md#Azure.ResourceManager.Foundations.ManagedServiceIdentityType) | The type of managed identity assigned to this resource. | -| userAssignedIdentities? | `Record` | The identities assigned to this resource by the user. | +| Name | Type | Description | +| ------------------- | -------- | --------------------------------------------------------------- | +| managementGroupName | `string` | The name of the management group. The name is case insensitive. | -### `Operation` {#Azure.ResourceManager.Foundations.Operation} +### `Operation` {#Azure.ResourceManager.CommonTypes.Operation} Details of a REST API operation, returned from the Resource Provider Operations API ```typespec -model Azure.ResourceManager.Foundations.Operation +model Azure.ResourceManager.CommonTypes.Operation ``` #### Properties @@ -1476,16 +1265,16 @@ model Azure.ResourceManager.Foundations.Operation | ------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | name? | `string` | The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" | | isDataAction? | `boolean` | Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. | -| display? | [`OperationDisplay`](./data-types.md#Azure.ResourceManager.Foundations.OperationDisplay) | Localized display information for this particular operation. | -| origin? | [`Origin`](./data-types.md#Azure.ResourceManager.Foundations.Origin) | The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" | -| actionType? | [`ActionType`](./data-types.md#Azure.ResourceManager.Foundations.ActionType) | Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. | +| display? | [`OperationDisplay`](./data-types.md#Azure.ResourceManager.CommonTypes.OperationDisplay) | Localized display information for this particular operation. | +| origin? | [`Origin`](./data-types.md#Azure.ResourceManager.CommonTypes.Origin) | The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" | +| actionType? | [`ActionType`](./data-types.md#Azure.ResourceManager.CommonTypes.ActionType) | Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. | -### `OperationDisplay` {#Azure.ResourceManager.Foundations.OperationDisplay} +### `OperationDisplay` {#Azure.ResourceManager.CommonTypes.OperationDisplay} Localized display information for and operation. ```typespec -model Azure.ResourceManager.Foundations.OperationDisplay +model Azure.ResourceManager.CommonTypes.OperationDisplay ``` #### Properties @@ -1497,12 +1286,12 @@ model Azure.ResourceManager.Foundations.OperationDisplay | operation? | `string` | The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". | | description? | `string` | The short, localized friendly description of the operation; suitable for tool tips and detailed views. | -### `OperationIdParameter` {#Azure.ResourceManager.Foundations.OperationIdParameter} +### `OperationIdParameter` {#Azure.ResourceManager.CommonTypes.OperationIdParameter} The default operationId parameter type. ```typespec -model Azure.ResourceManager.Foundations.OperationIdParameter +model Azure.ResourceManager.CommonTypes.OperationIdParameter ``` #### Properties @@ -1511,27 +1300,27 @@ model Azure.ResourceManager.Foundations.OperationIdParameter | ----------- | -------- | ------------------------------------- | | operationId | `string` | The ID of an ongoing async operation. | -### `OperationListResult` {#Azure.ResourceManager.Foundations.OperationListResult} +### `OperationListResult` {#Azure.ResourceManager.CommonTypes.OperationListResult} A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. ```typespec -model Azure.ResourceManager.Foundations.OperationListResult +model Azure.ResourceManager.CommonTypes.OperationListResult ``` #### Properties | Name | Type | Description | | --------- | ----------------------------------------- | ---------------------------------- | -| value | `ResourceManager.Foundations.Operation[]` | The Operation items on this page | +| value | `ResourceManager.CommonTypes.Operation[]` | The Operation items on this page | | nextLink? | `TypeSpec.Rest.ResourceLocation` | The link to the next page of items | -### `OperationStatusResult` {#Azure.ResourceManager.Foundations.OperationStatusResult} +### `OperationStatusResult` {#Azure.ResourceManager.CommonTypes.OperationStatusResult} The current status of an async operation. ```typespec -model Azure.ResourceManager.Foundations.OperationStatusResult +model Azure.ResourceManager.CommonTypes.OperationStatusResult ``` #### Properties @@ -1544,15 +1333,15 @@ model Azure.ResourceManager.Foundations.OperationStatusResult | percentComplete? | `float64` | Percent of the operation that is complete. | | startTime? | `utcDateTime` | The start time of the operation. | | endTime? | `utcDateTime` | The end time of the operation. | -| operations | `ResourceManager.Foundations.OperationStatusResult[]` | The operations list. | -| error? | [`ErrorDetail`](./data-types.md#Azure.ResourceManager.Foundations.ErrorDetail) | If present, details of the operation error. | +| operations? | `ResourceManager.CommonTypes.OperationStatusResult[]` | The operations list. | +| error? | [`ErrorDetail`](./data-types.md#Azure.ResourceManager.CommonTypes.ErrorDetail) | If present, details of the operation error. | -### `Plan` {#Azure.ResourceManager.Foundations.Plan} +### `Plan` {#Azure.ResourceManager.CommonTypes.Plan} -Details of the resource plan. +Plan for the resource. ```typespec -model Azure.ResourceManager.Foundations.Plan +model Azure.ResourceManager.CommonTypes.Plan ``` #### Properties @@ -1565,396 +1354,803 @@ model Azure.ResourceManager.Foundations.Plan | promotionCode? | `string` | A publisher provided promotion code as provisioned in Data Market for the said product/artifact. | | version? | `string` | The version of the desired product/artifact. | -### `ProxyResource` {#Azure.ResourceManager.Foundations.ProxyResource} +### `PrivateEndpoint` {#Azure.ResourceManager.CommonTypes.PrivateEndpoint} -The base proxy resource. +The Private Endpoint resource. ```typespec -model Azure.ResourceManager.Foundations.ProxyResource +model Azure.ResourceManager.CommonTypes.PrivateEndpoint ``` #### Properties -None +| Name | Type | Description | +| ---- | ---------------------------- | -------------------------------------------- | +| id? | `Core.armResourceIdentifier` | The resource identifier for private endpoint | -### `ProxyResourceUpdateModel` {#Azure.ResourceManager.Foundations.ProxyResourceUpdateModel} +### `PrivateEndpointConnection` {#Azure.ResourceManager.CommonTypes.PrivateEndpointConnection} -The type used for update operations of the resource. +The private endpoint connection resource ```typespec -model Azure.ResourceManager.Foundations.ProxyResourceUpdateModel +model Azure.ResourceManager.CommonTypes.PrivateEndpointConnection ``` -#### Template Parameters - -| Name | Description | -| ---------- | --------------------------- | -| Resource | The type of the resource. | -| Properties | The type of the properties. | - #### Properties -| Name | Type | Description | -| ----------- | --------------------------------------------------------------------------------- | ----------- | -| properties? | `ResourceManager.Foundations.ResourceUpdateModelProperties` | | +| Name | Type | Description | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------ | +| properties? | [`PrivateEndpointConnectionProperties`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties) | The private endpoint connection properties | -### `Resource` {#Azure.ResourceManager.Foundations.Resource} +### `PrivateEndpointConnectionListResult` {#Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionListResult} -Base model that defines common properties for all Azure Resource Manager resources. +List of private endpoint connections associated with the specified resource. ```typespec -model Azure.ResourceManager.Foundations.Resource +model Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionListResult ``` #### Properties -| Name | Type | Description | -| ----------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| id? | `string` | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} | -| name? | `string` | The name of the resource | -| type? | `string` | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" | -| systemData? | [`SystemData`](./data-types.md#Azure.ResourceManager.Foundations.SystemData) | Azure Resource Manager metadata containing createdBy and modifiedBy information. | +| Name | Type | Description | +| ------ | --------------------------------------------------------- | -------------------------------------- | +| value? | `ResourceManager.CommonTypes.PrivateEndpointConnection[]` | Array of private endpoint connections. | -### `ResourceGroupBaseParameters` {#Azure.ResourceManager.Foundations.ResourceGroupBaseParameters} +### `PrivateEndpointConnectionParameter` {#Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionParameter} -The static parameters for a resource-group based resource +The name of the private endpoint connection associated with the Azure resource. ```typespec -model Azure.ResourceManager.Foundations.ResourceGroupBaseParameters +model Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionParameter ``` +#### Template Parameters + +| Name | Description | +| ------- | ----------------------------------------------------------------------------------------------- | +| Segment | The resource type name for private endpoint connections (default is privateEndpointConnections) | + #### Properties -| Name | Type | Description | -| ----------------- | -------- | ------------------------------------------------------------- | -| apiVersion | `string` | The API version to use for this operation. | -| subscriptionId | `string` | The ID of the target subscription. | -| resourceGroupName | `string` | The name of the resource group. The name is case insensitive. | +| Name | Type | Description | +| ---- | -------- | ------------------------------------------------------------------------------- | +| name | `string` | The name of the private endpoint connection associated with the Azure resource. | -### `ResourceGroupScope` {#Azure.ResourceManager.Foundations.ResourceGroupScope} +### `PrivateEndpointConnectionProperties` {#Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties} -Parameter model for listing a resource at the resource group scope +Properties of the private endpoint connection. ```typespec -model Azure.ResourceManager.Foundations.ResourceGroupScope +model Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties ``` -#### Template Parameters - -| Name | Description | -| -------- | ------------------------- | -| Resource | The type of the resource. | - #### Properties -| Name | Type | Description | -| ----------------- | -------------------------------- | ---------------------------------------------------------------------- | -| apiVersion | `string` | The API version to use for this operation. | -| subscriptionId | `string` | The ID of the target subscription. | -| location | `string` | The location name. | -| resourceGroupName | `string` | The name of the resource group. The name is case insensitive. | -| resourceUri | `string` | The fully qualified Azure Resource manager identifier of the resource. | -| provider | `"Microsoft.ThisWillBeReplaced"` | | +| Name | Type | Description | +| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| groupIds? | `string[]` | The group ids for the private endpoint resource. | +| privateEndpoint? | [`PrivateEndpoint`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateEndpoint) | The private endpoint resource. | +| privateLinkServiceConnectionState | [`PrivateLinkServiceConnectionState`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState) | A collection of information about the state of the connection between service consumer and provider. | +| provisioningState? | [`PrivateEndpointConnectionProvisioningState`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState) | The provisioning state of the private endpoint connection resource. | -### `ResourceUpdateModel` {#Azure.ResourceManager.Foundations.ResourceUpdateModel} +### `PrivateLinkResource` {#Azure.ResourceManager.CommonTypes.PrivateLinkResource} -Defines a model type used to create named resource update models -e.g. `model MyResourceUpdate is ResourceUpdate {}` +A private link resource. ```typespec -model Azure.ResourceManager.Foundations.ResourceUpdateModel +model Azure.ResourceManager.CommonTypes.PrivateLinkResource ``` -#### Template Parameters +#### Properties -| Name | Description | -| ---------- | --------------------------- | -| Resource | The type of the resource. | -| Properties | The type of the properties. | +| Name | Type | Description | +| ----------- | ------------------------------------------------------------------------------------------------------------------ | -------------------- | +| properties? | [`PrivateLinkResourceProperties`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties) | Resource properties. | + +### `PrivateLinkResourceListResult` {#Azure.ResourceManager.CommonTypes.PrivateLinkResourceListResult} + +A list of private link resources. + +```typespec +model Azure.ResourceManager.CommonTypes.PrivateLinkResourceListResult +``` #### Properties -| Name | Type | Description | -| ----------- | --------------------------------------------------------------------------------- | ----------- | -| properties? | `ResourceManager.Foundations.ResourceUpdateModelProperties` | | +| Name | Type | Description | +| ------ | --------------------------------------------------- | ------------------------------- | +| value? | `ResourceManager.CommonTypes.PrivateLinkResource[]` | Array of private link resources | -### `ResourceUpdateModelProperties` {#Azure.ResourceManager.Foundations.ResourceUpdateModelProperties} +### `PrivateLinkResourceParameter` {#Azure.ResourceManager.CommonTypes.PrivateLinkResourceParameter} -Defines a properties type used to create named resource update models. -This type is not used directly, it is referenced by ResourceUpdateModel. +The name of the private link associated with the Azure resource. ```typespec -model Azure.ResourceManager.Foundations.ResourceUpdateModelProperties +model Azure.ResourceManager.CommonTypes.PrivateLinkResourceParameter ``` #### Template Parameters -| Name | Description | -| ---------- | --------------------------- | -| Resource | The type of the resource. | -| Properties | The type of the properties. | +| Name | Description | +| ------- | -------------------------------------------------------------------------- | +| Segment | The resource type name for private links (default is privateLinkResources) | #### Properties -None +| Name | Type | Description | +| ---- | -------- | ---------------------------------------------------------------- | +| name | `string` | The name of the private link associated with the Azure resource. | -### `Sku` {#Azure.ResourceManager.Foundations.Sku} +### `PrivateLinkResourceProperties` {#Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties} -The SKU (Stock Keeping Unit) assigned to this resource. +Properties of a private link resource. ```typespec -model Azure.ResourceManager.Foundations.Sku +model Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties ``` #### Properties -| Name | Type | Description | -| --------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| name | `string` | The name of the SKU, usually a combination of letters and numbers, for example, 'P3' | -| tier? | [`SkuTier`](./data-types.md#Azure.ResourceManager.Foundations.SkuTier) | This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. | -| size? | `string` | The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. | -| family? | `string` | If the service has different generations of hardware, for the same SKU, then that can be captured here. | -| capacity? | `int32` | If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. | +| Name | Type | Description | +| ------------------ | ---------- | ----------------------------------------------------- | +| groupId? | `string` | The private link resource group id. | +| requiredMembers? | `string[]` | The private link resource required member names. | +| requiredZoneNames? | `string[]` | The private link resource private link DNS zone name. | -### `SubscriptionBaseParameters` {#Azure.ResourceManager.Foundations.SubscriptionBaseParameters} +### `PrivateLinkServiceConnectionState` {#Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState} -The static parameters for a subscription based resource +A collection of information about the state of the connection between service consumer and provider. ```typespec -model Azure.ResourceManager.Foundations.SubscriptionBaseParameters +model Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState ``` #### Properties -| Name | Type | Description | -| -------------- | -------- | ------------------------------------------ | -| apiVersion | `string` | The API version to use for this operation. | -| subscriptionId | `string` | The ID of the target subscription. | +| Name | Type | Description | +| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| status? | [`PrivateEndpointServiceConnectionStatus`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus) | Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. | +| description? | `string` | The reason for approval/rejection of the connection. | +| actionsRequired? | `string` | A message indicating if changes on the service provider require any updates on the consumer. | -### `SubscriptionScope` {#Azure.ResourceManager.Foundations.SubscriptionScope} +### `ProxyResource` {#Azure.ResourceManager.CommonTypes.ProxyResource} -Parameter model for listing a resource at the subscription scope +The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location ```typespec -model Azure.ResourceManager.Foundations.SubscriptionScope +model Azure.ResourceManager.CommonTypes.ProxyResource ``` -#### Template Parameters - -| Name | Description | -| -------- | ------------------------- | -| Resource | The type of the resource. | - #### Properties -| Name | Type | Description | -| -------------- | -------------------------------- | ------------------------------------------ | -| apiVersion | `string` | The API version to use for this operation. | -| subscriptionId | `string` | The ID of the target subscription. | -| provider | `"Microsoft.ThisWillBeReplaced"` | | +None -### `SystemAssignedServiceIdentity` {#Azure.ResourceManager.Foundations.SystemAssignedServiceIdentity} +### `Resource` {#Azure.ResourceManager.CommonTypes.Resource} -The properties of the service-assigned identity associated with this resource. +Common fields that are returned in the response for all Azure Resource Manager resources ```typespec -model Azure.ResourceManager.Foundations.SystemAssignedServiceIdentity +model Azure.ResourceManager.CommonTypes.Resource ``` #### Properties -| Name | Type | Description | -| ------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | -| tenantId? | `string` | The Active Directory tenant id of the principal. | -| principalId? | `string` | The active directory identifier of this principal. | -| type | [`SystemAssignedServiceIdentityType`](./data-types.md#Azure.ResourceManager.Foundations.SystemAssignedServiceIdentityType) | The type of managed identity assigned to this resource. | +| Name | Type | Description | +| ----------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| id? | `Core.armResourceIdentifier` | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} | +| name? | `string` | The name of the resource | +| type? | `string` | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" | +| systemData? | [`SystemData`](./data-types.md#Azure.ResourceManager.CommonTypes.SystemData) | Azure Resource Manager metadata containing createdBy and modifiedBy information. | -### `SystemData` {#Azure.ResourceManager.Foundations.SystemData} +### `ResourceGroupNameParameter` {#Azure.ResourceManager.CommonTypes.ResourceGroupNameParameter} -Metadata pertaining to creation and last modification of the resource. +The default resource group parameter type. ```typespec -model Azure.ResourceManager.Foundations.SystemData +model Azure.ResourceManager.CommonTypes.ResourceGroupNameParameter ``` #### Properties -| Name | Type | Description | -| ------------------- | ---------------------------------------------------------------------------------- | ----------------------------------------------------- | -| createdBy? | `string` | The identity that created the resource. | -| createdByType? | [`createdByType`](./data-types.md#Azure.ResourceManager.Foundations.createdByType) | The type of identity that created the resource. | -| createdAt? | `plainDate` | The type of identity that created the resource. | -| lastModifiedBy? | `string` | The identity that last modified the resource. | -| lastModifiedByType? | [`createdByType`](./data-types.md#Azure.ResourceManager.Foundations.createdByType) | The type of identity that last modified the resource. | -| lastModifiedAt? | `plainDate` | The timestamp of resource last modification (UTC) | +| Name | Type | Description | +| ----------------- | -------- | ------------------------------------------------------------- | +| resourceGroupName | `string` | The name of the resource group. The name is case insensitive. | -### `TagsUpdateModel` {#Azure.ResourceManager.Foundations.TagsUpdateModel} +### `ResourceModelWithAllowedPropertySet` {#Azure.ResourceManager.CommonTypes.ResourceModelWithAllowedPropertySet} -The type used for updating tags in resources. +The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set. ```typespec -model Azure.ResourceManager.Foundations.TagsUpdateModel +model Azure.ResourceManager.CommonTypes.ResourceModelWithAllowedPropertySet ``` -#### Template Parameters - -| Name | Description | -| -------- | ------------------------- | -| Resource | The type of the resource. | - #### Properties -| Name | Type | Description | -| ----- | ---------------- | -------------- | -| tags? | `Record` | Resource tags. | +| Name | Type | Description | +| ---------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| managedBy? | `string` | The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource.
If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. | +| kind? | `string` | Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type.
If supported, the resource provider must validate and persist this value. | +| eTag? | `string` | The etag field is _not_ required. If it is provided in the response body, it must also be provided as a header per the normal etag convention.
Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19),
If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. | +| identity? | [`Identity`](./data-types.md#Azure.ResourceManager.CommonTypes.Identity) | | +| sku? | [`Sku`](./data-types.md#Azure.ResourceManager.CommonTypes.Sku) | | +| plan? | [`Plan`](./data-types.md#Azure.ResourceManager.CommonTypes.Plan) | | -### `TenantBaseParameters` {#Azure.ResourceManager.Foundations.TenantBaseParameters} +### `ScopeParameter` {#Azure.ResourceManager.CommonTypes.ScopeParameter} -The static parameters for a tenant-based resource +The default Scope parameter type. ```typespec -model Azure.ResourceManager.Foundations.TenantBaseParameters +model Azure.ResourceManager.CommonTypes.ScopeParameter ``` #### Properties -| Name | Type | Description | -| ---------- | -------- | ------------------------------------------ | -| apiVersion | `string` | The API version to use for this operation. | +| Name | Type | Description | +| ----- | -------- | ---------------------------------------------- | +| scope | `string` | The scope at which the operation is performed. | -### `TenantScope` {#Azure.ResourceManager.Foundations.TenantScope} +### `Sku` {#Azure.ResourceManager.CommonTypes.Sku} -Parameter model for listing a resource at the tenant scope +The resource model definition representing SKU ```typespec -model Azure.ResourceManager.Foundations.TenantScope +model Azure.ResourceManager.CommonTypes.Sku ``` -#### Template Parameters - -| Name | Description | -| -------- | ------------------------- | -| Resource | The type of the resource. | - #### Properties -| Name | Type | Description | -| ---------- | -------------------------------- | ------------------------------------------ | -| apiVersion | `string` | The API version to use for this operation. | -| provider | `"Microsoft.ThisWillBeReplaced"` | | +| Name | Type | Description | +| --------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | `string` | The name of the SKU. Ex - P3. It is typically a letter+number code | +| tier? | [`SkuTier`](./data-types.md#Azure.ResourceManager.CommonTypes.SkuTier) | This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. | +| size? | `string` | The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. | +| family? | `string` | If the service has different generations of hardware, for the same SKU, then that can be captured here. | +| capacity? | `int32` | If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. | + +### `SubscriptionIdParameter` {#Azure.ResourceManager.CommonTypes.SubscriptionIdParameter} + +The default subscriptionId parameter type. + +```typespec +model Azure.ResourceManager.CommonTypes.SubscriptionIdParameter +``` + +#### Properties + +| Name | Type | Description | +| -------------- | ----------- | ------------------------------------------------------------- | +| subscriptionId | `Core.uuid` | The ID of the target subscription. The value must be an UUID. | + +### `SystemAssignedServiceIdentity` {#Azure.ResourceManager.CommonTypes.SystemAssignedServiceIdentity} + +Managed service identity (either system assigned, or none) + +```typespec +model Azure.ResourceManager.CommonTypes.SystemAssignedServiceIdentity +``` + +#### Properties -### `TrackedResource` {#Azure.ResourceManager.Foundations.TrackedResource} +| Name | Type | Description | +| ------------ | -------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| principalId? | `Core.uuid` | The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. | +| tenantId? | `Core.uuid` | The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. | +| type | [`SystemAssignedServiceIdentityType`](./data-types.md#Azure.ResourceManager.CommonTypes.SystemAssignedServiceIdentityType) | The type of managed identity assigned to this resource. | -The base tracked resource. +### `SystemData` {#Azure.ResourceManager.CommonTypes.SystemData} + +Metadata pertaining to creation and last modification of the resource. ```typespec -model Azure.ResourceManager.Foundations.TrackedResource +model Azure.ResourceManager.CommonTypes.SystemData +``` + +#### Properties + +| Name | Type | Description | +| ------------------- | ---------------------------------------------------------------------------------- | ----------------------------------------------------- | +| createdBy? | `string` | The identity that created the resource. | +| createdByType? | [`createdByType`](./data-types.md#Azure.ResourceManager.CommonTypes.createdByType) | The type of identity that created the resource. | +| createdAt? | `utcDateTime` | The timestamp of resource creation (UTC). | +| lastModifiedBy? | `string` | The identity that last modified the resource. | +| lastModifiedByType? | [`createdByType`](./data-types.md#Azure.ResourceManager.CommonTypes.createdByType) | The type of identity that last modified the resource. | +| lastModifiedAt? | `utcDateTime` | The timestamp of resource last modification (UTC) | + +### `TenantIdParameter` {#Azure.ResourceManager.CommonTypes.TenantIdParameter} + +The default ManagementGroupName parameter type. + +```typespec +model Azure.ResourceManager.CommonTypes.TenantIdParameter +``` + +#### Properties + +| Name | Type | Description | +| -------- | ----------- | ------------------------------------------------------------------------------------------------ | +| tenantId | `Core.uuid` | The Azure tenant ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) | + +### `TrackedResource` {#Azure.ResourceManager.CommonTypes.TrackedResource} + +The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + +```typespec +model Azure.ResourceManager.CommonTypes.TrackedResource ``` #### Properties | Name | Type | Description | | -------- | ---------------- | ----------------------------------------- | -| location | `string` | The geo-location where the resource lives | | tags? | `Record` | Resource tags. | +| location | `string` | The geo-location where the resource lives | -### `UserAssignedIdentities` {#Azure.ResourceManager.Foundations.UserAssignedIdentities} +### `UserAssignedIdentities` {#Azure.ResourceManager.CommonTypes.UserAssignedIdentities} -The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", +The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. ```typespec -model Azure.ResourceManager.Foundations.UserAssignedIdentities +model Azure.ResourceManager.CommonTypes.UserAssignedIdentities ``` #### Properties | Name | Type | Description | | ---- | ------------------------------------------------------------------------------------------------ | --------------------- | -| | [`UserAssignedIdentity`](./data-types.md#Azure.ResourceManager.Foundations.UserAssignedIdentity) | Additional properties | +| | [`UserAssignedIdentity`](./data-types.md#Azure.ResourceManager.CommonTypes.UserAssignedIdentity) | Additional properties | -### `UserAssignedIdentity` {#Azure.ResourceManager.Foundations.UserAssignedIdentity} +### `UserAssignedIdentity` {#Azure.ResourceManager.CommonTypes.UserAssignedIdentity} -A managed identity assigned by the user. +User assigned identity properties ```typespec -model Azure.ResourceManager.Foundations.UserAssignedIdentity +model Azure.ResourceManager.CommonTypes.UserAssignedIdentity ``` #### Properties -| Name | Type | Description | -| ------------ | -------- | ---------------------------------------------------------- | -| clientId? | `string` | The active directory client identifier for this principal. | -| principalId? | `string` | The active directory identifier for this principal. | +| Name | Type | Description | +| ------------ | ----------- | ------------------------------------------ | +| principalId? | `Core.uuid` | The principal ID of the assigned identity. | +| clientId? | `Core.uuid` | The client ID of the assigned identity. | -### `ResourceHome` {#Azure.ResourceManager.Foundations.ResourceHome} +### `ResourceHome` {#Azure.ResourceManager.CommonTypes.ResourceHome} An internal enum to indicate the resource support for various path types ```typespec -enum Azure.ResourceManager.Foundations.ResourceHome +enum Azure.ResourceManager.CommonTypes.ResourceHome ``` -### `SkuTier` {#Azure.ResourceManager.Foundations.SkuTier} +### `Versions` {#Azure.ResourceManager.CommonTypes.Versions} -Available service tiers for the SKU. +The Azure Resource Manager common-types versions. ```typespec -enum Azure.ResourceManager.Foundations.SkuTier +enum Azure.ResourceManager.CommonTypes.Versions ``` -### `ActionType` {#Azure.ResourceManager.Foundations.ActionType} +### `ActionType` {#Azure.ResourceManager.CommonTypes.ActionType} Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. ```typespec -union Azure.ResourceManager.Foundations.ActionType +union Azure.ResourceManager.CommonTypes.ActionType ``` -### `CheckNameAvailabilityReason` {#Azure.ResourceManager.Foundations.CheckNameAvailabilityReason} +### `CheckNameAvailabilityReason` {#Azure.ResourceManager.CommonTypes.CheckNameAvailabilityReason} Possible reasons for a name not being available. ```typespec -union Azure.ResourceManager.Foundations.CheckNameAvailabilityReason +union Azure.ResourceManager.CommonTypes.CheckNameAvailabilityReason ``` -### `createdByType` {#Azure.ResourceManager.Foundations.createdByType} +### `createdByType` {#Azure.ResourceManager.CommonTypes.createdByType} The kind of entity that created the resource. ```typespec -union Azure.ResourceManager.Foundations.createdByType +union Azure.ResourceManager.CommonTypes.createdByType +``` + +### `EncryptionStatus` {#Azure.ResourceManager.CommonTypes.EncryptionStatus} + +Indicates whether or not the encryption is enabled for container registry. + +```typespec +union Azure.ResourceManager.CommonTypes.EncryptionStatus ``` -### `ExtendedLocationType` {#Azure.ResourceManager.Foundations.ExtendedLocationType} +### `ExtendedLocationType` {#Azure.ResourceManager.CommonTypes.ExtendedLocationType} The supported ExtendedLocation types. ```typespec -union Azure.ResourceManager.Foundations.ExtendedLocationType +union Azure.ResourceManager.CommonTypes.ExtendedLocationType ``` -### `ManagedServiceIdentityType` {#Azure.ResourceManager.Foundations.ManagedServiceIdentityType} +### `InfrastructureEncryption` {#Azure.ResourceManager.CommonTypes.InfrastructureEncryption} -The kind of managed identity assigned to this resource. +(Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. ```typespec -union Azure.ResourceManager.Foundations.ManagedServiceIdentityType +union Azure.ResourceManager.CommonTypes.InfrastructureEncryption ``` -### `Origin` {#Azure.ResourceManager.Foundations.Origin} +### `KeyEncryptionKeyIdentityType` {#Azure.ResourceManager.CommonTypes.KeyEncryptionKeyIdentityType} + +The type of identity to use. + +```typespec +union Azure.ResourceManager.CommonTypes.KeyEncryptionKeyIdentityType +``` + +### `ManagedServiceIdentityType` {#Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType} + +Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + +```typespec +union Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType +``` + +### `Origin` {#Azure.ResourceManager.CommonTypes.Origin} The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" ```typespec -union Azure.ResourceManager.Foundations.Origin +union Azure.ResourceManager.CommonTypes.Origin +``` + +### `PrivateEndpointConnectionProvisioningState` {#Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState} + +The current provisioning state. + +```typespec +union Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState +``` + +### `PrivateEndpointServiceConnectionStatus` {#Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus} + +The private endpoint connection status. + +```typespec +union Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus +``` + +### `ResourceIdentityType` {#Azure.ResourceManager.CommonTypes.ResourceIdentityType} + +```typespec +union Azure.ResourceManager.CommonTypes.ResourceIdentityType +``` + +### `SkuTier` {#Azure.ResourceManager.CommonTypes.SkuTier} + +This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. + +```typespec +union Azure.ResourceManager.CommonTypes.SkuTier +``` + +### `SystemAssignedServiceIdentityType` {#Azure.ResourceManager.CommonTypes.SystemAssignedServiceIdentityType} + +Type of managed service identity (either system assigned, or none). + +```typespec +union Azure.ResourceManager.CommonTypes.SystemAssignedServiceIdentityType +``` + +## Azure.ResourceManager.Foundations + +### `ArmTagsProperty` {#Azure.ResourceManager.Foundations.ArmTagsProperty} + +Standard type definition for Azure Resource Manager Tags property. + +It is included in the TrackedResource template definition. +The Azure Resource Manager Resource tags. + +```typespec +model Azure.ResourceManager.Foundations.ArmTagsProperty +``` + +#### Properties + +| Name | Type | Description | +| ----- | ---------------- | -------------- | +| tags? | `Record` | Resource tags. | + +### `DefaultBaseParameters` {#Azure.ResourceManager.Foundations.DefaultBaseParameters} + +Base parameters for a resource. + +```typespec +model Azure.ResourceManager.Foundations.DefaultBaseParameters +``` + +#### Template Parameters + +| Name | Description | +| -------- | ------------------------- | +| Resource | The type of the resource. | + +#### Properties + +| Name | Type | Description | +| ----------------- | ----------- | ---------------------------------------------------------------------- | +| apiVersion | `string` | The API version to use for this operation. | +| subscriptionId | `Core.uuid` | The ID of the target subscription. The value must be an UUID. | +| location | `string` | The location name. | +| resourceGroupName | `string` | The name of the resource group. The name is case insensitive. | +| resourceUri | `string` | The fully qualified Azure Resource manager identifier of the resource. | + +### `ExtensionBaseParameters` {#Azure.ResourceManager.Foundations.ExtensionBaseParameters} + +The static parameters for an extension resource + +```typespec +model Azure.ResourceManager.Foundations.ExtensionBaseParameters +``` + +#### Properties + +| Name | Type | Description | +| ----------- | -------- | ---------------------------------------------------------------------- | +| apiVersion | `string` | The API version to use for this operation. | +| resourceUri | `string` | The fully qualified Azure Resource manager identifier of the resource. | + +### `ExtensionScope` {#Azure.ResourceManager.Foundations.ExtensionScope} + +Parameter model for listing an extension resource + +```typespec +model Azure.ResourceManager.Foundations.ExtensionScope +``` + +#### Template Parameters + +| Name | Description | +| -------- | ------------------------- | +| Resource | The type of the resource. | + +#### Properties + +| Name | Type | Description | +| ----------- | -------------------------------- | ---------------------------------------------------------------------- | +| apiVersion | `string` | The API version to use for this operation. | +| resourceUri | `string` | The fully qualified Azure Resource manager identifier of the resource. | +| provider | `"Microsoft.ThisWillBeReplaced"` | | + +### `LocationBaseParameters` {#Azure.ResourceManager.Foundations.LocationBaseParameters} + +The static parameters for a location-based resource + +```typespec +model Azure.ResourceManager.Foundations.LocationBaseParameters ``` -### `SystemAssignedServiceIdentityType` {#Azure.ResourceManager.Foundations.SystemAssignedServiceIdentityType} +#### Properties -The kind of managemed identity assigned to this resource. +| Name | Type | Description | +| -------------- | ----------- | ------------------------------------------------------------- | +| apiVersion | `string` | The API version to use for this operation. | +| subscriptionId | `Core.uuid` | The ID of the target subscription. The value must be an UUID. | +| location | `string` | The location name. | + +### `LocationScope` {#Azure.ResourceManager.Foundations.LocationScope} + +Parameter model for listing a resource at the location scope ```typespec -union Azure.ResourceManager.Foundations.SystemAssignedServiceIdentityType +model Azure.ResourceManager.Foundations.LocationScope ``` + +#### Template Parameters + +| Name | Description | +| -------- | ------------------------- | +| Resource | The type of the resource. | + +#### Properties + +| Name | Type | Description | +| -------------- | -------------------------------- | ------------------------------------------------------------- | +| apiVersion | `string` | The API version to use for this operation. | +| subscriptionId | `Core.uuid` | The ID of the target subscription. The value must be an UUID. | +| location | `string` | The location name. | +| provider | `"Microsoft.ThisWillBeReplaced"` | | + +### `ProxyResourceUpdateModel` {#Azure.ResourceManager.Foundations.ProxyResourceUpdateModel} + +The type used for update operations of the resource. + +```typespec +model Azure.ResourceManager.Foundations.ProxyResourceUpdateModel +``` + +#### Template Parameters + +| Name | Description | +| ---------- | --------------------------- | +| Resource | The type of the resource. | +| Properties | The type of the properties. | + +#### Properties + +| Name | Type | Description | +| ----------- | --------------------------------------------------------------------------------- | ----------- | +| properties? | `ResourceManager.Foundations.ResourceUpdateModelProperties` | | + +### `ResourceGroupBaseParameters` {#Azure.ResourceManager.Foundations.ResourceGroupBaseParameters} + +The static parameters for a resource-group based resource + +```typespec +model Azure.ResourceManager.Foundations.ResourceGroupBaseParameters +``` + +#### Properties + +| Name | Type | Description | +| ----------------- | ----------- | ------------------------------------------------------------- | +| apiVersion | `string` | The API version to use for this operation. | +| subscriptionId | `Core.uuid` | The ID of the target subscription. The value must be an UUID. | +| resourceGroupName | `string` | The name of the resource group. The name is case insensitive. | + +### `ResourceGroupScope` {#Azure.ResourceManager.Foundations.ResourceGroupScope} + +Parameter model for listing a resource at the resource group scope + +```typespec +model Azure.ResourceManager.Foundations.ResourceGroupScope +``` + +#### Template Parameters + +| Name | Description | +| -------- | ------------------------- | +| Resource | The type of the resource. | + +#### Properties + +| Name | Type | Description | +| ----------------- | -------------------------------- | ---------------------------------------------------------------------- | +| apiVersion | `string` | The API version to use for this operation. | +| subscriptionId | `Core.uuid` | The ID of the target subscription. The value must be an UUID. | +| location | `string` | The location name. | +| resourceGroupName | `string` | The name of the resource group. The name is case insensitive. | +| resourceUri | `string` | The fully qualified Azure Resource manager identifier of the resource. | +| provider | `"Microsoft.ThisWillBeReplaced"` | | + +### `ResourceUpdateModel` {#Azure.ResourceManager.Foundations.ResourceUpdateModel} + +Defines a model type used to create named resource update models +e.g. `model MyResourceUpdate is ResourceUpdate {}` + +```typespec +model Azure.ResourceManager.Foundations.ResourceUpdateModel +``` + +#### Template Parameters + +| Name | Description | +| ---------- | --------------------------- | +| Resource | The type of the resource. | +| Properties | The type of the properties. | + +#### Properties + +| Name | Type | Description | +| ----------- | --------------------------------------------------------------------------------- | ----------- | +| properties? | `ResourceManager.Foundations.ResourceUpdateModelProperties` | | + +### `ResourceUpdateModelProperties` {#Azure.ResourceManager.Foundations.ResourceUpdateModelProperties} + +Defines a properties type used to create named resource update models. +This type is not used directly, it is referenced by ResourceUpdateModel. + +```typespec +model Azure.ResourceManager.Foundations.ResourceUpdateModelProperties +``` + +#### Template Parameters + +| Name | Description | +| ---------- | --------------------------- | +| Resource | The type of the resource. | +| Properties | The type of the properties. | + +#### Properties + +None + +### `SubscriptionBaseParameters` {#Azure.ResourceManager.Foundations.SubscriptionBaseParameters} + +The static parameters for a subscription based resource + +```typespec +model Azure.ResourceManager.Foundations.SubscriptionBaseParameters +``` + +#### Properties + +| Name | Type | Description | +| -------------- | ----------- | ------------------------------------------------------------- | +| apiVersion | `string` | The API version to use for this operation. | +| subscriptionId | `Core.uuid` | The ID of the target subscription. The value must be an UUID. | + +### `SubscriptionScope` {#Azure.ResourceManager.Foundations.SubscriptionScope} + +Parameter model for listing a resource at the subscription scope + +```typespec +model Azure.ResourceManager.Foundations.SubscriptionScope +``` + +#### Template Parameters + +| Name | Description | +| -------- | ------------------------- | +| Resource | The type of the resource. | + +#### Properties + +| Name | Type | Description | +| -------------- | -------------------------------- | ------------------------------------------------------------- | +| apiVersion | `string` | The API version to use for this operation. | +| subscriptionId | `Core.uuid` | The ID of the target subscription. The value must be an UUID. | +| provider | `"Microsoft.ThisWillBeReplaced"` | | + +### `TagsUpdateModel` {#Azure.ResourceManager.Foundations.TagsUpdateModel} + +The type used for updating tags in resources. + +```typespec +model Azure.ResourceManager.Foundations.TagsUpdateModel +``` + +#### Template Parameters + +| Name | Description | +| -------- | ------------------------- | +| Resource | The type of the resource. | + +#### Properties + +| Name | Type | Description | +| ----- | ---------------- | -------------- | +| tags? | `Record` | Resource tags. | + +### `TenantBaseParameters` {#Azure.ResourceManager.Foundations.TenantBaseParameters} + +The static parameters for a tenant-based resource + +```typespec +model Azure.ResourceManager.Foundations.TenantBaseParameters +``` + +#### Properties + +| Name | Type | Description | +| ---------- | -------- | ------------------------------------------ | +| apiVersion | `string` | The API version to use for this operation. | + +### `TenantScope` {#Azure.ResourceManager.Foundations.TenantScope} + +Parameter model for listing a resource at the tenant scope + +```typespec +model Azure.ResourceManager.Foundations.TenantScope +``` + +#### Template Parameters + +| Name | Description | +| -------- | ------------------------- | +| Resource | The type of the resource. | + +#### Properties + +| Name | Type | Description | +| ---------- | -------------------------------- | ------------------------------------------ | +| apiVersion | `string` | The API version to use for this operation. | +| provider | `"Microsoft.ThisWillBeReplaced"` | | diff --git a/docs/libraries/azure-resource-manager/reference/decorators.md b/docs/libraries/azure-resource-manager/reference/decorators.md index 7f8fbcdc0b..9983be00ac 100644 --- a/docs/libraries/azure-resource-manager/reference/decorators.md +++ b/docs/libraries/azure-resource-manager/reference/decorators.md @@ -23,9 +23,9 @@ the version of the Azure Resource Manager common-types to use for refs in emitte #### Parameters -| Name | Type | Description | -| ------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| version | `valueof string \| EnumMember` | The Azure.ResourceManager.CommonTypes.Versions for the desired common-types version or an equivalent string value. | +| 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` {#@Azure.ResourceManager.armLibraryNamespace} diff --git a/docs/libraries/azure-resource-manager/reference/index.mdx b/docs/libraries/azure-resource-manager/reference/index.mdx index 51360a7a56..ef473192d6 100644 --- a/docs/libraries/azure-resource-manager/reference/index.mdx +++ b/docs/libraries/azure-resource-manager/reference/index.mdx @@ -115,7 +115,6 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager ### Models -- [`ApiVersionParameter`](./data-types.md#Azure.ResourceManager.ApiVersionParameter) - [`ArmAcceptedLroResponse`](./data-types.md#Azure.ResourceManager.ArmAcceptedLroResponse) - [`ArmAcceptedResponse`](./data-types.md#Azure.ResourceManager.ArmAcceptedResponse) - [`ArmAsyncOperationHeader`](./data-types.md#Azure.ResourceManager.ArmAsyncOperationHeader) @@ -135,35 +134,20 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager - [`ArmResourceNotFoundResponse`](./data-types.md#Azure.ResourceManager.ArmResourceNotFoundResponse) - [`ArmResourceUpdatedResponse`](./data-types.md#Azure.ResourceManager.ArmResourceUpdatedResponse) - [`ArmResponse`](./data-types.md#Azure.ResourceManager.ArmResponse) -- [`CustomerManagedKeyEncryption`](./data-types.md#Azure.ResourceManager.CustomerManagedKeyEncryption) - [`DefaultProvisioningStateProperty`](./data-types.md#Azure.ResourceManager.DefaultProvisioningStateProperty) -- [`Encryption`](./data-types.md#Azure.ResourceManager.Encryption) -- [`EncryptionConfiguration`](./data-types.md#Azure.ResourceManager.EncryptionConfiguration) +- [`EncryptionProperty`](./data-types.md#Azure.ResourceManager.EncryptionProperty) - [`EntityTagProperty`](./data-types.md#Azure.ResourceManager.EntityTagProperty) -- [`ErrorResponse`](./data-types.md#Azure.ResourceManager.ErrorResponse) - [`ExtendedLocationProperty`](./data-types.md#Azure.ResourceManager.ExtendedLocationProperty) - [`ExtensionResource`](./data-types.md#Azure.ResourceManager.ExtensionResource) - [`KeysOf`](./data-types.md#Azure.ResourceManager.KeysOf) - [`LocationParameter`](./data-types.md#Azure.ResourceManager.LocationParameter) -- [`LocationResourceParameter`](./data-types.md#Azure.ResourceManager.LocationResourceParameter) - [`ManagedByProperty`](./data-types.md#Azure.ResourceManager.ManagedByProperty) - [`ManagedServiceIdentityProperty`](./data-types.md#Azure.ResourceManager.ManagedServiceIdentityProperty) - [`ManagedSystemAssignedIdentityProperty`](./data-types.md#Azure.ResourceManager.ManagedSystemAssignedIdentityProperty) - [`ParentKeysOf`](./data-types.md#Azure.ResourceManager.ParentKeysOf) -- [`PrivateEndpoint`](./data-types.md#Azure.ResourceManager.PrivateEndpoint) -- [`PrivateEndpointConnection`](./data-types.md#Azure.ResourceManager.PrivateEndpointConnection) -- [`PrivateEndpointConnectionParameter`](./data-types.md#Azure.ResourceManager.PrivateEndpointConnectionParameter) -- [`PrivateEndpointConnectionProperties`](./data-types.md#Azure.ResourceManager.PrivateEndpointConnectionProperties) -- [`PrivateEndpointConnectionResourceListResult`](./data-types.md#Azure.ResourceManager.PrivateEndpointConnectionResourceListResult) -- [`PrivateLinkResource`](./data-types.md#Azure.ResourceManager.PrivateLinkResource) -- [`PrivateLinkResourceListResult`](./data-types.md#Azure.ResourceManager.PrivateLinkResourceListResult) -- [`PrivateLinkResourceParameter`](./data-types.md#Azure.ResourceManager.PrivateLinkResourceParameter) -- [`PrivateLinkResourceProperties`](./data-types.md#Azure.ResourceManager.PrivateLinkResourceProperties) -- [`PrivateLinkServiceConnectionState`](./data-types.md#Azure.ResourceManager.PrivateLinkServiceConnectionState) - [`ProviderNamespace`](./data-types.md#Azure.ResourceManager.ProviderNamespace) - [`ProxyResource`](./data-types.md#Azure.ResourceManager.ProxyResource) - [`ResourceGroupLocationResource`](./data-types.md#Azure.ResourceManager.ResourceGroupLocationResource) -- [`ResourceGroupParameter`](./data-types.md#Azure.ResourceManager.ResourceGroupParameter) - [`ResourceInstanceParameters`](./data-types.md#Azure.ResourceManager.ResourceInstanceParameters) - [`ResourceKindProperty`](./data-types.md#Azure.ResourceManager.ResourceKindProperty) - [`ResourceListResult`](./data-types.md#Azure.ResourceManager.ResourceListResult) @@ -172,13 +156,66 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager - [`ResourcePlanProperty`](./data-types.md#Azure.ResourceManager.ResourcePlanProperty) - [`ResourceSkuProperty`](./data-types.md#Azure.ResourceManager.ResourceSkuProperty) - [`ResourceUriParameter`](./data-types.md#Azure.ResourceManager.ResourceUriParameter) -- [`SubscriptionIdParameter`](./data-types.md#Azure.ResourceManager.SubscriptionIdParameter) - [`SubscriptionLocationResource`](./data-types.md#Azure.ResourceManager.SubscriptionLocationResource) - [`TenantLocationResource`](./data-types.md#Azure.ResourceManager.TenantLocationResource) - [`TrackedResource`](./data-types.md#Azure.ResourceManager.TrackedResource) ## Azure.ResourceManager.CommonTypes +### Models + +- [`ApiVersionParameter`](./data-types.md#Azure.ResourceManager.CommonTypes.ApiVersionParameter) +- [`AzureEntityResource`](./data-types.md#Azure.ResourceManager.CommonTypes.AzureEntityResource) +- [`CheckNameAvailabilityRequest`](./data-types.md#Azure.ResourceManager.CommonTypes.CheckNameAvailabilityRequest) +- [`CheckNameAvailabilityResponse`](./data-types.md#Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse) +- [`CustomerManagedKeyEncryption`](./data-types.md#Azure.ResourceManager.CommonTypes.CustomerManagedKeyEncryption) +- [`Encryption`](./data-types.md#Azure.ResourceManager.CommonTypes.Encryption) +- [`EncryptionProperties`](./data-types.md#Azure.ResourceManager.CommonTypes.EncryptionProperties) +- [`ErrorAdditionalInfo`](./data-types.md#Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo) +- [`ErrorDetail`](./data-types.md#Azure.ResourceManager.CommonTypes.ErrorDetail) +- [`ErrorResponse`](./data-types.md#Azure.ResourceManager.CommonTypes.ErrorResponse) +- [`ExtendedLocation`](./data-types.md#Azure.ResourceManager.CommonTypes.ExtendedLocation) +- [`ExtensionResource`](./data-types.md#Azure.ResourceManager.CommonTypes.ExtensionResource) +- [`Identity`](./data-types.md#Azure.ResourceManager.CommonTypes.Identity) +- [`IfMatchHeader`](./data-types.md#Azure.ResourceManager.CommonTypes.IfMatchHeader) +- [`IfNoneMatchHeader`](./data-types.md#Azure.ResourceManager.CommonTypes.IfNoneMatchHeader) +- [`KeyEncryptionKeyIdentity`](./data-types.md#Azure.ResourceManager.CommonTypes.KeyEncryptionKeyIdentity) +- [`KeyVaultProperties`](./data-types.md#Azure.ResourceManager.CommonTypes.KeyVaultProperties) +- [`LocationData`](./data-types.md#Azure.ResourceManager.CommonTypes.LocationData) +- [`LocationParameter`](./data-types.md#Azure.ResourceManager.CommonTypes.LocationParameter) +- [`LocationResourceParameter`](./data-types.md#Azure.ResourceManager.CommonTypes.LocationResourceParameter) +- [`ManagedServiceIdentity`](./data-types.md#Azure.ResourceManager.CommonTypes.ManagedServiceIdentity) +- [`ManagementGroupNameParameter`](./data-types.md#Azure.ResourceManager.CommonTypes.ManagementGroupNameParameter) +- [`Operation`](./data-types.md#Azure.ResourceManager.CommonTypes.Operation) +- [`OperationDisplay`](./data-types.md#Azure.ResourceManager.CommonTypes.OperationDisplay) +- [`OperationIdParameter`](./data-types.md#Azure.ResourceManager.CommonTypes.OperationIdParameter) +- [`OperationListResult`](./data-types.md#Azure.ResourceManager.CommonTypes.OperationListResult) +- [`OperationStatusResult`](./data-types.md#Azure.ResourceManager.CommonTypes.OperationStatusResult) +- [`Plan`](./data-types.md#Azure.ResourceManager.CommonTypes.Plan) +- [`PrivateEndpoint`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateEndpoint) +- [`PrivateEndpointConnection`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateEndpointConnection) +- [`PrivateEndpointConnectionListResult`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionListResult) +- [`PrivateEndpointConnectionParameter`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionParameter) +- [`PrivateEndpointConnectionProperties`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties) +- [`PrivateLinkResource`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateLinkResource) +- [`PrivateLinkResourceListResult`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateLinkResourceListResult) +- [`PrivateLinkResourceParameter`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateLinkResourceParameter) +- [`PrivateLinkResourceProperties`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties) +- [`PrivateLinkServiceConnectionState`](./data-types.md#Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState) +- [`ProxyResource`](./data-types.md#Azure.ResourceManager.CommonTypes.ProxyResource) +- [`Resource`](./data-types.md#Azure.ResourceManager.CommonTypes.Resource) +- [`ResourceGroupNameParameter`](./data-types.md#Azure.ResourceManager.CommonTypes.ResourceGroupNameParameter) +- [`ResourceModelWithAllowedPropertySet`](./data-types.md#Azure.ResourceManager.CommonTypes.ResourceModelWithAllowedPropertySet) +- [`ScopeParameter`](./data-types.md#Azure.ResourceManager.CommonTypes.ScopeParameter) +- [`Sku`](./data-types.md#Azure.ResourceManager.CommonTypes.Sku) +- [`SubscriptionIdParameter`](./data-types.md#Azure.ResourceManager.CommonTypes.SubscriptionIdParameter) +- [`SystemAssignedServiceIdentity`](./data-types.md#Azure.ResourceManager.CommonTypes.SystemAssignedServiceIdentity) +- [`SystemData`](./data-types.md#Azure.ResourceManager.CommonTypes.SystemData) +- [`TenantIdParameter`](./data-types.md#Azure.ResourceManager.CommonTypes.TenantIdParameter) +- [`TrackedResource`](./data-types.md#Azure.ResourceManager.CommonTypes.TrackedResource) +- [`UserAssignedIdentities`](./data-types.md#Azure.ResourceManager.CommonTypes.UserAssignedIdentities) +- [`UserAssignedIdentity`](./data-types.md#Azure.ResourceManager.CommonTypes.UserAssignedIdentity) + ## Azure.ResourceManager.Foundations ### Operations @@ -191,40 +228,18 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager ### Models - [`ArmTagsProperty`](./data-types.md#Azure.ResourceManager.Foundations.ArmTagsProperty) -- [`AzureEntityResource`](./data-types.md#Azure.ResourceManager.Foundations.AzureEntityResource) -- [`CheckNameAvailabilityRequest`](./data-types.md#Azure.ResourceManager.Foundations.CheckNameAvailabilityRequest) -- [`CheckNameAvailabilityResponse`](./data-types.md#Azure.ResourceManager.Foundations.CheckNameAvailabilityResponse) - [`DefaultBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.DefaultBaseParameters) -- [`ErrorAdditionalInfo`](./data-types.md#Azure.ResourceManager.Foundations.ErrorAdditionalInfo) -- [`ErrorDetail`](./data-types.md#Azure.ResourceManager.Foundations.ErrorDetail) -- [`ExtendedLocation`](./data-types.md#Azure.ResourceManager.Foundations.ExtendedLocation) - [`ExtensionBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.ExtensionBaseParameters) -- [`ExtensionResource`](./data-types.md#Azure.ResourceManager.Foundations.ExtensionResource) - [`ExtensionScope`](./data-types.md#Azure.ResourceManager.Foundations.ExtensionScope) - [`LocationBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.LocationBaseParameters) - [`LocationScope`](./data-types.md#Azure.ResourceManager.Foundations.LocationScope) -- [`ManagedServiceIdentity`](./data-types.md#Azure.ResourceManager.Foundations.ManagedServiceIdentity) -- [`Operation`](./data-types.md#Azure.ResourceManager.Foundations.Operation) -- [`OperationDisplay`](./data-types.md#Azure.ResourceManager.Foundations.OperationDisplay) -- [`OperationIdParameter`](./data-types.md#Azure.ResourceManager.Foundations.OperationIdParameter) -- [`OperationListResult`](./data-types.md#Azure.ResourceManager.Foundations.OperationListResult) -- [`OperationStatusResult`](./data-types.md#Azure.ResourceManager.Foundations.OperationStatusResult) -- [`Plan`](./data-types.md#Azure.ResourceManager.Foundations.Plan) -- [`ProxyResource`](./data-types.md#Azure.ResourceManager.Foundations.ProxyResource) - [`ProxyResourceUpdateModel`](./data-types.md#Azure.ResourceManager.Foundations.ProxyResourceUpdateModel) -- [`Resource`](./data-types.md#Azure.ResourceManager.Foundations.Resource) - [`ResourceGroupBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.ResourceGroupBaseParameters) - [`ResourceGroupScope`](./data-types.md#Azure.ResourceManager.Foundations.ResourceGroupScope) - [`ResourceUpdateModel`](./data-types.md#Azure.ResourceManager.Foundations.ResourceUpdateModel) - [`ResourceUpdateModelProperties`](./data-types.md#Azure.ResourceManager.Foundations.ResourceUpdateModelProperties) -- [`Sku`](./data-types.md#Azure.ResourceManager.Foundations.Sku) - [`SubscriptionBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.SubscriptionBaseParameters) - [`SubscriptionScope`](./data-types.md#Azure.ResourceManager.Foundations.SubscriptionScope) -- [`SystemAssignedServiceIdentity`](./data-types.md#Azure.ResourceManager.Foundations.SystemAssignedServiceIdentity) -- [`SystemData`](./data-types.md#Azure.ResourceManager.Foundations.SystemData) - [`TagsUpdateModel`](./data-types.md#Azure.ResourceManager.Foundations.TagsUpdateModel) - [`TenantBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.TenantBaseParameters) - [`TenantScope`](./data-types.md#Azure.ResourceManager.Foundations.TenantScope) -- [`TrackedResource`](./data-types.md#Azure.ResourceManager.Foundations.TrackedResource) -- [`UserAssignedIdentities`](./data-types.md#Azure.ResourceManager.Foundations.UserAssignedIdentities) -- [`UserAssignedIdentity`](./data-types.md#Azure.ResourceManager.Foundations.UserAssignedIdentity) diff --git a/docs/libraries/azure-resource-manager/reference/interfaces.md b/docs/libraries/azure-resource-manager/reference/interfaces.md index e9faafed8d..bee0fa9964 100644 --- a/docs/libraries/azure-resource-manager/reference/interfaces.md +++ b/docs/libraries/azure-resource-manager/reference/interfaces.md @@ -25,7 +25,7 @@ interface Azure.ResourceManager.ExtensionResourceCollectionOperations #### `ExtensionResourceCollectionOperations.listByParent` {#Azure.ResourceManager.ExtensionResourceCollectionOperations.listByParent} ```typespec -op Azure.ResourceManager.ExtensionResourceCollectionOperations.listByParent(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ExtensionResourceCollectionOperations.listByParent(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ExtensionResourceInstanceOperations` {#Azure.ResourceManager.ExtensionResourceInstanceOperations} @@ -46,25 +46,25 @@ interface Azure.ResourceManager.ExtensionResourceInstanceOperations | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ExtensionResourceInstanceOperations.get(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ExtensionResourceInstanceOperations.createOrUpdate` {#Azure.ResourceManager.ExtensionResourceInstanceOperations.createOrUpdate} ```typespec -op Azure.ResourceManager.ExtensionResourceInstanceOperations.createOrUpdate(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ExtensionResourceInstanceOperations.createOrUpdate(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ExtensionResourceInstanceOperations.update` {#Azure.ResourceManager.ExtensionResourceInstanceOperations.update} ```typespec -op Azure.ResourceManager.ExtensionResourceInstanceOperations.update(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ExtensionResourceInstanceOperations.update(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ExtensionResourceInstanceOperations.delete` {#Azure.ResourceManager.ExtensionResourceInstanceOperations.delete} ```typespec -op Azure.ResourceManager.ExtensionResourceInstanceOperations.delete(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ExtensionResourceInstanceOperations.delete(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ExtensionResourceOperations` {#Azure.ResourceManager.ExtensionResourceOperations} @@ -85,31 +85,31 @@ interface Azure.ResourceManager.ExtensionResourceOperations | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ExtensionResourceOperations.get(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ExtensionResourceOperations.createOrUpdate` {#Azure.ResourceManager.ExtensionResourceOperations.createOrUpdate} ```typespec -op Azure.ResourceManager.ExtensionResourceOperations.createOrUpdate(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ExtensionResourceOperations.createOrUpdate(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ExtensionResourceOperations.update` {#Azure.ResourceManager.ExtensionResourceOperations.update} ```typespec -op Azure.ResourceManager.ExtensionResourceOperations.update(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ExtensionResourceOperations.update(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ExtensionResourceOperations.delete` {#Azure.ResourceManager.ExtensionResourceOperations.delete} ```typespec -op Azure.ResourceManager.ExtensionResourceOperations.delete(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ExtensionResourceOperations.delete(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ExtensionResourceOperations.listByParent` {#Azure.ResourceManager.ExtensionResourceOperations.listByParent} ```typespec -op Azure.ResourceManager.ExtensionResourceOperations.listByParent(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ExtensionResourceOperations.listByParent(apiVersion: string, resourceUri: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `Operations` {#Azure.ResourceManager.Operations} @@ -128,7 +128,7 @@ interface Azure.ResourceManager.Operations<> List the operations for the provider ```typespec -op Azure.ResourceManager.Operations.list(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.Operations.list(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ProxyResourceOperations` {#Azure.ResourceManager.ProxyResourceOperations} @@ -155,25 +155,25 @@ interface Azure.ResourceManager.ProxyResourceOperations | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ProxyResourceOperations.get(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ProxyResourceOperations.createOrUpdate` {#Azure.ResourceManager.ProxyResourceOperations.createOrUpdate} ```typespec -op Azure.ResourceManager.ProxyResourceOperations.createOrUpdate(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ProxyResourceOperations.createOrUpdate(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ProxyResourceOperations.delete` {#Azure.ResourceManager.ProxyResourceOperations.delete} ```typespec -op Azure.ResourceManager.ProxyResourceOperations.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ProxyResourceOperations.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ProxyResourceOperations.listByParent` {#Azure.ResourceManager.ProxyResourceOperations.listByParent} ```typespec -op Azure.ResourceManager.ProxyResourceOperations.listByParent(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ProxyResourceOperations.listByParent(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceCollectionOperations` {#Azure.ResourceManager.ResourceCollectionOperations} @@ -194,13 +194,13 @@ interface Azure.ResourceManager.ResourceCollectionOperations> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceCollectionOperations.listByParent(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ResourceCollectionOperations.listBySubscription` {#Azure.ResourceManager.ResourceCollectionOperations.listBySubscription} ```typespec -op Azure.ResourceManager.ResourceCollectionOperations.listBySubscription(apiVersion: string, subscriptionId: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceCollectionOperations.listBySubscription(apiVersion: string, subscriptionId: Azure.Core.uuid, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceCreateAsync` {#Azure.ResourceManager.ResourceCreateAsync} @@ -221,7 +221,7 @@ interface Azure.ResourceManager.ResourceCreateAsync #### `ResourceCreateAsync.createOrUpdate` {#Azure.ResourceManager.ResourceCreateAsync.createOrUpdate} ```typespec -op Azure.ResourceManager.ResourceCreateAsync.createOrUpdate(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceCreateAsync.createOrUpdate(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceCreateSync` {#Azure.ResourceManager.ResourceCreateSync} @@ -242,7 +242,7 @@ interface Azure.ResourceManager.ResourceCreateSync #### `ResourceCreateSync.createOrUpdate` {#Azure.ResourceManager.ResourceCreateSync.createOrUpdate} ```typespec -op Azure.ResourceManager.ResourceCreateSync.createOrUpdate(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedSyncResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceCreateSync.createOrUpdate(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedSyncResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceDeleteAsync` {#Azure.ResourceManager.ResourceDeleteAsync} @@ -261,7 +261,7 @@ interface Azure.ResourceManager.ResourceDeleteAsync #### `ResourceDeleteAsync.delete` {#Azure.ResourceManager.ResourceDeleteAsync.delete} ```typespec -op Azure.ResourceManager.ResourceDeleteAsync.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceDeleteAsync.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceDeleteSync` {#Azure.ResourceManager.ResourceDeleteSync} @@ -282,7 +282,7 @@ interface Azure.ResourceManager.ResourceDeleteSync #### `ResourceDeleteSync.delete` {#Azure.ResourceManager.ResourceDeleteSync.delete} ```typespec -op Azure.ResourceManager.ResourceDeleteSync.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceDeleteSync.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceDeleteWithoutOkAsync` {#Azure.ResourceManager.ResourceDeleteWithoutOkAsync} @@ -301,7 +301,7 @@ interface Azure.ResourceManager.ResourceDeleteWithoutOkAsync | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceDeleteWithoutOkAsync.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceInstanceOperations` {#Azure.ResourceManager.ResourceInstanceOperations} @@ -324,25 +324,25 @@ interface Azure.ResourceManager.ResourceInstanceOperations | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceInstanceOperations.get(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ResourceInstanceOperations.createOrUpdate` {#Azure.ResourceManager.ResourceInstanceOperations.createOrUpdate} ```typespec -op Azure.ResourceManager.ResourceInstanceOperations.createOrUpdate(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceInstanceOperations.createOrUpdate(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ResourceInstanceOperations.update` {#Azure.ResourceManager.ResourceInstanceOperations.update} ```typespec -op Azure.ResourceManager.ResourceInstanceOperations.update(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceInstanceOperations.update(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ResourceInstanceOperations.delete` {#Azure.ResourceManager.ResourceInstanceOperations.delete} ```typespec -op Azure.ResourceManager.ResourceInstanceOperations.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceInstanceOperations.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceListByParent` {#Azure.ResourceManager.ResourceListByParent} @@ -365,7 +365,7 @@ interface Azure.ResourceManager.ResourceListByParent> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceListByParent.listByParent(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceListBySubscription` {#Azure.ResourceManager.ResourceListBySubscription} @@ -385,7 +385,7 @@ interface Azure.ResourceManager.ResourceListBySubscription #### `ResourceListBySubscription.listBySubscription` {#Azure.ResourceManager.ResourceListBySubscription.listBySubscription} ```typespec -op Azure.ResourceManager.ResourceListBySubscription.listBySubscription(apiVersion: string, subscriptionId: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceListBySubscription.listBySubscription(apiVersion: string, subscriptionId: Azure.Core.uuid, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceOperations` {#Azure.ResourceManager.ResourceOperations} @@ -405,37 +405,37 @@ interface Azure.ResourceManager.ResourceOperations | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceOperations.get(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ResourceOperations.createOrUpdate` {#Azure.ResourceManager.ResourceOperations.createOrUpdate} ```typespec -op Azure.ResourceManager.ResourceOperations.createOrUpdate(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceOperations.createOrUpdate(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ResourceOperations.update` {#Azure.ResourceManager.ResourceOperations.update} ```typespec -op Azure.ResourceManager.ResourceOperations.update(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceOperations.update(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ResourceOperations.delete` {#Azure.ResourceManager.ResourceOperations.delete} ```typespec -op Azure.ResourceManager.ResourceOperations.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceOperations.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ResourceOperations.listByParent` {#Azure.ResourceManager.ResourceOperations.listByParent} ```typespec -op Azure.ResourceManager.ResourceOperations.listByParent(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceOperations.listByParent(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `ResourceOperations.listBySubscription` {#Azure.ResourceManager.ResourceOperations.listBySubscription} ```typespec -op Azure.ResourceManager.ResourceOperations.listBySubscription(apiVersion: string, subscriptionId: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceOperations.listBySubscription(apiVersion: string, subscriptionId: Azure.Core.uuid, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceRead` {#Azure.ResourceManager.ResourceRead} @@ -456,7 +456,7 @@ interface Azure.ResourceManager.ResourceRead #### `ResourceRead.get` {#Azure.ResourceManager.ResourceRead.get} ```typespec -op Azure.ResourceManager.ResourceRead.get(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceRead.get(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceUpdateAsync` {#Azure.ResourceManager.ResourceUpdateAsync} @@ -476,7 +476,7 @@ interface Azure.ResourceManager.ResourceUpdateAsync): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ArmAcceptedLroResponse<"Resource update request accepted.", Azure.ResourceManager.{ location: string, retryAfter: int32 }> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceUpdateAsync.update(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ArmAcceptedLroResponse<"Resource update request accepted.", Azure.ResourceManager.{ location: string, retryAfter: int32 }> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ResourceUpdateSync` {#Azure.ResourceManager.ResourceUpdateSync} @@ -498,7 +498,7 @@ interface Azure.ResourceManager.ResourceUpdateSync): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ResourceUpdateSync.update(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `TenantResourceOperations` {#Azure.ResourceManager.TenantResourceOperations} @@ -525,31 +525,31 @@ interface Azure.ResourceManager.TenantResourceOperations #### `TenantResourceOperations.get` {#Azure.ResourceManager.TenantResourceOperations.get} ```typespec -op Azure.ResourceManager.TenantResourceOperations.get(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TenantResourceOperations.get(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `TenantResourceOperations.createOrUpdate` {#Azure.ResourceManager.TenantResourceOperations.createOrUpdate} ```typespec -op Azure.ResourceManager.TenantResourceOperations.createOrUpdate(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TenantResourceOperations.createOrUpdate(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `TenantResourceOperations.update` {#Azure.ResourceManager.TenantResourceOperations.update} ```typespec -op Azure.ResourceManager.TenantResourceOperations.update(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TenantResourceOperations.update(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `TenantResourceOperations.delete` {#Azure.ResourceManager.TenantResourceOperations.delete} ```typespec -op Azure.ResourceManager.TenantResourceOperations.delete(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TenantResourceOperations.delete(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `TenantResourceOperations.listByParent` {#Azure.ResourceManager.TenantResourceOperations.listByParent} ```typespec -op Azure.ResourceManager.TenantResourceOperations.listByParent(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TenantResourceOperations.listByParent(apiVersion: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `TrackedResourceOperations` {#Azure.ResourceManager.TrackedResourceOperations} @@ -574,37 +574,37 @@ interface Azure.ResourceManager.TrackedResourceOperations | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TrackedResourceOperations.get(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `TrackedResourceOperations.createOrUpdate` {#Azure.ResourceManager.TrackedResourceOperations.createOrUpdate} ```typespec -op Azure.ResourceManager.TrackedResourceOperations.createOrUpdate(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TrackedResourceOperations.createOrUpdate(provider: "Microsoft.ThisWillBeReplaced", resource: Resource): Azure.ResourceManager.ArmResourceUpdatedResponse | Azure.ResourceManager.ArmResourceCreatedResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `TrackedResourceOperations.update` {#Azure.ResourceManager.TrackedResourceOperations.update} ```typespec -op Azure.ResourceManager.TrackedResourceOperations.update(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TrackedResourceOperations.update(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `TrackedResourceOperations.delete` {#Azure.ResourceManager.TrackedResourceOperations.delete} ```typespec -op Azure.ResourceManager.TrackedResourceOperations.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TrackedResourceOperations.delete(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmDeletedResponse | Azure.ResourceManager.ArmDeleteAcceptedLroResponse | Azure.ResourceManager.ArmDeletedNoContentResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `TrackedResourceOperations.listByParent` {#Azure.ResourceManager.TrackedResourceOperations.listByParent} ```typespec -op Azure.ResourceManager.TrackedResourceOperations.listByParent(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TrackedResourceOperations.listByParent(provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### `TrackedResourceOperations.listBySubscription` {#Azure.ResourceManager.TrackedResourceOperations.listBySubscription} ```typespec -op Azure.ResourceManager.TrackedResourceOperations.listBySubscription(apiVersion: string, subscriptionId: string, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.TrackedResourceOperations.listBySubscription(apiVersion: string, subscriptionId: Azure.Core.uuid, provider: "Microsoft.ThisWillBeReplaced"): Azure.ResourceManager.ArmResponse> | Azure.ResourceManager.CommonTypes.ErrorResponse ``` ### `ArmCustomPatchAsync` {#Azure.ResourceManager.ArmCustomPatchAsync} @@ -651,7 +651,7 @@ op Azure.ResourceManager.ArmCustomPatchSync(provider: "Microsoft.ThisWillBeRepla A resource list operation, at the subscription scope ```typespec -op Azure.ResourceManager.ArmListBySubscription(apiVersion: string, subscriptionId: string, provider: "Microsoft.ThisWillBeReplaced"): Response | Error +op Azure.ResourceManager.ArmListBySubscription(apiVersion: string, subscriptionId: Azure.Core.uuid, provider: "Microsoft.ThisWillBeReplaced"): Response | Error ``` #### Template Parameters @@ -970,7 +970,7 @@ op Azure.ResourceManager.ArmResourceListByParent(provider: "Microsoft.ThisWillBe ### `ArmResourcePatchAsync` {#Azure.ResourceManager.ArmResourcePatchAsync} ```typespec -op Azure.ResourceManager.ArmResourcePatchAsync(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ArmAcceptedLroResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ArmResourcePatchAsync(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ArmAcceptedLroResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### Template Parameters @@ -986,7 +986,7 @@ op Azure.ResourceManager.ArmResourcePatchAsync(provider: "Microsoft.ThisWillBeRe ### `ArmResourcePatchSync` {#Azure.ResourceManager.ArmResourcePatchSync} ```typespec -op Azure.ResourceManager.ArmResourcePatchSync(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ArmResourcePatchSync(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.ResourceUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### Template Parameters @@ -1019,7 +1019,7 @@ op Azure.ResourceManager.ArmResourceRead(provider: "Microsoft.ThisWillBeReplaced ### `ArmTagsPatchAsync` {#Azure.ResourceManager.ArmTagsPatchAsync} ```typespec -op Azure.ResourceManager.ArmTagsPatchAsync(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.TagsUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ArmAcceptedLroResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ArmTagsPatchAsync(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.TagsUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ArmAcceptedLroResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### Template Parameters @@ -1035,7 +1035,7 @@ op Azure.ResourceManager.ArmTagsPatchAsync(provider: "Microsoft.ThisWillBeReplac ### `ArmTagsPatchSync` {#Azure.ResourceManager.ArmTagsPatchSync} ```typespec -op Azure.ResourceManager.ArmTagsPatchSync(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.TagsUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.ArmTagsPatchSync(provider: "Microsoft.ThisWillBeReplaced", properties: Azure.ResourceManager.Foundations.TagsUpdateModel): Azure.ResourceManager.ArmResponse | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### Template Parameters @@ -1049,7 +1049,7 @@ op Azure.ResourceManager.ArmTagsPatchSync(provider: "Microsoft.ThisWillBeReplace ### `checkGlobalNameAvailability` {#Azure.ResourceManager.checkGlobalNameAvailability} ```typespec -op Azure.ResourceManager.checkGlobalNameAvailability(apiVersion: string, subscriptionId: string, provider: "Microsoft.ThisWillBeReplaced", body: Request): Response | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.checkGlobalNameAvailability(apiVersion: string, subscriptionId: Azure.Core.uuid, provider: "Microsoft.ThisWillBeReplaced", body: Request): Response | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### Template Parameters @@ -1063,7 +1063,7 @@ op Azure.ResourceManager.checkGlobalNameAvailability(apiVersion: string, subscri ### `checkLocalNameAvailability` {#Azure.ResourceManager.checkLocalNameAvailability} ```typespec -op Azure.ResourceManager.checkLocalNameAvailability(apiVersion: string, subscriptionId: string, provider: "Microsoft.ThisWillBeReplaced", location: string, body: Request): Response | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.checkLocalNameAvailability(apiVersion: string, subscriptionId: Azure.Core.uuid, provider: "Microsoft.ThisWillBeReplaced", location: string, body: Request): Response | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### Template Parameters @@ -1127,7 +1127,7 @@ a resource name must be globally unique (for example, if the resource exposes an endpoint that uses the resource name in the url) ```typespec -op Azure.ResourceManager.Foundations.checkNameAvailability(apiVersion: string, body: Request): Response | Azure.ResourceManager.ErrorResponse +op Azure.ResourceManager.Foundations.checkNameAvailability(apiVersion: string, body: Request): Response | Azure.ResourceManager.CommonTypes.ErrorResponse ``` #### Template Parameters diff --git a/packages/samples/specs/resource-manager/arm-library/ref-library/int-templates.tsp b/packages/samples/specs/resource-manager/arm-library/ref-library/int-templates.tsp index 8e59e40e18..48b7755e1a 100644 --- a/packages/samples/specs/resource-manager/arm-library/ref-library/int-templates.tsp +++ b/packages/samples/specs/resource-manager/arm-library/ref-library/int-templates.tsp @@ -11,6 +11,7 @@ using Azure.ResourceManager; #suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "cuz" @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) +@useDependency(Azure.ResourceManager.CommonTypes.Versions.v3) @armLibraryNamespace namespace Microsoft.InterfacesTest; diff --git a/packages/samples/specs/resource-manager/arm-library/ref-library/op-templates.tsp b/packages/samples/specs/resource-manager/arm-library/ref-library/op-templates.tsp index 4106ef2383..63c4ce47eb 100644 --- a/packages/samples/specs/resource-manager/arm-library/ref-library/op-templates.tsp +++ b/packages/samples/specs/resource-manager/arm-library/ref-library/op-templates.tsp @@ -11,6 +11,7 @@ using Azure.ResourceManager; #suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" "cuz" @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) +@useDependency(Azure.ResourceManager.CommonTypes.Versions.v3) @armLibraryNamespace namespace Microsoft.OperationsTest; diff --git a/packages/samples/specs/resource-manager/operations/operation-status/main.tsp b/packages/samples/specs/resource-manager/operations/operation-status/main.tsp index 62e829a52c..25a7b0d1b9 100644 --- a/packages/samples/specs/resource-manager/operations/operation-status/main.tsp +++ b/packages/samples/specs/resource-manager/operations/operation-status/main.tsp @@ -19,7 +19,7 @@ namespace Microsoft.OperationStatusSample; enum Versions { @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) @useDependency(Azure.Core.Versions.v1_0_Preview_2) - @armCommonTypesVersion("v5") + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) `2022-11-01-preview`, } diff --git a/packages/samples/specs/resource-manager/resource-common-properties/common-properties/main.tsp b/packages/samples/specs/resource-manager/resource-common-properties/common-properties/main.tsp new file mode 100644 index 0000000000..0b9bfdeb33 --- /dev/null +++ b/packages/samples/specs/resource-manager/resource-common-properties/common-properties/main.tsp @@ -0,0 +1,68 @@ +import "@typespec/http"; +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.ResourceManager; +using Azure.Core; + +@armProviderNamespace("Contoso.CommonEnvelopePropertiesExample") +@service({ + title: "Contoso.CommonEnvelopePropertiesExample", +}) +@versioned(Versions) +@doc("An example of using some of common envelope and property bag properties in a resource type. Their names are all end with 'Property'.") +namespace Microsoft.UpdateTests; + +/** UpdateTests API versions */ +enum Versions { + /** 2023-03-01-preview version */ + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) + `2023-03-01-preview`, +} + +interface Operations extends Azure.ResourceManager.Operations {} + +@doc("Widget Resource") +model WidgetResource is TrackedResource { + @pattern("^[a-zA-Z0-9-]{3,24}$") + @doc("The name of the widget.") + @key("widgetName") + @segment("widgets") + @path + name: string; + + ...ExtendedLocationProperty; + ...ManagedByProperty; +} + +@doc("Widget Resource Properties.") +model WidgetResourceProperties { + @doc("The widget color.") + @visibility("create", "read") + color: string; + + /** Provisioning state */ + @visibility("read") + provisioningState?: ResourceProvisioningState; + + ...EntityTagProperty; + ...ResourceKindProperty; + ...ResourcePlanProperty; + ...ResourceSkuProperty; +} + +@armResourceOperations +interface Widgets { + get is ArmResourceRead; + create is ArmResourceCreateOrReplaceAsync; + update is ArmTagsPatchSync; + delete is ArmResourceDeleteWithoutOkAsync; + listByResourceGroup is ArmResourceListByParent; + listBySubscription is ArmListBySubscription; +} diff --git a/packages/samples/specs/resource-manager/resource-common-properties/encryption/main.tsp b/packages/samples/specs/resource-manager/resource-common-properties/encryption/main.tsp index a1cc373bd2..812435d79b 100644 --- a/packages/samples/specs/resource-manager/resource-common-properties/encryption/main.tsp +++ b/packages/samples/specs/resource-manager/resource-common-properties/encryption/main.tsp @@ -14,14 +14,18 @@ using Azure.Core; @service({ title: "Contoso.CustomerManagedKeyExample", }) -@OpenAPI.info({ - version: "2023-03-01-preview", -}) +@versioned(Versions) @doc("An example of using the Customer Managed Key Encryption properties in a resource type.") -@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) namespace Microsoft.UpdateTests; +/** UpdateTests API versions */ +enum Versions { + /** 2023-03-01-preview version */ + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) + `2023-03-01-preview`, +} + interface Operations extends Azure.ResourceManager.Operations {} @doc("Widget Resource") @@ -44,7 +48,7 @@ model WidgetResourceProperties { @visibility("read") provisioningState?: ResourceProvisioningState; - ...Encryption; + ...EncryptionProperty; } @armResourceOperations diff --git a/packages/samples/specs/resource-manager/resource-common-properties/managed-identity/main.tsp b/packages/samples/specs/resource-manager/resource-common-properties/managed-identity/main.tsp new file mode 100644 index 0000000000..33af6987c1 --- /dev/null +++ b/packages/samples/specs/resource-manager/resource-common-properties/managed-identity/main.tsp @@ -0,0 +1,62 @@ +import "@typespec/http"; +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.ResourceManager; +using Azure.Core; + +@armProviderNamespace("Contoso.ManagedIdentityExample") +@service({ + title: "Contoso.ManagedIdentityExample", +}) +@versioned(Versions) +@doc("An example of using the ManagedIdentity properties in a resource type.") +namespace Microsoft.UpdateTests; + +/** UpdateTests API versions */ +enum Versions { + /** 2023-03-01-preview version */ + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) + `2023-03-01-preview`, +} + +interface Operations extends Azure.ResourceManager.Operations {} + +@doc("Widget Resource") +model WidgetResource is TrackedResource { + @pattern("^[a-zA-Z0-9-]{3,24}$") + @doc("The name of the widget.") + @key("widgetName") + @segment("widgets") + @path + name: string; + + ...ManagedServiceIdentityProperty; // Or ...ManagedSystemAssignedIdentityProperty; +} + +@doc("Widget Resource Properties.") +model WidgetResourceProperties { + @doc("The widget color.") + @visibility("create", "read") + color: string; + + /** Provisioning state */ + @visibility("read") + provisioningState?: ResourceProvisioningState; +} + +@armResourceOperations +interface Widgets { + get is ArmResourceRead; + create is ArmResourceCreateOrUpdateAsync; + update is ArmTagsPatchSync; + delete is ArmResourceDeleteWithoutOkAsync; + listByResourceGroup is ArmResourceListByParent; + listBySubscription is ArmListBySubscription; +} diff --git a/packages/samples/test/output/azure/resource-manager/resource-common-properties/common-properties/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-common-properties/common-properties/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json new file mode 100644 index 0000000000..55c9e6e16d --- /dev/null +++ b/packages/samples/test/output/azure/resource-manager/resource-common-properties/common-properties/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json @@ -0,0 +1,554 @@ +{ + "swagger": "2.0", + "info": { + "title": "Contoso.CommonEnvelopePropertiesExample", + "version": "2023-03-01-preview", + "description": "An example of using some of common envelope and property bag properties in a resource type. Their names are all end with 'Property'.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "tags": [ + { + "name": "Operations" + }, + { + "name": "Widgets" + } + ], + "paths": { + "/providers/Contoso.CommonEnvelopePropertiesExample/operations": { + "get": { + "operationId": "Operations_List", + "tags": [ + "Operations" + ], + "description": "List the operations for the provider", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Contoso.CommonEnvelopePropertiesExample/widgets": { + "get": { + "operationId": "Widgets_ListBySubscription", + "tags": [ + "Widgets" + ], + "description": "List WidgetResource resources by subscription ID", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/WidgetResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Contoso.CommonEnvelopePropertiesExample/widgets": { + "get": { + "operationId": "Widgets_ListByResourceGroup", + "tags": [ + "Widgets" + ], + "description": "List WidgetResource resources by resource group", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/WidgetResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Contoso.CommonEnvelopePropertiesExample/widgets/{widgetName}": { + "get": { + "operationId": "Widgets_Get", + "tags": [ + "Widgets" + ], + "description": "Get a WidgetResource", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "widgetName", + "in": "path", + "description": "The name of the widget.", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/WidgetResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "operationId": "Widgets_Create", + "tags": [ + "Widgets" + ], + "description": "Create a WidgetResource", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "widgetName", + "in": "path", + "description": "The name of the widget.", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/WidgetResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'WidgetResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/WidgetResource" + } + }, + "201": { + "description": "Resource 'WidgetResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/WidgetResource" + }, + "headers": { + "Azure-AsyncOperation": { + "type": "string", + "description": "A link to the status monitor" + }, + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "Widgets_Update", + "tags": [ + "Widgets" + ], + "description": "Update a WidgetResource", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "widgetName", + "in": "path", + "description": "The name of the widget.", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/WidgetResourceTagsUpdate" + } + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/WidgetResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "operationId": "Widgets_Delete", + "tags": [ + "Widgets" + ], + "description": "Delete a WidgetResource", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "widgetName", + "in": "path", + "description": "The name of the widget.", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$" + } + ], + "responses": { + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + }, + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "204": { + "description": "Resource does not exist." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + } + }, + "definitions": { + "Azure.ResourceManager.CommonTypes.ExtendedLocation": { + "type": "object", + "description": "The complex type of the extended location.", + "properties": { + "name": { + "type": "string", + "description": "The name of the extended location." + }, + "type": { + "$ref": "#/definitions/Azure.ResourceManager.CommonTypes.ExtendedLocationType", + "description": "The type of the extended location." + } + }, + "required": [ + "name", + "type" + ] + }, + "Azure.ResourceManager.CommonTypes.ExtendedLocationType": { + "type": "string", + "description": "The supported ExtendedLocation types.", + "enum": [ + "EdgeZone", + "CustomLocation" + ], + "x-ms-enum": { + "name": "ExtendedLocationType", + "modelAsString": true, + "values": [ + { + "name": "EdgeZone", + "value": "EdgeZone", + "description": "Azure Edge Zones location type" + }, + { + "name": "CustomLocation", + "value": "CustomLocation", + "description": "Azure Custom Locations type" + } + ] + } + }, + "Azure.ResourceManager.ResourceProvisioningState": { + "type": "string", + "description": "The provisioning state of a resource type.", + "enum": [ + "Succeeded", + "Failed", + "Canceled" + ], + "x-ms-enum": { + "name": "ResourceProvisioningState", + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Resource has been created." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Resource creation failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "Resource creation was canceled." + } + ] + }, + "readOnly": true + }, + "WidgetResource": { + "type": "object", + "description": "Widget Resource", + "properties": { + "properties": { + "$ref": "#/definitions/WidgetResourceProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + }, + "extendedLocation": { + "$ref": "#/definitions/Azure.ResourceManager.CommonTypes.ExtendedLocation", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "managedBy": { + "type": "string", + "description": "The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource." + } + }, + "allOf": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/TrackedResource" + } + ] + }, + "WidgetResourceListResult": { + "type": "object", + "description": "The response of a WidgetResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The WidgetResource items on this page", + "items": { + "$ref": "#/definitions/WidgetResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "WidgetResourceProperties": { + "type": "object", + "description": "Widget Resource Properties.", + "properties": { + "color": { + "type": "string", + "description": "The widget color.", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "provisioningState": { + "$ref": "#/definitions/Azure.ResourceManager.ResourceProvisioningState", + "description": "Provisioning state", + "readOnly": true + }, + "eTag": { + "type": "string", + "description": "If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.", + "readOnly": true + }, + "kind": { + "type": "string", + "description": "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value.", + "pattern": "^[-\\w\\._,\\(\\\\\\)]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "plan": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/Plan", + "description": "Details of the resource plan." + }, + "sku": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/Sku", + "description": "The SKU (Stock Keeping Unit) assigned to this resource." + } + }, + "required": [ + "color" + ] + }, + "WidgetResourceTagsUpdate": { + "type": "object", + "description": "The type used for updating tags in WidgetResource resources.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "parameters": {} +} diff --git a/packages/samples/test/output/azure/resource-manager/resource-common-properties/encryption/@azure-tools/typespec-autorest/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-common-properties/encryption/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json similarity index 76% rename from packages/samples/test/output/azure/resource-manager/resource-common-properties/encryption/@azure-tools/typespec-autorest/openapi.json rename to packages/samples/test/output/azure/resource-manager/resource-common-properties/encryption/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json index 55d9acba80..49b6327cae 100644 --- a/packages/samples/test/output/azure/resource-manager/resource-common-properties/encryption/@azure-tools/typespec-autorest/openapi.json +++ b/packages/samples/test/output/azure/resource-manager/resource-common-properties/encryption/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json @@ -56,20 +56,20 @@ "description": "List the operations for the provider", "parameters": [ { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/OperationListResult" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/OperationListResult" } }, "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" } } }, @@ -87,10 +87,10 @@ "description": "List WidgetResource resources by subscription ID", "parameters": [ { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -103,7 +103,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" } } }, @@ -121,13 +121,13 @@ "description": "List WidgetResource resources by resource group", "parameters": [ { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" } ], "responses": { @@ -140,7 +140,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" } } }, @@ -158,13 +158,13 @@ "description": "Get a WidgetResource", "parameters": [ { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "widgetName", @@ -185,7 +185,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" } } } @@ -198,13 +198,13 @@ "description": "Create a WidgetResource", "parameters": [ { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "widgetName", @@ -251,7 +251,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" } } }, @@ -268,13 +268,13 @@ "description": "Update a WidgetResource", "parameters": [ { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "widgetName", @@ -304,7 +304,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" } } } @@ -317,13 +317,13 @@ "description": "Delete a WidgetResource", "parameters": [ { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "widgetName", @@ -355,7 +355,7 @@ "default": { "description": "An unexpected error response.", "schema": { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" } } }, @@ -414,7 +414,7 @@ }, "allOf": [ { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/TrackedResource" + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/TrackedResource" } ] }, @@ -457,7 +457,7 @@ "readOnly": true }, "encryption": { - "$ref": "../../../../../../../../specs/resource-manager/common-types/v5/customermanagedkeys.json#/definitions/encryption", + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/customermanagedkeys.json#/definitions/encryption", "description": "All encryption configuration for a resource." } }, diff --git a/packages/samples/test/output/azure/resource-manager/resource-common-properties/managed-identity/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json b/packages/samples/test/output/azure/resource-manager/resource-common-properties/managed-identity/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json new file mode 100644 index 0000000000..f90ff76fb9 --- /dev/null +++ b/packages/samples/test/output/azure/resource-manager/resource-common-properties/managed-identity/@azure-tools/typespec-autorest/2023-03-01-preview/openapi.json @@ -0,0 +1,483 @@ +{ + "swagger": "2.0", + "info": { + "title": "Contoso.ManagedIdentityExample", + "version": "2023-03-01-preview", + "description": "An example of using the ManagedIdentity properties in a resource type.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "tags": [ + { + "name": "Operations" + }, + { + "name": "Widgets" + } + ], + "paths": { + "/providers/Contoso.ManagedIdentityExample/operations": { + "get": { + "operationId": "Operations_List", + "tags": [ + "Operations" + ], + "description": "List the operations for the provider", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Contoso.ManagedIdentityExample/widgets": { + "get": { + "operationId": "Widgets_ListBySubscription", + "tags": [ + "Widgets" + ], + "description": "List WidgetResource resources by subscription ID", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/WidgetResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Contoso.ManagedIdentityExample/widgets": { + "get": { + "operationId": "Widgets_ListByResourceGroup", + "tags": [ + "Widgets" + ], + "description": "List WidgetResource resources by resource group", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/WidgetResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Contoso.ManagedIdentityExample/widgets/{widgetName}": { + "get": { + "operationId": "Widgets_Get", + "tags": [ + "Widgets" + ], + "description": "Get a WidgetResource", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "widgetName", + "in": "path", + "description": "The name of the widget.", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/WidgetResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "operationId": "Widgets_Create", + "tags": [ + "Widgets" + ], + "description": "Create a WidgetResource", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "widgetName", + "in": "path", + "description": "The name of the widget.", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/WidgetResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'WidgetResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/WidgetResource" + } + }, + "201": { + "description": "Resource 'WidgetResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/WidgetResource" + }, + "headers": { + "Azure-AsyncOperation": { + "type": "string", + "description": "A link to the status monitor" + }, + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "Widgets_Update", + "tags": [ + "Widgets" + ], + "description": "Update a WidgetResource", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "widgetName", + "in": "path", + "description": "The name of the widget.", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/WidgetResourceTagsUpdate" + } + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "#/definitions/WidgetResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "operationId": "Widgets_Delete", + "tags": [ + "Widgets" + ], + "description": "Delete a WidgetResource", + "parameters": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "widgetName", + "in": "path", + "description": "The name of the widget.", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$" + } + ], + "responses": { + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + }, + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "204": { + "description": "Resource does not exist." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + } + }, + "definitions": { + "Azure.ResourceManager.ResourceProvisioningState": { + "type": "string", + "description": "The provisioning state of a resource type.", + "enum": [ + "Succeeded", + "Failed", + "Canceled" + ], + "x-ms-enum": { + "name": "ResourceProvisioningState", + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Resource has been created." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Resource creation failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "Resource creation was canceled." + } + ] + }, + "readOnly": true + }, + "WidgetResource": { + "type": "object", + "description": "Widget Resource", + "properties": { + "properties": { + "$ref": "#/definitions/WidgetResourceProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + }, + "identity": { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/managedidentity.json#/definitions/ManagedServiceIdentity", + "description": "The managed service identities assigned to this resource." + } + }, + "allOf": [ + { + "$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/TrackedResource" + } + ] + }, + "WidgetResourceListResult": { + "type": "object", + "description": "The response of a WidgetResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The WidgetResource items on this page", + "items": { + "$ref": "#/definitions/WidgetResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "WidgetResourceProperties": { + "type": "object", + "description": "Widget Resource Properties.", + "properties": { + "color": { + "type": "string", + "description": "The widget color.", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "provisioningState": { + "$ref": "#/definitions/Azure.ResourceManager.ResourceProvisioningState", + "description": "Provisioning state", + "readOnly": true + } + }, + "required": [ + "color" + ] + }, + "WidgetResourceTagsUpdate": { + "type": "object", + "description": "The type used for updating tags in WidgetResource resources.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "parameters": {} +} diff --git a/packages/typespec-autorest/test/arm/arm.test.ts b/packages/typespec-autorest/test/arm/arm.test.ts index 39513d75f0..35d3b5cfb5 100644 --- a/packages/typespec-autorest/test/arm/arm.test.ts +++ b/packages/typespec-autorest/test/arm/arm.test.ts @@ -69,6 +69,7 @@ it("can share types with a library namespace", async () => { it("can use private links with common-types references", async () => { const openapi = await openApiFor( `@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v4) @armProviderNamespace namespace Microsoft.PrivateLinkTest; @@ -120,6 +121,7 @@ it("can use private endpoints with common-types references", async () => { const openapi = await openApiFor( `@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) @armProviderNamespace + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) namespace Microsoft.PrivateLinkTest; interface Operations extends Azure.ResourceManager.Operations {} @@ -160,6 +162,7 @@ it("can use ResourceNameParameter for custom name parameter definition", async ( const openapi = await openApiFor( `@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) @armProviderNamespace + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) namespace Microsoft.PrivateLinkTest; interface Operations extends Azure.ResourceManager.Operations {} @@ -199,6 +202,7 @@ it("can use ResourceNameParameter for default name parameter definition", async const openapi = await openApiFor( `@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) @armProviderNamespace + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) namespace Microsoft.PrivateLinkTest; interface Operations extends Azure.ResourceManager.Operations {} diff --git a/packages/typespec-azure-portal-core/test/decorators.test.ts b/packages/typespec-azure-portal-core/test/decorators.test.ts index 91cd9a37d3..41390cfe3f 100644 --- a/packages/typespec-azure-portal-core/test/decorators.test.ts +++ b/packages/typespec-azure-portal-core/test/decorators.test.ts @@ -296,10 +296,12 @@ export function createTestSpec( enum Versions { @useDependency(Azure.Core.Versions.v1_0_Preview_2) @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v4) v2022_09_02_preview: "2022-09-02-preview", @useDependency(Azure.Core.Versions.v1_0_Preview_2) @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) v2024_02_20_preview: "2024-02-20-preview", } diff --git a/packages/typespec-azure-resource-manager/README.md b/packages/typespec-azure-resource-manager/README.md index a539c76ec9..703b9022a6 100644 --- a/packages/typespec-azure-resource-manager/README.md +++ b/packages/typespec-azure-resource-manager/README.md @@ -103,9 +103,9 @@ the version of the Azure Resource Manager common-types to use for refs in emitte ##### Parameters -| Name | Type | Description | -| ------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| version | `valueof string \| EnumMember` | The Azure.ResourceManager.CommonTypes.Versions for the desired common-types version or an equivalent string value. | +| 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` diff --git a/packages/typespec-azure-resource-manager/lib/arm.tsp b/packages/typespec-azure-resource-manager/lib/arm.tsp index dec73193f1..0a471f32bc 100644 --- a/packages/typespec-azure-resource-manager/lib/arm.tsp +++ b/packages/typespec-azure-resource-manager/lib/arm.tsp @@ -5,14 +5,9 @@ import "@typespec/rest"; import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; -import "./arm.foundations.tsp"; +import "./foundations/arm.foundations.tsp"; import "./common-types/common-types.tsp"; -import "./common-types/backcompat.tsp"; -import "./common-types/types.tsp"; -import "./common-types/managed-identity.tsp"; -import "./common-types/private-links.tsp"; -import "./common-types/customer-managed-keys.tsp"; -import "./common-types/extended-location.tsp"; +import "./backcompat.tsp"; import "./private.decorators.tsp"; import "./models.tsp"; import "./operations.tsp"; diff --git a/packages/typespec-azure-resource-manager/lib/backcompat.tsp b/packages/typespec-azure-resource-manager/lib/backcompat.tsp new file mode 100644 index 0000000000..57a60f2ac1 --- /dev/null +++ b/packages/typespec-azure-resource-manager/lib/backcompat.tsp @@ -0,0 +1,27 @@ +using Azure.ResourceManager.CommonTypes; + +namespace Azure.ResourceManager; + +// customer-managed-keys +alias InfrastructureEncryption = CommonTypes.InfrastructureEncryption; +alias KeyEncryptionIdentity = CommonTypes.KeyEncryptionKeyIdentity; +alias KeyEncryptionKeyIdentity = CommonTypes.KeyEncryptionKeyIdentity; +alias CustomerManagedKeyEncryption = CommonTypes.CustomerManagedKeyEncryption; +alias EncryptionConfiguration = CommonTypes.Encryption; + +// private-links +alias PrivateEndpoint = CommonTypes.PrivateEndpoint; +alias PrivateEndpointConnection = CommonTypes.PrivateEndpointConnection; +alias PrivateEndpointConnectionProperties = CommonTypes.PrivateEndpointConnectionProperties; +alias PrivateLinkServiceConnectionState = CommonTypes.PrivateLinkServiceConnectionState; +alias PrivateEndpointConnectionProvisioningState = CommonTypes.PrivateEndpointConnectionProvisioningState; +alias PrivateEndpointServiceConnectionStatus = CommonTypes.PrivateEndpointServiceConnectionStatus; +alias PrivateEndpointConnectionParameter = CommonTypes.PrivateEndpointConnectionParameter; +alias PrivateLinkResource = CommonTypes.PrivateLinkResource; +alias PrivateLinkResourceProperties = CommonTypes.PrivateLinkResourceProperties; +alias PrivateLinkResourceParameter = CommonTypes.PrivateLinkResourceParameter; +alias PrivateEndpointConnectionResourceListResult = CommonTypes.PrivateEndpointConnectionListResult; +alias PrivateLinkResourceListResult = CommonTypes.PrivateLinkResourceListResult; + +// types +alias ErrorResponse = CommonTypes.ErrorResponse; diff --git a/packages/typespec-azure-resource-manager/lib/common-types/common-types.tsp b/packages/typespec-azure-resource-manager/lib/common-types/common-types.tsp index 187403ac1a..211ef3d5e5 100644 --- a/packages/typespec-azure-resource-manager/lib/common-types/common-types.tsp +++ b/packages/typespec-azure-resource-manager/lib/common-types/common-types.tsp @@ -1,10 +1,20 @@ import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "./common-types.tsp"; +import "./types-ref.tsp"; +import "./managed-identity-ref.tsp"; +import "./private-links-ref.tsp"; +import "./customer-managed-keys-ref.tsp"; +import "./extended-location-ref.tsp"; +import "./internal.tsp"; +import "./commontypes.private.decorators.tsp"; using TypeSpec.Versioning; +@versioned(Versions) namespace Azure.ResourceManager.CommonTypes; -@Private.armCommonTypesVersions +@CommonTypes.Private.armCommonTypesVersions @doc("The Azure Resource Manager common-types versions.") enum Versions { @doc("The Azure Resource Manager v3 common types.") diff --git a/packages/typespec-azure-resource-manager/lib/common-types/commontypes.private.decorators.tsp b/packages/typespec-azure-resource-manager/lib/common-types/commontypes.private.decorators.tsp new file mode 100644 index 0000000000..889a7ec8e1 --- /dev/null +++ b/packages/typespec-azure-resource-manager/lib/common-types/commontypes.private.decorators.tsp @@ -0,0 +1,43 @@ +import "../../dist/src/commontypes.private.decorators.js"; + +namespace Azure.ResourceManager.CommonTypes.Private; + +using TypeSpec.Reflection; + +/** + * Describes the shape of model literals accepted by the `version` parameter of + * the `armCommonDefinition` and `armCommonParameter` decorators. + */ +alias ArmCommonTypeVersionSpec = { + version: string | EnumMember; + isDefault: boolean; +}; + +/** + * @param definitionName Definition name + * @param version Azure Resource Manager Version + * @param referenceFile Reference file + */ +extern dec armCommonDefinition( + target: Model, + definitionName?: valueof string, + version?: valueof EnumMember | ArmCommonTypeVersionSpec | string, + referenceFile?: valueof string +); + +/** + * @param definitionName Definition name + * @param version Azure Resource Manager Version + * @param referenceFile Reference file + */ +extern dec armCommonParameter( + target: ModelProperty, + definitionName?: valueof string, + version?: valueof EnumMember | ArmCommonTypeVersionSpec | string, + referenceFile?: valueof string +); + +/** + * Marks an enum as representing the valid `common-types` versions. + */ +extern dec armCommonTypesVersions(target: Enum); diff --git a/packages/typespec-azure-resource-manager/lib/common-types/customer-managed-keys-ref.tsp b/packages/typespec-azure-resource-manager/lib/common-types/customer-managed-keys-ref.tsp new file mode 100644 index 0000000000..3df1e5168a --- /dev/null +++ b/packages/typespec-azure-resource-manager/lib/common-types/customer-managed-keys-ref.tsp @@ -0,0 +1,27 @@ +import "./customer-managed-keys.tsp"; + +using Azure.ResourceManager.CommonTypes.Private; + +namespace Azure.ResourceManager.CommonTypes; + +@@armCommonDefinition(Encryption, + "encryption", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true }, + "customermanagedkeys.json" +); +@@armCommonDefinition(Encryption, + "encryption", + Azure.ResourceManager.CommonTypes.Versions.v5, + "customermanagedkeys.json" +); + +@@armCommonDefinition(CustomerManagedKeyEncryption, + "customerManagedKeyEncryption", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true }, + "customermanagedkeys.json" +); +@@armCommonDefinition(CustomerManagedKeyEncryption, + "customerManagedKeyEncryption", + Azure.ResourceManager.CommonTypes.Versions.v5, + "customermanagedkeys.json" +); diff --git a/packages/typespec-azure-resource-manager/lib/common-types/customer-managed-keys.tsp b/packages/typespec-azure-resource-manager/lib/common-types/customer-managed-keys.tsp index eefe408a05..577098f95b 100644 --- a/packages/typespec-azure-resource-manager/lib/common-types/customer-managed-keys.tsp +++ b/packages/typespec-azure-resource-manager/lib/common-types/customer-managed-keys.tsp @@ -1,84 +1,75 @@ using Azure.Core; -using Azure.ResourceManager.Private; +using TypeSpec.Versioning; -namespace Azure.ResourceManager; +namespace Azure.ResourceManager.CommonTypes; -@doc("(Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled.") +/** (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. */ +@added(Versions.v4) union InfrastructureEncryption { - @doc("Encryption is enabled") + /** Encryption is enabled */ Enabled: "enabled", - @doc("Encryption is disabled") + /** Encryption is disabled */ Disabled: "disabled", string, } -/** Alias of keyEncryptionKeyIdentity for back compatibility. Please change to keyEncryptionKeyIdentity. */ -alias KeyEncryptionIdentity = KeyEncryptionKeyIdentity; - -@doc("The type of identity to use.") -union KeyEncryptionKeyIdentity { - @doc("System assigned identity") +/** The type of identity to use. */ +@added(Versions.v4) +union KeyEncryptionKeyIdentityType { + /** System assigned identity */ SystemAssignedIdentity: "systemAssignedIdentity", - @doc("User assigned identity") + /** User assigned identity */ UserAssignedIdentity: "userAssignedIdentity", - @doc("Delegated identity") + /** Delegated identity */ DelegatedResourceIdentity: "delegatedResourceIdentity", string, } -@doc("Customer-managed key encryption properties for the resource.") -model CustomerManagedKeyEncryption { - @doc("The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity.") - keyEncryptionKeyIdentity?: KeyEncryptionKeyIdentity; +/** All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. */ +@added(Versions.v4) +model KeyEncryptionKeyIdentity { + /** The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity. */ + identityType?: KeyEncryptionKeyIdentityType; - @doc("User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity.") + /** User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity. */ userAssignedIdentityResourceId?: Azure.Core.armResourceIdentifier<[ { type: "Microsoft.ManagedIdentity/userAssignedIdentities"; } ]>; - @doc("application client identity to use for accessing key encryption key Url in a different tenant. Ex: f83c6b1b-4d34-47e4-bb34-9d83df58b540") + /** application client identity to use for accessing key encryption key Url in a different tenant. Ex: f83c6b1b-4d34-47e4-bb34-9d83df58b540 */ + @added(Versions.v5) federatedClientId?: uuid; - @doc("delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only.") + /** delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only. */ delegatedIdentityClientId?: uuid; } -@doc("All encryption configuration for a resource.") -@armCommonDefinition( - "encryption", - Azure.ResourceManager.CommonTypes.Versions.v5, - "customermanagedkeys.json" -) -model EncryptionConfiguration { - @doc("Indicates if infrastructure encryption is enabled or disabled.") - infrastructureEncryption?: InfrastructureEncryption; - - @doc("All customer-managed key encryption properties for the resource.") - customerManagedKeyEncryption?: CustomerManagedKeyEncryption; +/** Customer-managed key encryption properties for the resource. */ +@added(Versions.v4) +model CustomerManagedKeyEncryption { + /** All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. */ + keyEncryptionKeyIdentity?: KeyEncryptionKeyIdentity; - @doc("key encryption key Url, versioned or unversioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek.") + /** key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek. */ keyEncryptionKeyUrl?: string; } -/** - * Model used only to spread in the `encryption` envelope property for a resource. - * @example - * - * ```typespec - * model Foo is TrackedResource { - * ...Encryption; - * } - * ``` - */ -@doc("All encryption configuration for a resource.") +/** (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. */ +@added(Versions.v4) +@encodedName("application/json", "encryption") model Encryption { - @doc("All encryption configuration for a resource.") - encryption: EncryptionConfiguration; + /** Values are enabled and disabled. */ + infrastructureEncryption?: InfrastructureEncryption; + + /** All Customer-managed key encryption properties for the resource. */ + @added(Versions.v4) + @removed(Versions.v5) + customerManagedKeyEncryption?: CustomerManagedKeyEncryption; } diff --git a/packages/typespec-azure-resource-manager/lib/common-types/extended-location-ref.tsp b/packages/typespec-azure-resource-manager/lib/common-types/extended-location-ref.tsp new file mode 100644 index 0000000000..5feca7a65a --- /dev/null +++ b/packages/typespec-azure-resource-manager/lib/common-types/extended-location-ref.tsp @@ -0,0 +1 @@ +import "./extended-location.tsp"; diff --git a/packages/typespec-azure-resource-manager/lib/common-types/extended-location.tsp b/packages/typespec-azure-resource-manager/lib/common-types/extended-location.tsp index c9a7a398d8..3ff52b38aa 100644 --- a/packages/typespec-azure-resource-manager/lib/common-types/extended-location.tsp +++ b/packages/typespec-azure-resource-manager/lib/common-types/extended-location.tsp @@ -1,21 +1,20 @@ -namespace Azure.ResourceManager.Foundations { - /** The complex type of the extended location. */ - model ExtendedLocation { - /** The name of the extended location. */ - name: string; +namespace Azure.ResourceManager.CommonTypes; +/** The complex type of the extended location. */ +model ExtendedLocation { + /** The name of the extended location. */ + name: string; - /** The type of the extended location. */ - type: ExtendedLocationType; - } + /** The type of the extended location. */ + type: ExtendedLocationType; +} - /** The supported ExtendedLocation types. */ - union ExtendedLocationType { - /** Azure Edge Zones location type */ - EdgeZone: "EdgeZone", +/** The supported ExtendedLocation types. */ +union ExtendedLocationType { + /** Azure Edge Zones location type */ + EdgeZone: "EdgeZone", - /** Azure Custom Locations type */ - CustomLocation: "CustomLocation", + /** Azure Custom Locations type */ + CustomLocation: "CustomLocation", - string, - } + string, } diff --git a/packages/typespec-azure-resource-manager/lib/common-types/internal.tsp b/packages/typespec-azure-resource-manager/lib/common-types/internal.tsp new file mode 100644 index 0000000000..c1334a48a3 --- /dev/null +++ b/packages/typespec-azure-resource-manager/lib/common-types/internal.tsp @@ -0,0 +1,24 @@ +namespace Azure.ResourceManager.CommonTypes; + +/** + * An internal enum to indicate the resource support for various path types + */ +enum ResourceHome { + @doc("The resource is bound to a tenant") + Tenant, + + @doc("The resource is bound to a subscription") + Subscription, + + @doc("The resource is bound to a location") + Location, + + @doc("The resource is bound to a resource group") + ResourceGroup, + + @doc("The resource is bound to an extension") + Extension, +} + +/** Alias of keyEncryptionKeyIdentity for back compatibility. Please change to keyEncryptionKeyIdentity. */ +alias KeyEncryptionIdentity = KeyEncryptionKeyIdentity; diff --git a/packages/typespec-azure-resource-manager/lib/common-types/managed-identity-ref.tsp b/packages/typespec-azure-resource-manager/lib/common-types/managed-identity-ref.tsp new file mode 100644 index 0000000000..c839d489ed --- /dev/null +++ b/packages/typespec-azure-resource-manager/lib/common-types/managed-identity-ref.tsp @@ -0,0 +1,79 @@ +import "./managed-identity.tsp"; + +using Azure.ResourceManager.CommonTypes.Private; + +namespace Azure.ResourceManager.CommonTypes; + +/** + * The properties of the managed service identities assigned to this resource. + */ +@@armCommonDefinition(ManagedServiceIdentity, + "ManagedServiceIdentity", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "managedidentity.json" +); +@@armCommonDefinition(ManagedServiceIdentity, + "ManagedServiceIdentity", + Azure.ResourceManager.CommonTypes.Versions.v4, + "managedidentity.json" +); +@@armCommonDefinition(ManagedServiceIdentity, + "ManagedServiceIdentity", + Azure.ResourceManager.CommonTypes.Versions.v5, + "managedidentity.json" +); + +/** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", */ +@@armCommonDefinition(UserAssignedIdentities, + "UserAssignedIdentities", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "managedidentity.json" +); +@@armCommonDefinition(UserAssignedIdentities, + "UserAssignedIdentities", + Azure.ResourceManager.CommonTypes.Versions.v4, + "managedidentity.json" +); +@@armCommonDefinition(UserAssignedIdentities, + "UserAssignedIdentities", + Azure.ResourceManager.CommonTypes.Versions.v5, + "managedidentity.json" +); + +/** + * The properties of the service-assigned identity associated with this resource. + */ +@@armCommonDefinition(SystemAssignedServiceIdentity, + "SystemAssignedServiceIdentity", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "managedidentity.json" +); +@@armCommonDefinition(SystemAssignedServiceIdentity, + "SystemAssignedServiceIdentity", + Azure.ResourceManager.CommonTypes.Versions.v4, + "managedidentity.json" +); +@@armCommonDefinition(SystemAssignedServiceIdentity, + "SystemAssignedServiceIdentity", + Azure.ResourceManager.CommonTypes.Versions.v5, + "managedidentity.json" +); + +/** + * A managed identity assigned by the user. + */ +@@armCommonDefinition(UserAssignedIdentity, + "UserAssignedIdentity", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "managedidentity.json" +); +@@armCommonDefinition(UserAssignedIdentity, + "UserAssignedIdentity", + Azure.ResourceManager.CommonTypes.Versions.v4, + "managedidentity.json" +); +@@armCommonDefinition(UserAssignedIdentity, + "UserAssignedIdentity", + Azure.ResourceManager.CommonTypes.Versions.v5, + "managedidentity.json" +); diff --git a/packages/typespec-azure-resource-manager/lib/common-types/managed-identity.tsp b/packages/typespec-azure-resource-manager/lib/common-types/managed-identity.tsp index f44b698300..f42f111d84 100644 --- a/packages/typespec-azure-resource-manager/lib/common-types/managed-identity.tsp +++ b/packages/typespec-azure-resource-manager/lib/common-types/managed-identity.tsp @@ -1,137 +1,100 @@ -using Azure.ResourceManager.Private; +using Azure.Core; +using TypeSpec.Versioning; -namespace Azure.ResourceManager.Foundations; +namespace Azure.ResourceManager.CommonTypes; + +/** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ +#deprecated "Do not use this model. Instead, use Record directly. Using this model will result in a different client SDK when generated from TypeSpec compared to the Swagger." +model UserAssignedIdentities is Record; -#deprecated "Please change ManagedIdentityProperties to ManagedServiceIdentity." -alias ManagedIdentityProperties = ManagedServiceIdentity; /** - * The properties of the managed service identities assigned to this resource. + * Managed service identity (system assigned and/or user assigned identities) */ -@armCommonDefinition( - "ManagedServiceIdentity", - #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true }, - "managedidentity.json" -) -@armCommonDefinition( - "ManagedServiceIdentity", - Azure.ResourceManager.CommonTypes.Versions.v5, - "managedidentity.json" -) model ManagedServiceIdentity { - @doc("The Active Directory tenant id of the principal.") + /** The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */ @visibility("read") - tenantId?: string; + principalId?: uuid; - @doc("The active directory identifier of this principal.") + /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */ @visibility("read") - principalId?: string; + tenantId?: uuid; - @doc("The type of managed identity assigned to this resource.") + /** The type of managed identity assigned to this resource. */ type: ManagedServiceIdentityType; - @doc("The identities assigned to this resource by the user.") - userAssignedIdentities?: Record; + /** The identities assigned to this resource by the user. */ + @typeChangedFrom(Versions.v5, Record) + userAssignedIdentities?: Record | null; } -/** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", */ -#deprecated "Do not use this model. Instead, use Record directly. Using this model will result in a different client SDK when generated from TypeSpec compared to the Swagger." -@armCommonDefinition( - "UserAssignedIdentities", - #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true }, - "managedidentity.json" -) -@armCommonDefinition( - "UserAssignedIdentities", - Azure.ResourceManager.CommonTypes.Versions.v5, - "managedidentity.json" -) -model UserAssignedIdentities is Record; - -#deprecated "Please change ManagedSystemIdentityProperties to SystemAssignedServiceIdentity." -alias ManagedSystemIdentityProperties = SystemAssignedServiceIdentity; /** - * The properties of the service-assigned identity associated with this resource. + * Managed service identity (either system assigned, or none) */ -@armCommonDefinition( - "SystemAssignedServiceIdentity", - #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true }, - "managedidentity.json" -) -@armCommonDefinition( - "SystemAssignedServiceIdentity", - Azure.ResourceManager.CommonTypes.Versions.v5, - "managedidentity.json" -) model SystemAssignedServiceIdentity { - @doc("The Active Directory tenant id of the principal.") + /** The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */ @visibility("read") - tenantId?: string; + principalId?: uuid; - @doc("The active directory identifier of this principal.") + /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */ @visibility("read") - principalId?: string; + tenantId?: uuid; - @doc("The type of managed identity assigned to this resource.") + /** The type of managed identity assigned to this resource. */ type: SystemAssignedServiceIdentityType; } -/** Alias of ManagedServiceIdentityType for back compatability. Please change to ManagedServiceIdentityType. */ -#deprecated "Please change to ManagedServiceIdentityType." -alias ManagedIdentityType = ManagedServiceIdentityType; /** - * A managed identity assigned by the user. + * User assigned identity properties */ -@armCommonDefinition( - "UserAssignedIdentity", - #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true }, - "managedidentity.json" -) -@armCommonDefinition( - "UserAssignedIdentity", - Azure.ResourceManager.CommonTypes.Versions.v5, - "managedidentity.json" -) -@doc("A managed identity assigned by the user.") model UserAssignedIdentity { - @doc("The active directory client identifier for this principal.") - clientId?: string; + /** The principal ID of the assigned identity. */ + @visibility("read") + principalId?: uuid; - @doc("The active directory identifier for this principal.") - principalId?: string; + /** The client ID of the assigned identity. */ + @visibility("read") + clientId?: uuid; } /** - * The kind of managed identity assigned to this resource. + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ -@doc("The kind of managed identity assigned to this resource.") union ManagedServiceIdentityType { - @doc("No managed identity.") + /** No managed identity. */ None: "None", - @doc("System assigned managed identity.") + /** System assigned managed identity. */ SystemAssigned: "SystemAssigned", - @doc("User assigned managed identity.") + /** User assigned managed identity. */ UserAssigned: "UserAssigned", - @doc("System and user assigned managed identity.") - SystemAndUserAssigned: "SystemAssigned, UserAssigned", + /** System and user assigned managed identity. */ + @renamedFrom(Versions.v3, "SystemAndUserAssigned") + @removed(Versions.v4) + SystemAndUserAssignedV3: "SystemAssigned,UserAssigned", + + /** System and user assigned managed identity. */ + @added(Versions.v4) + @renamedFrom(Versions.v4, "SystemAndUserAssigned") + @removed(Versions.v5) + SystemAndUserAssignedV4: "SystemAssigned, UserAssigned", + + /** System and user assigned managed identity. */ + @added(Versions.v5) + SystemAndUserAssigned: "SystemAssigned,UserAssigned", string, } -/** Alias of SystemAssignedServiceIdentityType for back compatability. Please change to SystemAssignedServiceIdentityType. */ -alias ManagedSystemIdentityType = SystemAssignedServiceIdentityType; - /** - * The kind of managemed identity assigned to this resource. + * Type of managed service identity (either system assigned, or none). */ -@doc("The kind of managemed identity assigned to this resource.") union SystemAssignedServiceIdentityType { - @doc("No managed system identity.") + /** No managed system identity. */ None: "None", - @doc("System assigned managed system identity.") + /** System assigned managed system identity. */ SystemAssigned: "SystemAssigned", string, diff --git a/packages/typespec-azure-resource-manager/lib/common-types/private-links-ref.tsp b/packages/typespec-azure-resource-manager/lib/common-types/private-links-ref.tsp new file mode 100644 index 0000000000..2fca19e18d --- /dev/null +++ b/packages/typespec-azure-resource-manager/lib/common-types/private-links-ref.tsp @@ -0,0 +1,159 @@ +import "./private-links.tsp"; + +using Azure.ResourceManager.CommonTypes.Private; + +namespace Azure.ResourceManager.CommonTypes; + +/** The private endpoint */ +@@armCommonDefinition(PrivateEndpoint, + "PrivateEndpoint", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "privatelinks.json" +); +@@armCommonDefinition(PrivateEndpoint, + "PrivateEndpoint", + Azure.ResourceManager.CommonTypes.Versions.v4, + "privatelinks.json" +); +@@armCommonDefinition(PrivateEndpoint, + "PrivateEndpoint", + Azure.ResourceManager.CommonTypes.Versions.v5, + "privatelinks.json" +); + +/** The private endpoint resource */ +@@armCommonDefinition(PrivateLinkResource, + "PrivateLinkResource", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "privatelinks.json" +); +@@armCommonDefinition(PrivateLinkResource, + "PrivateLinkResource", + Azure.ResourceManager.CommonTypes.Versions.v4, + "privatelinks.json" +); +@@armCommonDefinition(PrivateLinkResource, + "PrivateLinkResource", + Azure.ResourceManager.CommonTypes.Versions.v5, + "privatelinks.json" +); + +/** PrivateEndpointConnection */ +@@armCommonDefinition(PrivateEndpointConnection, + "PrivateEndpointConnection", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "privatelinks.json" +); +@@armCommonDefinition(PrivateEndpointConnection, + "PrivateEndpointConnection", + Azure.ResourceManager.CommonTypes.Versions.v4, + "privatelinks.json" +); +@@armCommonDefinition(PrivateEndpointConnection, + "PrivateEndpointConnection", + Azure.ResourceManager.CommonTypes.Versions.v5, + "privatelinks.json" +); + +/** Properties of he private endpoint connection resource */ +@@armCommonDefinition(PrivateEndpointConnectionProperties, + "PrivateEndpointConnectionProperties", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "privatelinks.json" +); +@@armCommonDefinition(PrivateEndpointConnectionProperties, + "PrivateEndpointConnectionProperties", + Azure.ResourceManager.CommonTypes.Versions.v4, + "privatelinks.json" +); +@@armCommonDefinition(PrivateEndpointConnectionProperties, + "PrivateEndpointConnectionProperties", + Azure.ResourceManager.CommonTypes.Versions.v5, + "privatelinks.json" +); + +/** A collection of information about the state of the connection between service consumer and provider. */ +@@armCommonDefinition(PrivateLinkServiceConnectionState, + "PrivateLinkServiceConnectionState", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "privatelinks.json" +); +@@armCommonDefinition(PrivateLinkServiceConnectionState, + "PrivateLinkServiceConnectionState", + Azure.ResourceManager.CommonTypes.Versions.v4, + "privatelinks.json" +); +@@armCommonDefinition(PrivateLinkServiceConnectionState, + "PrivateLinkServiceConnectionState", + Azure.ResourceManager.CommonTypes.Versions.v5, + "privatelinks.json" +); + +/** Properties of a private link resource. */ +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "Matches current common code" +@@armCommonDefinition(PrivateLinkResourceProperties, + "PrivateLinkResourceProperties", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "privatelinks.json" +); +@@armCommonDefinition(PrivateLinkResourceProperties, + "PrivateLinkResourceProperties", + Azure.ResourceManager.CommonTypes.Versions.v4, + "privatelinks.json" +); +@@armCommonDefinition(PrivateLinkResourceProperties, + "PrivateLinkResourceProperties", + Azure.ResourceManager.CommonTypes.Versions.v5, + "privatelinks.json" +); + +/** PrivateEndpointConnectionListResult */ +@@armCommonDefinition(PrivateEndpointConnectionListResult, + "PrivateEndpointConnectionListResult", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "privatelinks.json" +); +@@armCommonDefinition(PrivateEndpointConnectionListResult, + "PrivateEndpointConnectionListResult", + Azure.ResourceManager.CommonTypes.Versions.v4, + "privatelinks.json" +); +@@armCommonDefinition(PrivateEndpointConnectionListResult, + "PrivateEndpointConnectionListResult", + Azure.ResourceManager.CommonTypes.Versions.v5, + "privatelinks.json" +); + +/** PrivateLinkResourceListResult */ +@@armCommonDefinition(PrivateLinkResourceListResult, + "PrivateLinkResourceListResult", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "privatelinks.json" +); +@@armCommonDefinition(PrivateLinkResourceListResult, + "PrivateLinkResourceListResult", + Azure.ResourceManager.CommonTypes.Versions.v4, + "privatelinks.json" +); +@@armCommonDefinition(PrivateLinkResourceListResult, + "PrivateLinkResourceListResult", + Azure.ResourceManager.CommonTypes.Versions.v5, + "privatelinks.json" +); + +/** PrivateEndpointConnectionParameter */ +@@CommonTypes.Private.armCommonParameter(PrivateEndpointConnectionParameter.name, + "PrivateEndpointConnectionName", + #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true }, + "privatelinks.json" +); +@@CommonTypes.Private.armCommonParameter(PrivateEndpointConnectionParameter.name, + "PrivateEndpointConnectionName", + Azure.ResourceManager.CommonTypes.Versions.v4, + "privatelinks.json" +); +@@CommonTypes.Private.armCommonParameter(PrivateEndpointConnectionParameter.name, + "PrivateEndpointConnectionName", + Azure.ResourceManager.CommonTypes.Versions.v5, + "privatelinks.json" +); diff --git a/packages/typespec-azure-resource-manager/lib/common-types/private-links.tsp b/packages/typespec-azure-resource-manager/lib/common-types/private-links.tsp index 1936211379..694bb96022 100644 --- a/packages/typespec-azure-resource-manager/lib/common-types/private-links.tsp +++ b/packages/typespec-azure-resource-manager/lib/common-types/private-links.tsp @@ -1,29 +1,13 @@ -import "@typespec/openapi"; -import "@typespec/http"; -import "@typespec/rest"; -import "@typespec/versioning"; -import "@azure-tools/typespec-azure-core"; - using TypeSpec.Http; -using TypeSpec.OpenAPI; using TypeSpec.Versioning; -using Azure.ResourceManager.Private; - -namespace Azure.ResourceManager; - -/** The private endpoint resource */ -@armCommonDefinition( - "PrivateEndpoint", - #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true }, - "privatelinks.json" -) -@armCommonDefinition( - "PrivateEndpoint", - Azure.ResourceManager.CommonTypes.Versions.v5, - "privatelinks.json" -) +using OpenAPI; + +namespace Azure.ResourceManager.CommonTypes; + +/** The Private Endpoint resource. */ model PrivateEndpoint { /** The resource identifier for private endpoint */ + @visibility("read") id?: Azure.Core.armResourceIdentifier<[ { type: "Microsoft.Network/privateEndpoints"; @@ -31,49 +15,65 @@ model PrivateEndpoint { ]>; } +/** A private link resource. */ +model PrivateLinkResource extends Resource { + /** Resource properties. */ + @extension("x-ms-client-flatten", true) + properties?: PrivateLinkResourceProperties; +} + +/** Properties of a private link resource. */ +model PrivateLinkResourceProperties { + /** The private link resource group id. */ + @visibility("read") + groupId?: string; + + /** The private link resource required member names. */ + @visibility("read") + requiredMembers?: string[]; + + /** The private link resource private link DNS zone name. */ + requiredZoneNames?: string[]; +} + +/** A list of private link resources. */ +model PrivateLinkResourceListResult { + /** Array of private link resources */ + value?: PrivateLinkResource[]; +} +//#region /** The private endpoint connection resource */ -model PrivateEndpointConnection extends Azure.ResourceManager.Foundations.ProxyResource { +model PrivateEndpointConnection extends Resource { /** The private endpoint connection properties */ + @extension("x-ms-client-flatten", true) properties?: PrivateEndpointConnectionProperties; } -/** Properties of he private endpoint connection resource */ -@armCommonDefinition( - "PrivateEndpointConnectionProperties", - #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true }, - "privatelinks.json" -) -@armCommonDefinition( - "PrivateEndpointConnectionProperties", - Azure.ResourceManager.CommonTypes.Versions.v5, - "privatelinks.json" -) +/** List of private endpoint connections associated with the specified resource. */ +model PrivateEndpointConnectionListResult { + /** Array of private endpoint connections. */ + value?: PrivateEndpointConnection[]; +} + +/** Properties of the private endpoint connection. */ model PrivateEndpointConnectionProperties { - /** The group identifiers for the private endpoint resource */ + /** The group ids for the private endpoint resource. */ @visibility("read") + @added(Versions.v4) groupIds?: string[]; - /** The private endpoint resource */ + /** The private endpoint resource. */ privateEndpoint?: PrivateEndpoint; /** A collection of information about the state of the connection between service consumer and provider. */ privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; /** The provisioning state of the private endpoint connection resource. */ + @visibility("read") provisioningState?: PrivateEndpointConnectionProvisioningState; } /** A collection of information about the state of the connection between service consumer and provider. */ -@armCommonDefinition( - "PrivateLinkServiceConnectionState", - #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true }, - "privatelinks.json" -) -@armCommonDefinition( - "PrivateLinkServiceConnectionState", - Azure.ResourceManager.CommonTypes.Versions.v5, - "privatelinks.json" -) model PrivateLinkServiceConnectionState { /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ status?: PrivateEndpointServiceConnectionStatus; @@ -85,18 +85,24 @@ model PrivateLinkServiceConnectionState { actionsRequired?: string; } -/** The provisioning state of the connection */ +/** The current provisioning state. */ union PrivateEndpointConnectionProvisioningState { - ResourceProvisioningState, + string, + + /** Connection has been provisioned */ + Succeeded: "Succeeded", /** Connection is being created */ Creating: "Creating", /** Connection is being deleted */ Deleting: "Deleting", + + /** Connection provisioning has failed */ + Failed: "Failed", } -/** The private endpoint connection status */ +/** The private endpoint connection status. */ union PrivateEndpointServiceConnectionStatus { /** Connectionaiting for approval or rejection */ Pending: "Pending", @@ -110,48 +116,6 @@ union PrivateEndpointServiceConnectionStatus { string, } -model PrivateLinkResource extends Azure.ResourceManager.Foundations.ProxyResource { - /** Properties of the private link resource. */ - properties?: PrivateLinkResourceProperties; -} - -/** Properties of a private link resource. */ -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "Matches current common code" -@armCommonDefinition( - "PrivateLinkResourceProperties", - #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true }, - "privatelinks.json" -) -@armCommonDefinition( - "PrivateLinkResourceProperties", - Azure.ResourceManager.CommonTypes.Versions.v5, - "privatelinks.json" -) -model PrivateLinkResourceProperties { - /** The private link resource group id. */ - @visibility("read") - groupId?: string; - - /** The private link resource required member names. */ - @visibility("read") - requiredMembers?: string[]; - - /** The private link resource private link DNS zone name. */ - requiredZoneNames?: string[]; -} - -/** List of private endpoint connections associated with the specified resource. */ -model PrivateEndpointConnectionResourceListResult { - /** Array of private endpoint connections */ - value?: PrivateEndpointConnection[]; -} - -/** A list of private link resources. */ -model PrivateLinkResourceListResult { - /** Array of private link resources */ - value?: PrivateLinkResource[]; -} - /** * The name of the private endpoint connection associated with the Azure resource. * @template Segment The resource type name for private endpoint connections (default is privateEndpointConnections) @@ -159,16 +123,6 @@ model PrivateLinkResourceListResult { model PrivateEndpointConnectionParameter { /** The name of the private endpoint connection associated with the Azure resource. */ @path - @armCommonParameter( - "PrivateEndpointConnectionName", - #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true }, - "privatelinks.json" - ) - @armCommonParameter( - "PrivateEndpointConnectionName", - Azure.ResourceManager.CommonTypes.Versions.v5, - "privatelinks.json" - ) @TypeSpec.Rest.segment(Segment) @key("privateEndpointConnectionName") name: string; diff --git a/packages/typespec-azure-resource-manager/lib/common-types/types-ref.tsp b/packages/typespec-azure-resource-manager/lib/common-types/types-ref.tsp new file mode 100644 index 0000000000..09cadfb7ba --- /dev/null +++ b/packages/typespec-azure-resource-manager/lib/common-types/types-ref.tsp @@ -0,0 +1,414 @@ +import "../private.decorators.tsp"; +import "./common-types.tsp"; +import "./types.tsp"; + +using Azure.ResourceManager.Private; +using Azure.ResourceManager.CommonTypes.Private; + +namespace Azure.ResourceManager.CommonTypes; + +/** Common resource fields that are returned in the response for all Azure Resource Manager resources. */ +@@armCommonDefinition(Resource, "Resource", Azure.ResourceManager.CommonTypes.Versions.v3); +@@armCommonDefinition(Resource, "Resource", Azure.ResourceManager.CommonTypes.Versions.v4); +@@armCommonDefinition(Resource, "Resource", Azure.ResourceManager.CommonTypes.Versions.v5); + +/** The resource model definition for an Azure Resource Manager resource with an etag. */ +@@armCommonDefinition(AzureEntityResource, + "TrackedResource", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(AzureEntityResource, + "TrackedResource", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(AzureEntityResource, + "TrackedResource", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * The base tracked resource. + */ +@@armCommonDefinition(TrackedResource, + "TrackedResource", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(TrackedResource, + "TrackedResource", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(TrackedResource, + "TrackedResource", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * The base proxy resource. + */ +@@armCommonDefinition(ProxyResource, + "ProxyResource", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(ProxyResource, + "ProxyResource", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(ProxyResource, + "ProxyResource", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * The base extension resource. + */ +@@armCommonDefinition(ExtensionResource, + "ProxyResource", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(ExtensionResource, + "ProxyResource", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(ExtensionResource, + "ProxyResource", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * The SKU (Stock Keeping Unit) assigned to this resource. + */ +@@armCommonDefinition(Sku, "Sku", Azure.ResourceManager.CommonTypes.Versions.v3); +@@armCommonDefinition(Sku, "Sku", Azure.ResourceManager.CommonTypes.Versions.v4); +@@armCommonDefinition(Sku, "Sku", Azure.ResourceManager.CommonTypes.Versions.v5); + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + */ +@@armCommonDefinition(OperationListResult, + "OperationListResult", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(OperationListResult, + "OperationListResult", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(OperationListResult, + "OperationListResult", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * Details of a REST API operation, returned from the Resource Provider Operations API + */ +@@armCommonDefinition(Operation, "Operation", Azure.ResourceManager.CommonTypes.Versions.v3); +@@armCommonDefinition(Operation, "Operation", Azure.ResourceManager.CommonTypes.Versions.v4); +@@armCommonDefinition(Operation, "Operation", Azure.ResourceManager.CommonTypes.Versions.v5); + +/** + * Localized display information for and operation. + */ +@@armCommonDefinition(OperationDisplay, + "OperationDisplay", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(OperationDisplay, + "OperationDisplay", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(OperationDisplay, + "OperationDisplay", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * The current status of an async operation. + */ +@@armCommonDefinition(OperationStatusResult, + "OperationStatusResult", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(OperationStatusResult, + "OperationStatusResult", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(OperationStatusResult, + "OperationStatusResult", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * locationData + */ +@@armCommonDefinition(LocationData, "locationData", Azure.ResourceManager.CommonTypes.Versions.v3); +@@armCommonDefinition(LocationData, "locationData", Azure.ResourceManager.CommonTypes.Versions.v4); +@@armCommonDefinition(LocationData, "locationData", Azure.ResourceManager.CommonTypes.Versions.v5); + +/** + * The error detail. + */ +@@armCommonDefinition(ErrorDetail, "ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v3); +@@armCommonDefinition(ErrorDetail, "ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v4); +@@armCommonDefinition(ErrorDetail, "ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v5); + +/** + * The resource management error additional info. + */ +@@armCommonDefinition(ErrorAdditionalInfo, + "ErrorAdditionalInfo", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(ErrorAdditionalInfo, + "ErrorAdditionalInfo", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(ErrorAdditionalInfo, + "ErrorAdditionalInfo", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * Identity + */ +@@armCommonDefinition(Identity, "Identity", Azure.ResourceManager.CommonTypes.Versions.v3); +@@armCommonDefinition(Identity, "Identity", Azure.ResourceManager.CommonTypes.Versions.v4); +@@armCommonDefinition(Identity, "Identity", Azure.ResourceManager.CommonTypes.Versions.v5); + +/** + * Metadata pertaining to creation and last modification of the resource. + */ +@@armCommonDefinition(SystemData, "systemData", Azure.ResourceManager.CommonTypes.Versions.v3); +@@armCommonDefinition(SystemData, "systemData", Azure.ResourceManager.CommonTypes.Versions.v4); +@@armCommonDefinition(SystemData, "systemData", Azure.ResourceManager.CommonTypes.Versions.v5); + +/** + * Details of the resource plan. + */ +@@armCommonDefinition(Plan, "Plan", Azure.ResourceManager.CommonTypes.Versions.v3); +@@armCommonDefinition(Plan, "Plan", Azure.ResourceManager.CommonTypes.Versions.v4); +@@armCommonDefinition(Plan, "Plan", Azure.ResourceManager.CommonTypes.Versions.v5); + +/** + * encryptionProperties + */ +@@armCommonDefinition(EncryptionProperties, + "encryptionProperties", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(EncryptionProperties, + "encryptionProperties", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(EncryptionProperties, + "encryptionProperties", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * KeyVaultProperties + */ +@@armCommonDefinition(KeyVaultProperties, + "KeyVaultProperties", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(KeyVaultProperties, + "KeyVaultProperties", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(KeyVaultProperties, + "KeyVaultProperties", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * ResourceModelWithAllowedPropertySet + */ +@@armCommonDefinition(ResourceModelWithAllowedPropertySet, + "ResourceModelWithAllowedPropertySet", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(ResourceModelWithAllowedPropertySet, + "ResourceModelWithAllowedPropertySet", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(ResourceModelWithAllowedPropertySet, + "ResourceModelWithAllowedPropertySet", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * The check availability request body. + */ +@@armCommonDefinition(CheckNameAvailabilityRequest, + "CheckNameAvailabilityRequest", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(CheckNameAvailabilityRequest, + "CheckNameAvailabilityRequest", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(CheckNameAvailabilityRequest, + "CheckNameAvailabilityRequest", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * The check availability result. + */ +@@armCommonDefinition(CheckNameAvailabilityResponse, + "CheckNameAvailabilityResponse", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(CheckNameAvailabilityResponse, + "CheckNameAvailabilityResponse", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(CheckNameAvailabilityResponse, + "CheckNameAvailabilityResponse", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +@@armCommonDefinition(ErrorResponse, + "ErrorResponse", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonDefinition(ErrorResponse, + "ErrorResponse", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonDefinition(ErrorResponse, + "ErrorResponse", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +// -- Parameters +/** ApiVersionParameter */ +@@armCommonParameter(ApiVersionParameter.apiVersion, + "ApiVersionParameter", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonParameter(ApiVersionParameter.apiVersion, + "ApiVersionParameter", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonParameter(ApiVersionParameter.apiVersion, + "ApiVersionParameter", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +@@resourceParameterBaseFor(ApiVersionParameter.apiVersion, + [ + ResourceHome.ResourceGroup, + ResourceHome.Subscription, + ResourceHome.Location, + ResourceHome.Tenant, + ResourceHome.Extension + ] +); + +/** SubscriptionIdParameter */ +@@armCommonParameter(SubscriptionIdParameter.subscriptionId, + "SubscriptionIdParameter", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonParameter(SubscriptionIdParameter.subscriptionId, + "SubscriptionIdParameter", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonParameter(SubscriptionIdParameter.subscriptionId, + "SubscriptionIdParameter", + Azure.ResourceManager.CommonTypes.Versions.v5 +); +@@resourceParameterBaseFor(SubscriptionIdParameter.subscriptionId, + [ResourceHome.ResourceGroup, ResourceHome.Subscription, ResourceHome.Location] +); + +/** ResourceGroupNameParameter */ +@@armCommonParameter(ResourceGroupNameParameter.resourceGroupName, + "ResourceGroupNameParameter", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonParameter(ResourceGroupNameParameter.resourceGroupName, + "ResourceGroupNameParameter", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonParameter(ResourceGroupNameParameter.resourceGroupName, + "ResourceGroupNameParameter", + Azure.ResourceManager.CommonTypes.Versions.v5 +); +@@resourceParameterBaseFor(ResourceGroupNameParameter.resourceGroupName, + [ResourceHome.ResourceGroup] +); + +/** ManagementGroupNameParameter */ +@@armCommonParameter(ManagementGroupNameParameter.managementGroupName, + "ManagementGroupNameParameter", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonParameter(ManagementGroupNameParameter.managementGroupName, + "ManagementGroupNameParameter", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonParameter(ManagementGroupNameParameter.managementGroupName, + "ManagementGroupNameParameter", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** ScopeParameter */ +@@armCommonParameter(ScopeParameter.scope, + "ScopeParameter", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonParameter(ScopeParameter.scope, + "ScopeParameter", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonParameter(ScopeParameter.scope, + "ScopeParameter", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** LocationResourceParameter */ +@@armCommonParameter(LocationResourceParameter.location, + "LocationParameter", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonParameter(LocationResourceParameter.location, + "LocationParameter", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonParameter(LocationResourceParameter.location, + "LocationParameter", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * The default operationId parameter type. + */ +@@armCommonParameter(OperationIdParameter.operationId, + "OperationIdParameter", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonParameter(OperationIdParameter.operationId, + "OperationIdParameter", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonParameter(OperationIdParameter.operationId, + "OperationIdParameter", + Azure.ResourceManager.CommonTypes.Versions.v5 +); + +/** + * TenantIdParameter + */ +@@armCommonParameter(TenantIdParameter.tenantId, + "TenantIdParameter", + Azure.ResourceManager.CommonTypes.Versions.v3 +); +@@armCommonParameter(TenantIdParameter.tenantId, + "TenantIdParameter", + Azure.ResourceManager.CommonTypes.Versions.v4 +); +@@armCommonParameter(TenantIdParameter.tenantId, + "TenantIdParameter", + Azure.ResourceManager.CommonTypes.Versions.v5 +); diff --git a/packages/typespec-azure-resource-manager/lib/common-types/types.tsp b/packages/typespec-azure-resource-manager/lib/common-types/types.tsp index cc1815421c..b2d5c8b19a 100644 --- a/packages/typespec-azure-resource-manager/lib/common-types/types.tsp +++ b/packages/typespec-azure-resource-manager/lib/common-types/types.tsp @@ -1,259 +1,220 @@ using TypeSpec.Http; +using TypeSpec.Rest; using TypeSpec.OpenAPI; +using TypeSpec.Versioning; using Azure.Core; -using Azure.ResourceManager.Private; -namespace Azure.ResourceManager.Foundations; +namespace Azure.ResourceManager.CommonTypes; -/** - * Base model that defines common properties for all Azure Resource Manager resources. - */ -@doc("Common properties for all Azure Resource Manager resources.") +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +@extension("x-ms-azure-resource", true) model Resource { - @doc("Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}") + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + @typeChangedFrom(Versions.v4, string) @visibility("read") - id?: string; + id?: armResourceIdentifier; - @doc("The name of the resource") + /** The name of the resource */ @visibility("read") name?: string; - @doc("The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"") + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ @visibility("read") type?: string; - @doc("Azure Resource Manager metadata containing createdBy and modifiedBy information.") + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @visibility("read") systemData?: SystemData; } /** The resource model definition for an Azure Resource Manager resource with an etag. */ -@armCommonDefinition("TrackedResource", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("TrackedResource", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("TrackedResource", Azure.ResourceManager.CommonTypes.Versions.v5) model AzureEntityResource extends Resource { /** Resource Etag. */ @visibility("read") - etag: string; + etag?: string; } /** - * Standard type definition for Azure Resource Manager Tags property. - * - * It is included in the TrackedResource template definition. + * The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -@doc("The Azure Resource Manager Resource tags.") -model ArmTagsProperty { - @doc("Resource tags.") +model TrackedResource extends Resource { + /** Resource tags. */ tags?: Record; -} -/** - * The base tracked resource. - */ -@armCommonDefinition("TrackedResource", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("TrackedResource", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("TrackedResource", Azure.ResourceManager.CommonTypes.Versions.v5) -@doc("The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'") -model TrackedResource extends Resource { - @doc("The geo-location where the resource lives") + /** The geo-location where the resource lives */ @visibility("read", "create") location: string; - - ...ArmTagsProperty; } /** - * The base proxy resource. + * The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -@doc("The base proxy resource.") -@armCommonDefinition("ProxyResource", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("ProxyResource", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("ProxyResource", Azure.ResourceManager.CommonTypes.Versions.v5) model ProxyResource extends Resource {} /** * The base extension resource. */ // Note that ProxyResource is the base definition for both kinds of resources -@doc("The base extension resource.") -@armCommonDefinition("ProxyResource", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("ProxyResource", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("ProxyResource", Azure.ResourceManager.CommonTypes.Versions.v5) model ExtensionResource extends Resource {} /** - * The SKU (Stock Keeping Unit) assigned to this resource. + * The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set. + */ +@extension("x-ms-azure-resource", true) +model ResourceModelWithAllowedPropertySet extends TrackedResource { + /** The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. + * If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. */ + managedBy?: string; + + /** Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. + * If supported, the resource provider must validate and persist this value. */ + @pattern("^[-\\w\\._,\\(\\)]+$") + @visibility("read", "create") + kind?: string; + + /** The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. + * Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), + * If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. */ + eTag?: string; + + identity?: Identity; + sku?: Sku; + plan?: Plan; +} + +/** + * The resource model definition representing SKU */ -@doc("The SKU (Stock Keeping Unit) assigned to this resource.") -@armCommonDefinition("Sku", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("Sku", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("Sku", Azure.ResourceManager.CommonTypes.Versions.v5) model Sku { - @doc("The name of the SKU, usually a combination of letters and numbers, for example, 'P3'") + /** The name of the SKU. Ex - P3. It is typically a letter+number code */ name: string; - @doc("This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.") + /** This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. */ tier?: SkuTier; - @doc("The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code.") + /** The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. */ size?: string; - @doc("If the service has different generations of hardware, for the same SKU, then that can be captured here.") + /** If the service has different generations of hardware, for the same SKU, then that can be captured here. */ family?: string; - @doc("If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted.") + /** If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. */ capacity?: int32; } /** - * Available service tiers for the SKU. + * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. */ -@doc("Available service tiers for the SKU.") -enum SkuTier { - @doc("The Free service tier.") - Free, +union SkuTier { + /** The Free service tier. */ + Free: "Free", - @doc("The Basic service tier.") - Basic, + /** The Basic service tier. */ + Basic: "Basic", - @doc("The Standard service tier.") - Standard, + /** The Standard service tier. */ + Standard: "Standard", - @doc("The Premium service tier.") - Premium, + /** The Premium service tier. */ + Premium: "Premium", } /** * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ -@armCommonDefinition("OperationListResult", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("OperationListResult", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("OperationListResult", Azure.ResourceManager.CommonTypes.Versions.v5) -@doc(""" - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - """) +@friendlyName("OperationListResult") model OperationListResult is Azure.Core.Page; /** * Details of a REST API operation, returned from the Resource Provider Operations API */ -@armCommonDefinition("Operation", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("Operation", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("Operation", Azure.ResourceManager.CommonTypes.Versions.v5) -@doc("Details of a REST API operation, returned from the Resource Provider Operations API") model Operation { - @doc(""" + /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - """) + */ @visibility("read") name?: string; - @doc(""" + /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. - """) + */ @visibility("read") isDataAction?: boolean; - @doc("Localized display information for this particular operation.") + /** Localized display information for this particular operation. */ display?: OperationDisplay; - @doc(""" + /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" - """) + */ @visibility("read") origin?: Origin; - @doc(""" + /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - """) + */ actionType?: ActionType; } /** * Localized display information for and operation. */ -@armCommonDefinition("OperationDisplay", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("OperationDisplay", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("OperationDisplay", Azure.ResourceManager.CommonTypes.Versions.v5) -@doc("Localized display information for and operation.") model OperationDisplay { - @doc(""" - The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - """) + /** + The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + */ provider?: string; - @doc(""" + /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - """) + */ resource?: string; - @doc(""" + /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - """) + */ operation?: string; - @doc("The short, localized friendly description of the operation; suitable for tool tips and detailed views.") + /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ description?: string; } /** * The current status of an async operation. */ -@armCommonDefinition("OperationStatusResult", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("OperationStatusResult", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("OperationStatusResult", Azure.ResourceManager.CommonTypes.Versions.v5) -@doc("The current status of an async operation.") model OperationStatusResult { - @doc("Fully qualified ID for the async operation.") + /** Fully qualified ID for the async operation. */ id?: string; - @doc("Name of the async operation.") + /** Name of the async operation. */ name?: string; - @doc("Operation status.") + /** Operation status. */ status: string; - @doc("Percent of the operation that is complete.") + /** Percent of the operation that is complete. */ @minValue(0) @maxValue(100) percentComplete?: float64; - @doc("The start time of the operation.") + /** The start time of the operation. */ startTime?: utcDateTime; - @doc("The end time of the operation.") + /** The end time of the operation. */ endTime?: utcDateTime; - @doc("The operations list.") - operations: OperationStatusResult[]; + /** The operations list. */ + operations?: OperationStatusResult[]; - @doc("If present, details of the operation error.") + /** If present, details of the operation error. */ error?: ErrorDetail; } -/** - * The default operationId parameter type. - */ -@doc("The default operationId parameter type.") -model OperationIdParameter { - @path - @minLength(1) - @doc("The ID of an ongoing async operation.") - @armCommonParameter("OperationIdParameter", Azure.ResourceManager.CommonTypes.Versions.v3) - @armCommonParameter("OperationIdParameter", Azure.ResourceManager.CommonTypes.Versions.v4) - @armCommonParameter("OperationIdParameter", Azure.ResourceManager.CommonTypes.Versions.v5) - operationId: string; -} - /** * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ -@doc(""" - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - """) union ActionType { - @doc("Actions are for internal-only APIs.") + /** Actions are for internal-only APIs. */ Internal: "Internal", string, @@ -262,17 +223,14 @@ union ActionType { /** * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ -@doc(""" - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" - """) union Origin { - @doc("Indicates the operation is initiated by a user.") + /** Indicates the operation is initiated by a user. */ user: "user", - @doc("Indicates the operation is initiated by a system.") + /** Indicates the operation is initiated by a system. */ system: "system", - @doc("Indicates the operation is initiated by a user or system.") + /** Indicates the operation is initiated by a user or system. */ `user,system`: "user,system", string, @@ -281,47 +239,47 @@ union Origin { /** * The error detail. */ -@armCommonDefinition("ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v5) -@doc("The error detail.") model ErrorDetail { - @doc("The error code.") + /** The error code. */ @visibility("read") code?: string; - @doc("The error message.") + /** The error message. */ @visibility("read") message?: string; - @doc("The error target.") + /** The error target. */ @visibility("read") target?: string; + /** The error details. */ @extension("x-ms-identifiers", ["message", "target"]) - @doc("The error details.") @visibility("read") details?: ErrorDetail[]; - @extension("x-ms-identifiers", ["message", "target"]) - @doc("The error additional info.") + /** The error additional info. */ @visibility("read") additionalInfo?: ErrorAdditionalInfo[]; } +/** + * Common error response for all Azure Resource Manager APIs to return error details for failed operations. + */ +@error +model ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + /** * The resource management error additional info. */ -@armCommonDefinition("ErrorAdditionalInfo", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("ErrorAdditionalInfo", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("ErrorAdditionalInfo", Azure.ResourceManager.CommonTypes.Versions.v5) -@doc("The resource management error additional info.") model ErrorAdditionalInfo { - @doc("The additional info type.") + /** The additional info type. */ @visibility("read") type?: string; - @doc("The additional info.") + /** The additional info. */ @visibility("read") info?: {}; } @@ -329,124 +287,288 @@ model ErrorAdditionalInfo { /** * Metadata pertaining to creation and last modification of the resource. */ -@armCommonDefinition("systemData", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("systemData", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("systemData", Azure.ResourceManager.CommonTypes.Versions.v5) -@doc("Metadata pertaining to creation and last modification of the resource.") model SystemData { - @visibility("read") - @doc("The identity that created the resource.") + /** The identity that created the resource. */ createdBy?: string; - @visibility("read") - @doc("The type of identity that created the resource.") + /** The type of identity that created the resource. */ createdByType?: createdByType; - @visibility("read") - @doc("The type of identity that created the resource.") - createdAt?: plainDate; + /** The timestamp of resource creation (UTC). */ + createdAt?: utcDateTime; - @visibility("read") - @doc("The identity that last modified the resource.") + /** The identity that last modified the resource. */ lastModifiedBy?: string; - @visibility("read") - @doc("The type of identity that last modified the resource.") + /** The type of identity that last modified the resource. */ lastModifiedByType?: createdByType; - @visibility("read") - @doc("The timestamp of resource last modification (UTC)") - lastModifiedAt?: plainDate; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: utcDateTime; } /** * The kind of entity that created the resource. */ // NOTE: This is how the extensible enum is named in types.json -@doc("The kind of entity that created the resource.") union createdByType { - @doc("The entity was created by a user.") + /** The entity was created by a user. */ User: "User", - @doc("The entity was created by an application.") + /** The entity was created by an application. */ Application: "Application", - @doc("The entity was created by a managed identity.") + /** The entity was created by a managed identity. */ ManagedIdentity: "ManagedIdentity", - @doc("The entity was created by a key.") + /** The entity was created by a key. */ Key: "Key", string, } +union ResourceIdentityType { + SystemAssigned: "SystemAssigned", +} + +/** Identity for the resource. */ +model Identity { + /** The principal ID of resource identity. The value must be an UUID. */ + @typeChangedFrom(Versions.v4, string) + @visibility("read") + principalId?: uuid; + + /** The tenant ID of resource. The value must be an UUID. */ + @typeChangedFrom(Versions.v4, string) + @visibility("read") + tenantId?: uuid; + + /** The identity type. */ + type?: ResourceIdentityType; +} + +model KeyVaultProperties { + /** Key vault uri to access the encryption key. */ + keyIdentifier?: string; + + /** The client ID of the identity which will be used to access key vault. */ + identity?: string; +} /** - * Details of the resource plan. + * Plan for the resource. */ -@doc("Details of the resource plan.") -@armCommonDefinition("Plan", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("Plan", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("Plan", Azure.ResourceManager.CommonTypes.Versions.v5) model Plan { - @doc("A user defined name of the 3rd Party Artifact that is being procured.") + /** A user defined name of the 3rd Party Artifact that is being procured. */ name: string; - @doc("The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic") + /** The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic */ publisher: string; - @doc("The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. ") + /** The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. */ product: string; - @doc("A publisher provided promotion code as provisioned in Data Market for the said product/artifact.") + /** A publisher provided promotion code as provisioned in Data Market for the said product/artifact. */ promotionCode?: string; - @doc("The version of the desired product/artifact.") + /** The version of the desired product/artifact. */ version?: string; } /** * The check availability request body. */ -@armCommonDefinition("CheckNameAvailabilityRequest", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("CheckNameAvailabilityRequest", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("CheckNameAvailabilityRequest", Azure.ResourceManager.CommonTypes.Versions.v5) -@doc("The check availability request body.") model CheckNameAvailabilityRequest { - @doc("The name of the resource for which availability needs to be checked.") + /** The name of the resource for which availability needs to be checked. */ name?: string; - @doc("The resource type.") + /** The resource type. */ type?: string; } /** * The check availability result. */ -@armCommonDefinition("CheckNameAvailabilityResponse", Azure.ResourceManager.CommonTypes.Versions.v3) -@armCommonDefinition("CheckNameAvailabilityResponse", Azure.ResourceManager.CommonTypes.Versions.v4) -@armCommonDefinition("CheckNameAvailabilityResponse", Azure.ResourceManager.CommonTypes.Versions.v5) -@doc("The check availability result.") model CheckNameAvailabilityResponse { - @doc("Indicates if the resource name is available.") + /** Indicates if the resource name is available. */ nameAvailable?: boolean; - @doc("The reason why the given name is not available.") + /** The reason why the given name is not available. */ reason?: CheckNameAvailabilityReason; - @doc("Detailed reason why the given name is not available.") + /** Detailed reason why the given name is not available. */ message?: string; } /** * Possible reasons for a name not being available. */ -@doc("Possible reasons for a name not being available.") union CheckNameAvailabilityReason { - @doc("Name is invalid.") + /** Name is invalid. */ Invalid: "Invalid", - @doc("Name already exists.") + /** Name already exists. */ AlreadyExists: "AlreadyExists", string, } + +/** Indicates whether or not the encryption is enabled for container registry. */ +union EncryptionStatus { + /** Encryption is enabled. */ + enabled: "enabled", + + /** Encryption is disabled. */ + disabled: "disabled", + + string, +} +/** + * Configuration of key for data encryption + */ +model EncryptionProperties { + /** Indicates whether or not the encryption is enabled for container registry. */ + status?: EncryptionStatus; + + /** Key vault properties. */ + keyVaultProperties?: KeyVaultProperties; +} + +/** + * Metadata pertaining to the geographic location of the resource. + */ +model LocationData { + /** A canonical name for the geographic or physical location. */ + @maxLength(256) + name: string; + + /** The city or locality where the resource is located. */ + city?: string; + + /** The district, state, or province where the resource is located. */ + district?: string; + + /** The country or region where the resource is located */ + countryOrRegion?: string; +} + +/** + * The default api-version parameter type. + */ +model ApiVersionParameter { + /** The API version to use for this operation. */ + @query("api-version") + @minLength(1) + apiVersion: string; +} + +/** + * The default operationId parameter type. + */ +model OperationIdParameter { + /** The ID of an ongoing async operation. */ + @path + @minLength(1) + operationId: string; +} + +/** + * The default location parameter type. + */ +model LocationParameter { + /** The name of Azure region. */ + @path + @minLength(1) + @segment("locations") + location: string; +} + +/** + * The default resource group parameter type. + */ +model ResourceGroupNameParameter { + /** The name of the resource group. The name is case insensitive. */ + @path + @minLength(1) + @maxLength(90) + @segment("resourceGroups") + @pattern("^[-\\w\\._\\(\\)]+$") + resourceGroupName: string; +} + +/** + * The default subscriptionId parameter type. + */ +model SubscriptionIdParameter { + /** The ID of the target subscription. The value must be an UUID. */ + @typeChangedFrom(Versions.v4, string) + @path + @segment("subscriptions") + subscriptionId: uuid; +} + +/** The default location parameter type. */ +model LocationResourceParameter { + /** The name of the Azure region. */ + @path + @minLength(1) + @segment("locations") + @key + location: string; +} + +/** + * The default ManagementGroupName parameter type. + */ +@added(Versions.v4) +model ManagementGroupNameParameter { + /** The name of the management group. The name is case insensitive. */ + @path + @minLength(1) + @maxLength(90) + @segment("managementGroups") + managementGroupName: string; +} + +/** + * The default Scope parameter type. + */ +@added(Versions.v4) +model ScopeParameter { + /** The scope at which the operation is performed. */ + @path + @segment("scope") + @minLength(1) + @extension("x-ms-skip-url-encoding", true) + scope: string; +} + +/** + * The default ManagementGroupName parameter type. + */ +@added(Versions.v4) +model TenantIdParameter { + /** The Azure tenant ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) */ + @path + @segment("tenant") + tenantId: uuid; +} + +/** + * The default ARM If-Match header type. + */ +@added(Versions.v4) +model IfMatchHeader { + /** The If-Match header that makes a request conditional. */ + @header("If-Match") + ifMatch: string; +} + +/** + * The default ARM If-Match header type. + */ +@added(Versions.v4) +model IfNoneMatchHeader { + /** The If-None-Match header that makes a request conditional. */ + @header("If-None-Match") + ifNoneMatch: string; +} diff --git a/packages/typespec-azure-resource-manager/lib/decorators.tsp b/packages/typespec-azure-resource-manager/lib/decorators.tsp index 027cd9c75d..6923f09652 100644 --- a/packages/typespec-azure-resource-manager/lib/decorators.tsp +++ b/packages/typespec-azure-resource-manager/lib/decorators.tsp @@ -180,7 +180,7 @@ extern dec armResourceOperations(target: Interface, _?: unknown); * 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. * - * @param version The Azure.ResourceManager.CommonTypes.Versions for the desired common-types version or an equivalent string value. + * @param version The Azure.ResourceManager.CommonTypes.Versions for the desired common-types version or an equivalent string value like "v5". */ extern dec armCommonTypesVersion( target: Namespace | EnumMember, diff --git a/packages/typespec-azure-resource-manager/lib/arm.foundations.tsp b/packages/typespec-azure-resource-manager/lib/foundations/arm.foundations.tsp similarity index 93% rename from packages/typespec-azure-resource-manager/lib/arm.foundations.tsp rename to packages/typespec-azure-resource-manager/lib/foundations/arm.foundations.tsp index 47fdbf802f..644bc0437f 100644 --- a/packages/typespec-azure-resource-manager/lib/arm.foundations.tsp +++ b/packages/typespec-azure-resource-manager/lib/foundations/arm.foundations.tsp @@ -1,30 +1,21 @@ +import "@typespec/openapi"; +import "@typespec/http"; +import "@typespec/rest"; + +import "./backcompat.tsp"; +import "./deprecation.tsp"; +import "../common-types/common-types.tsp"; +import "../decorators.tsp"; +import "../responses.tsp"; +import "../private.decorators.tsp"; +import "../parameters.tsp"; + using TypeSpec.Http; using TypeSpec.OpenAPI; -using TypeSpec.Versioning; using Azure.ResourceManager.Private; namespace Azure.ResourceManager.Foundations; -/** - * An internal enum to indicate the resource support for various path types - */ -enum ResourceHome { - @doc("The resource is bound to a tenant") - Tenant, - - @doc("The resource is bound to a subscription") - Subscription, - - @doc("The resource is bound to a location") - Location, - - @doc("The resource is bound to a resource group") - ResourceGroup, - - @doc("The resource is bound to an extension") - Extension, -} - /** * Base parameters for a resource. * @@ -53,6 +44,17 @@ model DefaultBaseParameters { ...ResourceUriParameter; } +/** + * Standard type definition for Azure Resource Manager Tags property. + * + * It is included in the TrackedResource template definition. + */ +/** The Azure Resource Manager Resource tags. */ +model ArmTagsProperty { + /** Resource tags. */ + tags?: Record; +} + /** * The static parameters for a tenant-based resource */ diff --git a/packages/typespec-azure-resource-manager/lib/foundations/backcompat.tsp b/packages/typespec-azure-resource-manager/lib/foundations/backcompat.tsp new file mode 100644 index 0000000000..e8b0595352 --- /dev/null +++ b/packages/typespec-azure-resource-manager/lib/foundations/backcompat.tsp @@ -0,0 +1,39 @@ +namespace Azure.ResourceManager.Foundations { + // extended-location + alias ExtendedLocation = CommonTypes.ExtendedLocation; + alias ExtendedLocationType = CommonTypes.ExtendedLocationType; + + // managed-identities + alias ManagedServiceIdentity = CommonTypes.ManagedServiceIdentity; + #suppress "deprecated" "Need for back compatibility in common-types" + alias UserAssignedIdentities = CommonTypes.UserAssignedIdentities; + alias SystemAssignedServiceIdentity = CommonTypes.SystemAssignedServiceIdentity; + alias UserAssignedIdentity = CommonTypes.UserAssignedIdentity; + alias ManagedServiceIdentityType = CommonTypes.ManagedServiceIdentityType; + alias SystemAssignedServiceIdentityType = CommonTypes.SystemAssignedServiceIdentityType; + alias ManagedSystemIdentityType = SystemAssignedServiceIdentityType; + + // types + alias Resource = CommonTypes.Resource; + alias AzureEntityResource = CommonTypes.AzureEntityResource; + alias TrackedResource = CommonTypes.TrackedResource; + alias ProxyResource = CommonTypes.ProxyResource; + alias ExtensionResource = CommonTypes.ExtensionResource; + alias Sku = CommonTypes.Sku; + alias SkuTier = CommonTypes.SkuTier; + alias OperationListResult = CommonTypes.OperationListResult; + alias Operation = CommonTypes.Operation; + alias OperationDisplay = CommonTypes.OperationDisplay; + alias OperationStatusResult = CommonTypes.OperationStatusResult; + alias OperationIdParameter = CommonTypes.OperationIdParameter; + alias ActionType = CommonTypes.ActionType; + alias Origin = CommonTypes.Origin; + alias ErrorDetail = CommonTypes.ErrorDetail; + alias ErrorAdditionalInfo = CommonTypes.ErrorAdditionalInfo; + alias SystemData = CommonTypes.SystemData; + alias createdByType = CommonTypes.createdByType; + alias Plan = CommonTypes.Plan; + alias CheckNameAvailabilityRequest = CommonTypes.CheckNameAvailabilityRequest; + alias CheckNameAvailabilityResponse = CommonTypes.CheckNameAvailabilityResponse; + alias CheckNameAvailabilityReason = CommonTypes.CheckNameAvailabilityReason; +} diff --git a/packages/typespec-azure-resource-manager/lib/common-types/backcompat.tsp b/packages/typespec-azure-resource-manager/lib/foundations/deprecation.tsp similarity index 59% rename from packages/typespec-azure-resource-manager/lib/common-types/backcompat.tsp rename to packages/typespec-azure-resource-manager/lib/foundations/deprecation.tsp index bca365485f..e9f0d74cec 100644 --- a/packages/typespec-azure-resource-manager/lib/common-types/backcompat.tsp +++ b/packages/typespec-azure-resource-manager/lib/foundations/deprecation.tsp @@ -17,3 +17,14 @@ alias ResourceSkuType = Sku; #deprecated "Please use Foundations.Plan instead of Foundations.ResourcePlanType" alias ResourcePlanType = Plan; + +// managed-identity +#deprecated "Please change ManagedIdentityProperties to ManagedServiceIdentity." +alias ManagedIdentityProperties = ManagedServiceIdentity; + +#deprecated "Please change ManagedSystemIdentityProperties to SystemAssignedServiceIdentity." +alias ManagedSystemIdentityProperties = SystemAssignedServiceIdentity; + +/** Alias of ManagedServiceIdentityType for back compatability. Please change to ManagedServiceIdentityType. */ +#deprecated "Please change to ManagedServiceIdentityType." +alias ManagedIdentityType = ManagedServiceIdentityType; diff --git a/packages/typespec-azure-resource-manager/lib/models.tsp b/packages/typespec-azure-resource-manager/lib/models.tsp index a5bb6d4e5e..e5eb45bf68 100644 --- a/packages/typespec-azure-resource-manager/lib/models.tsp +++ b/packages/typespec-azure-resource-manager/lib/models.tsp @@ -352,4 +352,22 @@ model ManagedByProperty { managedBy?: string; } +/** Please use the spread model EncryptionProperty */ +alias Encryption = EncryptionProperty; +/** + * Model used only to spread in the `encryption` envelope property for a resource. + * @example + * + * ```typespec + * model Foo is TrackedResource { + * ...Encryption; + * } + * ``` + */ +/** All encryption configuration for a resource. */ +model EncryptionProperty { + /** All encryption configuration for a resource. */ + encryption: EncryptionConfiguration; +} + //#endregion diff --git a/packages/typespec-azure-resource-manager/lib/parameters.tsp b/packages/typespec-azure-resource-manager/lib/parameters.tsp index 79788ad073..43a17c652e 100644 --- a/packages/typespec-azure-resource-manager/lib/parameters.tsp +++ b/packages/typespec-azure-resource-manager/lib/parameters.tsp @@ -3,80 +3,45 @@ using TypeSpec.Rest; using TypeSpec.OpenAPI; using Azure.ResourceManager.Foundations; using Azure.ResourceManager.Private; +using Azure.ResourceManager.CommonTypes; +using Azure.ResourceManager.CommonTypes.Private; namespace Azure.ResourceManager; /** * The default api-version parameter type. */ -@doc("The default api-version parameter type.") -model ApiVersionParameter { - @query("api-version") - @minLength(1) - @doc("The API version to use for this operation.") - @armCommonParameter("ApiVersionParameter", Azure.ResourceManager.CommonTypes.Versions.v3) - @armCommonParameter("ApiVersionParameter", Azure.ResourceManager.CommonTypes.Versions.v4) - @armCommonParameter("ApiVersionParameter", Azure.ResourceManager.CommonTypes.Versions.v5) - @resourceParameterBaseFor( - [ - ResourceHome.ResourceGroup, - ResourceHome.Subscription, - ResourceHome.Location, - ResourceHome.Tenant, - ResourceHome.Extension - ] - ) - apiVersion: string; -} +alias ApiVersionParameter = CommonTypes.ApiVersionParameter; /** * The default subscriptionId parameter type. */ -@doc("The default subscriptionId parameter type.") -model SubscriptionIdParameter { - @path - @minLength(1) - @segment("subscriptions") - @doc("The ID of the target subscription.") - @armCommonParameter("SubscriptionIdParameter", Azure.ResourceManager.CommonTypes.Versions.v3) - @armCommonParameter("SubscriptionIdParameter", Azure.ResourceManager.CommonTypes.Versions.v4) - @armCommonParameter("SubscriptionIdParameter", Azure.ResourceManager.CommonTypes.Versions.v5) - @resourceParameterBaseFor( - [ResourceHome.ResourceGroup, ResourceHome.Subscription, ResourceHome.Location] - ) - subscriptionId: string; -} +alias SubscriptionIdParameter = CommonTypes.SubscriptionIdParameter; /** - * DEPRECATED - DO NOT USE - * The default location parameter type. + * The default ResourceGroup parameter type. */ -@doc("The default location parameter type.") -model LocationParameter { - @path - @minLength(1) - @segment("locations") - @doc("The location name.") - @armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v3) - @armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v4) - @armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v5) - @resourceParameterBaseFor([ResourceHome.Location]) - location: string; -} +alias ResourceGroupParameter = CommonTypes.ResourceGroupNameParameter; + +/** + * The default LocationResource parameter type. + */ +alias LocationResourceParameter = CommonTypes.LocationResourceParameter; /** + * DEPRECATED - DO NOT USE * The default location parameter type. */ @doc("The default location parameter type.") -model LocationResourceParameter { +model LocationParameter { @path @minLength(1) @segment("locations") @doc("The location name.") - @key @armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v3) @armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v4) @armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v5) + @resourceParameterBaseFor([ResourceHome.Location]) location: string; } @@ -113,24 +78,6 @@ model ArmLocationResource = program.stateMap(ArmStateKeys.armCommonTypesVersions); return map?.values().next().value as any; } +export function getArmCommonTypesVersionFromString( + program: Program, + entity: Namespace | EnumMember, + versionStr: string +): [EnumMember | undefined, readonly Diagnostic[]] { + const commonTypeVersionEnum = program.resolveTypeReference( + `Azure.ResourceManager.CommonTypes.Versions.${versionStr}` + )[0] as EnumMember; + if (commonTypeVersionEnum === undefined) { + return [ + undefined, + [ + createDiagnostic({ + code: "arm-common-types-invalid-version", + target: entity, + format: { + versionString: versionStr, + supportedVersions: [...getArmCommonTypesVersions(program).type.members.keys()].join( + ", " + ), + }, + }), + ], + ]; + } else { + return [commonTypeVersionEnum, []]; + } +} + /** * Check if a given model or model property is an ARM common type. * @param {Type} entity - The entity to be checked. @@ -58,9 +87,34 @@ export function $armCommonTypesVersion( entity: Namespace | EnumMember, version: string | EnumValue ) { - context.program - .stateMap(ArmStateKeys.armCommonTypesVersion) - .set(entity, typeof version === "string" ? version : version.value.name); + // try convert string to EnumMember + let versionEnum: EnumMember; + if (typeof version === "string") { + const [foundEnumMember, diagnostics] = getArmCommonTypesVersionFromString( + context.program, + entity, + version + ); + if (!foundEnumMember) { + context.program.reportDiagnostics(diagnostics); + return; + } + versionEnum = foundEnumMember as EnumMember; + } else { + versionEnum = version.value; + } + + context.program.stateMap(ArmStateKeys.armCommonTypesVersion).set(entity, versionEnum.name); + + if (entity.kind === "Namespace") { + const versioned = entity.decorators.find((x) => x.definition?.name === "@versioned"); + // If it is versioned namespace, we will skip adding @useDependency to namespace + if (versioned) { + return; + } + } + // Add @useDependency on version enum members or on unversioned namespace + context.call($useDependency, entity, versionEnum); } /** diff --git a/packages/typespec-azure-resource-manager/src/commontypes.private.decorators.ts b/packages/typespec-azure-resource-manager/src/commontypes.private.decorators.ts new file mode 100644 index 0000000000..326a380203 --- /dev/null +++ b/packages/typespec-azure-resource-manager/src/commontypes.private.decorators.ts @@ -0,0 +1,135 @@ +import { + DecoratorContext, + Enum, + EnumValue, + Model, + ModelProperty, + Program, +} from "@typespec/compiler"; +import { ArmStateKeys } from "./state.js"; + +export const namespace = "Azure.ResourceManager.CommonTypes.Private"; + +export const ArmCommonTypesDefaultVersion = "v3"; + +function getArmTypesPath(program: Program): string { + return program.getOption("arm-types-path") || "{arm-types-dir}"; +} + +function storeCommonTypeRecord( + context: DecoratorContext, + entity: Model | ModelProperty, + kind: "definitions" | "parameters", + name: string, + version?: string | EnumValue | ArmCommonTypeVersionSpec, + referenceFile?: string +): void { + const basePath: string = getArmTypesPath(context.program).trim(); + + // NOTE: Right now we don't try to prevent multiple versions from declaring that they are the default + let isDefault = false; + if (version && typeof version !== "string" && !("valueKind" in version)) { + isDefault = !!version.isDefault; + version = version.version; + } + + // for backward compatibility, skip if we are trying to access a non-default file and emit the type + if ((version || referenceFile) && basePath.endsWith(".json")) return; + if (!version) version = ArmCommonTypesDefaultVersion; + if (!referenceFile) referenceFile = "types.json"; + + const versionStr = typeof version === "string" ? version : version.value.name; + const records = getCommonTypeRecords(context.program, entity); + + records.records[versionStr] = { + name, + kind, + version: versionStr, + basePath, + referenceFile, + }; + if (isDefault) { + records.defaultKey = versionStr; + } + context.program.stateMap(ArmStateKeys.armCommonDefinitions).set(entity, records); +} + +export interface ArmCommonTypeRecord { + name: string; + kind: "definitions" | "parameters"; + version: string; + basePath: string; + referenceFile?: string; +} + +export interface ArmCommonTypeRecords { + records: { [key: string]: ArmCommonTypeRecord }; + defaultKey?: string; +} + +export function getCommonTypeRecords( + program: Program, + entity: Model | ModelProperty +): ArmCommonTypeRecords { + return program.stateMap(ArmStateKeys.armCommonDefinitions).get(entity) ?? { records: {} }; +} + +interface ArmCommonTypeVersionSpec { + version: string | EnumValue; + isDefault: boolean; +} + +/** + * Refer an model property to be a common ARM parameter + * @param {DecoratorContext} context DecoratorContext object + * @param {Type} entity Decorator target type. Must be `Model` + * @param {string?} definitionName Optional definition name + * @param {string?} version Optional version + * @param {string?} referenceFile Optional common file path + * @returns void + */ +export function $armCommonParameter( + context: DecoratorContext, + entity: ModelProperty, + parameterName?: string, + version?: string | EnumValue | ArmCommonTypeVersionSpec, + referenceFile?: string +): void { + // Use the name of the model type if not specified + if (!parameterName) { + parameterName = entity.name; + } + + storeCommonTypeRecord(context, entity, "parameters", parameterName, version, referenceFile); +} + +/** + * Using ARM common definition for a Model + * @param {DecoratorContext} context DecoratorContext object + * @param {Type} entity Decorator target type. Must be `Model` + * @param {string?} definitionName Optional definition name + * @param {string?} version Optional version + * @param {string?} referenceFile Optional common file path + * @returns {void} + */ +export function $armCommonDefinition( + context: DecoratorContext, + entity: Model, + definitionName?: string, + version?: string | EnumValue | ArmCommonTypeVersionSpec, + referenceFile?: string +): void { + // Use the name of the model type if not specified + if (!definitionName) { + definitionName = entity.name; + } + + storeCommonTypeRecord(context, entity, "definitions", definitionName, version, referenceFile); +} + +export function $armCommonTypesVersions(context: DecoratorContext, enumType: Enum) { + context.program.stateMap(ArmStateKeys.armCommonTypesVersions).set(enumType, { + type: enumType, + allVersions: Array.from(enumType.members.values()).reverse(), + }); +} diff --git a/packages/typespec-azure-resource-manager/src/lib.ts b/packages/typespec-azure-resource-manager/src/lib.ts index 4ba733df3b..11dd6eca9c 100644 --- a/packages/typespec-azure-resource-manager/src/lib.ts +++ b/packages/typespec-azure-resource-manager/src/lib.ts @@ -76,6 +76,12 @@ export const $lib = createTypeSpecLibrary({ default: paramMessage`No ARM common-types version for this type satisfies the expected version ${"selectedVersion"}. This type only supports the following version(s): ${"supportedVersions"}`, }, }, + "arm-common-types-invalid-version": { + severity: "error", + messages: { + default: paramMessage`No ARM common-types version matches the version string ${"versionString"}. The following versions are supported: ${"supportedVersions"}`, + }, + }, "decorator-in-namespace": { severity: "error", messages: { diff --git a/packages/typespec-azure-resource-manager/src/namespace.ts b/packages/typespec-azure-resource-manager/src/namespace.ts index f8a44002d7..4ea6b15449 100644 --- a/packages/typespec-azure-resource-manager/src/namespace.ts +++ b/packages/typespec-azure-resource-manager/src/namespace.ts @@ -1,6 +1,9 @@ import { __unsupported_enable_checkStandardOperations } from "@azure-tools/typespec-azure-core"; import { DecoratorContext, + Enum, + EnumMember, + EnumValue, Model, ModelProperty, Namespace, @@ -12,10 +15,35 @@ import { import * as http from "@typespec/http"; import { getAuthentication, setAuthentication, setRouteOptionsForNamespace } from "@typespec/http"; import { getResourceTypeForKeyParam } from "@typespec/rest"; +import { $armCommonTypesVersion } from "./common-types.js"; import { reportDiagnostic } from "./lib.js"; import { getSingletonResourceKey } from "./resource.js"; import { ArmStateKeys } from "./state.js"; +function getArmCommonTypesVersion( + context: DecoratorContext, + entity: Namespace | EnumMember +): EnumValue | undefined { + return entity.decorators.find((x) => x.definition?.name === "@armCommonTypesVersion")?.args[0] + .jsValue as EnumValue | undefined; +} + +function setArmCommonTypesVersionIfDoesnotExist( + context: DecoratorContext, + entity: Namespace | EnumMember, + commonTypeVersion: string +) { + // Determine whether to set a default ARM CommonTypes.Version + const armCommonTypesVersion = entity.decorators.find( + (x) => x.definition?.name === "@armCommonTypesVersion" + ); + // if no existing @armCommonTypesVersion decorator, add default. + // This will NOT cause error if overrode on version enum. + if (!armCommonTypesVersion) { + context.call($armCommonTypesVersion, entity, commonTypeVersion); + } +} + /** * Mark the target namespace as containign only ARM library types. This is used to create libraries to share among RPs * @param context The doecorator context, automatically supplied by the compiler @@ -29,6 +57,8 @@ export function $armLibraryNamespace(context: DecoratorContext, entity: Namespac __unsupported_enable_checkStandardOperations(false); program.stateMap(ArmStateKeys.armLibraryNamespaces).set(entity, true); + + setArmCommonTypesVersionIfDoesnotExist(context, entity, "v3"); } /** @@ -128,6 +158,27 @@ export function $armProviderNamespace( } } + const armCommonTypesVersion = getArmCommonTypesVersion(context, entity); + + // If it is versioned namespace, we will check each Version enum member. If no + // @armCommonTypeVersion decorator, add the one + const versioned = entity.decorators.find((x) => x.definition?.name === "@versioned"); + if (versioned) { + const versionEnum = versioned.args[0].value as Enum; + versionEnum.members.forEach((v) => { + if (!getArmCommonTypesVersion(context, v)) { + context.call($armCommonTypesVersion, v, armCommonTypesVersion ?? "v3"); + } + }); + } else { + // if it is unversioned namespace, set @armCommonTypesVersion and + // no existing @armCommonTypesVersion decorator, add default. + // This will NOT cause error if overrode on version enum. + if (!armCommonTypesVersion) { + context.call($armCommonTypesVersion, entity, "v3"); + } + } + // 'namespace' is optional, use the actual namespace string if omitted const typespecNamespace = getNamespaceFullName(entity); if (!armProviderNamespace) { diff --git a/packages/typespec-azure-resource-manager/src/private.decorators.ts b/packages/typespec-azure-resource-manager/src/private.decorators.ts index 4aa53d8548..39afe7bc27 100644 --- a/packages/typespec-azure-resource-manager/src/private.decorators.ts +++ b/packages/typespec-azure-resource-manager/src/private.decorators.ts @@ -2,8 +2,6 @@ import { $key, $visibility, DecoratorContext, - Enum, - EnumValue, Interface, Model, ModelProperty, @@ -31,8 +29,6 @@ import { ArmStateKeys } from "./state.js"; export const namespace = "Azure.ResourceManager.Private"; -export const ArmCommonTypesDefaultVersion = "v3"; - export function $omitIfEmpty(context: DecoratorContext, entity: Model, propertyName: string) { const modelProp = getProperty(entity, propertyName); @@ -160,121 +156,6 @@ function isResourceParameterBaseForInternal( return false; } -function getArmTypesPath(program: Program): string { - return program.getOption("arm-types-path") || "{arm-types-dir}"; -} - -function storeCommonTypeRecord( - context: DecoratorContext, - entity: Model | ModelProperty, - kind: "definitions" | "parameters", - name: string, - version?: string | EnumValue | ArmCommonTypeVersionSpec, - referenceFile?: string -): void { - const basePath: string = getArmTypesPath(context.program).trim(); - - // NOTE: Right now we don't try to prevent multiple versions from declaring that they are the default - let isDefault = false; - if (version && typeof version !== "string" && !("valueKind" in version)) { - isDefault = !!version.isDefault; - version = version.version; - } - - // for backward compatibility, skip if we are trying to access a non-default file and emit the type - if ((version || referenceFile) && basePath.endsWith(".json")) return; - if (!version) version = ArmCommonTypesDefaultVersion; - if (!referenceFile) referenceFile = "types.json"; - - const versionStr = typeof version === "string" ? version : version.value.name; - const records = getCommonTypeRecords(context.program, entity); - - records.records[versionStr] = { - name, - kind, - version: versionStr, - basePath, - referenceFile, - }; - if (isDefault) { - records.defaultKey = versionStr; - } - context.program.stateMap(ArmStateKeys.armCommonDefinitions).set(entity, records); -} - -export interface ArmCommonTypeRecord { - name: string; - kind: "definitions" | "parameters"; - version: string; - basePath: string; - referenceFile?: string; -} - -export interface ArmCommonTypeRecords { - records: { [key: string]: ArmCommonTypeRecord }; - defaultKey?: string; -} - -export function getCommonTypeRecords( - program: Program, - entity: Model | ModelProperty -): ArmCommonTypeRecords { - return program.stateMap(ArmStateKeys.armCommonDefinitions).get(entity) ?? { records: {} }; -} - -interface ArmCommonTypeVersionSpec { - version: string | EnumValue; - isDefault: boolean; -} - -/** - * Refer an model property to be a common ARM parameter - * @param {DecoratorContext} context DecoratorContext object - * @param {Type} entity Decorator target type. Must be `Model` - * @param {string?} definitionName Optional definition name - * @param {string?} version Optional version - * @param {string?} referenceFile Optional common file path - * @returns void - */ -export function $armCommonParameter( - context: DecoratorContext, - entity: ModelProperty, - parameterName?: string, - version?: string | EnumValue | ArmCommonTypeVersionSpec, - referenceFile?: string -): void { - // Use the name of the model type if not specified - if (!parameterName) { - parameterName = entity.name; - } - - storeCommonTypeRecord(context, entity, "parameters", parameterName, version, referenceFile); -} - -/** - * Using ARM common definition for a Model - * @param {DecoratorContext} context DecoratorContext object - * @param {Type} entity Decorator target type. Must be `Model` - * @param {string?} definitionName Optional definition name - * @param {string?} version Optional version - * @param {string?} referenceFile Optional common file path - * @returns {void} - */ -export function $armCommonDefinition( - context: DecoratorContext, - entity: Model, - definitionName?: string, - version?: string | EnumValue | ArmCommonTypeVersionSpec, - referenceFile?: string -): void { - // Use the name of the model type if not specified - if (!definitionName) { - definitionName = entity.name; - } - - storeCommonTypeRecord(context, entity, "definitions", definitionName, version, referenceFile); -} - /** * This decorator dynamically assigns the serviceNamespace from the containing * namespace to the string literal value of the path parameter to which this @@ -469,10 +350,3 @@ function hasProperty(program: Program, model: Model): boolean { if (model.baseModel) return hasProperty(program, model.baseModel); return false; } - -export function $armCommonTypesVersions(context: DecoratorContext, enumType: Enum) { - context.program.stateMap(ArmStateKeys.armCommonTypesVersions).set(enumType, { - type: enumType, - allVersions: Array.from(enumType.members.values()).reverse(), - }); -} diff --git a/packages/typespec-azure-resource-manager/src/rules/arm-common-types-version.ts b/packages/typespec-azure-resource-manager/src/rules/arm-common-types-version.ts index dc3b262185..0da4458e1c 100644 --- a/packages/typespec-azure-resource-manager/src/rules/arm-common-types-version.ts +++ b/packages/typespec-azure-resource-manager/src/rules/arm-common-types-version.ts @@ -1,7 +1,6 @@ import { Program, SemanticNodeListener, createRule } from "@typespec/compiler"; import { getAllHttpServices } from "@typespec/http"; import { getVersion } from "@typespec/versioning"; -import { getArmCommonTypesVersion } from "../common-types.js"; import { getArmProviderNamespace } from "../namespace.js"; /** @@ -34,9 +33,16 @@ export const armCommonTypesVersionRule = createRule({ versionMap && versionMap .getVersions() - .every((version) => !!getArmCommonTypesVersion(program, version.enumMember)) + .every( + (version) => + !!version.enumMember.decorators.find( + (x) => x.definition?.name === "@armCommonTypesVersion" + ) + ) ) && - !getArmCommonTypesVersion(program, service.namespace) + !service.namespace.decorators.find( + (x) => x.definition?.name === "@armCommonTypesVersion" + ) ) { context.reportDiagnostic({ target: service.namespace, diff --git a/packages/typespec-azure-resource-manager/src/rules/core-operations.ts b/packages/typespec-azure-resource-manager/src/rules/core-operations.ts index 8d5da0574b..7bde58f7f0 100644 --- a/packages/typespec-azure-resource-manager/src/rules/core-operations.ts +++ b/packages/typespec-azure-resource-manager/src/rules/core-operations.ts @@ -90,7 +90,7 @@ function isApiParameter(program: Program, property: ModelProperty): boolean { if (sourceModel === undefined) return false; return ( sourceModel.name === "ApiVersionParameter" && - getNamespaceName(program, sourceModel) === "Azure.ResourceManager" + getNamespaceName(program, sourceModel) === "Azure.ResourceManager.CommonTypes" ); } diff --git a/packages/typespec-azure-resource-manager/test/arm-common-types-registration.test.ts b/packages/typespec-azure-resource-manager/test/arm-common-types-registration.test.ts index f5b3adb969..bb365e7367 100644 --- a/packages/typespec-azure-resource-manager/test/arm-common-types-registration.test.ts +++ b/packages/typespec-azure-resource-manager/test/arm-common-types-registration.test.ts @@ -3,7 +3,7 @@ import { getService } from "@typespec/compiler"; import { expectDiagnosticEmpty, expectDiagnostics } from "@typespec/compiler/testing"; import { describe, expect, it } from "vitest"; import { findArmCommonTypeRecord } from "../src/common-types.js"; -import type { ArmCommonTypeRecord } from "../src/private.decorators.js"; +import type { ArmCommonTypeRecord } from "../src/commontypes.private.decorators.js"; import { createAzureResourceManagerTestRunner } from "./test-host.js"; function boilerplate(version: string | undefined) { @@ -44,9 +44,9 @@ describe("common definition", () => { it.each(["v3", "v4", "v5"])("link to %s", async (version) => { const [ref, diagnostics] = await compute( ` - @Azure.ResourceManager.Private.armCommonDefinition("Foo", Azure.ResourceManager.CommonTypes.Versions.v3, "foo.json") - @Azure.ResourceManager.Private.armCommonDefinition("Foo", Azure.ResourceManager.CommonTypes.Versions.v4, "foo.json") - @Azure.ResourceManager.Private.armCommonDefinition("Foo", Azure.ResourceManager.CommonTypes.Versions.v5, "foo.json") + @Azure.ResourceManager.CommonTypes.Private.armCommonDefinition("Foo", Azure.ResourceManager.CommonTypes.Versions.v3, "foo.json") + @Azure.ResourceManager.CommonTypes.Private.armCommonDefinition("Foo", Azure.ResourceManager.CommonTypes.Versions.v4, "foo.json") + @Azure.ResourceManager.CommonTypes.Private.armCommonDefinition("Foo", Azure.ResourceManager.CommonTypes.Versions.v5, "foo.json") `, version ); @@ -63,8 +63,8 @@ describe("common definition", () => { describe("type added in v4", () => { const decorators = ` - @Azure.ResourceManager.Private.armCommonDefinition("Foo", Azure.ResourceManager.CommonTypes.Versions.v4, "foo.json") - @Azure.ResourceManager.Private.armCommonDefinition("Foo", Azure.ResourceManager.CommonTypes.Versions.v5, "foo.json") + @Azure.ResourceManager.CommonTypes.Private.armCommonDefinition("Foo", Azure.ResourceManager.CommonTypes.Versions.v4, "foo.json") + @Azure.ResourceManager.CommonTypes.Private.armCommonDefinition("Foo", Azure.ResourceManager.CommonTypes.Versions.v5, "foo.json") `; it.each(["v3"])("using in %s emits diagnostics", async () => { const [_, diagnostics] = await compute(decorators, "v3"); @@ -89,7 +89,7 @@ describe("common definition", () => { describe("type added in v5", () => { const decorators = ` - @Azure.ResourceManager.Private.armCommonDefinition("Foo", Azure.ResourceManager.CommonTypes.Versions.v5, "foo.json") + @Azure.ResourceManager.CommonTypes.Private.armCommonDefinition("Foo", Azure.ResourceManager.CommonTypes.Versions.v5, "foo.json") `; it.each(["v3", "v4"])("using in %s emits diagnostics", async () => { const [_, diagnostics] = await compute(decorators, "v3"); @@ -137,9 +137,9 @@ describe("common parameters", () => { it.each(["v3", "v4", "v5"])("using %s link to version", async (version) => { const [ref, diagnostics] = await compute( ` - @Azure.ResourceManager.Private.armCommonParameter("Foo", Azure.ResourceManager.CommonTypes.Versions.v3, "foo.json") - @Azure.ResourceManager.Private.armCommonParameter("Foo", Azure.ResourceManager.CommonTypes.Versions.v4, "foo.json") - @Azure.ResourceManager.Private.armCommonParameter("Foo", Azure.ResourceManager.CommonTypes.Versions.v5, "foo.json") + @Azure.ResourceManager.CommonTypes.Private.armCommonParameter("Foo", Azure.ResourceManager.CommonTypes.Versions.v3, "foo.json") + @Azure.ResourceManager.CommonTypes.Private.armCommonParameter("Foo", Azure.ResourceManager.CommonTypes.Versions.v4, "foo.json") + @Azure.ResourceManager.CommonTypes.Private.armCommonParameter("Foo", Azure.ResourceManager.CommonTypes.Versions.v5, "foo.json") `, version ); @@ -156,8 +156,8 @@ describe("common parameters", () => { describe("type added in v4", () => { const decorators = ` - @Azure.ResourceManager.Private.armCommonParameter("Foo", Azure.ResourceManager.CommonTypes.Versions.v4, "foo.json") - @Azure.ResourceManager.Private.armCommonParameter("Foo", Azure.ResourceManager.CommonTypes.Versions.v5, "foo.json") + @Azure.ResourceManager.CommonTypes.Private.armCommonParameter("Foo", Azure.ResourceManager.CommonTypes.Versions.v4, "foo.json") + @Azure.ResourceManager.CommonTypes.Private.armCommonParameter("Foo", Azure.ResourceManager.CommonTypes.Versions.v5, "foo.json") `; it.each(["v3"])("using in %s emits diagnostics", async () => { const [_, diagnostics] = await compute(decorators, "v3"); @@ -182,7 +182,7 @@ describe("common parameters", () => { describe("type added in v5", () => { const decorators = ` - @Azure.ResourceManager.Private.armCommonParameter("Foo", Azure.ResourceManager.CommonTypes.Versions.v5, "foo.json") + @Azure.ResourceManager.CommonTypes.Private.armCommonParameter("Foo", Azure.ResourceManager.CommonTypes.Versions.v5, "foo.json") `; it.each(["v3", "v4"])("using in %s emits diagnostics", async () => { const [_, diagnostics] = await compute(decorators, "v3"); diff --git a/packages/typespec-azure-resource-manager/test/enforce-constraint.test.ts b/packages/typespec-azure-resource-manager/test/enforce-constraint.test.ts index b89efdebab..a7267c1af1 100644 --- a/packages/typespec-azure-resource-manager/test/enforce-constraint.test.ts +++ b/packages/typespec-azure-resource-manager/test/enforce-constraint.test.ts @@ -73,20 +73,18 @@ describe("typespec-azure-resource-manager: @enforceConstraint", () => { `); expectDiagnostics(diagnostics, [ { - code: "@azure-tools/typespec-azure-resource-manager/template-type-constraint-no-met", - message: `The template parameter "Widget" for "ArmResourceCreateOrReplaceSync" does not extend the constraint type "Resource". Please use the "TrackedResource", "ProxyResource", or "ExtensionResource" template to define the resource.`, - }, - { - code: "@azure-tools/typespec-azure-resource-manager/template-type-constraint-no-met", - message: `The template parameter "Widget" for "create" does not extend the constraint type "Resource". Please use the "TrackedResource", "ProxyResource", or "ExtensionResource" template to define the resource.`, + code: "invalid-argument", + message: `Argument of type 'Microsoft.Contoso.Widget' is not assignable to parameter of type 'Azure.ResourceManager.CommonTypes.Resource'`, }, { code: "@azure-tools/typespec-azure-resource-manager/template-type-constraint-no-met", - message: `The template parameter "CustomResource" for "ArmResourceCreateOrReplaceSync" does not extend the constraint type "Resource". Please use the "TrackedResource", "ProxyResource", or "ExtensionResource" template to define the resource.`, + message: + 'The template parameter "CustomResource" for "ArmResourceCreateOrReplaceSync" does not extend the constraint type "Resource". Please use the "TrackedResource", "ProxyResource", or "ExtensionResource" template to define the resource.', }, { code: "@azure-tools/typespec-azure-resource-manager/template-type-constraint-no-met", - message: `The template parameter "CustomResource" for "delete" does not extend the constraint type "Resource". Please use the "TrackedResource", "ProxyResource", or "ExtensionResource" template to define the resource.`, + message: + 'The template parameter "CustomResource" for "delete" does not extend the constraint type "Resource". Please use the "TrackedResource", "ProxyResource", or "ExtensionResource" template to define the resource.', }, ]); }); diff --git a/packages/typespec-azure-resource-manager/test/rules/arm-resource-interface.test.ts b/packages/typespec-azure-resource-manager/test/rules/arm-resource-interface.test.ts index 93bdd46d2f..b6e31b5842 100644 --- a/packages/typespec-azure-resource-manager/test/rules/arm-resource-interface.test.ts +++ b/packages/typespec-azure-resource-manager/test/rules/arm-resource-interface.test.ts @@ -32,9 +32,11 @@ describe("typespec-azure-resource-manager: detect non-post actions", () => { enum Versions { @doc(".") @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) v2021_09_21: "2022-09-21-preview", @doc(".") @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v4) v2022_01_10: "2022-01-10-alpha.1" } diff --git a/packages/typespec-azure-resource-manager/test/rules/core-operations.test.ts b/packages/typespec-azure-resource-manager/test/rules/core-operations.test.ts index c76fa3904a..6242e29c55 100644 --- a/packages/typespec-azure-resource-manager/test/rules/core-operations.test.ts +++ b/packages/typespec-azure-resource-manager/test/rules/core-operations.test.ts @@ -83,9 +83,11 @@ describe("typespec-azure-resource-manager: core operations rule", () => { enum Versions { @doc(".") @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) v2021_09_21: "2022-09-21-preview", @doc(".") @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v4) v2022_01_10: "2022-01-10-alpha.1" } @@ -147,9 +149,13 @@ describe("typespec-azure-resource-manager: core operations rule", () => { enum Versions { @doc(".") @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @useDependency(Azure.Core.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) v2021_09_21: "2022-09-21-preview", @doc(".") @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @useDependency(Azure.Core.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v4) v2022_01_10: "2022-01-10-alpha.1" } diff --git a/packages/typespec-azure-resource-manager/test/rules/operation-usage.test.ts b/packages/typespec-azure-resource-manager/test/rules/operation-usage.test.ts index b15b677562..94e2b592ec 100644 --- a/packages/typespec-azure-resource-manager/test/rules/operation-usage.test.ts +++ b/packages/typespec-azure-resource-manager/test/rules/operation-usage.test.ts @@ -36,9 +36,11 @@ describe("typespec-azure-resource-manager: detect non-post actions", () => { enum Versions { @doc(".") @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) v2021_09_21: "2022-09-21-preview", @doc(".") @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v4) v2022_01_10: "2022-01-10-alpha.1" } diff --git a/packages/typespec-azure-resource-manager/test/rules/patch-operations.test.ts b/packages/typespec-azure-resource-manager/test/rules/patch-operations.test.ts index 72bf418487..c8fbf35197 100644 --- a/packages/typespec-azure-resource-manager/test/rules/patch-operations.test.ts +++ b/packages/typespec-azure-resource-manager/test/rules/patch-operations.test.ts @@ -33,9 +33,11 @@ describe("typespec-azure-resource-manager: core operations rule", () => { enum Versions { @doc(".") @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) v2021_09_21: "2022-09-21-preview", @doc(".") @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v4) v2022_01_10: "2022-01-10-alpha.1" } @@ -106,9 +108,11 @@ describe("typespec-azure-resource-manager: core operations rule", () => { enum Versions { @doc(".") @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3) v2021_09_21: "2022-09-21-preview", @doc(".") @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v4) v2022_01_10: "2022-01-10-alpha.1" } diff --git a/packages/typespec-azure-resource-manager/test/rules/retry-after.test.ts b/packages/typespec-azure-resource-manager/test/rules/retry-after.test.ts index 0220cfe8b9..36fb856064 100644 --- a/packages/typespec-azure-resource-manager/test/rules/retry-after.test.ts +++ b/packages/typespec-azure-resource-manager/test/rules/retry-after.test.ts @@ -24,27 +24,38 @@ describe("typespec-azure-resource-manager: retry-after rule", () => { await tester .expect( ` - @useDependency(Azure.Core.Versions.v1_0_Preview_2) - @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @service @armProviderNamespace + @versioned(Versions) namespace Microsoft.Foo; - + + /** Contoso API versions */ + enum Versions { + /** 2021-10-01-preview version */ + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v4) + "2021-10-01-preview", + } + model FooResource is TrackedResource<{}> { - @key("foo") @segment("foo") @path + @key("foo") + @segment("foo") + @path name: string; } - + model UpdateFooResponse { @header("Retry-After") retryAfter: utcDateTime; ...FooResource; } - + @armResourceOperations interface FooResources { @armResourceUpdate(FooResource) @OpenAPI.extension("x-ms-long-running-operation", true) - @patch - op update(): UpdateFooResponse; + @patch + update(): UpdateFooResponse; } ` )