Skip to content

Commit

Permalink
Upgrade to TypeSpec 0.58 (Azure#29863)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin authored and zaowang-ms committed Jul 22, 2024
1 parent 0e95656 commit ef953f6
Show file tree
Hide file tree
Showing 151 changed files with 1,369 additions and 382 deletions.
828 changes: 732 additions & 96 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
"name": "azure-rest-api-specs",
"devDependencies": {
"@azure-tools/typespec-apiview": "0.4.9",
"@azure-tools/typespec-autorest": "0.43.0",
"@azure-tools/typespec-azure-core": "0.43.0",
"@azure-tools/typespec-azure-portal-core": "0.43.0",
"@azure-tools/typespec-azure-resource-manager": "0.43.0",
"@azure-tools/typespec-azure-rulesets": "0.43.0",
"@azure-tools/typespec-autorest": "0.44.0",
"@azure-tools/typespec-azure-core": "0.44.0",
"@azure-tools/typespec-azure-portal-core": "0.44.0",
"@azure-tools/typespec-azure-resource-manager": "0.44.0",
"@azure-tools/typespec-azure-rulesets": "0.44.0",
"@azure-tools/typespec-client-generator-cli": "0.9.3",
"@azure-tools/typespec-client-generator-core": "0.43.0",
"@azure-tools/typespec-client-generator-core": "0.44.0",
"@azure/avocado": "^0.8.4",
"@typespec/compiler": "0.57.0",
"@typespec/http": "0.57.0",
"@typespec/openapi": "0.57.0",
"@typespec/openapi3": "0.57.0",
"@typespec/rest": "0.57.0",
"@typespec/versioning": "0.57.0",
"@typespec/compiler": "0.58.1",
"@typespec/http": "0.58.0",
"@typespec/openapi": "0.58.0",
"@typespec/openapi3": "0.58.0",
"@typespec/rest": "0.58.0",
"@typespec/versioning": "0.58.0",
"azure-rest-api-specs-eng-tools": "file:eng/tools",
"oav": "^3.3.7",
"prettier": "~3.2.5",
Expand Down
8 changes: 7 additions & 1 deletion specification/apicenter/ApiCenter.Management/Service.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ interface Services {
@doc("Creates new or updates existing API.")
createOrUpdate is Azure.ResourceManager.ArmResourceCreateOrReplaceSync<Service>;
@doc("Updates existing service.")
update is ArmResourcePatchSync<Service, ServiceProperties>;
update is ArmCustomPatchSync<
Service,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
Service,
ServiceProperties
>
>;
@doc("Deletes specified service.")
delete is ArmResourceDeleteSync<Service>;
@doc("Returns a collection of services within the resource group.")
Expand Down
3 changes: 3 additions & 0 deletions specification/apicenter/ApiCenter.Management/tspconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/apicenter.json"
examples-directory: "{project-root}/examples"
use-read-only-status-schema: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4817,6 +4817,7 @@
},
"properties": {
"$ref": "#/definitions/ServiceUpdateProperties",
"description": "The resource-specific properties for this resource.",
"x-ms-client-flatten": true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ options:
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/appcomplianceautomation.json"
examples-directory: "{project-root}/examples"
"@azure-tools/typespec-ts":
Expand Down
3 changes: 3 additions & 0 deletions specification/azurefleet/AzureFleet.Management/tspconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ options:
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/azurefleet.json"
examples-directory: "examples"
"@azure-tools/typespec-csharp":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,42 +486,6 @@
}
},
"definitions": {
"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType": {
"type": "string",
"description": "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).",
"enum": [
"None",
"SystemAssigned",
"UserAssigned",
"SystemAssigned,UserAssigned"
],
"x-ms-enum": {
"name": "ManagedServiceIdentityType",
"modelAsString": true,
"values": [
{
"name": "None",
"value": "None",
"description": "No managed identity."
},
{
"name": "SystemAssigned",
"value": "SystemAssigned",
"description": "System assigned managed identity."
},
{
"name": "UserAssigned",
"value": "UserAssigned",
"description": "User assigned managed identity."
},
{
"name": "SystemAndUserAssigned",
"value": "SystemAssigned,UserAssigned",
"description": "System and user assigned managed identity."
}
]
}
},
"BasePriorityProfile": {
"type": "object",
"description": "Contains common properties that are applicable to both Spot and Regular.",
Expand Down Expand Up @@ -738,15 +702,20 @@
"description": "The template for adding optional properties.",
"properties": {
"type": {
"$ref": "#/definitions/Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType",
"$ref": "../../../../../common-types/resource-management/v5/managedidentity.json#/definitions/ManagedServiceIdentityType",
"description": "The type of managed identity assigned to this resource."
},
"userAssignedIdentities": {
"type": "object",
"description": "The identities assigned to this resource by the user.",
"x-nullable": true,
"additionalProperties": {
"$ref": "../../../../../common-types/resource-management/v5/managedidentity.json#/definitions/UserAssignedIdentity"
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v5/managedidentity.json#/definitions/UserAssignedIdentity"
}
],
"type": "object",
"x-nullable": true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,42 +465,6 @@
}
},
"definitions": {
"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType": {
"type": "string",
"description": "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).",
"enum": [
"None",
"SystemAssigned",
"UserAssigned",
"SystemAssigned,UserAssigned"
],
"x-ms-enum": {
"name": "ManagedServiceIdentityType",
"modelAsString": true,
"values": [
{
"name": "None",
"value": "None",
"description": "No managed identity."
},
{
"name": "SystemAssigned",
"value": "SystemAssigned",
"description": "System assigned managed identity."
},
{
"name": "UserAssigned",
"value": "UserAssigned",
"description": "User assigned managed identity."
},
{
"name": "SystemAndUserAssigned",
"value": "SystemAssigned,UserAssigned",
"description": "System and user assigned managed identity."
}
]
}
},
"BasePriorityProfile": {
"type": "object",
"description": "Contains common properties that are applicable to both Spot and Regular.",
Expand Down Expand Up @@ -727,15 +691,20 @@
"description": "The template for adding optional properties.",
"properties": {
"type": {
"$ref": "#/definitions/Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType",
"$ref": "../../../../../common-types/resource-management/v5/managedidentity.json#/definitions/ManagedServiceIdentityType",
"description": "The type of managed identity assigned to this resource."
},
"userAssignedIdentities": {
"type": "object",
"description": "The identities assigned to this resource by the user.",
"x-nullable": true,
"additionalProperties": {
"$ref": "../../../../../common-types/resource-management/v5/managedidentity.json#/definitions/UserAssignedIdentity"
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v5/managedidentity.json#/definitions/UserAssignedIdentity"
}
],
"type": "object",
"x-nullable": true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/azurelargeinstance.json"
examples-directory: "{project-root}/examples"
use-read-only-status-schema: true
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ interface GalleryImages {
delete is ArmResourceDeleteWithoutOkAsync<GalleryImage>;

@doc("Lists all of the gallery images in the specified resource group. Use the nextLink property in the response to get the next page of gallery images.")
list is ArmResourceListByParent<GalleryImage>;
listByResourceGroup is ArmResourceListByParent<GalleryImage>;

@doc("Lists all of the gallery images in the specified subscription. Use the nextLink property in the response to get the next page of gallery images.")
listAll is ArmListBySubscription<GalleryImage>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ interface GuestAgents {
delete is ArmResourceDeleteWithoutOkAsync<GuestAgent>;

@doc("Returns the list of GuestAgent of the given vm.")
list is ArmResourceListByParent<GuestAgent>;
listByVirtualMachineInstance is ArmResourceListByParent<GuestAgent>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ interface HybridIdentityMetadataGroup {
get is ArmResourceRead<HybridIdentityMetadata>;

@doc("Returns the list of HybridIdentityMetadata of the given vm.")
list is ArmResourceListByParent<HybridIdentityMetadata>;
listByVirtualMachineInstance is ArmResourceListByParent<HybridIdentityMetadata>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ interface LogicalNetworks {
delete is ArmResourceDeleteWithoutOkAsync<LogicalNetwork>;

@doc("Lists all of the logical networks in the specified resource group. Use the nextLink property in the response to get the next page of logical networks.")
list is ArmResourceListByParent<LogicalNetwork>;
listByResourceGroup is ArmResourceListByParent<LogicalNetwork>;

@doc("Lists all of the logical networks in the specified subscription. Use the nextLink property in the response to get the next page of logical networks.")
listAll is ArmListBySubscription<LogicalNetwork>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface MarketplaceGalleryImages {
delete is ArmResourceDeleteWithoutOkAsync<MarketplaceGalleryImage>;

@doc("Lists all of the marketplace gallery images in the specified resource group. Use the nextLink property in the response to get the next page of marketplace gallery images.")
list is ArmResourceListByParent<MarketplaceGalleryImage>;
listByResourceGroup is ArmResourceListByParent<MarketplaceGalleryImage>;

@doc("Lists all of the marketplace gallery images in the specified subscription. Use the nextLink property in the response to get the next page of marketplace gallery images.")
listAll is ArmListBySubscription<MarketplaceGalleryImage>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ interface NetworkInterfaces {
delete is ArmResourceDeleteWithoutOkAsync<NetworkInterface>;

@doc("Lists all of the network interfaces in the specified resource group. Use the nextLink property in the response to get the next page of network interfaces.")
list is ArmResourceListByParent<NetworkInterface>;
listByResourceGroup is ArmResourceListByParent<NetworkInterface>;

@doc("Lists all of the network interfaces in the specified subscription. Use the nextLink property in the response to get the next page of network interfaces.")
listAll is ArmListBySubscription<NetworkInterface>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ interface NetworkSecurityGroups {
delete is ArmResourceDeleteWithoutOkAsync<NetworkSecurityGroup>;

@doc("Gets all network security groups in a resource group.")
list is ArmResourceListByParent<NetworkSecurityGroup>;
listByResourceGroup is ArmResourceListByParent<NetworkSecurityGroup>;

@doc("Gets all network security groups in a subscription.")
listAll is ArmListBySubscription<NetworkSecurityGroup>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ interface SecurityRules {
delete is ArmResourceDeleteWithoutOkAsync<SecurityRule>;

@doc("Gets all security rules in a Network Security Group.")
list is ArmResourceListByParent<SecurityRule>;
listByNetworkSecurityGroup is ArmResourceListByParent<SecurityRule>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface StorageContainers {
delete is ArmResourceDeleteWithoutOkAsync<StorageContainer>;

@doc("Lists all of the storage containers in the specified resource group. Use the nextLink property in the response to get the next page of storage containers.")
list is ArmResourceListByParent<StorageContainer>;
listByResourceGroup is ArmResourceListByParent<StorageContainer>;

@doc("Lists all of the storage containers in the specified subscription. Use the nextLink property in the response to get the next page of storage containers.")
listAll is ArmListBySubscription<StorageContainer>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ interface VirtualHardDisks {
delete is ArmResourceDeleteWithoutOkAsync<VirtualHardDisk>;

@doc("Lists all of the virtual hard disks in the specified resource group. Use the nextLink property in the response to get the next page of virtual hard disks.")
list is ArmResourceListByParent<VirtualHardDisk>;
listByResourceGroup is ArmResourceListByParent<VirtualHardDisk>;

@doc("Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in the response to get the next page of virtual hard disks.")
listAll is ArmListBySubscription<VirtualHardDisk>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ options:
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/StackHCIVM/{version-status}/{version}/stackhcivm.json"
examples-directory: "{project-root}/examples"
linter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ options:
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/operations/{version-status}/{version}/operations.json"
examples-directory: "{project-root}/examples"
linter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ options:
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/codeSigningAccount.json"
examples-directory: "{project-root}/examples"
linter:
Expand Down
7 changes: 5 additions & 2 deletions specification/communitytraining/Community.Management/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,12 @@ interface CommunityTrainings {
CommunityTraining,
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
>;
update is ArmResourcePatchAsync<
update is ArmCustomPatchAsync<
CommunityTraining,
CommunityTrainingProperties
Azure.ResourceManager.Foundations.ResourceUpdateModel<
CommunityTraining,
CommunityTrainingProperties
>
>;
delete is ArmResourceDeleteAsync<CommunityTraining>;
listByResourceGroup is ArmResourceListByParent<CommunityTraining>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
emit-common-types-schema: "never"
# `arm-resource-flattening` is only used for back-compat for specs existed on July 2024. All new service spec should NOT use this flag
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/CommunityTrainings.json"
examples-directory: "{project-root}/examples"
linter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@
},
"properties": {
"$ref": "#/definitions/CommunityTrainingUpdateProperties",
"description": "The resource-specific properties for this resource.",
"x-ms-client-flatten": true
}
}
Expand Down
Loading

0 comments on commit ef953f6

Please sign in to comment.