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

Fixing typespec-next for June 2024 release #29427

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion specification/azurefleet/AzureFleet.Management/fleet.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ model FleetUpdate {
}

model ManagedServiceIdentityUpdate
is OptionalProperties<UpdateableProperties<Azure.ResourceManager.Foundations.ManagedServiceIdentity>>;
is OptionalProperties<UpdateableProperties<Azure.ResourceManager.Legacy.ManagedServiceIdentityV4>>;

model ResourcePlanUpdate
is OptionalProperties<UpdateableProperties<Azure.ResourceManager.Foundations.Plan>>;
Expand Down
3 changes: 2 additions & 1 deletion specification/azurefleet/AzureFleet.Management/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ using Azure.ResourceManager;
@service({
title: "Microsoft.AzureFleet",
})
@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
@versioned(Versions)
namespace Microsoft.AzureFleet;

/** Api versions */
enum Versions {
@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
@doc("Private Preview Api version")
v2023_11_01_preview: "2023-11-01-preview",

@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
@doc("Public Preview Api version")
v2024_05_01_preview: "2024-05-01-preview",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,9 @@
}
},
"definitions": {
"Azure.ResourceManager.Foundations.ManagedServiceIdentityType": {
"Azure.ResourceManager.Legacy.ManagedServiceIdentityType": {
"type": "string",
"description": "The kind of managed identity assigned to this resource.",
"description": "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).",
"enum": [
"None",
"SystemAssigned",
Expand Down Expand Up @@ -744,7 +744,7 @@
"description": "The template for adding optional properties.",
"properties": {
"type": {
"$ref": "#/definitions/Azure.ResourceManager.Foundations.ManagedServiceIdentityType",
"$ref": "#/definitions/Azure.ResourceManager.Legacy.ManagedServiceIdentityType",
"description": "The type of managed identity assigned to this resource."
},
"userAssignedIdentities": {
Expand Down Expand Up @@ -865,7 +865,7 @@
},
"product": {
"type": "string",
"description": "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. "
"description": "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."
},
"promotionCode": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,9 @@
}
},
"definitions": {
"Azure.ResourceManager.Foundations.ManagedServiceIdentityType": {
"Azure.ResourceManager.Legacy.ManagedServiceIdentityType": {
"type": "string",
"description": "The kind of managed identity assigned to this resource.",
"description": "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).",
"enum": [
"None",
"SystemAssigned",
Expand Down Expand Up @@ -730,7 +730,7 @@
"description": "The template for adding optional properties.",
"properties": {
"type": {
"$ref": "#/definitions/Azure.ResourceManager.Foundations.ManagedServiceIdentityType",
"$ref": "#/definitions/Azure.ResourceManager.Legacy.ManagedServiceIdentityType",
"description": "The type of managed identity assigned to this resource."
},
"userAssignedIdentities": {
Expand Down Expand Up @@ -857,7 +857,7 @@
},
"product": {
"type": "string",
"description": "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. "
"description": "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."
},
"promotionCode": {
"type": "string",
Expand Down
4 changes: 2 additions & 2 deletions specification/containerservice/Fleet.Management/fleet.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ model Fleet is TrackedResource<FleetProperties> {
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "https://github.com/Azure/typespec-azure/issues/2840"
@added(Versions.v2023_06_15_preview)
@doc("Managed identity.")
identity?: Azure.ResourceManager.Foundations.ManagedServiceIdentity;
identity?: Azure.ResourceManager.Legacy.ManagedServiceIdentityV4;
}

@doc("Fleet properties.")
Expand Down Expand Up @@ -154,7 +154,7 @@ model FleetPatch {
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "https://github.com/Azure/typespec-azure/issues/2840"
@added(Versions.v2023_06_15_preview)
@doc("Managed identity.")
identity?: Azure.ResourceManager.Foundations.ManagedServiceIdentity;
identity?: Azure.ResourceManager.Legacy.ManagedServiceIdentityV4;
}

@doc("One credential result item.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ model Encryption {
@doc("The URI of the key vault.")
keyVaultUri: string;

...ManagedServiceIdentityProperty;
...Legacy.ManagedServiceIdentityV4Property;
}

@doc("Elastic San Pool Properties")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ model Watcher is TrackedResource<WatcherProperties> {
@segment("watchers")
name: string;

...ManagedServiceIdentityProperty;
...Legacy.ManagedServiceIdentityV4Property;
}

@doc("The RP specific properties of the resource.")
Expand Down
20 changes: 3 additions & 17 deletions specification/deviceregistry/DeviceRegistry.Management/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,8 @@ interface OperationStatus {

...LocationParameter,

@path
@segment("operationStatuses")
@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,
...Foundations.OperationIdParameter,
): ArmResponse<OperationStatusResult> | ErrorResponse;
}

@@segment(OperationStatus.get::parameters.operationId, "operationStatuses");
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ model OrganizationResource is TrackedResource<OrganizationProperties> {
@path
name: string;

...ManagedServiceIdentityProperty;
...Legacy.ManagedServiceIdentityV4Property;
}

@armResourceOperations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,21 +1119,6 @@
}
},
"definitions": {
"Azure.ResourceManager.PrivateEndpointConnection": {
"type": "object",
"description": "The private endpoint connection resource",
"properties": {
"properties": {
"$ref": "../../../../../common-types/resource-management/v5/privatelinks.json#/definitions/PrivateEndpointConnectionProperties",
"description": "The private endpoint connection properties"
}
},
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource"
}
]
},
"ConnectionString": {
"type": "object",
"description": "Connection string for the mongo cluster",
Expand Down Expand Up @@ -1365,7 +1350,7 @@
"type": "array",
"description": "List of private endpoint connections.",
"items": {
"$ref": "#/definitions/Azure.ResourceManager.PrivateEndpointConnection"
"$ref": "../../../../../common-types/resource-management/v5/privatelinks.json#/definitions/PrivateEndpointConnection"
},
"readOnly": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.ResourceManager;
using Azure.ResourceManager.Private;
using OpenAPI;

namespace Microsoft.Monitor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.ResourceManager;
using Azure.ResourceManager.Private;
using OpenAPI;

namespace Microsoft.Monitor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,21 +741,6 @@
}
},
"definitions": {
"Azure.ResourceManager.PrivateEndpointConnection": {
"type": "object",
"description": "The private endpoint connection resource",
"properties": {
"properties": {
"$ref": "../../../../../common-types/resource-management/v4/privatelinks.json#/definitions/PrivateEndpointConnectionProperties",
"description": "The private endpoint connection properties"
}
},
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource"
}
]
},
"AzureMonitorWorkspace": {
"type": "object",
"description": "An Azure Monitor Workspace definition.",
Expand Down Expand Up @@ -867,7 +852,7 @@
"type": "array",
"description": "List of private endpoint connections.",
"items": {
"$ref": "#/definitions/Azure.ResourceManager.PrivateEndpointConnection"
"$ref": "../../../../../common-types/resource-management/v3/privatelinks.json#/definitions/PrivateEndpointConnection"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar situation with ManagedServiceIdenity.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the presence of GroupId in example files (which was added in v4/privatelink), we will have to upgrade commonTypes to "v4". It does incur two other type changes on Resource.Id (string -> arm-id) and SubscriptionId(string-uuid). This is not service impacting but only SDK breaking. I have obtained breaking change approval on this from Jeffrey.

},
"readOnly": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ model DataProduct is TrackedResource<DataProductProperties> {
@maxLength(63)
name: string;

...ManagedServiceIdentityProperty;
...Legacy.ManagedServiceIdentityV4Property;
}

@doc("The data product properties.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using TypeSpec.Http;
using Azure.ResourceManager;

@@path(ResourceUriParameter.resourceUri, "scope");
@@Azure.ResourceManager.Private.armCommonParameter(ResourceUriParameter.resourceUri,
@@Azure.ResourceManager.CommonTypes.Private.armCommonParameter(ResourceUriParameter.resourceUri,
"ScopeParameter",
Azure.ResourceManager.CommonTypes.Versions.v5
);
Expand Down
2 changes: 1 addition & 1 deletion specification/vmware/Microsoft.AVS/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ model Location is ProxyResource<LocationProperties> {
@key("location")
@path
@segment("locations")
@Azure.ResourceManager.Private.armCommonParameter(
@Azure.ResourceManager.CommonTypes.Private.armCommonParameter(
"LocationParameter",
Azure.ResourceManager.CommonTypes.Versions.v5
)
Expand Down
Loading