Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making mixin model names to have consistent `Property" suffix #768

Merged
merged 6 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .chronus/changes/azhang_managedIdentity-2024-4-1-16-18-41.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
changeKind: deprecation
packages:
- "@azure-tools/typespec-azure-resource-manager"
---

Standardizing mix-in model names with consistent `Property` suffix.

- Deprecate `ManagedServiceIdentity`. `ManagedServiceIdentityProperty` should be used instead.

Example:
```diff
-...ManagedServiceIdentity;
+...ManagedServiceIdentityProperty;
```

- Deprecate `ManagedSystemAssignedIdentity`. `ManagedSystemAssignedIdentityProperty` should be used instead.

Example:
```diff
-...ManagedSystemAssignedIdentity;
+...ManagedSystemAssignedIdentityProperty;
```

- Deprecate `EntityTag`. `EntityTagProperty` should be used instead.

Example:
```diff
-...EntityTag;
+...EntityTagProperty;
```

- Deprecate `ResourceKind`. `ResourceKindProperty` should be used instead.

Example:
```diff
-...ResourceKind;
+...ResourceKindProperty;
```

- Deprecate `ResourcePlan`. `ResourcePlanProperty` should be used instead.

Example:
```diff
-...ResourcePlan;
+...ResourcePlanProperty;
```

- Deprecate `ResourceSku`. `ResourceSkuProperty` should be used instead.

Example:
```diff
-...ResourceSku;
+...ResourceSkuProperty;
```

- Deprecate `ManagedBy`. `ManagedByProperty` should be used instead.

Example:
```diff
-...ManagedBy;
+...ManagedByProperty;
```

143 changes: 91 additions & 52 deletions docs/libraries/azure-resource-manager/reference/data-types.md

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions docs/libraries/azure-resource-manager/reference/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,16 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager
- [`DefaultProvisioningStateProperty`](./data-types.md#Azure.ResourceManager.DefaultProvisioningStateProperty)
- [`Encryption`](./data-types.md#Azure.ResourceManager.Encryption)
- [`EncryptionConfiguration`](./data-types.md#Azure.ResourceManager.EncryptionConfiguration)
- [`EntityTag`](./data-types.md#Azure.ResourceManager.EntityTag)
- [`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)
- [`ManagedBy`](./data-types.md#Azure.ResourceManager.ManagedBy)
- [`ManagedServiceIdentity`](./data-types.md#Azure.ResourceManager.ManagedServiceIdentity)
- [`ManagedSystemAssignedIdentity`](./data-types.md#Azure.ResourceManager.ManagedSystemAssignedIdentity)
- [`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)
Expand All @@ -165,12 +165,12 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager
- [`ResourceGroupLocationResource`](./data-types.md#Azure.ResourceManager.ResourceGroupLocationResource)
- [`ResourceGroupParameter`](./data-types.md#Azure.ResourceManager.ResourceGroupParameter)
- [`ResourceInstanceParameters`](./data-types.md#Azure.ResourceManager.ResourceInstanceParameters)
- [`ResourceKind`](./data-types.md#Azure.ResourceManager.ResourceKind)
- [`ResourceKindProperty`](./data-types.md#Azure.ResourceManager.ResourceKindProperty)
- [`ResourceListResult`](./data-types.md#Azure.ResourceManager.ResourceListResult)
- [`ResourceNameParameter`](./data-types.md#Azure.ResourceManager.ResourceNameParameter)
- [`ResourceParentParameters`](./data-types.md#Azure.ResourceManager.ResourceParentParameters)
- [`ResourcePlan`](./data-types.md#Azure.ResourceManager.ResourcePlan)
- [`ResourceSku`](./data-types.md#Azure.ResourceManager.ResourceSku)
- [`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)
Expand Down Expand Up @@ -204,8 +204,7 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager
- [`ExtensionScope`](./data-types.md#Azure.ResourceManager.Foundations.ExtensionScope)
- [`LocationBaseParameters`](./data-types.md#Azure.ResourceManager.Foundations.LocationBaseParameters)
- [`LocationScope`](./data-types.md#Azure.ResourceManager.Foundations.LocationScope)
- [`ManagedIdentityProperties`](./data-types.md#Azure.ResourceManager.Foundations.ManagedIdentityProperties)
- [`ManagedSystemIdentityProperties`](./data-types.md#Azure.ResourceManager.Foundations.ManagedSystemIdentityProperties)
- [`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)
Expand All @@ -221,9 +220,11 @@ npm install --save-peer @azure-tools/typespec-azure-resource-manager
- [`ResourceUpdateModelProperties`](./data-types.md#Azure.ResourceManager.Foundations.ResourceUpdateModelProperties)
- [`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)
- [`TrackedResourceBase`](./data-types.md#Azure.ResourceManager.Foundations.TrackedResourceBase)
- [`UserAssignedIdentities`](./data-types.md#Azure.ResourceManager.Foundations.UserAssignedIdentities)
- [`UserAssignedIdentity`](./data-types.md#Azure.ResourceManager.Foundations.UserAssignedIdentity)
12 changes: 6 additions & 6 deletions packages/samples/specs/resource-manager/arm-library/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ model AllPropertiesResource is TrackedResource<AllPropertiesProperties> {
@path
name: string;

...EntityTag;
...ManagedBy;
...ResourceKind;
...ResourcePlan;
...ResourceSku;
...ManagedServiceIdentity;
...EntityTagProperty;
...ManagedByProperty;
...ResourceKindProperty;
...ResourcePlanProperty;
...ResourceSkuProperty;
...ManagedServiceIdentityProperty;
}

@armResourceOperations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ model MonitorResource is TrackedResource<MonitorProperties> {
@path
name: string;

...ManagedServiceIdentity; // change here to use the standard definition
...ManagedServiceIdentityProperty; // change here to use the standard definition
}

@armResourceOperations
Expand Down
14 changes: 7 additions & 7 deletions packages/samples/specs/resource-manager/envelopetest/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ model AllPropertiesResource is TrackedResource<AllPropertiesProperties> {
@path
name: string;

...EntityTag;
...ManagedBy;
...ResourceKind;
...ResourcePlan;
...ResourceSku;
...ManagedServiceIdentity;
...EntityTagProperty;
...ManagedByProperty;
...ResourceKindProperty;
...ResourcePlanProperty;
...ResourceSkuProperty;
...ManagedServiceIdentityProperty;
}

@armResourceOperations
Expand Down Expand Up @@ -62,7 +62,7 @@ model SystemOnlyResource is TrackedResource<SystemOnlyProperties> {
@path
name: string;

...ManagedSystemAssignedIdentity;
...ManagedSystemAssignedIdentityProperty;
}

@armResourceOperations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ model Building is TrackedResource<BuildingProperties> {
@TypeSpec.Http.path
name: string;

...ManagedServiceIdentity;
...ResourceSku;
...ManagedBy;
...ManagedServiceIdentityProperty;
...ResourceSkuProperty;
...ManagedByProperty;
}

@doc("The rp-specific building properties")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ using Azure.ResourceManager.Private;

namespace Azure.ResourceManager.Foundations;

#deprecated "Please change ManagedIdentityProperties to ManagedServiceIdentity."
alias ManagedIdentityProperties = ManagedServiceIdentity;
/**
* The properties of the managed service identities assigned to this resource.
*/
Expand All @@ -18,8 +20,7 @@ namespace Azure.ResourceManager.Foundations;
Azure.ResourceManager.CommonTypes.Versions.v5,
"managedidentity.json"
)
@doc("The properties of the managed service identities assigned to this resource.")
model ManagedIdentityProperties {
model ManagedServiceIdentity {
@doc("The Active Directory tenant id of the principal.")
@visibility("read")
tenantId?: string;
Expand All @@ -32,9 +33,14 @@ model ManagedIdentityProperties {
type: ManagedServiceIdentityType;

@doc("The identities assigned to this resource by the user.")
userAssignedIdentities?: Record<UserAssignedIdentity>;
userAssignedIdentities?: 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.", */
model UserAssignedIdentities is Record<UserAssignedIdentity>;
allenjzhang marked this conversation as resolved.
Show resolved Hide resolved

#deprecated "Please change ManagedSystemIdentityProperties to SystemAssignedServiceIdentity."
alias ManagedSystemIdentityProperties = SystemAssignedServiceIdentity;
/**
* The properties of the service-assigned identity associated with this resource.
*/
Expand All @@ -51,8 +57,7 @@ model ManagedIdentityProperties {
Azure.ResourceManager.CommonTypes.Versions.v5,
"managedidentity.json"
)
@doc("The properties of the service-assigned identity associated with this resource.")
model ManagedSystemIdentityProperties {
model SystemAssignedServiceIdentity {
@doc("The Active Directory tenant id of the principal.")
@visibility("read")
tenantId?: string;
Expand Down
Loading
Loading