From 812da7888fab3f344e9bd0489294c572a066ed10 Mon Sep 17 00:00:00 2001 From: Pan Shao <97225342+pshao25@users.noreply.github.com> Date: Mon, 12 Aug 2024 12:48:40 +0800 Subject: [PATCH] Upgrade tsp to 0.58 (#4998) Upgrade tsp version of converter to 0.58 Uptake changes from - https://github.com/Azure/typespec-azure/issues/709 1. For brownfield: add flag `arm-resource-flattening`, add `@@flattenProperty` to properties if needed, direct use of Azure.ResourceManager.XXXResource allows us not need `x-ms-client-flatten` any more. 2. For greenfield: no flag `arm-resource-flattening`, no `@@flattenProperty` - https://github.com/Azure/typespec-azure/issues/862 Remove all the workaround for Azure.ResourceManager.XXXResource. --------- Co-authored-by: Pan Shao --- .../upgrade58_2024-08-08-06-30.json | 10 + common/config/rush/pnpm-lock.yaml | 503 +++++--- .../openapi-to-typespec/package.json | 24 +- .../src/emiters/emit-typespec-config.ts | 9 +- .../src/generate/generate-arm-resource.ts | 59 +- .../src/generate/generate-client.ts | 6 + .../openapi-to-typespec/src/interfaces.ts | 2 +- .../src/transforms/transform-arm-resources.ts | 36 +- .../src/utils/decorators.ts | 14 +- .../openapi-to-typespec/src/utils/imports.ts | 1 + .../arm-agrifood/tsp-output/DataConnector.tsp | 15 +- .../tsp-output/DataManagerForAgriculture.tsp | 19 +- .../DataManagerForAgricultureExtension.tsp | 18 +- .../DataManagerForAgricultureSolution.tsp | 18 +- .../arm-agrifood/tsp-output/Extension.tsp | 14 +- .../tsp-output/PrivateEndpointConnection.tsp | 16 +- .../tsp-output/PrivateLinkResource.tsp | 16 +- .../test/arm-agrifood/tsp-output/Solution.tsp | 14 +- .../tsp-output/client.tsp | 11 +- .../arm-agrifood/tsp-output/tspconfig.yaml | 1 + .../arm-alertsmanagement/tsp-output/Alert.tsp | 13 +- .../tsp-output/AlertProcessingRule.tsp | 16 +- .../tsp-output/SmartGroup.tsp | 13 +- .../tsp-output/client.tsp | 3 + .../tsp-output/models.tsp | 3 + .../tsp-output/tspconfig.yaml | 1 + .../tsp-output/AnalysisServicesServer.tsp | 15 +- .../tsp-output/client.tsp | 3 + .../tsp-output/models.tsp | 3 + .../tsp-output/tspconfig.yaml | 1 + .../tsp-output/AccessInformationContract.tsp | 36 +- .../tsp-output/ApiContract.tsp | 14 +- .../ApiManagementServiceResource.tsp | 21 +- .../tsp-output/ApiReleaseContract.tsp | 14 +- .../tsp-output/ApiVersionSetContract.tsp | 16 +- .../AuthorizationServerContract.tsp | 18 +- .../tsp-output/BackendContract.tsp | 14 +- .../tsp-output/CacheContract.tsp | 14 +- .../tsp-output/CertificateContract.tsp | 16 +- .../tsp-output/DeletedServiceContract.tsp | 18 +- .../tsp-output/DiagnosticContract.tsp | 14 +- .../tsp-output/EmailTemplateContract.tsp | 34 +- .../GatewayCertificateAuthorityContract.tsp | 18 +- .../tsp-output/GatewayContract.tsp | 14 +- .../GatewayHostnameConfigurationContract.tsp | 18 +- .../tsp-output/GlobalSchemaContract.tsp | 16 +- .../tsp-output/GroupContract.tsp | 14 +- .../tsp-output/IdentityProviderContract.tsp | 34 +- .../tsp-output/IssueAttachmentContract.tsp | 18 +- .../tsp-output/IssueCommentContract.tsp | 16 +- .../tsp-output/IssueContract.tsp | 14 +- .../tsp-output/LoggerContract.tsp | 14 +- .../tsp-output/NamedValueContract.tsp | 14 +- .../tsp-output/NotificationContract.tsp | 35 +- .../OpenidConnectProviderContract.tsp | 18 +- .../tsp-output/OperationContract.tsp | 14 +- .../tsp-output/PolicyContract.tsp | 30 +- .../tsp-output/PortalDelegationSettings.tsp | 18 +- .../tsp-output/PortalRevisionContract.tsp | 16 +- .../tsp-output/PortalSigninSettings.tsp | 16 +- .../tsp-output/PortalSignupSettings.tsp | 16 +- .../tsp-output/PrivateEndpointConnection.tsp | 16 +- .../tsp-output/PrivateLinkResource.tsp | 16 +- .../tsp-output/ProductContract.tsp | 14 +- .../tsp-output/SchemaContract.tsp | 14 +- .../tsp-output/SubscriptionContract.tsp | 16 +- .../tsp-output/TagContract.tsp | 14 +- .../tsp-output/TagDescriptionContract.tsp | 18 +- .../tsp-output/TenantSettingsContract.tsp | 35 +- .../tsp-output/UserContract.tsp | 14 +- .../arm-apimanagement/tsp-output/client.tsp | 117 ++ .../arm-apimanagement/tsp-output/models.tsp | 48 + .../tsp-output/tspconfig.yaml | 1 + .../tsp-output/DenyAssignment.tsp | 14 +- .../tsp-output/RoleAssignment.tsp | 14 +- .../tsp-output/RoleAssignmentSchedule.tsp | 18 +- .../RoleAssignmentScheduleInstance.tsp | 18 +- .../RoleAssignmentScheduleRequest.tsp | 18 +- .../tsp-output/RoleDefinition.tsp | 14 +- .../tsp-output/RoleEligibilitySchedule.tsp | 18 +- .../RoleEligibilityScheduleInstance.tsp | 18 +- .../RoleEligibilityScheduleRequest.tsp | 18 +- .../tsp-output/RoleManagementPolicy.tsp | 16 +- .../RoleManagementPolicyAssignment.tsp | 18 +- .../arm-authorization/tsp-output/client.tsp | 33 + .../arm-authorization/tsp-output/models.tsp | 16 + .../tsp-output/tspconfig.yaml | 1 + .../tsp-output/Application.tsp | 3 + .../tsp-output/BusinessProcess.tsp | 3 + .../tsp-output/BusinessProcessVersion.tsp | 3 + .../tsp-output/InfrastructureResource.tsp | 3 + .../tsp-output/Space.tsp | 1 + .../tsp-output/client.tsp | 15 + .../tsp-output/models.tsp | 8 + .../tsp-output/tspconfig.yaml | 1 + .../tsp-output/AvailabilitySet.tsp | 13 +- .../tsp-output/CapacityReservation.tsp | 15 +- .../tsp-output/CapacityReservationGroup.tsp | 15 +- .../arm-compute/tsp-output/CloudService.tsp | 13 +- .../tsp-output/CloudServiceRole.tsp | 13 +- .../tsp-output/CommunityGallery.tsp | 9 +- .../tsp-output/CommunityGalleryImage.tsp | 15 +- .../CommunityGalleryImageVersion.tsp | 15 +- .../arm-compute/tsp-output/DedicatedHost.tsp | 13 +- .../tsp-output/DedicatedHostGroup.tsp | 13 +- .../test/arm-compute/tsp-output/Disk.tsp | 12 +- .../arm-compute/tsp-output/DiskAccess.tsp | 10 +- .../tsp-output/DiskEncryptionSet.tsp | 10 +- .../tsp-output/DiskRestorePoint.tsp | 15 +- .../test/arm-compute/tsp-output/Gallery.tsp | 14 +- .../tsp-output/GalleryApplication.tsp | 15 +- .../tsp-output/GalleryApplicationVersion.tsp | 15 +- .../arm-compute/tsp-output/GalleryImage.tsp | 15 +- .../tsp-output/GalleryImageVersion.tsp | 15 +- .../test/arm-compute/tsp-output/Image.tsp | 12 +- .../test/arm-compute/tsp-output/OSFamily.tsp | 12 +- .../test/arm-compute/tsp-output/OSVersion.tsp | 12 +- .../tsp-output/PrivateEndpointConnection.tsp | 13 +- .../tsp-output/ProximityPlacementGroup.tsp | 15 +- .../arm-compute/tsp-output/RestorePoint.tsp | 13 +- .../tsp-output/RestorePointCollection.tsp | 15 +- .../arm-compute/tsp-output/RoleInstance.tsp | 13 +- .../tsp-output/RollingUpgradeStatusInfo.tsp | 15 +- .../arm-compute/tsp-output/SharedGallery.tsp | 9 +- .../tsp-output/SharedGalleryImage.tsp | 15 +- .../tsp-output/SharedGalleryImageVersion.tsp | 15 +- .../test/arm-compute/tsp-output/Snapshot.tsp | 12 +- .../tsp-output/SshPublicKeyResource.tsp | 13 +- .../arm-compute/tsp-output/VirtualMachine.tsp | 15 +- .../tsp-output/VirtualMachineExtension.tsp | 15 +- .../VirtualMachineExtensionImage.tsp | 15 +- .../tsp-output/VirtualMachineRunCommand.tsp | 15 +- .../tsp-output/VirtualMachineScaleSet.tsp | 15 +- .../VirtualMachineScaleSetExtension.tsp | 15 +- .../tsp-output/VirtualMachineScaleSetVM.tsp | 15 +- .../VirtualMachineScaleSetVMExtension.tsp | 15 +- .../test/arm-compute/tsp-output/client.tsp | 117 ++ .../test/arm-compute/tsp-output/models.tsp | 42 + .../arm-compute/tsp-output/tspconfig.yaml | 1 + .../test/arm-dns/tsp-output/DnsRecord.tsp | 12 +- .../test/arm-dns/tsp-output/DnsZone.tsp | 12 +- .../test/arm-dns/tsp-output/client.tsp | 6 + .../test/arm-dns/tsp-output/models.tsp | 4 + .../test/arm-dns/tsp-output/tspconfig.yaml | 1 + .../BatchDeploymentTrackedResource.tsp | 16 +- .../BatchEndpointTrackedResource.tsp | 16 +- .../tsp-output/CodeContainerResource.tsp | 16 +- .../tsp-output/CodeVersionResource.tsp | 16 +- .../tsp-output/ComponentContainerResource.tsp | 16 +- .../tsp-output/ComponentVersionResource.tsp | 16 +- .../tsp-output/DataContainerResource.tsp | 16 +- .../tsp-output/DataVersionBaseResource.tsp | 16 +- .../tsp-output/DatastoreResource.tsp | 16 +- .../EnvironmentContainerResource.tsp | 16 +- .../tsp-output/EnvironmentVersionResource.tsp | 16 +- .../tsp-output/Feature.tsp | 13 +- .../tsp-output/FeaturesetContainer.tsp | 18 +- .../tsp-output/FeaturesetVersion.tsp | 16 +- .../FeaturestoreEntityContainer.tsp | 21 +- .../tsp-output/FeaturestoreEntityVersion.tsp | 21 +- .../tsp-output/JobBaseResource.tsp | 15 +- .../tsp-output/LabelingJob.tsp | 16 +- .../tsp-output/ModelContainerResource.tsp | 16 +- .../tsp-output/ModelVersionResource.tsp | 16 +- .../OnlineDeploymentTrackedResource.tsp | 16 +- .../OnlineEndpointTrackedResource.tsp | 16 +- .../tsp-output/OutboundRuleBasicResource.tsp | 16 +- .../tsp-output/PrivateEndpointConnection.tsp | 19 +- .../tsp-output/Registry.tsp | 14 +- .../tsp-output/Schedule.tsp | 14 +- .../tsp-output/Workspace.tsp | 15 +- ...aceConnectionPropertiesV2BasicResource.tsp | 15 +- .../tsp-output/client.tsp | 9 + .../tsp-output/models.tsp | 7 + .../tsp-output/tspconfig.yaml | 1 + .../swagger-output/swagger.json | 9 +- .../tsp-output/DataProduct.tsp | 3 + .../tsp-output/DataProductsCatalog.tsp | 3 + .../tsp-output/DataType.tsp | 3 + .../tsp-output/client.tsp | 11 - .../examples/Quotas_ListBySubscription.json | 34 + .../swagger-output/swagger.json | 33 +- .../tsp-output/Account.tsp | 29 +- .../tsp-output/Quota.tsp | 21 +- .../tsp-output/client.tsp | 8 - .../arm-playwrighttesting/tsp-output/main.tsp | 6 + .../tsp-output/models.tsp | 20 +- .../swagger-output/swagger.json | 9 +- .../tsp-output/Association.tsp | 3 + .../tsp-output/Frontend.tsp | 3 + .../tsp-output/TrafficController.tsp | 3 + .../tsp-output/client.tsp | 8 - .../arm-sphere/swagger-output/swagger.json | 21 +- .../test/arm-sphere/tsp-output/Catalog.tsp | 3 + .../arm-sphere/tsp-output/Certificate.tsp | 3 + .../test/arm-sphere/tsp-output/Deployment.tsp | 3 + .../test/arm-sphere/tsp-output/Device.tsp | 1 + .../arm-sphere/tsp-output/DeviceGroup.tsp | 3 + .../test/arm-sphere/tsp-output/Image.tsp | 1 + .../test/arm-sphere/tsp-output/Product.tsp | 3 + .../arm-storage/swagger-output/swagger.json | 67 +- .../arm-storage/tsp-output/BlobContainer.tsp | 14 +- .../tsp-output/BlobInventoryPolicy.tsp | 18 +- .../tsp-output/BlobServiceProperties.tsp | 19 +- .../arm-storage/tsp-output/DeletedAccount.tsp | 14 +- .../tsp-output/EncryptionScope.tsp | 14 +- .../tsp-output/FileServiceProperties.tsp | 19 +- .../test/arm-storage/tsp-output/FileShare.tsp | 13 +- .../tsp-output/ImmutabilityPolicy.tsp | 16 +- .../test/arm-storage/tsp-output/LocalUser.tsp | 13 +- .../tsp-output/ManagementPolicy.tsp | 16 +- .../tsp-output/ObjectReplicationPolicy.tsp | 18 +- .../tsp-output/PrivateEndpointConnection.tsp | 16 +- .../tsp-output/QueueServiceProperties.tsp | 18 +- .../arm-storage/tsp-output/StorageAccount.tsp | 14 +- .../arm-storage/tsp-output/StorageQueue.tsp | 13 +- .../test/arm-storage/tsp-output/Table.tsp | 13 +- .../tsp-output/TableServiceProperties.tsp | 18 +- .../test/arm-storage/tsp-output/client.tsp | 47 + .../test/arm-storage/tsp-output/models.tsp | 9 + .../arm-storage/tsp-output/tspconfig.yaml | 1 + .../test/arm-test/swagger-output/swagger.json | 16 +- .../test/arm-test/tsp-output/ArrayDefault.tsp | 3 + .../test/arm-test/tsp-output/DictProperty.tsp | 3 + .../test/arm-test/tsp-output/Employee.tsp | 3 + .../test/arm-test/tsp-output/Enroll.tsp | 1 + .../test/arm-test/tsp-output/client.tsp | 8 - .../test/bodyComplex/tsp-output/client.tsp | 8 - .../test/keyvault/tsp-output/client.tsp | 8 - .../test/search/tsp-output/main.tsp | 4 +- .../test/search/tsp-output/models.tsp | 1135 ++++++++++++++++- .../test/search/tsp-output/routes.tsp | 198 ++- .../test/utils/generate-typespec.ts | 2 - 233 files changed, 3073 insertions(+), 2227 deletions(-) create mode 100644 common/changes/@autorest/openapi-to-typespec/upgrade58_2024-08-08-06-30.json rename packages/extensions/openapi-to-typespec/test/{arm-sphere => arm-agrifood}/tsp-output/client.tsp (51%) delete mode 100644 packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/client.tsp create mode 100644 packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/swagger-output/examples/Quotas_ListBySubscription.json delete mode 100644 packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/bodyComplex/tsp-output/client.tsp delete mode 100644 packages/extensions/openapi-to-typespec/test/keyvault/tsp-output/client.tsp diff --git a/common/changes/@autorest/openapi-to-typespec/upgrade58_2024-08-08-06-30.json b/common/changes/@autorest/openapi-to-typespec/upgrade58_2024-08-08-06-30.json new file mode 100644 index 000000000..2da2a11dc --- /dev/null +++ b/common/changes/@autorest/openapi-to-typespec/upgrade58_2024-08-08-06-30.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@autorest/openapi-to-typespec", + "comment": "upgrade tsp version of converter to 0.58", + "type": "patch" + } + ], + "packageName": "@autorest/openapi-to-typespec" +} \ No newline at end of file diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7429df5c4..c088e43aa 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -15,17 +15,17 @@ dependencies: specifier: ~3.0.0 version: 3.0.255 '@azure-tools/typespec-autorest': - specifier: ^0.43.0 - version: 0.43.0(@azure-tools/typespec-azure-core@0.43.0)(@azure-tools/typespec-azure-resource-manager@0.43.0)(@azure-tools/typespec-client-generator-core@0.43.0)(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/openapi@0.57.0)(@typespec/rest@0.57.0)(@typespec/versioning@0.57.0) + specifier: ^0.44.0 + version: 0.44.1(@azure-tools/typespec-azure-core@0.44.0)(@azure-tools/typespec-azure-resource-manager@0.44.0)(@azure-tools/typespec-client-generator-core@0.44.3)(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/rest@0.58.0)(@typespec/versioning@0.58.0) '@azure-tools/typespec-azure-core': - specifier: ^0.43.0 - version: 0.43.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/rest@0.57.0) + specifier: ^0.44.0 + version: 0.44.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/rest@0.58.0) '@azure-tools/typespec-azure-resource-manager': - specifier: ^0.43.0 - version: 0.43.0(@azure-tools/typespec-azure-core@0.43.0)(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/openapi@0.57.0)(@typespec/rest@0.57.0)(@typespec/versioning@0.57.0) + specifier: ^0.44.0 + version: 0.44.0(@azure-tools/typespec-azure-core@0.44.0)(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/rest@0.58.0)(@typespec/versioning@0.58.0) '@azure-tools/typespec-client-generator-core': - specifier: ^0.43.0 - version: 0.43.0(@azure-tools/typespec-azure-core@0.43.0)(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/rest@0.57.0)(@typespec/versioning@0.57.0) + specifier: ^0.44.0 + version: 0.44.3(@azure-tools/typespec-azure-core@0.44.0)(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/rest@0.58.0)(@typespec/versioning@0.58.0) '@azure-tools/uri': specifier: ~3.1.1 version: 3.1.1 @@ -168,26 +168,26 @@ dependencies: specifier: ^6.11.0 version: 6.11.0(eslint@8.53.0)(typescript@5.2.2) '@typespec/compiler': - specifier: ^0.57.0 - version: 0.57.0 + specifier: ^0.58.0 + version: 0.58.1 '@typespec/http': - specifier: ^0.57.0 - version: 0.57.0(@typespec/compiler@0.57.0) + specifier: ^0.58.0 + version: 0.58.0(@typespec/compiler@0.58.1) '@typespec/openapi': - specifier: ^0.57.0 - version: 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0) + specifier: ^0.58.0 + version: 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0) '@typespec/openapi3': - specifier: ^0.57.0 - version: 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/openapi@0.57.0)(@typespec/versioning@0.57.0) + specifier: ^0.58.0 + version: 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/versioning@0.58.0) '@typespec/prettier-plugin-typespec': - specifier: ^0.57.0 - version: 0.57.0 + specifier: ^0.58.0 + version: 0.58.0 '@typespec/rest': - specifier: ^0.57.0 - version: 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0) + specifier: ^0.58.0 + version: 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0) '@typespec/versioning': - specifier: ^0.57.0 - version: 0.57.0(@typespec/compiler@0.57.0) + specifier: ^0.58.0 + version: 0.58.0(@typespec/compiler@0.58.1) ajv: specifier: ^8.6.0 version: 8.12.0 @@ -378,6 +378,10 @@ packages: '@jridgewell/trace-mapping': 0.3.20 dev: false + /@apidevtools/swagger-methods@3.0.2: + resolution: {integrity: sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==} + dev: false + /@azure-tools/async-io@3.0.254: resolution: {integrity: sha512-X1C7XdyCuo50ch9FzKtTvmK18FgDxxf1Bbt3cSoknQqeDaRegHSSCO+zByq2YA4NvUzKXeZ1engh29IDxZXgpQ==} engines: {node: '>=10.12.0'} @@ -396,78 +400,80 @@ packages: engines: {node: '>=10.12.0'} dev: false - /@azure-tools/typespec-autorest@0.43.0(@azure-tools/typespec-azure-core@0.43.0)(@azure-tools/typespec-azure-resource-manager@0.43.0)(@azure-tools/typespec-client-generator-core@0.43.0)(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/openapi@0.57.0)(@typespec/rest@0.57.0)(@typespec/versioning@0.57.0): - resolution: {integrity: sha512-tZ9uXXOdxu2y01W9n3mzXf+IEY2MQkP/JaQaKlcOx2+dbklHNQWSDU0Vm6Gmm6l//XiF9QiI8653BiuO97czyw==} + /@azure-tools/typespec-autorest@0.44.1(@azure-tools/typespec-azure-core@0.44.0)(@azure-tools/typespec-azure-resource-manager@0.44.0)(@azure-tools/typespec-client-generator-core@0.44.3)(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/rest@0.58.0)(@typespec/versioning@0.58.0): + resolution: {integrity: sha512-lw/iM659GuFgckDeRFFu0vx6wGBy814n+mjzbpi0Qwjvj8/hYULSjpty9P4WBDE30rYCUde1pWX5nK6TnwhOkQ==} engines: {node: '>=18.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ~0.43.0 - '@azure-tools/typespec-azure-resource-manager': ~0.43.0 - '@azure-tools/typespec-client-generator-core': ~0.43.0 - '@typespec/compiler': ~0.57.0 - '@typespec/http': ~0.57.0 - '@typespec/openapi': ~0.57.0 - '@typespec/rest': ~0.57.0 - '@typespec/versioning': ~0.57.0 + '@azure-tools/typespec-azure-core': ~0.44.0 + '@azure-tools/typespec-azure-resource-manager': ~0.44.0 + '@azure-tools/typespec-client-generator-core': ~0.44.2 + '@typespec/compiler': ~0.58.0 + '@typespec/http': ~0.58.0 + '@typespec/openapi': ~0.58.0 + '@typespec/rest': ~0.58.0 + '@typespec/versioning': ~0.58.0 dependencies: - '@azure-tools/typespec-azure-core': 0.43.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/rest@0.57.0) - '@azure-tools/typespec-azure-resource-manager': 0.43.0(@azure-tools/typespec-azure-core@0.43.0)(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/openapi@0.57.0)(@typespec/rest@0.57.0)(@typespec/versioning@0.57.0) - '@azure-tools/typespec-client-generator-core': 0.43.0(@azure-tools/typespec-azure-core@0.43.0)(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/rest@0.57.0)(@typespec/versioning@0.57.0) - '@typespec/compiler': 0.57.0 - '@typespec/http': 0.57.0(@typespec/compiler@0.57.0) - '@typespec/openapi': 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0) - '@typespec/rest': 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0) - '@typespec/versioning': 0.57.0(@typespec/compiler@0.57.0) + '@azure-tools/typespec-azure-core': 0.44.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/rest@0.58.0) + '@azure-tools/typespec-azure-resource-manager': 0.44.0(@azure-tools/typespec-azure-core@0.44.0)(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/rest@0.58.0)(@typespec/versioning@0.58.0) + '@azure-tools/typespec-client-generator-core': 0.44.3(@azure-tools/typespec-azure-core@0.44.0)(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/rest@0.58.0)(@typespec/versioning@0.58.0) + '@typespec/compiler': 0.58.1 + '@typespec/http': 0.58.0(@typespec/compiler@0.58.1) + '@typespec/openapi': 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0) + '@typespec/rest': 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0) + '@typespec/versioning': 0.58.0(@typespec/compiler@0.58.1) dev: false - /@azure-tools/typespec-azure-core@0.43.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/rest@0.57.0): - resolution: {integrity: sha512-B1r0i3segJ7RuNXxcAMBy8H2t+jTkaf74dkyUWD0HIFPkhETN0uR59nuor+s+LoLU8yI4JypOFSNZt6e1rod8w==} + /@azure-tools/typespec-azure-core@0.44.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/rest@0.58.0): + resolution: {integrity: sha512-d11QK2v5fOZH8YUqf42FsqHEirKCHzeKFq4Uo/51BXCXmJJahsTaFMAG2M0GoJe8tmTHeMijStnVMfzcGNqCAA==} engines: {node: '>=18.0.0'} peerDependencies: - '@typespec/compiler': ~0.57.0 - '@typespec/http': ~0.57.0 - '@typespec/rest': ~0.57.0 + '@typespec/compiler': ~0.58.0 + '@typespec/http': ~0.58.0 + '@typespec/rest': ~0.58.0 dependencies: - '@typespec/compiler': 0.57.0 - '@typespec/http': 0.57.0(@typespec/compiler@0.57.0) - '@typespec/rest': 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0) + '@typespec/compiler': 0.58.1 + '@typespec/http': 0.58.0(@typespec/compiler@0.58.1) + '@typespec/rest': 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0) dev: false - /@azure-tools/typespec-azure-resource-manager@0.43.0(@azure-tools/typespec-azure-core@0.43.0)(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/openapi@0.57.0)(@typespec/rest@0.57.0)(@typespec/versioning@0.57.0): - resolution: {integrity: sha512-0GQL+/o1u+PAB63FpYz3sy3ZgZvCtk5T4sDAnICnV23v2YWIONDMUfxxd0x40xJbY6PkcwwHDpBLNMqajf2H6A==} + /@azure-tools/typespec-azure-resource-manager@0.44.0(@azure-tools/typespec-azure-core@0.44.0)(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/rest@0.58.0)(@typespec/versioning@0.58.0): + resolution: {integrity: sha512-m4dG41at6En1swbxlvCDl1v4Mvrfp17acDnRxEcd4SdKP2R9eVS2mBy1tSuFtMcJlOnoBZ5CxQgk+Osg/Q9nmA==} engines: {node: '>=18.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ~0.43.0 - '@typespec/compiler': ~0.57.0 - '@typespec/http': ~0.57.0 - '@typespec/openapi': ~0.57.0 - '@typespec/rest': ~0.57.0 - '@typespec/versioning': ~0.57.0 + '@azure-tools/typespec-azure-core': ~0.44.0 + '@typespec/compiler': ~0.58.0 + '@typespec/http': ~0.58.0 + '@typespec/openapi': ~0.58.0 + '@typespec/rest': ~0.58.0 + '@typespec/versioning': ~0.58.0 dependencies: - '@azure-tools/typespec-azure-core': 0.43.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/rest@0.57.0) - '@typespec/compiler': 0.57.0 - '@typespec/http': 0.57.0(@typespec/compiler@0.57.0) - '@typespec/openapi': 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0) - '@typespec/rest': 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0) - '@typespec/versioning': 0.57.0(@typespec/compiler@0.57.0) + '@azure-tools/typespec-azure-core': 0.44.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/rest@0.58.0) + '@typespec/compiler': 0.58.1 + '@typespec/http': 0.58.0(@typespec/compiler@0.58.1) + '@typespec/openapi': 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0) + '@typespec/rest': 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0) + '@typespec/versioning': 0.58.0(@typespec/compiler@0.58.1) change-case: 5.4.4 pluralize: 8.0.0 dev: false - /@azure-tools/typespec-client-generator-core@0.43.0(@azure-tools/typespec-azure-core@0.43.0)(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/rest@0.57.0)(@typespec/versioning@0.57.0): - resolution: {integrity: sha512-rssB/zsg89wstzJC1MWzbd8oPpqbgoftkp9G/NP3BoMb/gCP5uRLggwlSUAgnoU2Lt0jBUKcMlqEiVLTAkY9LA==} + /@azure-tools/typespec-client-generator-core@0.44.3(@azure-tools/typespec-azure-core@0.44.0)(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/rest@0.58.0)(@typespec/versioning@0.58.0): + resolution: {integrity: sha512-HXjxQs7ELrTuIDqOjlYhP4rM4AXb143klbiM8dkEGtqNBRCk77gVCGYVH1M3kWKAEs0dQKhzoUukscqRsfELuw==} engines: {node: '>=18.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ~0.43.0 - '@typespec/compiler': ~0.57.0 - '@typespec/http': ~0.57.0 - '@typespec/rest': ~0.57.0 - '@typespec/versioning': ~0.57.0 + '@azure-tools/typespec-azure-core': ~0.44.0 + '@typespec/compiler': ~0.58.0 + '@typespec/http': ~0.58.0 + '@typespec/openapi': ~0.58.0 + '@typespec/rest': ~0.58.0 + '@typespec/versioning': ~0.58.0 dependencies: - '@azure-tools/typespec-azure-core': 0.43.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/rest@0.57.0) - '@typespec/compiler': 0.57.0 - '@typespec/http': 0.57.0(@typespec/compiler@0.57.0) - '@typespec/rest': 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0) - '@typespec/versioning': 0.57.0(@typespec/compiler@0.57.0) + '@azure-tools/typespec-azure-core': 0.44.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/rest@0.58.0) + '@typespec/compiler': 0.58.1 + '@typespec/http': 0.58.0(@typespec/compiler@0.58.1) + '@typespec/openapi': 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0) + '@typespec/rest': 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0) + '@typespec/versioning': 0.58.0(@typespec/compiler@0.58.1) change-case: 5.4.4 pluralize: 8.0.0 dev: false @@ -506,6 +512,14 @@ packages: picocolors: 1.0.1 dev: false + /@babel/code-frame@7.24.7: + resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.24.7 + picocolors: 1.0.1 + dev: false + /@babel/compat-data@7.23.3: resolution: {integrity: sha512-BmR4bWbDIoFJmJ9z2cZ8Gmm2MXgEDgjdWgpKmKWUt54UGFJdlj31ECtbaDvCG/qVdG3AQ1SfpZEs01lUFbzLOQ==} engines: {node: '>=6.9.0'} @@ -630,6 +644,11 @@ packages: engines: {node: '>=6.9.0'} dev: false + /@babel/helper-validator-identifier@7.24.7: + resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} + engines: {node: '>=6.9.0'} + dev: false + /@babel/helper-validator-option@7.22.15: resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} engines: {node: '>=6.9.0'} @@ -665,6 +684,16 @@ packages: picocolors: 1.0.1 dev: false + /@babel/highlight@7.24.7: + resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.24.7 + chalk: 2.4.2 + js-tokens: 4.0.0 + picocolors: 1.0.1 + dev: false + /@babel/parser@7.23.3: resolution: {integrity: sha512-uVsWNvlVsIninV2prNz/3lHCb+5CJ+e+IUBfbjToAHODtfGYLfCFuY4AU7TskI+dAKk+njsPiBjq1gKTvZOBaw==} engines: {node: '>=6.0.0'} @@ -800,6 +829,13 @@ packages: '@babel/helper-plugin-utils': 7.22.5 dev: false + /@babel/runtime@7.25.0: + resolution: {integrity: sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.14.1 + dev: false + /@babel/template@7.22.15: resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} engines: {node: '>=6.9.0'} @@ -949,6 +985,11 @@ packages: engines: {node: '>=12.22'} dev: false + /@humanwhocodes/momoa@2.0.4: + resolution: {integrity: sha512-RE815I4arJFtt+FVeU1Tgp9/Xvecacji8w/V6XtXsWWH/wz/eNkNbhb+ny/+PlVZjV0rxQpRSQKNKE3lcktHEA==} + engines: {node: '>=10.10.0'} + dev: false + /@humanwhocodes/object-schema@2.0.1: resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} dev: false @@ -1250,6 +1291,10 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: false + /@jsdevtools/ono@7.1.3: + resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} + dev: false + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1288,7 +1333,7 @@ packages: resolution: {integrity: sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - semver: 7.6.1 + semver: 7.6.2 dev: false /@pkgjs/parseargs@0.11.0: @@ -1310,6 +1355,52 @@ packages: tslib: 2.6.2 dev: false + /@readme/better-ajv-errors@1.6.0(ajv@8.13.0): + resolution: {integrity: sha512-9gO9rld84Jgu13kcbKRU+WHseNhaVt76wYMeRDGsUGYxwJtI3RmEJ9LY9dZCYQGI8eUZLuxb5qDja0nqklpFjQ==} + engines: {node: '>=14'} + peerDependencies: + ajv: 4.11.8 - 8 + dependencies: + '@babel/code-frame': 7.24.2 + '@babel/runtime': 7.25.0 + '@humanwhocodes/momoa': 2.0.4 + ajv: 8.13.0 + chalk: 4.1.2 + json-to-ast: 2.1.0 + jsonpointer: 5.0.1 + leven: 3.1.0 + dev: false + + /@readme/json-schema-ref-parser@1.2.0: + resolution: {integrity: sha512-Bt3QVovFSua4QmHa65EHUmh2xS0XJ3rgTEUPH998f4OW4VVJke3BuS16f+kM0ZLOGdvIrzrPRqwihuv5BAjtrA==} + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + call-me-maybe: 1.0.2 + js-yaml: 4.1.0 + dev: false + + /@readme/openapi-parser@2.6.0: + resolution: {integrity: sha512-pyFJXezWj9WI1O+gdp95CoxfY+i+Uq3kKk4zXIFuRAZi9YnHpHOpjumWWr67wkmRTw19Hskh9spyY0Iyikf3fA==} + engines: {node: '>=18'} + peerDependencies: + openapi-types: '>=7' + dependencies: + '@apidevtools/swagger-methods': 3.0.2 + '@jsdevtools/ono': 7.1.3 + '@readme/better-ajv-errors': 1.6.0(ajv@8.13.0) + '@readme/json-schema-ref-parser': 1.2.0 + '@readme/openapi-schemas': 3.1.0 + ajv: 8.13.0 + ajv-draft-04: 1.0.0(ajv@8.13.0) + call-me-maybe: 1.0.2 + dev: false + + /@readme/openapi-schemas@3.1.0: + resolution: {integrity: sha512-9FC/6ho8uFa8fV50+FPy/ngWN53jaUu4GRXlAjcxIRrzhltJnpKkBG2Tp0IDraFJeWrOpk84RJ9EMEEYzaI1Bw==} + engines: {node: '>=18'} + dev: false + /@sinclair/typebox@0.27.8: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: false @@ -1713,7 +1804,7 @@ packages: debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.6.1 + semver: 7.6.2 tsutils: 3.21.0(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: @@ -1796,86 +1887,91 @@ packages: eslint-visitor-keys: 3.4.3 dev: false - /@typespec/compiler@0.57.0: - resolution: {integrity: sha512-Z5L7J90Ol21IbzU+rBD2wzKy2vJ2Yg2FIzi+yB5rtb7/c4oBea/CgEByMVHBtT7uw45ZXJpHOiepuGSPVXw2EA==} + /@typespec/compiler@0.58.1: + resolution: {integrity: sha512-bVxxM35r40OtuL4+/9W/g1EevlnWnW6i151nsZAFOJj1xWHoE2G9zkx5/Feic8OlzArjhGGLJOLH3Ez1Wrw35A==} engines: {node: '>=18.0.0'} hasBin: true dependencies: - '@babel/code-frame': 7.24.2 - ajv: 8.13.0 + '@babel/code-frame': 7.24.7 + ajv: 8.16.0 change-case: 5.4.4 - globby: 14.0.1 + globby: 14.0.2 mustache: 4.2.0 picocolors: 1.0.1 - prettier: 3.2.5 + prettier: 3.3.3 prompts: 2.4.2 semver: 7.6.2 + temporal-polyfill: 0.2.5 vscode-languageserver: 9.0.1 vscode-languageserver-textdocument: 1.0.11 - yaml: 2.4.2 + yaml: 2.4.5 yargs: 17.7.2 dev: false - /@typespec/http@0.57.0(@typespec/compiler@0.57.0): - resolution: {integrity: sha512-k3bWOTPNqlRB3/TmrXVBtObmxj2J20l2FnhGXvs+tjdtbXLxCQWmvQz6xlne9nkLAtWVB/pQRUn+oMJfhWta3w==} + /@typespec/http@0.58.0(@typespec/compiler@0.58.1): + resolution: {integrity: sha512-jQpkugg9AZVrNDMkDIgZRpIoRkkU2b0LtKWqMGg33MItYj9/DYSgDtY7xb7oCBppRtFFZ/h138HyhYl3zQxZRg==} engines: {node: '>=18.0.0'} peerDependencies: - '@typespec/compiler': ~0.57.0 + '@typespec/compiler': ~0.58.0 dependencies: - '@typespec/compiler': 0.57.0 + '@typespec/compiler': 0.58.1 dev: false - /@typespec/openapi3@0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/openapi@0.57.0)(@typespec/versioning@0.57.0): - resolution: {integrity: sha512-spNLzwCTduPISJBTWhqsMLTjuGC3Tdh/FVI1rTGnRunB7ZXjhRyz031o1bCe2BZeW1w1sacZGfe+ba8sXqgMxA==} + /@typespec/openapi3@0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/versioning@0.58.0): + resolution: {integrity: sha512-G9t9CWT9cN6ip39dLZaE6JdEDxGsFyOUxA2s6a087rweoTH85XzsFiQL7uiUD8vHhXyEo6tF6sy3LMZVN0BsoQ==} + engines: {node: '>=18.0.0'} + hasBin: true + peerDependencies: + '@typespec/compiler': ~0.58.0 + '@typespec/http': ~0.58.0 + '@typespec/openapi': ~0.58.0 + '@typespec/versioning': ~0.58.0 + dependencies: + '@readme/openapi-parser': 2.6.0 + '@typespec/compiler': 0.58.1 + '@typespec/http': 0.58.0(@typespec/compiler@0.58.1) + '@typespec/openapi': 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0) + '@typespec/versioning': 0.58.0(@typespec/compiler@0.58.1) + yaml: 2.4.5 + transitivePeerDependencies: + - openapi-types + dev: false + + /@typespec/openapi@0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0): + resolution: {integrity: sha512-gu6nXfmpfZrfq8Etpgl1dpMfsXii7EzQyhZgsPhIy7ZwV5bDmFk1/oyhTqIpWrnr4pD3r151T2BQjzJefjf15A==} engines: {node: '>=18.0.0'} peerDependencies: - '@typespec/compiler': ~0.57.0 - '@typespec/http': ~0.57.0 - '@typespec/openapi': ~0.57.0 - '@typespec/versioning': ~0.57.0 + '@typespec/compiler': ~0.58.0 + '@typespec/http': ~0.58.0 dependencies: - '@typespec/compiler': 0.57.0 - '@typespec/http': 0.57.0(@typespec/compiler@0.57.0) - '@typespec/openapi': 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0) - '@typespec/versioning': 0.57.0(@typespec/compiler@0.57.0) - yaml: 2.4.2 + '@typespec/compiler': 0.58.1 + '@typespec/http': 0.58.0(@typespec/compiler@0.58.1) dev: false - /@typespec/openapi@0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0): - resolution: {integrity: sha512-35wK/BqjOXSlhWuGMwoYN3FSgIYFOKtw8ot4ErcgmxAGuKaS2GkUhZvtQJXUn2ByU0Fl4jqslPmTz8SEcz7rbw==} + /@typespec/prettier-plugin-typespec@0.58.0: + resolution: {integrity: sha512-GtG9MvVGKytT6jPEksySSRMKl6IYg7dWnjLWMkCwvoViuSAlz3lxjIO0hGUaU5maNCC2+fe5m4vvFmNXGlMOsg==} + dependencies: + prettier: 3.3.3 + dev: false + + /@typespec/rest@0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0): + resolution: {integrity: sha512-QBxkED0/KQKG22pwzis0n7BY+uLMSZZPSoVe/ESBFika9n5/yyeQ0l58xbFFwwfxAxe4xwuZ5PNwTdEXZbzr5g==} engines: {node: '>=18.0.0'} peerDependencies: - '@typespec/compiler': ~0.57.0 - '@typespec/http': ~0.57.0 + '@typespec/compiler': ~0.58.0 + '@typespec/http': ~0.58.0 dependencies: - '@typespec/compiler': 0.57.0 - '@typespec/http': 0.57.0(@typespec/compiler@0.57.0) + '@typespec/compiler': 0.58.1 + '@typespec/http': 0.58.0(@typespec/compiler@0.58.1) dev: false - /@typespec/prettier-plugin-typespec@0.57.0: - resolution: {integrity: sha512-nWrgv/yPGYfE4FL6ON3BpYZnvCdZYvE6yrgcr/ifqZnMBJfCLl4sk+tk3JoVysj6kTTWaFME7GQ/X/guMvbjUA==} - dependencies: - prettier: 3.2.5 - dev: false - - /@typespec/rest@0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0): - resolution: {integrity: sha512-mZj76Kf+cmH38pYA6LT8Zz7QjuR3fdQo5bc8pXhKMwLq9vRqNLz6Z9InbOeo8zY+xP0GfUwEU9kXczmCc8gyRA==} + /@typespec/versioning@0.58.0(@typespec/compiler@0.58.1): + resolution: {integrity: sha512-brnQQ3wKWh4AbgqmnVLj+8zyOaDk9VPWg4QBecdQxzz7PrSrlAzIzRfeIyr67+hwi/0SvkTAB6GNH7YYTypKGA==} engines: {node: '>=18.0.0'} peerDependencies: - '@typespec/compiler': ~0.57.0 - '@typespec/http': ~0.57.0 + '@typespec/compiler': ~0.58.0 dependencies: - '@typespec/compiler': 0.57.0 - '@typespec/http': 0.57.0(@typespec/compiler@0.57.0) - dev: false - - /@typespec/versioning@0.57.0(@typespec/compiler@0.57.0): - resolution: {integrity: sha512-kk6zCNSwcqqYB9isNNagTy+Zv6wEIRA4NkcZ/X1riTj2zhJwKsIFNXQWm1yxpZn+BY4+1QtuaQHuBLo8HbgR/w==} - engines: {node: '>=18.0.0'} - peerDependencies: - '@typespec/compiler': ~0.57.0 - dependencies: - '@typespec/compiler': 0.57.0 + '@typespec/compiler': 0.58.1 dev: false /@ungap/structured-clone@1.2.0: @@ -2119,6 +2215,17 @@ packages: indent-string: 5.0.0 dev: false + /ajv-draft-04@1.0.0(ajv@8.13.0): + resolution: {integrity: sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==} + peerDependencies: + ajv: ^8.5.0 + peerDependenciesMeta: + ajv: + optional: true + dependencies: + ajv: 8.13.0 + dev: false + /ajv-errors@3.0.0(ajv@8.12.0): resolution: {integrity: sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==} peerDependencies: @@ -2182,6 +2289,15 @@ packages: uri-js: 4.4.1 dev: false + /ajv@8.16.0: + resolution: {integrity: sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==} + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + dev: false + /ajv@8.9.0: resolution: {integrity: sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==} dependencies: @@ -2581,7 +2697,7 @@ packages: /builtins@5.0.1: resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} dependencies: - semver: 7.6.1 + semver: 7.6.2 dev: false /bundle-name@3.0.0: @@ -2652,6 +2768,10 @@ packages: set-function-length: 1.1.1 dev: false + /call-me-maybe@1.0.2: + resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} + dev: false + /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -2851,6 +2971,11 @@ packages: resolution: {integrity: sha512-NiujjUFB4SwScJq2bwbYUtXbZhBSlY6vYzm++3Q6oC+U+injTqfPYFK8wS9COOmb2lueqp0ZRB4nK1VYeHgNyw==} dev: false + /code-error-fragment@0.0.230: + resolution: {integrity: sha512-cadkfKp6932H8UkhzE/gcUqhRMNf8jHzkAN7+5Myabswaghu4xABTgPHDCjW+dBAJxj/SpkTYokpzDqY4pCzQw==} + engines: {node: '>= 4'} + dev: false + /collect-v8-coverage@1.0.2: resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} dev: false @@ -4314,8 +4439,8 @@ packages: slash: 4.0.0 dev: false - /globby@14.0.1: - resolution: {integrity: sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==} + /globby@14.0.2: + resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} engines: {node: '>=18'} dependencies: '@sindresorhus/merge-streams': 2.3.0 @@ -4336,6 +4461,10 @@ packages: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: false + /grapheme-splitter@1.0.4: + resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: false + /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: false @@ -4914,7 +5043,7 @@ packages: '@babel/parser': 7.23.3 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 - semver: 7.6.1 + semver: 7.6.2 transitivePeerDependencies: - supports-color dev: false @@ -5415,7 +5544,7 @@ packages: jest-util: 29.7.0 natural-compare: 1.4.0 pretty-format: 29.7.0 - semver: 7.6.1 + semver: 7.6.2 transitivePeerDependencies: - supports-color dev: false @@ -5579,6 +5708,14 @@ packages: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} dev: false + /json-to-ast@2.1.0: + resolution: {integrity: sha512-W9Lq347r8tA1DfMvAGn9QNcgYm4Wm7Yc+k8e6vezpMnRT+NHbtlxgNBXRVjXe9YM6eTn6+p/MKOlV/aABJcSnQ==} + engines: {node: '>= 4'} + dependencies: + code-error-fragment: 0.0.230 + grapheme-splitter: 1.0.4 + dev: false + /json5@1.0.2: resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} hasBin: true @@ -5616,6 +5753,11 @@ packages: engines: {node: '>=10.0.0'} dev: false + /jsonpointer@5.0.1: + resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} + engines: {node: '>=0.10.0'} + dev: false + /junk@4.0.1: resolution: {integrity: sha512-Qush0uP+G8ZScpGMZvHUiRfI0YBWuB3gVBYlI0v0vvOJt5FLicco+IkP0a50LqTTQhmts/m6tP5SWE+USyIvcQ==} engines: {node: '>=12.20'} @@ -5729,7 +5871,7 @@ packages: resolution: {integrity: sha512-Yj9mA8fPiVgOUpByoTZO5pNrcl5Yk37FcSHsUINpAsaBIEZIuqcCclDZJCVxqQShDsmYX8QG63svJiTbOATZwg==} engines: {node: 14 || >=16.14} dependencies: - semver: 7.6.1 + semver: 7.6.2 dev: false /lru-cache@5.1.1: @@ -5754,7 +5896,7 @@ packages: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} dependencies: - semver: 7.6.1 + semver: 7.6.2 dev: false /make-error@1.3.6: @@ -6117,7 +6259,7 @@ packages: resolution: {integrity: sha512-SQkEP4hmNWjlniS5zdnfIXTk1x7Ome85RDzHlTbBtzE97Gfwz/Ipw4v/Ryk20DWIy3yCNVLVlGKApCnmvYoJbA==} engines: {node: '>=10'} dependencies: - semver: 7.6.1 + semver: 7.6.2 dev: false /node-domexception@1.0.0: @@ -6789,8 +6931,8 @@ packages: hasBin: true dev: false - /prettier@3.2.5: - resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} hasBin: true dev: false @@ -6989,6 +7131,10 @@ packages: resolution: {integrity: sha512-5mqpskzvXDo5Vy29Vj8tH30a0+XBmY11aqWGoN/uB94UHRwndX2EuPvH+WtbqOYkrwAF718/lDo6U4CB1qSSqQ==} dev: false + /regenerator-runtime@0.14.1: + resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} + dev: false + /regex-not@1.0.2: resolution: {integrity: sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==} engines: {node: '>=0.10.0'} @@ -7808,6 +7954,16 @@ packages: yallist: 4.0.0 dev: false + /temporal-polyfill@0.2.5: + resolution: {integrity: sha512-ye47xp8Cb0nDguAhrrDS1JT1SzwEV9e26sSsrWzVu+yPZ7LzceEcH0i2gci9jWfOfSCCgM3Qv5nOYShVUUFUXA==} + dependencies: + temporal-spec: 0.2.4 + dev: false + + /temporal-spec@0.2.4: + resolution: {integrity: sha512-lDMFv4nKQrSjlkHKAlHVqKrBG4DyFfa9F74cmBZ3Iy3ed8yvWnlWSIdi4IKfSqwmazAohBNwiN64qGx4y5Q3IQ==} + dev: false + /terser-webpack-plugin@5.3.9(webpack@5.89.0): resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} engines: {node: '>= 10.13.0'} @@ -8304,7 +8460,7 @@ packages: dependencies: browserslist: 4.22.1 escalade: 3.1.1 - picocolors: 1.0.0 + picocolors: 1.0.1 dev: false /upper-case-first@2.0.2: @@ -8688,8 +8844,8 @@ packages: resolution: {integrity: sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==} dev: false - /yaml@2.4.2: - resolution: {integrity: sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==} + /yaml@2.4.5: + resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} engines: {node: '>= 14'} hasBin: true dev: false @@ -8761,7 +8917,7 @@ packages: dev: false file:projects/autorest.tgz(ts-node@10.9.1): - resolution: {integrity: sha512-zmT8H4TPYLbIAfpAIuWq2Fl5ElGAw/YDNepBCev66YxQpJQ764g2UyRcfWksA/YxHSIrpCALm0aKJ/t/TbfdNQ==, tarball: file:projects/autorest.tgz} + resolution: {integrity: sha512-fIgRGOmU1tuhRBEDMgEsCO3Y4uFGcZ9rhGulYqI42nwz1r/cL3Eqn8XYlFg/lU/3lrj26gcfYdejMhHEzZ4wkw==, tarball: file:projects/autorest.tgz} id: file:projects/autorest.tgz name: '@rush-temp/autorest' version: 0.0.0 @@ -8819,7 +8975,7 @@ packages: dev: false file:projects/cadl.tgz(ts-node@10.9.1)(webpack-cli@5.1.4)(webpack@5.89.0): - resolution: {integrity: sha512-av7i43qPFgwFiE7GHT5KJPa4d0FHlFTbx/y04efEF/83afKlgZ5HVMrFi7N/+lYpm1lHBMPZ0aPn4gK6m23EsQ==, tarball: file:projects/cadl.tgz} + resolution: {integrity: sha512-GO2iRP6pv3OR2QwYUE+tb7TP6nC+o6bv5ErnrT1vleUz33DH9Kz1Jb9obYFl+4GgtXAaT0fSvCUNgm3pA5ej+A==, tarball: file:projects/cadl.tgz} id: file:projects/cadl.tgz name: '@rush-temp/cadl' version: 0.0.0 @@ -8865,7 +9021,7 @@ packages: dev: false file:projects/codegen.tgz(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-3C8weoCa1kCOKeoOVrLzpSZo5dzm6rUBu6GpSekpssx7TPkHZP/9D2Zk7gaMX3IdLiJe9UHH8mMtNEUZM07QMQ==, tarball: file:projects/codegen.tgz} + resolution: {integrity: sha512-VovTenml5aFvdxVxeubTWgNxH95b97qPKSJfccqCog+K5N1MLKQ8OyLfHBIj1we1u2OWAwsUVfDAJDBRsZvCmQ==, tarball: file:projects/codegen.tgz} id: file:projects/codegen.tgz name: '@rush-temp/codegen' version: 0.0.0 @@ -8905,7 +9061,7 @@ packages: dev: false file:projects/codemodel.tgz(jest@29.7.0)(prettier@3.1.0): - resolution: {integrity: sha512-XU/8wU9Jo2eyvIFEVi22uh9YHNGK2X69RZ3fhSsdx9e6Ccp2ajm3QX++m7rV8b1FthMVeIn3FHFGIC7miuT2/Q==, tarball: file:projects/codemodel.tgz} + resolution: {integrity: sha512-eciCOrz1bsEKinYsI0hZwEsNX/tZZSbOwiI6BGzznOoVjf7gZ/bE9IhoVnRz6rQ192Qtrkz0IzsoAmCHNZQ1cw==, tarball: file:projects/codemodel.tgz} id: file:projects/codemodel.tgz name: '@rush-temp/codemodel' version: 0.0.0 @@ -8937,7 +9093,7 @@ packages: dev: false file:projects/common.tgz(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-dr0VbBpkYbGLe+5tnqwXZcU37okgm1NFocwBAyMKuwD8M7QRNEBSw+CWz04fKcO6bFUc4QZHbNQyM9RiDZs8pg==, tarball: file:projects/common.tgz} + resolution: {integrity: sha512-Dr5MV/1kdgzhxptcFbe1cla9YfQKIIPgZ+KjDwrrSlUGr8B4449Bq++2So07dJMQANDoyXjEPYVWoMAUB3YndA==, tarball: file:projects/common.tgz} id: file:projects/common.tgz name: '@rush-temp/common' version: 0.0.0 @@ -8970,7 +9126,7 @@ packages: dev: false file:projects/compare.tgz(prettier@3.1.0): - resolution: {integrity: sha512-TdSUwopQGGjakA2XILTfCpdkmPjMt0tg/U2uHdTsRPS3cBco9dE42Lzg2fQWuqo8kpP54tIAQ38w2mIg9IYiLw==, tarball: file:projects/compare.tgz} + resolution: {integrity: sha512-+V9SrJtEo0ilGKK7vr0UsFzAxl0GfRPB+MxBS8dl9KkR0/YTOIOgbY2nKDXPxsG5vkaFZ71hgDAwAbdqVOxhWg==, tarball: file:projects/compare.tgz} id: file:projects/compare.tgz name: '@rush-temp/compare' version: 0.0.0 @@ -9016,7 +9172,7 @@ packages: dev: false file:projects/configuration.tgz(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-QIvRtuY4X8HzqQc5WSZSnxTEMte4WOqY5CcI2VgvRWeuj9X/BpUwCvUJG7qQc7FhQ/KUlTLC4Qqfsy3DzD+/gA==, tarball: file:projects/configuration.tgz} + resolution: {integrity: sha512-refACiofNn9MEmuxOHQ+FlnM1QVGK7jt1n0cTpoK3vUp9A865OmlIPq6GPuSRw6WqGD1vJFX4IS+ng7+fJwGIA==, tarball: file:projects/configuration.tgz} id: file:projects/configuration.tgz name: '@rush-temp/configuration' version: 0.0.0 @@ -9057,7 +9213,7 @@ packages: dev: false file:projects/core.tgz(ts-node@10.9.1): - resolution: {integrity: sha512-zdm2pbBeVnYjQfB4bYGn+EDY8BISYjyHr1MIPfuq2kjXIdsQIeE0+rX5dBJ22dJWZrbwX8lv77SAsa5wTH5IAg==, tarball: file:projects/core.tgz} + resolution: {integrity: sha512-mJr9LRJtSDgwhpqjtwQWiIQMb3NCx8EbDVhf2vRK8uZAfx8R0nerrRziF7PMNbVV5wS4C8OAxI4DxCcQlSgcrg==, tarball: file:projects/core.tgz} id: file:projects/core.tgz name: '@rush-temp/core' version: 0.0.0 @@ -9122,7 +9278,7 @@ packages: dev: false file:projects/datastore.tgz(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-6/wu2bBUSvArdPUcvguk4iP5weUXdYt6po8oTByiu4MOKai2WH6T2elniSQVeNa8i0nspiwRrrKZfBA1LRYNfw==, tarball: file:projects/datastore.tgz} + resolution: {integrity: sha512-rw9TMnec+y4rClT4qX7eiU/MnaDL4sxvFHk5dFVa3n0W2aK8BSvOKfnYezMGXEQ6AcBwC1b3jOIQyGGl/y7LHg==, tarball: file:projects/datastore.tgz} id: file:projects/datastore.tgz name: '@rush-temp/datastore' version: 0.0.0 @@ -9163,7 +9319,7 @@ packages: dev: false file:projects/deduplication.tgz(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-OeYQ73RhcmGwZbW6Ctnuh+q4vIjgRR2880FOuFYSGSAia3/ROZGlAzQqZrHn2/vsOcYXRWZHXy/84HCRcSsIww==, tarball: file:projects/deduplication.tgz} + resolution: {integrity: sha512-v0Qz78yfJ+q4XeJE/VJp9JDKvIjRt264L4SrYTs+m85UIFpBl4XoP7sSUOk5yuTSeJlaEbaAQ5WRwJcnT+Q8vw==, tarball: file:projects/deduplication.tgz} id: file:projects/deduplication.tgz name: '@rush-temp/deduplication' version: 0.0.0 @@ -9197,7 +9353,7 @@ packages: dev: false file:projects/extension-base.tgz(jest@29.7.0)(prettier@3.1.0): - resolution: {integrity: sha512-tooRuR6QsOAqpII/MvkKbICjhyRxKFNPhT1y05CG5wlgrqTrwok6sYt0M6bGb73apeC0n7MZbPpWvSR7kQKdrQ==, tarball: file:projects/extension-base.tgz} + resolution: {integrity: sha512-MBEh+961tu6edrkkdRYUrNtAngts+uuekG3CzzYbIpmsTup2RzIk57euiWSh8zA0d3375iPVMwuHd6m6ORcaxA==, tarball: file:projects/extension-base.tgz} id: file:projects/extension-base.tgz name: '@rush-temp/extension-base' version: 0.0.0 @@ -9225,7 +9381,7 @@ packages: dev: false file:projects/extension.tgz(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-YXVy7zorVQE5y0/DwaZobVpgJKsMg8FN2/17G/IXxFH8qzEmEoC6gJPE26mf10HTI0noSGV3NCWCSyzsReEb7w==, tarball: file:projects/extension.tgz} + resolution: {integrity: sha512-BtX8trhAIukgMnSIDC0Ou3fn3IKV9dNyF4oVHAqvudItaLrJSLRfzg6wxyXabSFFSRrohWNSx3ZdnNRgJsRSWw==, tarball: file:projects/extension.tgz} id: file:projects/extension.tgz name: '@rush-temp/extension' version: 0.0.0 @@ -9270,7 +9426,7 @@ packages: dev: false file:projects/fixer.tgz(ts-node@10.9.1): - resolution: {integrity: sha512-ZyqP7Gub1FyIjYmv7IBtE8jOfK/dp5fTUcRo5WjMCldnLJlqLvZrteccdnVqeKd+TRi3PDnanrW1k6z+CekfQw==, tarball: file:projects/fixer.tgz} + resolution: {integrity: sha512-hgI1LGdKk3LtK5qtwPy1GcbgVQyo6jHY/+eKB7lgrg0YQHQtbOOx66NJcV9CYLuYl5eWEwHcI94wnGOy7ehkGA==, tarball: file:projects/fixer.tgz} id: file:projects/fixer.tgz name: '@rush-temp/fixer' version: 0.0.0 @@ -9314,7 +9470,7 @@ packages: dev: false file:projects/json.tgz(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-TWVpPxmRslYdAtw0qUukBOH0VgsqWuIxh7p1KWAysUa5kQ1OhGT8XqG5+ADb70+RgXFbHGYYN9iqjOAapp4QMw==, tarball: file:projects/json.tgz} + resolution: {integrity: sha512-8ePBJH0KNMHYtw84tnP/BDhe2srShAUkXkcow/UjMU5FbaGBouPvLYlYzqA2ZDDYIlsKDEEKxQu594xORCCFYw==, tarball: file:projects/json.tgz} id: file:projects/json.tgz name: '@rush-temp/json' version: 0.0.0 @@ -9343,7 +9499,7 @@ packages: dev: false file:projects/jsonschema.tgz(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-w+3HeMxVDFR0oXDmQegTFnxPoC15xfB20qKeGDyhs10ODDeBw3P5+sdokfFu/n/jzUWtyB71vrwaUOzxhr/fbA==, tarball: file:projects/jsonschema.tgz} + resolution: {integrity: sha512-TlSf9AgX2HVChk9Rc4GyUIPrZrOyrE91SPpFJlYKkK4FASq6oAEstJvpL/+GRBL8KRP2aY2JWQ8AyYEDbEDG0Q==, tarball: file:projects/jsonschema.tgz} id: file:projects/jsonschema.tgz name: '@rush-temp/jsonschema' version: 0.0.0 @@ -9372,7 +9528,7 @@ packages: dev: false file:projects/modelerfour.tgz(ts-node@10.9.1): - resolution: {integrity: sha512-6jJDUoekbhc7cEhjyadfzwunHkiOCehYPZh/QEEuOzzTJSixWUIle6ejSyptngSe8uxSsVpDJ/4QSTj6UvFoPw==, tarball: file:projects/modelerfour.tgz} + resolution: {integrity: sha512-yqvv8uLcXaCtMnHap9s3Ks9ozN6NLDmS8EzHhCP5XgKAQCnQoBuX2J64Kkt5WRdtuvIEJqDtx8kX/qKapZeQWg==, tarball: file:projects/modelerfour.tgz} id: file:projects/modelerfour.tgz name: '@rush-temp/modelerfour' version: 0.0.0 @@ -9423,7 +9579,7 @@ packages: dev: false file:projects/oai2-to-oai3.tgz(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-EmqXeZJWuoXi6p1c9Flme9Km7H1ISlOOEX1rMEhn/G14Fxe2BJujI8iheV/3eN7CyqwhdBr3Zko2CY77132LDQ==, tarball: file:projects/oai2-to-oai3.tgz} + resolution: {integrity: sha512-429l1k8VRbB/Qk1N0kCG+c70ZG5B2ixgF3RQCrm1dF6T0946z327MpAITNIfL0qtD5vC0jW3hzBasXPaMXc7Mw==, tarball: file:projects/oai2-to-oai3.tgz} id: file:projects/oai2-to-oai3.tgz name: '@rush-temp/oai2-to-oai3' version: 0.0.0 @@ -9460,15 +9616,15 @@ packages: dev: false file:projects/openapi-to-typespec.tgz(jest@29.7.0): - resolution: {integrity: sha512-9YYhU9b3KOm8wKYwa3zFQBE5tKLSPCSQ1+IW63Z7xEMJ4T8BIo25l0Z3dhz0pwMFx8NtftauMplKNimQVjh0UQ==, tarball: file:projects/openapi-to-typespec.tgz} + resolution: {integrity: sha512-28nKqU7UU1PglD2CKC3x/TLVCfBuqh49TKi8tvA6RXvJ8IzaYBMAVy0PEYv7roph6UBtBB+suT7SkGOWZBRARQ==, tarball: file:projects/openapi-to-typespec.tgz} id: file:projects/openapi-to-typespec.tgz name: '@rush-temp/openapi-to-typespec' version: 0.0.0 dependencies: - '@azure-tools/typespec-autorest': 0.43.0(@azure-tools/typespec-azure-core@0.43.0)(@azure-tools/typespec-azure-resource-manager@0.43.0)(@azure-tools/typespec-client-generator-core@0.43.0)(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/openapi@0.57.0)(@typespec/rest@0.57.0)(@typespec/versioning@0.57.0) - '@azure-tools/typespec-azure-core': 0.43.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/rest@0.57.0) - '@azure-tools/typespec-azure-resource-manager': 0.43.0(@azure-tools/typespec-azure-core@0.43.0)(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/openapi@0.57.0)(@typespec/rest@0.57.0)(@typespec/versioning@0.57.0) - '@azure-tools/typespec-client-generator-core': 0.43.0(@azure-tools/typespec-azure-core@0.43.0)(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/rest@0.57.0)(@typespec/versioning@0.57.0) + '@azure-tools/typespec-autorest': 0.44.1(@azure-tools/typespec-azure-core@0.44.0)(@azure-tools/typespec-azure-resource-manager@0.44.0)(@azure-tools/typespec-client-generator-core@0.44.3)(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/rest@0.58.0)(@typespec/versioning@0.58.0) + '@azure-tools/typespec-azure-core': 0.44.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/rest@0.58.0) + '@azure-tools/typespec-azure-resource-manager': 0.44.0(@azure-tools/typespec-azure-core@0.44.0)(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/rest@0.58.0)(@typespec/versioning@0.58.0) + '@azure-tools/typespec-client-generator-core': 0.44.3(@azure-tools/typespec-azure-core@0.44.0)(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/rest@0.58.0)(@typespec/versioning@0.58.0) '@types/fs-extra': 9.0.13 '@types/lodash': 4.14.201 '@types/node': 20.9.0 @@ -9477,13 +9633,13 @@ packages: '@types/webpack': 5.28.5(webpack-cli@5.1.4) '@typescript-eslint/eslint-plugin': 6.11.0(@typescript-eslint/parser@6.11.0)(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/parser': 6.11.0(eslint@8.53.0)(typescript@5.2.2) - '@typespec/compiler': 0.57.0 - '@typespec/http': 0.57.0(@typespec/compiler@0.57.0) - '@typespec/openapi': 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0) - '@typespec/openapi3': 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0)(@typespec/openapi@0.57.0)(@typespec/versioning@0.57.0) - '@typespec/prettier-plugin-typespec': 0.57.0 - '@typespec/rest': 0.57.0(@typespec/compiler@0.57.0)(@typespec/http@0.57.0) - '@typespec/versioning': 0.57.0(@typespec/compiler@0.57.0) + '@typespec/compiler': 0.58.1 + '@typespec/http': 0.58.0(@typespec/compiler@0.58.1) + '@typespec/openapi': 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0) + '@typespec/openapi3': 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0)(@typespec/openapi@0.58.0)(@typespec/versioning@0.58.0) + '@typespec/prettier-plugin-typespec': 0.58.0 + '@typespec/rest': 0.58.0(@typespec/compiler@0.58.1)(@typespec/http@0.58.0) + '@typespec/versioning': 0.58.0(@typespec/compiler@0.58.1) chalk: 4.1.2 change-case: 5.0.2 change-case-all: 2.1.0 @@ -9511,6 +9667,7 @@ packages: - esbuild - eslint-config-prettier - jest + - openapi-types - supports-color - uglify-js - webpack-bundle-analyzer @@ -9518,7 +9675,7 @@ packages: dev: false file:projects/openapi.tgz(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-jeOfewor/wxa+HdeUSgWjhsV4FbhMs9QX8uxqJxh7KZvTBxcvw1XhQkrriRoSEXnBXmHDuAvxKG6gEImlL6c7w==, tarball: file:projects/openapi.tgz} + resolution: {integrity: sha512-HE2/rfH9QyCccaXSR+AEAe/wGVAe/l37tqzQYSU1sFWE+u4MkZA1p7IoBgXOit6m8qOi9HGYFbm4TlpkPLKUrQ==, tarball: file:projects/openapi.tgz} id: file:projects/openapi.tgz name: '@rush-temp/openapi' version: 0.0.0 @@ -9547,13 +9704,13 @@ packages: dev: false file:projects/schemas.tgz: - resolution: {integrity: sha512-R4SNYE56Q0TOMYcT8gSTZIInxE9vVJH1k54SR8Ksvg8HNkzG+Pko1NIxb8zpWFB74VEmx3TDaruHnodgJjUrvQ==, tarball: file:projects/schemas.tgz} + resolution: {integrity: sha512-aeHJHwq6RJNeECiY4g86CukjYKRNg8eHFoxQVmU/aCtNct/TMpfrAc19FVV4JyuNRKtXdFrVNjO2hUJxZXQSQA==, tarball: file:projects/schemas.tgz} name: '@rush-temp/schemas' version: 0.0.0 dev: false file:projects/system-requirements.tgz(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-z9xJ+0SQtAhIFr9wve8giTZZxNxdWfI6JxRdXLqEpRLZHHakvBWugiaIe/sfMbYBz+2tFyvHVmI1g6MqA5w1EA==, tarball: file:projects/system-requirements.tgz} + resolution: {integrity: sha512-2/b/vgr/a7FOjk7eTBfvo9o+w4QywiBeIgIHzYhVYTJcy5Huxm1ce0sNnId9Bay+/MrR8aw3lvRDlPUrWdbJUQ==, tarball: file:projects/system-requirements.tgz} id: file:projects/system-requirements.tgz name: '@rush-temp/system-requirements' version: 0.0.0 @@ -9588,7 +9745,7 @@ packages: dev: false file:projects/test-public-packages.tgz(prettier@3.1.0): - resolution: {integrity: sha512-4kAwPf9RR49MJI4A3gfHMTkVAOcI+r5jV9HKcXAQzs0sr5z/XZbsjTT0gOIu2uLz1KvrVZxxmx/5m1scKzFQgg==, tarball: file:projects/test-public-packages.tgz} + resolution: {integrity: sha512-e/CJlHEX7+rfz3fOY70mxIN6ynrQSfG8XYgLfT0dydzZ1YbV/IeloiF4OKNr5ckxt6Hx8wrTg6ULJTEv4uImXw==, tarball: file:projects/test-public-packages.tgz} id: file:projects/test-public-packages.tgz name: '@rush-temp/test-public-packages' version: 0.0.0 @@ -9609,7 +9766,7 @@ packages: dev: false file:projects/test-utils.tgz(@types/node@20.9.0)(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-PjGDVMkoTdQpgj3j0MSrYPkMoilJ3rXaramucEQu/DXD2iUlUqLbATiDxEeOeeJcbyChAWoj8U/ZPV0UG3JdZg==, tarball: file:projects/test-utils.tgz} + resolution: {integrity: sha512-tit5MjyO3D/0svfHHHE79slcHCUmLc+cyL2DJ+jLP/LFZ1FCDGzyNhW04+fJbCd0LIM05efwORznprhNtesO9A==, tarball: file:projects/test-utils.tgz} id: file:projects/test-utils.tgz name: '@rush-temp/test-utils' version: 0.0.0 @@ -9636,7 +9793,7 @@ packages: dev: false file:projects/yaml.tgz(prettier@3.1.0)(ts-node@10.9.1): - resolution: {integrity: sha512-BKdiJVcGwcy3siN8gBZEoV3uGhFsHHp2cz7xx1bhy7yUgO8mU1utB0CClwHw575UMrMfxJ/2/tOwWZZ6YRzNVA==, tarball: file:projects/yaml.tgz} + resolution: {integrity: sha512-H8/9GzwHHWTFw9aj6TqJWA8Hnb0a2ZwNMDALfKiPxzqK8qkqA7ddM9XXKwrK9Vn4Hfry5Lf80q59WoI5KkzaJw==, tarball: file:projects/yaml.tgz} id: file:projects/yaml.tgz name: '@rush-temp/yaml' version: 0.0.0 diff --git a/packages/extensions/openapi-to-typespec/package.json b/packages/extensions/openapi-to-typespec/package.json index 7ca2ab8fc..d4c0adaa6 100644 --- a/packages/extensions/openapi-to-typespec/package.json +++ b/packages/extensions/openapi-to-typespec/package.json @@ -42,16 +42,16 @@ "@azure-tools/codegen": "~2.10.0", "@autorest/extension-base": "~3.6.0", "@autorest/codemodel": "~4.20.0", - "@typespec/compiler": "^0.57.0", - "@typespec/rest": "^0.57.0", - "@typespec/http": "^0.57.0", - "@typespec/versioning": "^0.57.0", - "@typespec/prettier-plugin-typespec": "^0.57.0", - "@azure-tools/typespec-azure-core": "^0.43.0", - "@azure-tools/typespec-autorest": "^0.43.0", - "@azure-tools/typespec-azure-resource-manager": "^0.43.0", - "@typespec/openapi": "^0.57.0", - "@typespec/openapi3": "^0.57.0", + "@typespec/compiler": "^0.58.0", + "@typespec/rest": "^0.58.0", + "@typespec/http": "^0.58.0", + "@typespec/versioning": "^0.58.0", + "@typespec/prettier-plugin-typespec": "^0.58.0", + "@azure-tools/typespec-azure-core": "^0.44.0", + "@azure-tools/typespec-autorest": "^0.44.0", + "@azure-tools/typespec-azure-resource-manager": "^0.44.0", + "@typespec/openapi": "^0.58.0", + "@typespec/openapi3": "^0.58.0", "prettier": "~3.1.0", "lodash": "~4.17.20", "pluralize": "^8.0.0", @@ -68,8 +68,8 @@ "fs-extra": "^10.1.0", "@types/fs-extra": "^9.0.13", "chalk": "^4.1.0", - "@azure-tools/typespec-autorest": "^0.43.0", - "@azure-tools/typespec-client-generator-core": "^0.43.0", + "@azure-tools/typespec-autorest": "^0.44.0", + "@azure-tools/typespec-client-generator-core": "^0.44.0", "webpack-cli": "~5.1.4", "webpack": "~5.89.0", "@typescript-eslint/eslint-plugin": "^6.11.0", diff --git a/packages/extensions/openapi-to-typespec/src/emiters/emit-typespec-config.ts b/packages/extensions/openapi-to-typespec/src/emiters/emit-typespec-config.ts index f657addc8..c8b20e9f4 100644 --- a/packages/extensions/openapi-to-typespec/src/emiters/emit-typespec-config.ts +++ b/packages/extensions/openapi-to-typespec/src/emiters/emit-typespec-config.ts @@ -6,7 +6,7 @@ import { formatFile } from "../utils/format"; export async function emitTypespecConfig(filePath: string, programDetails: TypespecProgram): Promise { const session = getSession(); - const { isArm } = getOptions(); + const { isArm, isFullCompatible } = getOptions(); let content = ` emit: - "@azure-tools/typespec-autorest" @@ -43,7 +43,12 @@ options: emitter-output-dir: "{project-root}/.." azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/${swaggerName}" - examples-directory: "{project-root}/examples" + examples-directory: "{project-root}/examples"${ + isFullCompatible + ? ` + arm-resource-flattening: true` + : "" + } linter: extends: - "@azure-tools/typespec-azure-resource-manager/all" diff --git a/packages/extensions/openapi-to-typespec/src/generate/generate-arm-resource.ts b/packages/extensions/openapi-to-typespec/src/generate/generate-arm-resource.ts index 207db96a3..dd69ec681 100644 --- a/packages/extensions/openapi-to-typespec/src/generate/generate-arm-resource.ts +++ b/packages/extensions/openapi-to-typespec/src/generate/generate-arm-resource.ts @@ -36,8 +36,6 @@ export function generateArmResource(resource: TspArmResource): string { } function generateArmResourceModel(resource: TspArmResource): string { - const { isFullCompatible } = getOptions(); - let definitions: string[] = []; for (const fixme of resource.fixMe ?? []) { @@ -58,57 +56,16 @@ function generateArmResourceModel(resource: TspArmResource): string { definitions.push(`@parentResource(${resource.locationParent})`); } - if ( - !isFullCompatible || - (getArmCommonTypeVersion() && - !resource.propertiesPropertyRequired && - resource.propertiesPropertyVisibility.length === 2 && - resource.propertiesPropertyVisibility.includes("read") && - resource.propertiesPropertyVisibility.includes("create")) - ) { - definitions.push( - `model ${resource.name} is Azure.ResourceManager.${resource.resourceKind}<${resource.propertiesModelName}> {`, - ); + definitions.push( + `model ${resource.name} is Azure.ResourceManager.${resource.resourceKind}<${resource.propertiesModelName}${ + resource.propertiesPropertyRequired ? ", false" : "" + }> {`, + ); - if (resource.keyExpression) { - definitions.push(`${resource.keyExpression}`); - } - definitions = [...definitions, ...getModelPropertiesDeclarations(resource.properties)]; - } else { - definitions.push( - `#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility"`, - ); - definitions.push( - `#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility"`, - ); - definitions.push(`@includeInapplicableMetadataInPayload(false)`); - - if (!getArmCommonTypeVersion()) { - if (resource.baseModelName) { - definitions.push(`model ${resource.name} extends ${resource.baseModelName} {`); - } else { - definitions.push(`model ${resource.name} {`); - } - } else { - definitions.push(`@Azure.ResourceManager.Private.armResourceInternal(${resource.propertiesModelName})`); - definitions.push(`model ${resource.name} extends Foundations.${resource.resourceKind} {`); - } - - if (resource.keyExpression) { - definitions.push(`${resource.keyExpression}`); - } - definitions = [...definitions, ...getModelPropertiesDeclarations(resource.properties)]; - - const propertyDoc = generateDocs({ doc: resource.propertiesPropertyDescription }); - propertyDoc && definitions.push(propertyDoc); - - definitions.push(`@extension("x-ms-client-flatten", true)`); - if (resource.propertiesPropertyVisibility.length > 0) { - definitions.push(`@visibility("${resource.propertiesPropertyVisibility.join(",")}")`); - } - - definitions.push(`properties${resource.propertiesPropertyRequired ? "" : "?"}: ${resource.propertiesModelName}`); + if (resource.keyExpression) { + definitions.push(`${resource.keyExpression}`); } + definitions = [...definitions, ...getModelPropertiesDeclarations(resource.properties)]; for (const p of resource.optionalStandardProperties) { definitions.push(`\n...${p}`); diff --git a/packages/extensions/openapi-to-typespec/src/generate/generate-client.ts b/packages/extensions/openapi-to-typespec/src/generate/generate-client.ts index afba783d6..bc18ae9df 100644 --- a/packages/extensions/openapi-to-typespec/src/generate/generate-client.ts +++ b/packages/extensions/openapi-to-typespec/src/generate/generate-client.ts @@ -63,5 +63,11 @@ export function generateArmResourceClientDecorator(resource: TspArmResource): st decorators && definitions.push(decorators); } + const propertyDecorators = generateAugmentedDecorators( + `${resource.name}.properties`, + resource.propertiesPropertyClientDecorator, + ); + propertyDecorators && definitions.push(propertyDecorators); + return definitions.join("\n"); } diff --git a/packages/extensions/openapi-to-typespec/src/interfaces.ts b/packages/extensions/openapi-to-typespec/src/interfaces.ts index b41d0ecab..47c6e54af 100644 --- a/packages/extensions/openapi-to-typespec/src/interfaces.ts +++ b/packages/extensions/openapi-to-typespec/src/interfaces.ts @@ -263,8 +263,8 @@ export interface TspArmResource extends TypespecObject { keyExpression: string | undefined; propertiesModelName: string; propertiesPropertyRequired: boolean; - propertiesPropertyVisibility: string[]; propertiesPropertyDescription: string; + propertiesPropertyClientDecorator: TypespecDecorator[]; resourceParent?: TspArmResource; resourceOperations: TspArmResourceOperation[]; normalOperations: TypespecOperation[]; diff --git a/packages/extensions/openapi-to-typespec/src/transforms/transform-arm-resources.ts b/packages/extensions/openapi-to-typespec/src/transforms/transform-arm-resources.ts index aa776db6e..6a970e461 100644 --- a/packages/extensions/openapi-to-typespec/src/transforms/transform-arm-resources.ts +++ b/packages/extensions/openapi-to-typespec/src/transforms/transform-arm-resources.ts @@ -1,4 +1,4 @@ -import { Operation, Parameter, Response, SchemaResponse, SchemaType } from "@autorest/codemodel"; +import { Operation, Parameter, Property, Response, SchemaResponse, SchemaType } from "@autorest/codemodel"; import _ from "lodash"; import pluralize, { singular } from "pluralize"; import { getArmCommonTypeVersion, getSession } from "../autorest-session"; @@ -54,6 +54,7 @@ function addGeneratedResourceObjectIfNotExits(name: string, mapping: string) { } export function transformTspArmResource(schema: ArmResourceSchema): TspArmResource { + const { isFullCompatible } = getOptions(); const fixMe: string[] = []; if (!getSession().configuration["namespace"]) { @@ -80,14 +81,12 @@ export function transformTspArmResource(schema: ArmResourceSchema): TspArmResour const propertiesModelSchema = propertiesModel?.schema; let propertiesModelName = propertiesModelSchema?.language.default.name; let propertiesPropertyRequired = false; - let propertiesPropertyVisibility = ["read", "create"]; let propertiesPropertyDescription = ""; if (propertiesModelSchema?.type === SchemaType.Dictionary) { propertiesModelName = "Record"; } else if (propertiesModelSchema?.type === SchemaType.Object) { propertiesPropertyRequired = propertiesModel?.required ?? false; - propertiesPropertyVisibility = propertiesModel?.extensions?.["x-ms-mutability"] ?? []; propertiesPropertyDescription = propertiesModel?.language.default.description ?? ""; } @@ -120,13 +119,29 @@ export function transformTspArmResource(schema: ArmResourceSchema): TspArmResour const keyProperty = buildKeyProperty(schema); const properties = [...getOtherProperties(schema, !getArmCommonTypeVersion())]; let keyExpression, augmentDecorators; - if (keyProperty.name === "name" && keyProperty.type === "string") { + if (keyProperty.name === "name") { keyExpression = buildKeyExpression(schema, keyProperty); augmentDecorators = buildKeyAugmentDecorators(schema, keyProperty); } else { properties.unshift(keyProperty); } + if (propertiesModel) { + if (augmentDecorators === undefined) augmentDecorators = buildPropertiesAugmentDecorators(schema, propertiesModel); + else augmentDecorators.push(...buildPropertiesAugmentDecorators(schema, propertiesModel)); + } + + const propertiesPropertyClientDecorator = []; + if (isFullCompatible && propertiesModel?.extensions?.["x-ms-client-flatten"]) { + propertiesPropertyClientDecorator.push({ + name: "flattenProperty", + module: "@azure-tools/typespec-client-generator-core", + namespace: "Azure.ClientGenerator.Core", + suppressionCode: "deprecated", + suppressionMessage: "@flattenProperty decorator is not recommended to use.", + }); + } + return { fixMe, resourceKind: getResourceKind(schema), @@ -138,8 +153,8 @@ export function transformTspArmResource(schema: ArmResourceSchema): TspArmResour resourceParent: getParentResource(schema), propertiesModelName, propertiesPropertyRequired, - propertiesPropertyVisibility, propertiesPropertyDescription, + propertiesPropertyClientDecorator, doc: schema.language.default.description, decorators, clientDecorators, @@ -844,6 +859,7 @@ function buildKeyExpression(schema: ArmResourceSchema, keyProperty: TypespecObje ${keyName ? `, KeyName = "${keyName}"` : ""} ${segmentName ? `, SegmentName = "${segmentName}"` : ""}, NamePattern = ${namePattern ? `"${namePattern}"` : `""`} + ${keyProperty.type !== "string" ? `, Type = ${keyProperty.type}` : ""} >`; } @@ -865,6 +881,16 @@ function buildKeyAugmentDecorators( }); } +function buildPropertiesAugmentDecorators(schema: ArmResourceSchema, propertiesModel: Property): TypespecDecorator[] { + return [ + { + name: "doc", + target: `${schema.resourceMetadata.SwaggerModelName}.properties`, + arguments: [generateDocsContent({ doc: propertiesModel?.language.default.description })], + }, + ]; +} + function buildKeyProperty(schema: ArmResourceSchema): TypespecObjectProperty { let parameter; if (!schema.resourceMetadata.IsSingletonResource) { diff --git a/packages/extensions/openapi-to-typespec/src/utils/decorators.ts b/packages/extensions/openapi-to-typespec/src/utils/decorators.ts index 608027dfb..dc73b7978 100644 --- a/packages/extensions/openapi-to-typespec/src/utils/decorators.ts +++ b/packages/extensions/openapi-to-typespec/src/utils/decorators.ts @@ -12,6 +12,7 @@ import { isNumberSchema, } from "@autorest/codemodel"; import { TypespecDecorator, DecoratorArgument } from "../interfaces"; +import { getOptions } from "../options"; import { createCSharpNameDecorator } from "../pretransforms/rename-pretransform"; import { getOwnDiscriminator } from "./discriminator"; import { isSealedChoiceSchema, isStringSchema } from "./schemas"; @@ -68,6 +69,7 @@ export function getModelClientDecorators(model: ObjectSchema): TypespecDecorator } export function getPropertyDecorators(element: Property | Parameter): TypespecDecorator[] { + const { isFullCompatible } = getOptions(); const decorators: TypespecDecorator[] = []; const paging = element.language.default.paging ?? {}; @@ -158,13 +160,23 @@ export function getPropertyDecorators(element: Property | Parameter): TypespecDe }); } + if (element.extensions?.["x-ms-client-flatten"] && isFullCompatible) { + decorators.push({ + name: "extension", + module: "@typespec/openapi", + namespace: "TypeSpec.OpenAPI", + arguments: [{ value: `"x-ms-client-flatten"` }, { value: "true" }], + }); + } + return decorators; } export function getPropertyClientDecorators(element: Property | Parameter): TypespecDecorator[] { + const { isFullCompatible } = getOptions(); const decorators: TypespecDecorator[] = []; - if (element.extensions?.["x-ms-client-flatten"]) { + if (element.extensions?.["x-ms-client-flatten"] && isFullCompatible) { decorators.push({ name: "flattenProperty", module: "@azure-tools/typespec-client-generator-core", diff --git a/packages/extensions/openapi-to-typespec/src/utils/imports.ts b/packages/extensions/openapi-to-typespec/src/utils/imports.ts index d4ec4d2d9..c532f52c5 100644 --- a/packages/extensions/openapi-to-typespec/src/utils/imports.ts +++ b/packages/extensions/openapi-to-typespec/src/utils/imports.ts @@ -77,6 +77,7 @@ export function getClientImports(program: TypespecProgram) { for (const op of resource.normalOperations) { addImports(op.clientDecorators); } + addImports(resource.propertiesPropertyClientDecorator); } return { diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataConnector.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataConnector.tsp index d483bc905..e4d641a08 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataConnector.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataConnector.tsp @@ -14,25 +14,15 @@ namespace Azure.ResourceManager.AgFoodPlatform; /** * DataConnector Model. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(DataManagerForAgriculture) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(DataConnectorProperties) -model DataConnector extends Foundations.ProxyResource { +model DataConnector + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = DataConnector, KeyName = "dataConnectorName", SegmentName = "dataConnectors", NamePattern = "" >; - - /** - * DataConnector Properties. - */ - @extension("x-ms-client-flatten", true) - properties: DataConnectorProperties; - ...Azure.ResourceManager.EntityTagProperty; } @@ -85,6 +75,7 @@ interface DataConnectors { @@maxLength(DataConnector.name, 63); @@minLength(DataConnector.name, 1); @@doc(DataConnector.name, "Connector name."); +@@doc(DataConnector.properties, "DataConnector Properties."); @@encodedName(DataConnectors.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgriculture.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgriculture.tsp index bfb8e74f3..434679293 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgriculture.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgriculture.tsp @@ -13,26 +13,14 @@ namespace Azure.ResourceManager.AgFoodPlatform; /** * Data Manager For Agriculture ARM Resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - DataManagerForAgricultureProperties -) -model DataManagerForAgriculture extends Foundations.TrackedResource { +model DataManagerForAgriculture + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = DataManagerForAgriculture, KeyName = "dataManagerForAgricultureResourceName", SegmentName = "farmBeats", NamePattern = "^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$" >; - - /** - * Data Manager For Agriculture ARM Resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: DataManagerForAgricultureProperties; - ...Azure.ResourceManager.ManagedServiceIdentityProperty; } @@ -111,6 +99,9 @@ interface DataManagerForAgricultures { @@doc(DataManagerForAgriculture.name, "DataManagerForAgriculture resource name." ); +@@doc(DataManagerForAgriculture.properties, + "Data Manager For Agriculture ARM Resource properties." +); @@encodedName(DataManagerForAgricultures.createOrUpdate::parameters.resource, "application/json", "request" diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgricultureExtension.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgricultureExtension.tsp index 675c62e99..1b75ee381 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgricultureExtension.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgricultureExtension.tsp @@ -13,26 +13,15 @@ namespace Azure.ResourceManager.AgFoodPlatform; /** * DataManagerForAgriculture extension resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @tenantResource -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - DataManagerForAgricultureExtensionProperties -) -model DataManagerForAgricultureExtension extends Foundations.ProxyResource { +model DataManagerForAgricultureExtension + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = DataManagerForAgricultureExtension, KeyName = "dataManagerForAgricultureExtensionId", SegmentName = "farmBeatsExtensionDefinitions", NamePattern = "^[a-zA-Z]{3,50}[.][a-zA-Z]{3,100}$" >; - - /** - * DataManagerForAgricultureExtension properties. - */ - @extension("x-ms-client-flatten", true) - properties?: DataManagerForAgricultureExtensionProperties; } @armResourceOperations @@ -103,3 +92,6 @@ interface DataManagerForAgricultureExtensions { @@doc(DataManagerForAgricultureExtension.name, "dataManagerForAgricultureExtensionId to be queried." ); +@@doc(DataManagerForAgricultureExtension.properties, + "DataManagerForAgricultureExtension properties." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgricultureSolution.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgricultureSolution.tsp index 28ff96d3f..92f4afb2c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgricultureSolution.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/DataManagerForAgricultureSolution.tsp @@ -13,26 +13,15 @@ namespace Azure.ResourceManager.AgFoodPlatform; /** * DataManagerForAgriculture solution resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @tenantResource -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - DataManagerForAgricultureSolutionProperties -) -model DataManagerForAgricultureSolution extends Foundations.ProxyResource { +model DataManagerForAgricultureSolution + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = DataManagerForAgricultureSolution, KeyName = "dataManagerForAgricultureSolutionId", SegmentName = "farmBeatsSolutionDefinitions", NamePattern = "^[a-zA-Z]{3,50}[.][a-zA-Z]{3,100}$" >; - - /** - * DataManagerForAgricultureSolution properties. - */ - @extension("x-ms-client-flatten", true) - properties?: DataManagerForAgricultureSolutionProperties; } @armResourceOperations @@ -87,3 +76,6 @@ interface DataManagerForAgricultureSolutions { @@doc(DataManagerForAgricultureSolution.name, "dataManagerForAgricultureSolutionId to be queried." ); +@@doc(DataManagerForAgricultureSolution.properties, + "DataManagerForAgricultureSolution properties." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Extension.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Extension.tsp index 5f4b07311..eeb85127a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Extension.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Extension.tsp @@ -14,25 +14,14 @@ namespace Azure.ResourceManager.AgFoodPlatform; /** * Extension resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(DataManagerForAgriculture) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(ExtensionProperties) -model Extension extends Foundations.ProxyResource { +model Extension is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = Extension, KeyName = "extensionId", SegmentName = "extensions", NamePattern = "" >; - - /** - * Extension resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: ExtensionProperties; - ...Azure.ResourceManager.EntityTagProperty; } @@ -101,6 +90,7 @@ interface Extensions { } @@doc(Extension.name, "Id of extension resource."); +@@doc(Extension.properties, "Extension resource properties."); @@encodedName(Extensions.createOrUpdate::parameters.resource, "application/json", "requestBody" diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/PrivateEndpointConnection.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/PrivateEndpointConnection.tsp index 9167476b7..4083b3d31 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/PrivateEndpointConnection.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/PrivateEndpointConnection.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.AgFoodPlatform; /** * The private endpoint connection resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(DataManagerForAgriculture) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - PrivateEndpointConnectionProperties -) -model PrivateEndpointConnection extends Foundations.ProxyResource { +model PrivateEndpointConnection + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = PrivateEndpointConnection, KeyName = "privateEndpointConnectionName", SegmentName = "privateEndpointConnections", NamePattern = "" >; - - /** - * Resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: PrivateEndpointConnectionProperties; } @armResourceOperations @@ -65,6 +54,7 @@ interface PrivateEndpointConnections { } @@doc(PrivateEndpointConnection.name, "Private endpoint connection name."); +@@doc(PrivateEndpointConnection.properties, "Resource properties."); @@encodedName(PrivateEndpointConnections.createOrUpdate::parameters.resource, "application/json", "request" diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/PrivateLinkResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/PrivateLinkResource.tsp index 597677907..678d79999 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/PrivateLinkResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/PrivateLinkResource.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.AgFoodPlatform; /** * A private link resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(DataManagerForAgriculture) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - PrivateLinkResourceProperties -) -model PrivateLinkResource extends Foundations.ProxyResource { +model PrivateLinkResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = PrivateLinkResource, KeyName = "subResourceName", SegmentName = "privateLinkResources", NamePattern = "" >; - - /** - * Resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: PrivateLinkResourceProperties; } @armResourceOperations @@ -52,3 +41,4 @@ interface PrivateLinkResources { } @@doc(PrivateLinkResource.name, "Sub resource name."); +@@doc(PrivateLinkResource.properties, "Resource properties."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Solution.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Solution.tsp index b40a59cec..59bb35a00 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Solution.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/Solution.tsp @@ -14,25 +14,14 @@ namespace Azure.ResourceManager.AgFoodPlatform; /** * Solution resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(DataManagerForAgriculture) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(SolutionProperties) -model Solution extends Foundations.ProxyResource { +model Solution is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = Solution, KeyName = "solutionId", SegmentName = "solutions", NamePattern = "^[a-zA-Z]{3,50}[.][a-zA-Z]{3,100}$" >; - - /** - * Solution resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: SolutionProperties; - ...Azure.ResourceManager.EntityTagProperty; } @@ -153,6 +142,7 @@ interface Solutions { } @@doc(Solution.name, "SolutionId for Data Manager For Agriculture Resource."); +@@doc(Solution.properties, "Solution resource properties."); @@encodedName(Solutions.createOrUpdate::parameters.resource, "application/json", "requestBody" diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/client.tsp similarity index 51% rename from packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/client.tsp rename to packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/client.tsp index fe3642005..60d879f6b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/client.tsp @@ -2,13 +2,16 @@ import "./main.tsp"; import "@azure-tools/typespec-client-generator-core"; using Azure.ClientGenerator.Core; -using Microsoft.AzureSphere; +using Azure.ResourceManager.AgFoodPlatform; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." -@@flattenProperty(ProductUpdate.properties); +@@flattenProperty(DataManagerForAgriculture.properties); #suppress "deprecated" "@flattenProperty decorator is not recommended to use." -@@flattenProperty(DeviceGroupUpdate.properties); +@@flattenProperty(PrivateEndpointConnection.properties); #suppress "deprecated" "@flattenProperty decorator is not recommended to use." -@@flattenProperty(DeviceUpdate.properties); +@@flattenProperty(Extension.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(PrivateLinkResource.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/tspconfig.yaml index cf72afecd..4d8081ad3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-agrifood/tsp-output/tspconfig.yaml @@ -8,6 +8,7 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/agfood.json" examples-directory: "{project-root}/examples" + arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-resource-manager/all" diff --git a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/Alert.tsp b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/Alert.tsp index ca7c50518..02600fe65 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/Alert.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/Alert.tsp @@ -13,24 +13,14 @@ namespace Azure.ResourceManager.AlertsManagement; /** * An alert created in alert management service. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @subscriptionResource -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(AlertProperties) -model Alert extends Foundations.ProxyResource { +model Alert is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = Alert, KeyName = "alertId", SegmentName = "alerts", NamePattern = "" >; - - /** - * Alert property bag - */ - @extension("x-ms-client-flatten", true) - properties?: AlertProperties; } @armResourceOperations @@ -191,6 +181,7 @@ interface Alerts { } @@doc(Alert.name, "Unique ID of an alert instance."); +@@doc(Alert.properties, "Alert property bag"); @@encodedName(Alerts.changeState::parameters.body, "application/json", "comment" diff --git a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/AlertProcessingRule.tsp b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/AlertProcessingRule.tsp index db761f973..7a8d8ed2f 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/AlertProcessingRule.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/AlertProcessingRule.tsp @@ -13,25 +13,14 @@ namespace Azure.ResourceManager.AlertsManagement; /** * Alert processing rule object containing target scopes, conditions and scheduling logic. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - AlertProcessingRuleProperties -) -model AlertProcessingRule extends Foundations.TrackedResource { +model AlertProcessingRule + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = AlertProcessingRule, KeyName = "alertProcessingRuleName", SegmentName = "actionRules", NamePattern = "" >; - - /** - * Alert processing rule properties. - */ - @extension("x-ms-client-flatten", true) - properties?: AlertProcessingRuleProperties; } @armResourceOperations @@ -74,6 +63,7 @@ interface AlertProcessingRules { @@doc(AlertProcessingRule.name, "The name of the alert processing rule that needs to be fetched." ); +@@doc(AlertProcessingRule.properties, "Alert processing rule properties."); @@encodedName(AlertProcessingRules.createOrUpdate::parameters.resource, "application/json", "alertProcessingRule" diff --git a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/SmartGroup.tsp b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/SmartGroup.tsp index a8fc56ab3..8e20c9567 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/SmartGroup.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/SmartGroup.tsp @@ -13,24 +13,14 @@ namespace Azure.ResourceManager.AlertsManagement; /** * Set of related alerts grouped together smartly by AMS. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @subscriptionResource -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(SmartGroupProperties) -model SmartGroup extends Foundations.ProxyResource { +model SmartGroup is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = SmartGroup, KeyName = "smartGroupId", SegmentName = "smartGroups", NamePattern = "" >; - - /** - * Properties of smart group. - */ - @extension("x-ms-client-flatten", true) - properties?: SmartGroupProperties; } @armResourceOperations @@ -155,3 +145,4 @@ interface SmartGroups { } @@doc(SmartGroup.name, "Smart group unique id. "); +@@doc(SmartGroup.properties, "Properties of smart group."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/client.tsp index 7757d58d1..3b093b01c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/client.tsp @@ -6,3 +6,6 @@ using Azure.ResourceManager.AlertsManagement; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(PatchObject.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(SmartGroup.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/models.tsp index 94eaa7681..5fac4946c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/models.tsp @@ -1,9 +1,11 @@ import "@typespec/rest"; import "@typespec/http"; +import "@typespec/openapi"; import "@azure-tools/typespec-azure-resource-manager"; using TypeSpec.Rest; using TypeSpec.Http; +using TypeSpec.OpenAPI; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; @@ -398,6 +400,7 @@ model PatchObject { /** * Properties supported by patch operation. */ + @extension("x-ms-client-flatten", true) properties?: PatchProperties; /** diff --git a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/tspconfig.yaml index 3c7a890db..7768960f4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-alertsmanagement/tsp-output/tspconfig.yaml @@ -8,6 +8,7 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" examples-directory: "{project-root}/examples" + arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-resource-manager/all" diff --git a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/AnalysisServicesServer.tsp b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/AnalysisServicesServer.tsp index eae07c660..316a1864b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/AnalysisServicesServer.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/AnalysisServicesServer.tsp @@ -13,22 +13,14 @@ namespace Azure.ResourceManager.Analysis; /** * Represents an instance of an Analysis Services resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model AnalysisServicesServer extends Resource { +model AnalysisServicesServer + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = AnalysisServicesServer, KeyName = "serverName", SegmentName = "servers", NamePattern = "^[a-z][a-z0-9]*$" >; - - /** - * Properties of the provision operation request. - */ - @extension("x-ms-client-flatten", true) - properties?: AnalysisServicesServerProperties; } @armResourceOperations @@ -165,6 +157,9 @@ interface AnalysisServicesServers { @@doc(AnalysisServicesServer.name, "The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63." ); +@@doc(AnalysisServicesServer.properties, + "Properties of the provision operation request." +); @@encodedName(AnalysisServicesServers.create::parameters.resource, "application/json", "serverParameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/client.tsp index f9776e7b5..4ae063dc3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/client.tsp @@ -6,3 +6,6 @@ using Azure.ResourceManager.Analysis; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(AnalysisServicesServerUpdateParameters.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(AnalysisServicesServer.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/models.tsp index 30ce8e8f4..49adfa53d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/models.tsp @@ -1,9 +1,11 @@ import "@typespec/rest"; import "@typespec/http"; +import "@typespec/openapi"; import "@azure-tools/typespec-azure-resource-manager"; using TypeSpec.Rest; using TypeSpec.Http; +using TypeSpec.OpenAPI; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; @@ -305,6 +307,7 @@ model AnalysisServicesServerUpdateParameters { /** * Properties of the provision operation request. */ + @extension("x-ms-client-flatten", true) properties?: AnalysisServicesServerMutableProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/tspconfig.yaml index a1d2b7611..ec71a41ea 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-analysisservices/tsp-output/tspconfig.yaml @@ -8,6 +8,7 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/analysisservices.json" examples-directory: "{project-root}/examples" + arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-resource-manager/all" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AccessInformationContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AccessInformationContract.tsp index e7bea49a3..5896e7064 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AccessInformationContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AccessInformationContract.tsp @@ -14,28 +14,16 @@ namespace Azure.ResourceManager.ApiManagement; /** * Tenant Settings. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - AccessInformationContractProperties -) -model AccessInformationContract extends Foundations.ProxyResource { - /** - * The identifier of the Access configuration. - */ - @path - @key("accessName") - @segment("tenant") - @visibility("read") - name: AccessIdName; - - /** - * AccessInformation entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: AccessInformationContractProperties; +model AccessInformationContract + is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = AccessInformationContract, + KeyName = "accessName", + SegmentName = "tenant", + NamePattern = "", + Type = AccessIdName + >; } @armResourceOperations @@ -168,6 +156,12 @@ interface AccessInformationContracts { >; } +@@doc(AccessInformationContract.name, + "The identifier of the Access configuration." +); +@@doc(AccessInformationContract.properties, + "AccessInformation entity contract properties." +); @@encodedName(AccessInformationContracts.create::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiContract.tsp index 7cd7c75d2..3632b0a3b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * API details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(ApiContractProperties) -model ApiContract extends Foundations.ProxyResource { +model ApiContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = ApiContract, KeyName = "apiId", SegmentName = "apis", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * API entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: ApiContractProperties; } @armResourceOperations @@ -325,6 +316,7 @@ interface ApiContracts { @@doc(ApiContract.name, "API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number." ); +@@doc(ApiContract.properties, "API entity contract properties."); @@encodedName(ApiContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiManagementServiceResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiManagementServiceResource.tsp index b2d12342c..908013279 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiManagementServiceResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiManagementServiceResource.tsp @@ -13,13 +13,11 @@ namespace Azure.ResourceManager.ApiManagement; /** * A single API Management service resource in List or Get response. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - ApiManagementServiceProperties -) -model ApiManagementServiceResource extends Foundations.TrackedResource { +model ApiManagementServiceResource + is Azure.ResourceManager.TrackedResource< + ApiManagementServiceProperties, + false + > { ...ResourceNameParameter< Resource = ApiManagementServiceResource, KeyName = "serviceName", @@ -38,12 +36,6 @@ model ApiManagementServiceResource extends Foundations.TrackedResource { */ zones?: string[]; - /** - * Properties of the API Management service. - */ - @extension("x-ms-client-flatten", true) - properties: ApiManagementServiceProperties; - ...Azure.ResourceManager.ManagedServiceIdentityProperty; ...Azure.ResourceManager.ResourceSkuProperty; } @@ -1156,6 +1148,9 @@ interface ApiManagementServiceResources { @@doc(ApiManagementServiceResource.name, "The name of the API Management service." ); +@@doc(ApiManagementServiceResource.properties, + "Properties of the API Management service." +); @@encodedName(ApiManagementServiceResources.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiReleaseContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiReleaseContract.tsp index 7edfb75f1..1f5216adf 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiReleaseContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiReleaseContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * ApiRelease details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiContract) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(ApiReleaseContractProperties) -model ApiReleaseContract extends Foundations.ProxyResource { +model ApiReleaseContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = ApiReleaseContract, KeyName = "releaseId", SegmentName = "releases", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * ApiRelease entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: ApiReleaseContractProperties; } @armResourceOperations @@ -150,6 +141,7 @@ interface ApiReleaseContracts { @@doc(ApiReleaseContract.name, "Release identifier within an API. Must be unique in the current API Management service instance." ); +@@doc(ApiReleaseContract.properties, "ApiRelease entity contract properties."); @@encodedName(ApiReleaseContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiVersionSetContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiVersionSetContract.tsp index 063081623..c1b844129 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiVersionSetContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ApiVersionSetContract.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * API Version Set Contract details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - ApiVersionSetContractProperties -) -model ApiVersionSetContract extends Foundations.ProxyResource { +model ApiVersionSetContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = ApiVersionSetContract, KeyName = "versionSetId", SegmentName = "apiVersionSets", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * API VersionSet contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: ApiVersionSetContractProperties; } @armResourceOperations @@ -152,6 +141,7 @@ interface ApiVersionSetContracts { @@doc(ApiVersionSetContract.name, "Api Version Set identifier. Must be unique in the current API Management service instance." ); +@@doc(ApiVersionSetContract.properties, "API VersionSet contract properties."); @@encodedName(ApiVersionSetContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AuthorizationServerContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AuthorizationServerContract.tsp index ae84bfced..b463cf756 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AuthorizationServerContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/AuthorizationServerContract.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * External OAuth authorization server settings. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - AuthorizationServerContractProperties -) -model AuthorizationServerContract extends Foundations.ProxyResource { +model AuthorizationServerContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = AuthorizationServerContract, KeyName = "authsid", SegmentName = "authorizationServers", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * Properties of the External OAuth authorization server Contract. - */ - @extension("x-ms-client-flatten", true) - properties?: AuthorizationServerContractProperties; } @armResourceOperations @@ -163,6 +152,9 @@ interface AuthorizationServerContracts { @@doc(AuthorizationServerContract.name, "Identifier of the authorization server." ); +@@doc(AuthorizationServerContract.properties, + "Properties of the External OAuth authorization server Contract." +); @@encodedName(AuthorizationServerContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/BackendContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/BackendContract.tsp index dfbbe513e..17be80b8d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/BackendContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/BackendContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Backend details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(BackendContractProperties) -model BackendContract extends Foundations.ProxyResource { +model BackendContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = BackendContract, KeyName = "backendId", SegmentName = "backends", NamePattern = "" >; - - /** - * Backend entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: BackendContractProperties; } @armResourceOperations @@ -160,6 +151,7 @@ interface BackendContracts { @@doc(BackendContract.name, "Identifier of the Backend entity. Must be unique in the current API Management service instance." ); +@@doc(BackendContract.properties, "Backend entity contract properties."); @@encodedName(BackendContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CacheContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CacheContract.tsp index d328e5494..6402f08dc 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CacheContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CacheContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Cache details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(CacheContractProperties) -model CacheContract extends Foundations.ProxyResource { +model CacheContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = CacheContract, KeyName = "cacheId", SegmentName = "caches", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * Cache properties details. - */ - @extension("x-ms-client-flatten", true) - properties?: CacheContractProperties; } @armResourceOperations @@ -141,6 +132,7 @@ interface CacheContracts { @@doc(CacheContract.name, "Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier)." ); +@@doc(CacheContract.properties, "Cache properties details."); @@encodedName(CacheContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CertificateContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CertificateContract.tsp index 8af7bf05b..9c827d8fe 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CertificateContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/CertificateContract.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Certificate details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - CertificateContractProperties -) -model CertificateContract extends Foundations.ProxyResource { +model CertificateContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = CertificateContract, KeyName = "certificateId", SegmentName = "certificates", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * Certificate properties details. - */ - @extension("x-ms-client-flatten", true) - properties?: CertificateContractProperties; } @armResourceOperations @@ -149,6 +138,7 @@ interface CertificateContracts { @@doc(CertificateContract.name, "Identifier of the certificate entity. Must be unique in the current API Management service instance." ); +@@doc(CertificateContract.properties, "Certificate properties details."); @@encodedName(CertificateContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/DeletedServiceContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/DeletedServiceContract.tsp index 5daf3b1f0..e678611df 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/DeletedServiceContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/DeletedServiceContract.tsp @@ -13,27 +13,16 @@ namespace Azure.ResourceManager.ApiManagement; /** * Deleted API Management Service information. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @subscriptionResource @parentResource(SubscriptionLocationResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - DeletedServiceContractProperties -) -model DeletedServiceContract extends Foundations.ProxyResource { +model DeletedServiceContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = DeletedServiceContract, KeyName = "serviceName", SegmentName = "deletedservices", NamePattern = "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$" >; - - /** - * Deleted API Management Service details. - */ - @extension("x-ms-client-flatten", true) - properties?: DeletedServiceContractProperties; } @armResourceOperations @@ -66,3 +55,6 @@ interface DeletedServiceContracts { @@maxLength(DeletedServiceContract.name, 50); @@minLength(DeletedServiceContract.name, 1); @@doc(DeletedServiceContract.name, "The name of the API Management service."); +@@doc(DeletedServiceContract.properties, + "Deleted API Management Service details." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/DiagnosticContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/DiagnosticContract.tsp index 9c34a1564..1d356d760 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/DiagnosticContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/DiagnosticContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Diagnostic details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiContract) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(DiagnosticContractProperties) -model DiagnosticContract extends Foundations.ProxyResource { +model DiagnosticContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = DiagnosticContract, KeyName = "diagnosticId", SegmentName = "diagnostics", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * Diagnostic entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: DiagnosticContractProperties; } @armResourceOperations @@ -150,6 +141,7 @@ interface DiagnosticContracts { @@doc(DiagnosticContract.name, "Diagnostic identifier. Must be unique in the current API Management service instance." ); +@@doc(DiagnosticContract.properties, "Diagnostic entity contract properties."); @@encodedName(DiagnosticContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/EmailTemplateContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/EmailTemplateContract.tsp index adc7aad2d..65811fc16 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/EmailTemplateContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/EmailTemplateContract.tsp @@ -14,28 +14,16 @@ namespace Azure.ResourceManager.ApiManagement; /** * Email Template details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - EmailTemplateContractProperties -) -model EmailTemplateContract extends Foundations.ProxyResource { - /** - * Email Template Name Identifier. - */ - @path - @key("templateName") - @segment("templates") - @visibility("read") - name: TemplateName; - - /** - * Email Template entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: EmailTemplateContractProperties; +model EmailTemplateContract + is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = EmailTemplateContract, + KeyName = "templateName", + SegmentName = "templates", + NamePattern = "", + Type = TemplateName + >; } @armResourceOperations @@ -149,6 +137,10 @@ interface EmailTemplateContracts { >; } +@@doc(EmailTemplateContract.name, "Email Template Name Identifier."); +@@doc(EmailTemplateContract.properties, + "Email Template entity contract properties." +); @@encodedName(EmailTemplateContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayCertificateAuthorityContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayCertificateAuthorityContract.tsp index 2cf8dadf5..cc09874b1 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayCertificateAuthorityContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayCertificateAuthorityContract.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Gateway certificate authority details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(GatewayContract) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - GatewayCertificateAuthorityContractProperties -) -model GatewayCertificateAuthorityContract extends Foundations.ProxyResource { +model GatewayCertificateAuthorityContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = GatewayCertificateAuthorityContract, KeyName = "certificateId", SegmentName = "certificateAuthorities", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * Gateway certificate authority details. - */ - @extension("x-ms-client-flatten", true) - properties?: GatewayCertificateAuthorityContractProperties; } @armResourceOperations @@ -132,6 +121,9 @@ interface GatewayCertificateAuthorityContracts { @@doc(GatewayCertificateAuthorityContract.name, "Identifier of the certificate entity. Must be unique in the current API Management service instance." ); +@@doc(GatewayCertificateAuthorityContract.properties, + "Gateway certificate authority details." +); @@encodedName(GatewayCertificateAuthorityContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayContract.tsp index f3f1f1274..1e1c9cff0 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Gateway details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(GatewayContractProperties) -model GatewayContract extends Foundations.ProxyResource { +model GatewayContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = GatewayContract, KeyName = "gatewayId", SegmentName = "gateways", NamePattern = "" >; - - /** - * Gateway details. - */ - @extension("x-ms-client-flatten", true) - properties?: GatewayContractProperties; } @armResourceOperations @@ -229,6 +220,7 @@ interface GatewayContracts { @@doc(GatewayContract.name, "Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value 'managed'" ); +@@doc(GatewayContract.properties, "Gateway details."); @@encodedName(GatewayContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayHostnameConfigurationContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayHostnameConfigurationContract.tsp index cacc8afc2..f4dc1955c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayHostnameConfigurationContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GatewayHostnameConfigurationContract.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Gateway hostname configuration details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(GatewayContract) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - GatewayHostnameConfigurationContractProperties -) -model GatewayHostnameConfigurationContract extends Foundations.ProxyResource { +model GatewayHostnameConfigurationContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = GatewayHostnameConfigurationContract, KeyName = "hcId", SegmentName = "hostnameConfigurations", NamePattern = "" >; - - /** - * Gateway hostname configuration details. - */ - @extension("x-ms-client-flatten", true) - properties?: GatewayHostnameConfigurationContractProperties; } @armResourceOperations @@ -132,6 +121,9 @@ interface GatewayHostnameConfigurationContracts { @@doc(GatewayHostnameConfigurationContract.name, "Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity." ); +@@doc(GatewayHostnameConfigurationContract.properties, + "Gateway hostname configuration details." +); @@encodedName(GatewayHostnameConfigurationContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GlobalSchemaContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GlobalSchemaContract.tsp index 536bdf622..18131d521 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GlobalSchemaContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GlobalSchemaContract.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Global Schema Contract details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - GlobalSchemaContractProperties -) -model GlobalSchemaContract extends Foundations.ProxyResource { +model GlobalSchemaContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = GlobalSchemaContract, KeyName = "schemaId", SegmentName = "schemas", NamePattern = "" >; - - /** - * Properties of the Global Schema. - */ - @extension("x-ms-client-flatten", true) - properties?: GlobalSchemaContractProperties; } @armResourceOperations @@ -132,6 +121,7 @@ interface GlobalSchemaContracts { @@doc(GlobalSchemaContract.name, "Schema id identifier. Must be unique in the current API Management service instance." ); +@@doc(GlobalSchemaContract.properties, "Properties of the Global Schema."); @@encodedName(GlobalSchemaContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GroupContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GroupContract.tsp index f415505e8..bc1cef119 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GroupContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/GroupContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Contract details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(GroupContractProperties) -model GroupContract extends Foundations.ProxyResource { +model GroupContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = GroupContract, KeyName = "groupId", SegmentName = "groups", NamePattern = "" >; - - /** - * Group entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: GroupContractProperties; } @armResourceOperations @@ -198,6 +189,7 @@ interface GroupContracts { @@doc(GroupContract.name, "Group identifier. Must be unique in the current API Management service instance." ); +@@doc(GroupContract.properties, "Group entity contract properties."); @@encodedName(GroupContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IdentityProviderContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IdentityProviderContract.tsp index f352e8458..b156ff073 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IdentityProviderContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IdentityProviderContract.tsp @@ -14,28 +14,16 @@ namespace Azure.ResourceManager.ApiManagement; /** * Identity Provider details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - IdentityProviderContractProperties -) -model IdentityProviderContract extends Foundations.ProxyResource { - /** - * Identity Provider Type identifier. - */ - @path - @key("identityProviderName") - @segment("identityProviders") - @visibility("read") - name: IdentityProviderType; - - /** - * Identity Provider contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: IdentityProviderContractProperties; +model IdentityProviderContract + is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = IdentityProviderContract, + KeyName = "identityProviderName", + SegmentName = "identityProviders", + NamePattern = "", + Type = IdentityProviderType + >; } @armResourceOperations @@ -136,6 +124,10 @@ interface IdentityProviderContracts { >; } +@@doc(IdentityProviderContract.name, "Identity Provider Type identifier."); +@@doc(IdentityProviderContract.properties, + "Identity Provider contract properties." +); @@encodedName(IdentityProviderContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueAttachmentContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueAttachmentContract.tsp index 1c12ee07e..b1e57c4d3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueAttachmentContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueAttachmentContract.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Issue Attachment Contract details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(IssueContract) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - IssueAttachmentContractProperties -) -model IssueAttachmentContract extends Foundations.ProxyResource { +model IssueAttachmentContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = IssueAttachmentContract, KeyName = "attachmentId", SegmentName = "attachments", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * Properties of the Issue Attachment. - */ - @extension("x-ms-client-flatten", true) - properties?: IssueAttachmentContractProperties; } @armResourceOperations @@ -132,6 +121,9 @@ interface IssueAttachmentContracts { @@doc(IssueAttachmentContract.name, "Attachment identifier within an Issue. Must be unique in the current Issue." ); +@@doc(IssueAttachmentContract.properties, + "Properties of the Issue Attachment." +); @@encodedName(IssueAttachmentContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueCommentContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueCommentContract.tsp index 015f0377e..e2acd9af1 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueCommentContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueCommentContract.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Issue Comment Contract details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(IssueContract) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - IssueCommentContractProperties -) -model IssueCommentContract extends Foundations.ProxyResource { +model IssueCommentContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = IssueCommentContract, KeyName = "commentId", SegmentName = "comments", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * Properties of the Issue Comment. - */ - @extension("x-ms-client-flatten", true) - properties?: IssueCommentContractProperties; } @armResourceOperations @@ -132,6 +121,7 @@ interface IssueCommentContracts { @@doc(IssueCommentContract.name, "Comment identifier within an Issue. Must be unique in the current Issue." ); +@@doc(IssueCommentContract.properties, "Properties of the Issue Comment."); @@encodedName(IssueCommentContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueContract.tsp index d4d8ece51..e9eac8b52 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/IssueContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Issue Contract details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiContract) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(IssueContractProperties) -model IssueContract extends Foundations.ProxyResource { +model IssueContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = IssueContract, KeyName = "issueId", SegmentName = "issues", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * Properties of the Issue. - */ - @extension("x-ms-client-flatten", true) - properties?: IssueContractProperties; } @armResourceOperations @@ -164,6 +155,7 @@ interface IssueContracts { @@doc(IssueContract.name, "Issue identifier. Must be unique in the current API Management service instance." ); +@@doc(IssueContract.properties, "Properties of the Issue."); @@encodedName(IssueContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/LoggerContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/LoggerContract.tsp index ecd6a43b4..58caddbee 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/LoggerContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/LoggerContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Logger details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(LoggerContractProperties) -model LoggerContract extends Foundations.ProxyResource { +model LoggerContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = LoggerContract, KeyName = "loggerId", SegmentName = "loggers", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * Logger entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: LoggerContractProperties; } @armResourceOperations @@ -149,6 +140,7 @@ interface LoggerContracts { @@doc(LoggerContract.name, "Logger identifier. Must be unique in the API Management service instance." ); +@@doc(LoggerContract.properties, "Logger entity contract properties."); @@encodedName(LoggerContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/NamedValueContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/NamedValueContract.tsp index 2c5b81e54..51a998390 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/NamedValueContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/NamedValueContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * NamedValue details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(NamedValueContractProperties) -model NamedValueContract extends Foundations.ProxyResource { +model NamedValueContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = NamedValueContract, KeyName = "namedValueId", SegmentName = "namedValues", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * NamedValue entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: NamedValueContractProperties; } @armResourceOperations @@ -175,6 +166,7 @@ interface NamedValueContracts { @@maxLength(NamedValueContract.name, 256); @@doc(NamedValueContract.name, "Identifier of the NamedValue."); +@@doc(NamedValueContract.properties, "NamedValue entity contract properties."); @@encodedName(NamedValueContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/NotificationContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/NotificationContract.tsp index 00da425cc..c8153b9ef 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/NotificationContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/NotificationContract.tsp @@ -14,28 +14,16 @@ namespace Azure.ResourceManager.ApiManagement; /** * Notification details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - NotificationContractProperties -) -model NotificationContract extends Foundations.ProxyResource { - /** - * Notification Name Identifier. - */ - @path - @key("notificationName") - @segment("notifications") - @visibility("read") - name: NotificationName; - - /** - * Notification entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: NotificationContractProperties; +model NotificationContract + is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = NotificationContract, + KeyName = "notificationName", + SegmentName = "notifications", + NamePattern = "", + Type = NotificationName + >; } @armResourceOperations @@ -150,3 +138,8 @@ interface NotificationContracts { ...SubscriptionIdParameter, ): ArmResponse | ErrorResponse; } + +@@doc(NotificationContract.name, "Notification Name Identifier."); +@@doc(NotificationContract.properties, + "Notification entity contract properties." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OpenidConnectProviderContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OpenidConnectProviderContract.tsp index 9893be0ea..229535e53 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OpenidConnectProviderContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OpenidConnectProviderContract.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * OpenId Connect Provider details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - OpenidConnectProviderContractProperties -) -model OpenidConnectProviderContract extends Foundations.ProxyResource { +model OpenidConnectProviderContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = OpenidConnectProviderContract, KeyName = "opid", SegmentName = "openidConnectProviders", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * OpenId Connect Provider contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: OpenidConnectProviderContractProperties; } @armResourceOperations @@ -197,6 +186,9 @@ interface OpenidConnectProviderContracts { @@doc(OpenidConnectProviderContract.name, "Identifier of the OpenID Connect Provider." ); +@@doc(OpenidConnectProviderContract.properties, + "OpenId Connect Provider contract properties." +); @@encodedName(OpenidConnectProviderContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OperationContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OperationContract.tsp index 6f89a32fd..4742b5594 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OperationContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/OperationContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * API Operation details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiContract) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(OperationContractProperties) -model OperationContract extends Foundations.ProxyResource { +model OperationContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = OperationContract, KeyName = "operationId", SegmentName = "operations", NamePattern = "" >; - - /** - * Properties of the Operation Contract. - */ - @extension("x-ms-client-flatten", true) - properties?: OperationContractProperties; } @armResourceOperations @@ -156,6 +147,7 @@ interface OperationContracts { @@doc(OperationContract.name, "Operation identifier within an API. Must be unique in the current API Management service instance." ); +@@doc(OperationContract.properties, "Properties of the Operation Contract."); @@encodedName(OperationContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PolicyContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PolicyContract.tsp index d8fb72f3e..3a189c414 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PolicyContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PolicyContract.tsp @@ -14,26 +14,16 @@ namespace Azure.ResourceManager.ApiManagement; /** * Policy Contract details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(OperationContract) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(PolicyContractProperties) -model PolicyContract extends Foundations.ProxyResource { - /** - * The identifier of the Policy. - */ - @path - @key("policyId") - @segment("policies") - @visibility("read") - name: PolicyIdName; - - /** - * Properties of the Policy. - */ - @extension("x-ms-client-flatten", true) - properties?: PolicyContractProperties; +model PolicyContract + is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = PolicyContract, + KeyName = "policyId", + SegmentName = "policies", + NamePattern = "", + Type = PolicyIdName + >; } @armResourceOperations @@ -114,6 +104,8 @@ interface PolicyContracts { listByOperation is ArmResourceListByParent; } +@@doc(PolicyContract.name, "The identifier of the Policy."); +@@doc(PolicyContract.properties, "Properties of the Policy."); @@encodedName(PolicyContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalDelegationSettings.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalDelegationSettings.tsp index 799879dc2..360cffa38 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalDelegationSettings.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalDelegationSettings.tsp @@ -14,27 +14,16 @@ namespace Azure.ResourceManager.ApiManagement; /** * Delegation settings for a developer portal. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @singleton("delegation") @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - PortalDelegationSettingsProperties -) -model PortalDelegationSettings extends Foundations.ProxyResource { +model PortalDelegationSettings + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = PortalDelegationSettings, KeyName = "portalsetting", SegmentName = "portalsettings", NamePattern = "" >; - - /** - * Delegation settings contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: PortalDelegationSettingsProperties; } @armResourceOperations @@ -117,6 +106,9 @@ interface PortalDelegationSettingsOperationGroup { } @@doc(PortalDelegationSettings.name, ""); +@@doc(PortalDelegationSettings.properties, + "Delegation settings contract properties." +); @@encodedName(PortalDelegationSettingsOperationGroup.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalRevisionContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalRevisionContract.tsp index e21831268..8dc5ab711 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalRevisionContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalRevisionContract.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Portal Revision's contract details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - PortalRevisionContractProperties -) -model PortalRevisionContract extends Foundations.ProxyResource { +model PortalRevisionContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = PortalRevisionContract, KeyName = "portalRevisionId", SegmentName = "portalRevisions", NamePattern = "" >; - - /** - * Properties of the portal revisions. - */ - @extension("x-ms-client-flatten", true) - properties?: PortalRevisionContractProperties; } @armResourceOperations @@ -128,6 +117,7 @@ interface PortalRevisionContracts { @@doc(PortalRevisionContract.name, "Portal revision identifier. Must be unique in the current API Management service instance." ); +@@doc(PortalRevisionContract.properties, "Properties of the portal revisions."); @@encodedName(PortalRevisionContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSigninSettings.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSigninSettings.tsp index 9c39ff625..87d7ed98b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSigninSettings.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSigninSettings.tsp @@ -14,27 +14,16 @@ namespace Azure.ResourceManager.ApiManagement; /** * Sign-In settings for the Developer Portal. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @singleton("signin") @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - PortalSigninSettingProperties -) -model PortalSigninSettings extends Foundations.ProxyResource { +model PortalSigninSettings + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = PortalSigninSettings, KeyName = "portalsetting", SegmentName = "portalsettings", NamePattern = "" >; - - /** - * Sign-in settings contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: PortalSigninSettingProperties; } @armResourceOperations @@ -106,6 +95,7 @@ interface PortalSigninSettingsOperationGroup { } @@doc(PortalSigninSettings.name, ""); +@@doc(PortalSigninSettings.properties, "Sign-in settings contract properties."); @@encodedName(PortalSigninSettingsOperationGroup.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSignupSettings.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSignupSettings.tsp index 9680be901..405d2f8e4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSignupSettings.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PortalSignupSettings.tsp @@ -14,27 +14,16 @@ namespace Azure.ResourceManager.ApiManagement; /** * Sign-Up settings for a developer portal. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @singleton("signup") @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - PortalSignupSettingsProperties -) -model PortalSignupSettings extends Foundations.ProxyResource { +model PortalSignupSettings + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = PortalSignupSettings, KeyName = "portalsetting", SegmentName = "portalsettings", NamePattern = "" >; - - /** - * Sign-up settings contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: PortalSignupSettingsProperties; } @armResourceOperations @@ -106,6 +95,7 @@ interface PortalSignupSettingsOperationGroup { } @@doc(PortalSignupSettings.name, ""); +@@doc(PortalSignupSettings.properties, "Sign-up settings contract properties."); @@encodedName(PortalSignupSettingsOperationGroup.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PrivateEndpointConnection.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PrivateEndpointConnection.tsp index dc9780430..e5298fc45 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PrivateEndpointConnection.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PrivateEndpointConnection.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * The Private Endpoint Connection resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - PrivateEndpointConnectionProperties -) -model PrivateEndpointConnection extends Foundations.ProxyResource { +model PrivateEndpointConnection + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = PrivateEndpointConnection, KeyName = "privateEndpointConnectionName", SegmentName = "privateEndpointConnections", NamePattern = "" >; - - /** - * Resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: PrivateEndpointConnectionProperties; } @armResourceOperations @@ -73,6 +62,7 @@ interface PrivateEndpointConnections { @@doc(PrivateEndpointConnection.name, "Name of the private endpoint connection." ); +@@doc(PrivateEndpointConnection.properties, "Resource properties."); @@encodedName(PrivateEndpointConnections.createOrUpdate::parameters.resource, "application/json", "privateEndpointConnectionRequest" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PrivateLinkResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PrivateLinkResource.tsp index 6a3111089..4dd831ca2 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PrivateLinkResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/PrivateLinkResource.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * A private link resource */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - PrivateLinkResourceProperties -) -model PrivateLinkResource extends Foundations.ProxyResource { +model PrivateLinkResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = PrivateLinkResource, KeyName = "privateLinkSubResourceName", SegmentName = "privateLinkResources", NamePattern = "" >; - - /** - * Resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: PrivateLinkResourceProperties; } @armResourceOperations @@ -54,3 +43,4 @@ interface PrivateLinkResources { } @@doc(PrivateLinkResource.name, "Name of the private link resource."); +@@doc(PrivateLinkResource.properties, "Resource properties."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ProductContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ProductContract.tsp index db4906865..dea6aa6bb 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ProductContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/ProductContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Product details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(ProductContractProperties) -model ProductContract extends Foundations.ProxyResource { +model ProductContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = ProductContract, KeyName = "productId", SegmentName = "products", NamePattern = "" >; - - /** - * Product entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: ProductContractProperties; } @armResourceOperations @@ -321,6 +312,7 @@ interface ProductContracts { @@doc(ProductContract.name, "Product identifier. Must be unique in the current API Management service instance." ); +@@doc(ProductContract.properties, "Product entity contract properties."); @@encodedName(ProductContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SchemaContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SchemaContract.tsp index 02f6d2f5e..78891b4dd 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SchemaContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SchemaContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * API Schema Contract details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiContract) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(SchemaContractProperties) -model SchemaContract extends Foundations.ProxyResource { +model SchemaContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = SchemaContract, KeyName = "schemaId", SegmentName = "schemas", NamePattern = "" >; - - /** - * Properties of the API Schema. - */ - @extension("x-ms-client-flatten", true) - properties?: SchemaContractProperties; } @armResourceOperations @@ -136,6 +127,7 @@ interface SchemaContracts { @@doc(SchemaContract.name, "Schema id identifier. Must be unique in the current API Management service instance." ); +@@doc(SchemaContract.properties, "Properties of the API Schema."); @@encodedName(SchemaContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SubscriptionContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SubscriptionContract.tsp index b89c74132..197afafaa 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SubscriptionContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/SubscriptionContract.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Subscription details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - SubscriptionContractProperties -) -model SubscriptionContract extends Foundations.ProxyResource { +model SubscriptionContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = SubscriptionContract, KeyName = "subscriptionId", SegmentName = "subscriptions", NamePattern = "" >; - - /** - * Subscription contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: SubscriptionContractProperties; } @armResourceOperations @@ -209,6 +198,7 @@ interface SubscriptionContracts { @@doc(SubscriptionContract.name, "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." ); +@@doc(SubscriptionContract.properties, "Subscription contract properties."); @@encodedName(SubscriptionContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TagContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TagContract.tsp index c1e8e8a40..19ed8b3cd 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TagContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TagContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Tag Contract details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(OperationContract) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(TagContractProperties) -model TagContract extends Foundations.ProxyResource { +model TagContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = TagContract, KeyName = "tagId", SegmentName = "tags", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * Tag entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: TagContractProperties; } @armResourceOperations @@ -105,3 +96,4 @@ interface TagContracts { @@doc(TagContract.name, "Tag identifier. Must be unique in the current API Management service instance." ); +@@doc(TagContract.properties, "Tag entity contract properties."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TagDescriptionContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TagDescriptionContract.tsp index b1d1fd175..6f4362a6c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TagDescriptionContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TagDescriptionContract.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * Contract details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiContract) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - TagDescriptionContractProperties -) -model TagDescriptionContract extends Foundations.ProxyResource { +model TagDescriptionContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = TagDescriptionContract, KeyName = "tagDescriptionId", SegmentName = "tagDescriptions", NamePattern = "^[^*#&+:<>?]+$" >; - - /** - * TagDescription entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: TagDescriptionContractProperties; } @armResourceOperations @@ -132,6 +121,9 @@ interface TagDescriptionContracts { @@doc(TagDescriptionContract.name, "Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API and Tag names." ); +@@doc(TagDescriptionContract.properties, + "TagDescription entity contract properties." +); @@encodedName(TagDescriptionContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TenantSettingsContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TenantSettingsContract.tsp index 12e976f18..1c47e40e7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TenantSettingsContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/TenantSettingsContract.tsp @@ -14,28 +14,16 @@ namespace Azure.ResourceManager.ApiManagement; /** * Tenant Settings. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - TenantSettingsContractProperties -) -model TenantSettingsContract extends Foundations.ProxyResource { - /** - * The identifier of the settings. - */ - @path - @key("settingsType") - @segment("settings") - @visibility("read") - name: SettingsTypeName; - - /** - * TenantSettings entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: TenantSettingsContractProperties; +model TenantSettingsContract + is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = TenantSettingsContract, + KeyName = "settingsType", + SegmentName = "settings", + NamePattern = "", + Type = SettingsTypeName + >; } @armResourceOperations @@ -65,3 +53,8 @@ interface TenantSettingsContracts { } >; } + +@@doc(TenantSettingsContract.name, "The identifier of the settings."); +@@doc(TenantSettingsContract.properties, + "TenantSettings entity contract properties." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/UserContract.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/UserContract.tsp index 5608cfe1b..8522b5d2e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/UserContract.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/UserContract.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.ApiManagement; /** * User details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ApiManagementServiceResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(UserContractProperties) -model UserContract extends Foundations.ProxyResource { +model UserContract + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = UserContract, KeyName = "userId", SegmentName = "users", NamePattern = "" >; - - /** - * User entity contract properties. - */ - @extension("x-ms-client-flatten", true) - properties?: UserContractProperties; } @armResourceOperations @@ -301,6 +292,7 @@ interface UserContracts { @@doc(UserContract.name, "User identifier. Must be unique in the current API Management service instance." ); +@@doc(UserContract.properties, "User entity contract properties."); @@encodedName(UserContracts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/client.tsp index 8077e058b..da7fd943e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/client.tsp @@ -142,10 +142,127 @@ using Azure.ResourceManager.ApiManagement; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(QuotaCounterValueContract.value); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(ApiContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(ApiReleaseContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(OperationContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(PolicyContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(TagContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(ProductContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(SchemaContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(DiagnosticContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(IssueContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(IssueCommentContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(IssueAttachmentContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(TagDescriptionContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(ApiVersionSetContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(AuthorizationServerContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(BackendContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(CacheContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(CertificateContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(DeletedServiceContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(ApiManagementServiceResource.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(EmailTemplateContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(GatewayContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(GatewayHostnameConfigurationContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(GatewayCertificateAuthorityContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(GroupContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(UserContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(IdentityProviderContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(LoggerContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(NamedValueContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(NotificationContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(OpenidConnectProviderContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(PortalRevisionContract.properties); + @@clientName(PortalSigninSettingsOperationGroup, "PortalSigninSettings"); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(PortalSigninSettings.properties); @@clientName(PortalSignupSettingsOperationGroup, "PortalSignupSettings"); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(PortalSignupSettings.properties); @@clientName(PortalDelegationSettingsOperationGroup, "PortalDelegationSettings" ); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(PortalDelegationSettings.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(PrivateEndpointConnection.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(PrivateLinkResource.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(SubscriptionContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(GlobalSchemaContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(TenantSettingsContract.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(AccessInformationContract.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/models.tsp index 6c78bb6bc..ed64b9a17 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/models.tsp @@ -1,10 +1,12 @@ import "@typespec/rest"; import "@typespec/http"; +import "@typespec/openapi"; import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-azure-resource-manager"; using TypeSpec.Rest; using TypeSpec.Http; +using TypeSpec.OpenAPI; using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; @@ -1391,6 +1393,7 @@ model ApiCreateOrUpdateParameter { /** * API entity create of update properties. */ + @extension("x-ms-client-flatten", true) properties?: ApiCreateOrUpdateProperties; } @@ -1446,6 +1449,7 @@ model ApiUpdateContract { /** * Properties of the API entity that can be updated. */ + @extension("x-ms-client-flatten", true) properties?: ApiContractUpdateProperties; } @@ -1803,6 +1807,7 @@ model OperationUpdateContract { /** * Properties of the API Operation entity that can be updated. */ + @extension("x-ms-client-flatten", true) properties?: OperationUpdateContractProperties; } @@ -1919,6 +1924,7 @@ model SchemaContractProperties { /** * Create or update Properties of the API Schema Document. */ + @extension("x-ms-client-flatten", true) document?: SchemaDocumentProperties; } @@ -2133,6 +2139,7 @@ model IssueUpdateContract { /** * Issue entity Update contract properties. */ + @extension("x-ms-client-flatten", true) properties?: IssueUpdateContractProperties; } @@ -2242,6 +2249,7 @@ model TagDescriptionCreateParameters { /** * Properties supplied to Create TagDescription operation. */ + @extension("x-ms-client-flatten", true) properties?: TagDescriptionBaseProperties; } @@ -2482,6 +2490,7 @@ model ApiVersionSetUpdateParameters { /** * Parameters to update or create an API Version Set Contract. */ + @extension("x-ms-client-flatten", true) properties?: ApiVersionSetUpdateParametersProperties; } @@ -2620,6 +2629,7 @@ model AuthorizationServerUpdateContract extends Resource { /** * Properties of the External OAuth authorization server update Contract. */ + @extension("x-ms-client-flatten", true) properties?: AuthorizationServerUpdateContractProperties; } @@ -2900,6 +2910,7 @@ model BackendUpdateParameters { /** * Backend entity update contract properties. */ + @extension("x-ms-client-flatten", true) properties?: BackendUpdateParameterProperties; } @@ -2927,6 +2938,7 @@ model BackendReconnectContract extends Resource { /** * Reconnect request properties. */ + @extension("x-ms-client-flatten", true) properties?: BackendReconnectProperties; } @@ -2977,6 +2989,7 @@ model CacheUpdateParameters { /** * Cache update properties details. */ + @extension("x-ms-client-flatten", true) properties?: CacheUpdateProperties; } @@ -3091,6 +3104,7 @@ model CertificateCreateOrUpdateParameters { /** * Certificate create or update properties details. */ + @extension("x-ms-client-flatten", true) properties?: CertificateCreateOrUpdateProperties; } @@ -3352,6 +3366,7 @@ model ContentTypeContract extends Resource { /** * Properties of the content type. */ + @extension("x-ms-client-flatten", true) properties?: ContentTypeContractProperties; } @@ -3395,6 +3410,7 @@ model ContentItemContract extends Resource { * Properties of the content item. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "For backward compatibility" + @extension("x-ms-client-flatten", true) properties?: Record; } @@ -3915,6 +3931,7 @@ model RemotePrivateEndpointConnectionWrapper { /** * Resource properties. */ + @extension("x-ms-client-flatten", true) properties?: PrivateEndpointConnectionWrapperProperties; } @@ -4052,6 +4069,7 @@ model ApiManagementServiceUpdateParameters extends ApimResource { /** * Properties of the API Management service. */ + @extension("x-ms-client-flatten", true) properties?: ApiManagementServiceUpdateProperties; /** @@ -4232,6 +4250,7 @@ model EmailTemplateUpdateParameters { /** * Email Template Update contract properties. */ + @extension("x-ms-client-flatten", true) properties?: EmailTemplateUpdateParameterProperties; } @@ -4420,6 +4439,7 @@ model AssociationContract extends Resource { /** * Association entity contract properties. */ + @extension("x-ms-client-flatten", true) properties?: AssociationContractProperties; } @@ -4484,6 +4504,7 @@ model GroupCreateParameters { /** * Properties supplied to Create Group operation. */ + @extension("x-ms-client-flatten", true) properties?: GroupCreateParametersProperties; } @@ -4521,6 +4542,7 @@ model GroupUpdateParameters { /** * Group entity update contract properties. */ + @extension("x-ms-client-flatten", true) properties?: GroupUpdateParametersProperties; } @@ -4711,6 +4733,7 @@ model IdentityProviderCreateContract extends Resource { /** * Identity Provider contract properties. */ + @extension("x-ms-client-flatten", true) properties?: IdentityProviderCreateContractProperties; } @@ -4739,6 +4762,7 @@ model IdentityProviderUpdateParameters { /** * Identity Provider update properties. */ + @extension("x-ms-client-flatten", true) properties?: IdentityProviderUpdateProperties; } @@ -4809,6 +4833,7 @@ model LoggerUpdateContract { /** * Logger entity update contract properties. */ + @extension("x-ms-client-flatten", true) properties?: LoggerUpdateParameters; } @@ -4885,6 +4910,7 @@ model NamedValueCreateContract extends Resource { /** * NamedValue entity contract properties for PUT operation. */ + @extension("x-ms-client-flatten", true) properties?: NamedValueCreateContractProperties; } @@ -4920,6 +4946,7 @@ model NamedValueUpdateParameters { /** * NamedValue entity Update contract properties. */ + @extension("x-ms-client-flatten", true) properties?: NamedValueUpdateParameterProperties; } @@ -5102,6 +5129,7 @@ model RecipientUserContract extends Resource { /** * Recipient User entity contract properties. */ + @extension("x-ms-client-flatten", true) properties?: RecipientUsersContractProperties; } @@ -5142,6 +5170,7 @@ model RecipientEmailContract extends Resource { /** * Recipient Email contract properties. */ + @extension("x-ms-client-flatten", true) properties?: RecipientEmailContractProperties; } @@ -5193,6 +5222,7 @@ model OpenidConnectProviderUpdateContract { /** * OpenId Connect Provider Update contract properties. */ + @extension("x-ms-client-flatten", true) properties?: OpenidConnectProviderUpdateContractProperties; } @@ -5315,6 +5345,7 @@ model PolicyDescriptionContract extends Resource { /** * Policy description contract properties. */ + @extension("x-ms-client-flatten", true) properties?: PolicyDescriptionContractProperties; } @@ -5382,6 +5413,7 @@ model PortalSettingsContract extends Resource { /** * Portal Settings contract properties. */ + @extension("x-ms-client-flatten", true) properties?: PortalSettingsContractProperties; } @@ -5608,6 +5640,7 @@ model ProductUpdateParameters { /** * Product entity Update contract properties. */ + @extension("x-ms-client-flatten", true) properties?: ProductUpdateProperties; } @@ -5815,6 +5848,7 @@ model QuotaCounterValueUpdateContract { /** * Quota counter value details. */ + @extension("x-ms-client-flatten", true) properties?: QuotaCounterValueContractProperties; } @@ -6136,6 +6170,7 @@ model GlobalSchemaContractProperties { /** * Global Schema document object for json-based schema formats(e.g. json schema). */ + @extension("x-ms-client-flatten", true) document?: Record; } @@ -6400,6 +6435,7 @@ model SubscriptionCreateParameters { /** * Subscription contract properties. */ + @extension("x-ms-client-flatten", true) properties?: SubscriptionCreateParameterProperties; } @@ -6456,6 +6492,7 @@ model SubscriptionUpdateParameters { /** * Subscription Update contract properties. */ + @extension("x-ms-client-flatten", true) properties?: SubscriptionUpdateParameterProperties; } @@ -6540,6 +6577,7 @@ model TagCreateUpdateParameters { /** * Properties supplied to Create Tag operation. */ + @extension("x-ms-client-flatten", true) properties?: TagContractProperties; } @@ -6570,6 +6608,7 @@ model AccessInformationCreateParameters { /** * Tenant access information update parameter properties. */ + @extension("x-ms-client-flatten", true) properties?: AccessInformationCreateParameterProperties; } @@ -6605,6 +6644,7 @@ model AccessInformationUpdateParameters { /** * Tenant access information update parameter properties. */ + @extension("x-ms-client-flatten", true) properties?: AccessInformationUpdateParameterProperties; } @@ -6655,6 +6695,7 @@ model DeployConfigurationParameters { /** * Deploy Configuration Parameter contract properties. */ + @extension("x-ms-client-flatten", true) properties?: DeployConfigurationParameterProperties; } @@ -6680,6 +6721,7 @@ model OperationResultContract extends Resource { /** * Properties of the Operation Contract. */ + @extension("x-ms-client-flatten", true) properties?: OperationResultContractProperties; } @@ -6756,6 +6798,7 @@ model SaveConfigurationParameter { /** * Properties of the Save Configuration Parameters. */ + @extension("x-ms-client-flatten", true) properties?: SaveConfigurationParameterProperties; } @@ -6781,6 +6824,7 @@ model TenantConfigurationSyncStateContract extends Resource { /** * Properties returned Tenant Configuration Sync State check. */ + @extension("x-ms-client-flatten", true) properties?: TenantConfigurationSyncStateContractProperties; } @@ -6840,6 +6884,7 @@ model UserCreateParameters { /** * User entity create contract properties. */ + @extension("x-ms-client-flatten", true) properties?: UserCreateParameterProperties; } @@ -6891,6 +6936,7 @@ model UserUpdateParameters { /** * User entity update contract properties. */ + @extension("x-ms-client-flatten", true) properties?: UserUpdateParametersProperties; } @@ -6952,6 +6998,7 @@ model UserTokenParameters { /** * User Token Parameter contract properties. */ + @extension("x-ms-client-flatten", true) properties?: UserTokenParameterProperties; } @@ -7016,5 +7063,6 @@ model QuotaCounterValueContract { /** * Quota counter Value Properties. */ + @extension("x-ms-client-flatten", true) value?: QuotaCounterValueContractProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/tspconfig.yaml index 3c7a890db..7768960f4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-apimanagement/tsp-output/tspconfig.yaml @@ -8,6 +8,7 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" examples-directory: "{project-root}/examples" + arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-resource-manager/all" diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/DenyAssignment.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/DenyAssignment.tsp index 5bd163404..10a7bf0ff 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/DenyAssignment.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/DenyAssignment.tsp @@ -13,23 +13,14 @@ namespace Azure.ResourceManager.Authorization; /** * Deny Assignment */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(DenyAssignmentProperties) -model DenyAssignment extends Foundations.ExtensionResource { +model DenyAssignment + is Azure.ResourceManager.ExtensionResource { ...ResourceNameParameter< Resource = DenyAssignment, KeyName = "denyAssignmentId", SegmentName = "denyAssignments", NamePattern = "" >; - - /** - * Deny assignment properties. - */ - @extension("x-ms-client-flatten", true) - properties?: DenyAssignmentProperties; } @armResourceOperations @@ -85,3 +76,4 @@ interface DenyAssignments { } @@doc(DenyAssignment.name, "The ID of the deny assignment to get."); +@@doc(DenyAssignment.properties, "Deny assignment properties."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignment.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignment.tsp index da0d8f87a..566483ece 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignment.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignment.tsp @@ -13,23 +13,14 @@ namespace Azure.ResourceManager.Authorization; /** * Role Assignments */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(RoleAssignmentProperties) -model RoleAssignment extends Foundations.ExtensionResource { +model RoleAssignment + is Azure.ResourceManager.ExtensionResource { ...ResourceNameParameter< Resource = RoleAssignment, KeyName = "roleAssignmentName", SegmentName = "roleAssignments", NamePattern = "" >; - - /** - * Role assignment properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RoleAssignmentProperties; } @armResourceOperations @@ -106,6 +97,7 @@ interface RoleAssignments { @@doc(RoleAssignment.name, "The name of the role assignment. It can be any valid GUID." ); +@@doc(RoleAssignment.properties, "Role assignment properties."); @@encodedName(RoleAssignments.create::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentSchedule.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentSchedule.tsp index e3ee6816e..3f39e95ae 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentSchedule.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentSchedule.tsp @@ -13,25 +13,14 @@ namespace Azure.ResourceManager.Authorization; /** * Role Assignment schedule */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - RoleAssignmentScheduleProperties -) -model RoleAssignmentSchedule extends Foundations.ExtensionResource { +model RoleAssignmentSchedule + is Azure.ResourceManager.ExtensionResource { ...ResourceNameParameter< Resource = RoleAssignmentSchedule, KeyName = "roleAssignmentScheduleName", SegmentName = "roleAssignmentSchedules", NamePattern = "" >; - - /** - * Role assignment schedule properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RoleAssignmentScheduleProperties; } @armResourceOperations @@ -63,3 +52,6 @@ interface RoleAssignmentSchedules { @@doc(RoleAssignmentSchedule.name, "The name (guid) of the role assignment schedule to get." ); +@@doc(RoleAssignmentSchedule.properties, + "Role assignment schedule properties." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentScheduleInstance.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentScheduleInstance.tsp index d2af5db6e..1800afd38 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentScheduleInstance.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentScheduleInstance.tsp @@ -13,25 +13,14 @@ namespace Azure.ResourceManager.Authorization; /** * Information about current or upcoming role assignment schedule instance */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - RoleAssignmentScheduleInstanceProperties -) -model RoleAssignmentScheduleInstance extends Foundations.ExtensionResource { +model RoleAssignmentScheduleInstance + is Azure.ResourceManager.ExtensionResource { ...ResourceNameParameter< Resource = RoleAssignmentScheduleInstance, KeyName = "roleAssignmentScheduleInstanceName", SegmentName = "roleAssignmentScheduleInstances", NamePattern = "" >; - - /** - * Role assignment schedule instance properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RoleAssignmentScheduleInstanceProperties; } @armResourceOperations @@ -63,3 +52,6 @@ interface RoleAssignmentScheduleInstances { @@doc(RoleAssignmentScheduleInstance.name, "The name (hash of schedule name + time) of the role assignment schedule to get." ); +@@doc(RoleAssignmentScheduleInstance.properties, + "Role assignment schedule instance properties." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentScheduleRequest.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentScheduleRequest.tsp index 9a44f2edf..b4a62be74 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentScheduleRequest.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleAssignmentScheduleRequest.tsp @@ -13,25 +13,14 @@ namespace Azure.ResourceManager.Authorization; /** * Role Assignment schedule request */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - RoleAssignmentScheduleRequestProperties -) -model RoleAssignmentScheduleRequest extends Foundations.ExtensionResource { +model RoleAssignmentScheduleRequest + is Azure.ResourceManager.ExtensionResource { ...ResourceNameParameter< Resource = RoleAssignmentScheduleRequest, KeyName = "roleAssignmentScheduleRequestName", SegmentName = "roleAssignmentScheduleRequests", NamePattern = "" >; - - /** - * Role assignment schedule request properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RoleAssignmentScheduleRequestProperties; } @armResourceOperations @@ -82,6 +71,9 @@ interface RoleAssignmentScheduleRequests { @@doc(RoleAssignmentScheduleRequest.name, "The name (guid) of the role assignment schedule request to get." ); +@@doc(RoleAssignmentScheduleRequest.properties, + "Role assignment schedule request properties." +); @@encodedName(RoleAssignmentScheduleRequests.create::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleDefinition.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleDefinition.tsp index 0000adf50..68145d882 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleDefinition.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleDefinition.tsp @@ -13,23 +13,14 @@ namespace Azure.ResourceManager.Authorization; /** * Role definition. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(RoleDefinitionProperties) -model RoleDefinition extends Foundations.ExtensionResource { +model RoleDefinition + is Azure.ResourceManager.ExtensionResource { ...ResourceNameParameter< Resource = RoleDefinition, KeyName = "roleDefinitionId", SegmentName = "roleDefinitions", NamePattern = "" >; - - /** - * Role definition properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RoleDefinitionProperties; } @armResourceOperations @@ -70,6 +61,7 @@ interface RoleDefinitions { } @@doc(RoleDefinition.name, "The ID of the role definition."); +@@doc(RoleDefinition.properties, "Role definition properties."); @@encodedName(RoleDefinitions.createOrUpdate::parameters.resource, "application/json", "roleDefinition" diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilitySchedule.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilitySchedule.tsp index 569254b12..7c2f97be8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilitySchedule.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilitySchedule.tsp @@ -13,25 +13,14 @@ namespace Azure.ResourceManager.Authorization; /** * Role eligibility schedule */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - RoleEligibilityScheduleProperties -) -model RoleEligibilitySchedule extends Foundations.ExtensionResource { +model RoleEligibilitySchedule + is Azure.ResourceManager.ExtensionResource { ...ResourceNameParameter< Resource = RoleEligibilitySchedule, KeyName = "roleEligibilityScheduleName", SegmentName = "roleEligibilitySchedules", NamePattern = "" >; - - /** - * role eligibility schedule properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RoleEligibilityScheduleProperties; } @armResourceOperations @@ -63,3 +52,6 @@ interface RoleEligibilitySchedules { @@doc(RoleEligibilitySchedule.name, "The name (guid) of the role eligibility schedule to get." ); +@@doc(RoleEligibilitySchedule.properties, + "role eligibility schedule properties." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilityScheduleInstance.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilityScheduleInstance.tsp index 6839944b9..e9ee360f3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilityScheduleInstance.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilityScheduleInstance.tsp @@ -13,25 +13,14 @@ namespace Azure.ResourceManager.Authorization; /** * Information about current or upcoming role eligibility schedule instance */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - RoleEligibilityScheduleInstanceProperties -) -model RoleEligibilityScheduleInstance extends Foundations.ExtensionResource { +model RoleEligibilityScheduleInstance + is Azure.ResourceManager.ExtensionResource { ...ResourceNameParameter< Resource = RoleEligibilityScheduleInstance, KeyName = "roleEligibilityScheduleInstanceName", SegmentName = "roleEligibilityScheduleInstances", NamePattern = "" >; - - /** - * Role eligibility schedule instance properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RoleEligibilityScheduleInstanceProperties; } @armResourceOperations @@ -63,3 +52,6 @@ interface RoleEligibilityScheduleInstances { @@doc(RoleEligibilityScheduleInstance.name, "The name (hash of schedule name + time) of the role eligibility schedule to get." ); +@@doc(RoleEligibilityScheduleInstance.properties, + "Role eligibility schedule instance properties." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilityScheduleRequest.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilityScheduleRequest.tsp index 068d088b6..0733230a5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilityScheduleRequest.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleEligibilityScheduleRequest.tsp @@ -13,25 +13,14 @@ namespace Azure.ResourceManager.Authorization; /** * Role Eligibility schedule request */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - RoleEligibilityScheduleRequestProperties -) -model RoleEligibilityScheduleRequest extends Foundations.ExtensionResource { +model RoleEligibilityScheduleRequest + is Azure.ResourceManager.ExtensionResource { ...ResourceNameParameter< Resource = RoleEligibilityScheduleRequest, KeyName = "roleEligibilityScheduleRequestName", SegmentName = "roleEligibilityScheduleRequests", NamePattern = "" >; - - /** - * Role eligibility schedule request properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RoleEligibilityScheduleRequestProperties; } @armResourceOperations @@ -82,6 +71,9 @@ interface RoleEligibilityScheduleRequests { @@doc(RoleEligibilityScheduleRequest.name, "The name (guid) of the role eligibility schedule request to get." ); +@@doc(RoleEligibilityScheduleRequest.properties, + "Role eligibility schedule request properties." +); @@encodedName(RoleEligibilityScheduleRequests.create::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicy.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicy.tsp index bae896c1b..0b93b7a4a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicy.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicy.tsp @@ -13,25 +13,14 @@ namespace Azure.ResourceManager.Authorization; /** * Role management policy */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - RoleManagementPolicyProperties -) -model RoleManagementPolicy extends Foundations.ExtensionResource { +model RoleManagementPolicy + is Azure.ResourceManager.ExtensionResource { ...ResourceNameParameter< Resource = RoleManagementPolicy, KeyName = "roleManagementPolicyName", SegmentName = "roleManagementPolicies", NamePattern = "" >; - - /** - * Role management policy properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RoleManagementPolicyProperties; } @armResourceOperations @@ -58,6 +47,7 @@ interface RoleManagementPolicies { @@doc(RoleManagementPolicy.name, "The name (guid) of the role management policy to get." ); +@@doc(RoleManagementPolicy.properties, "Role management policy properties."); @@encodedName(RoleManagementPolicies.update::parameters.properties, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicyAssignment.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicyAssignment.tsp index 630b958c8..041ccaa31 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicyAssignment.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/RoleManagementPolicyAssignment.tsp @@ -13,25 +13,14 @@ namespace Azure.ResourceManager.Authorization; /** * Role management policy */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - RoleManagementPolicyAssignmentProperties -) -model RoleManagementPolicyAssignment extends Foundations.ExtensionResource { +model RoleManagementPolicyAssignment + is Azure.ResourceManager.ExtensionResource { ...ResourceNameParameter< Resource = RoleManagementPolicyAssignment, KeyName = "roleManagementPolicyAssignmentName", SegmentName = "roleManagementPolicyAssignments", NamePattern = "" >; - - /** - * Role management policy properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RoleManagementPolicyAssignmentProperties; } @armResourceOperations @@ -57,6 +46,9 @@ interface RoleManagementPolicyAssignments { @@doc(RoleManagementPolicyAssignment.name, "The name of format {guid_guid} the role management policy assignment to get." ); +@@doc(RoleManagementPolicyAssignment.properties, + "Role management policy properties." +); @@encodedName(RoleManagementPolicyAssignments.create::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/client.tsp index 565ca685c..314c4a0a1 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/client.tsp @@ -44,6 +44,39 @@ using Azure.ResourceManager.Authorization; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(PolicyAssignmentProperties.policy); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(DenyAssignment.properties); + @@clientName(ProviderOperationsMetadataOperationGroup, "ProviderOperationsMetadata" ); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RoleAssignment.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RoleDefinition.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RoleAssignmentSchedule.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RoleAssignmentScheduleInstance.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RoleAssignmentScheduleRequest.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RoleEligibilitySchedule.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RoleEligibilityScheduleInstance.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RoleEligibilityScheduleRequest.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RoleManagementPolicy.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RoleManagementPolicyAssignment.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/models.tsp index 43838914d..be571fe5d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/models.tsp @@ -1,10 +1,12 @@ import "@typespec/rest"; import "@typespec/http"; import "@azure-tools/typespec-azure-core"; +import "@typespec/openapi"; import "@azure-tools/typespec-azure-resource-manager"; using TypeSpec.Rest; using TypeSpec.Http; +using TypeSpec.OpenAPI; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; @@ -223,6 +225,7 @@ model ClassicAdministrator { /** * Properties for the classic administrator. */ + @extension("x-ms-client-flatten", true) properties?: ClassicAdministratorProperties; } @@ -396,6 +399,7 @@ model ProviderOperation { /** * The operation properties. */ + @extension("x-ms-client-flatten", true) properties?: Record; /** @@ -481,6 +485,7 @@ model RoleAssignmentCreateParameters { /** * Role assignment properties. */ + @extension("x-ms-client-flatten", true) properties: RoleAssignmentProperties; } @@ -692,16 +697,19 @@ model ExpandedProperties { /** * Details of the resource scope */ + @extension("x-ms-client-flatten", true) scope?: ExpandedPropertiesScope; /** * Details of role definition */ + @extension("x-ms-client-flatten", true) roleDefinition?: ExpandedPropertiesRoleDefinition; /** * Details of the principal */ + @extension("x-ms-client-flatten", true) principal?: ExpandedPropertiesPrincipal; } @@ -926,6 +934,7 @@ model RoleAssignmentScheduleRequestProperties { /** * Schedule info of the role assignment schedule */ + @extension("x-ms-client-flatten", true) scheduleInfo?: RoleAssignmentScheduleRequestPropertiesScheduleInfo; /** @@ -984,6 +993,7 @@ model RoleAssignmentScheduleRequestPropertiesScheduleInfo { /** * Expiration of the role assignment schedule */ + @extension("x-ms-client-flatten", true) expiration?: RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration; } @@ -1218,6 +1228,7 @@ model RoleEligibilityScheduleRequestProperties { /** * Schedule info of the role eligibility schedule */ + @extension("x-ms-client-flatten", true) scheduleInfo?: RoleEligibilityScheduleRequestPropertiesScheduleInfo; /** @@ -1281,6 +1292,7 @@ model RoleEligibilityScheduleRequestPropertiesScheduleInfo { /** * Expiration of the role eligibility schedule */ + @extension("x-ms-client-flatten", true) expiration?: RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration; } @@ -1435,6 +1447,7 @@ model PolicyProperties { * Details of the resource scope */ @visibility("read") + @extension("x-ms-client-flatten", true) scope?: PolicyPropertiesScope; } @@ -1500,16 +1513,19 @@ model PolicyAssignmentProperties { /** * Details of the resource scope */ + @extension("x-ms-client-flatten", true) scope?: PolicyAssignmentPropertiesScope; /** * Details of role definition */ + @extension("x-ms-client-flatten", true) roleDefinition?: PolicyAssignmentPropertiesRoleDefinition; /** * Details of the policy */ + @extension("x-ms-client-flatten", true) policy?: PolicyAssignmentPropertiesPolicy; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/tspconfig.yaml index 3c7a890db..7768960f4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-authorization/tsp-output/tspconfig.yaml @@ -8,6 +8,7 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" examples-directory: "{project-root}/examples" + arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-resource-manager/all" diff --git a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/Application.tsp b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/Application.tsp index e037ac95f..3d4b6a1a1 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/Application.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/Application.tsp @@ -159,3 +159,6 @@ interface Applications { } @@doc(Application.name, "The name of the Application"); +@@doc(Application.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/BusinessProcess.tsp b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/BusinessProcess.tsp index b112495ac..6534ee598 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/BusinessProcess.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/BusinessProcess.tsp @@ -114,3 +114,6 @@ interface BusinessProcesses { } @@doc(BusinessProcess.name, "The name of the business process"); +@@doc(BusinessProcess.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/BusinessProcessVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/BusinessProcessVersion.tsp index 189ecee16..91945319b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/BusinessProcessVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/BusinessProcessVersion.tsp @@ -97,3 +97,6 @@ interface BusinessProcessVersions { } @@doc(BusinessProcessVersion.name, "The version of the business process"); +@@doc(BusinessProcessVersion.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/InfrastructureResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/InfrastructureResource.tsp index ae100cd5f..a3b58d6be 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/InfrastructureResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/InfrastructureResource.tsp @@ -119,3 +119,6 @@ interface InfrastructureResources { @@doc(InfrastructureResource.name, "The name of the infrastructure resource in the space." ); +@@doc(InfrastructureResource.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/Space.tsp b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/Space.tsp index 3abdd107c..58b856d62 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/Space.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/Space.tsp @@ -116,3 +116,4 @@ interface Spaces { } @@doc(Space.name, "The name of the space"); +@@doc(Space.properties, "The resource-specific properties for this resource."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/client.tsp index aa738c8fd..e32700df4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/client.tsp @@ -21,3 +21,18 @@ using Microsoft.IntegrationSpaces; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(InfrastructureResourceUpdate.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(Space.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(Application.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(BusinessProcess.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(BusinessProcessVersion.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(InfrastructureResource.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/models.tsp index b491e24f1..8275a9e85 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/models.tsp @@ -1,10 +1,12 @@ import "@typespec/rest"; import "@typespec/http"; +import "@typespec/openapi"; import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-azure-resource-manager"; using TypeSpec.Rest; using TypeSpec.Http; +using TypeSpec.OpenAPI; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; @@ -97,6 +99,7 @@ model SpaceUpdate { /** * The updatable properties of the Space. */ + @extension("x-ms-client-flatten", true) properties?: SpaceUpdateProperties; } @@ -170,6 +173,7 @@ model ApplicationUpdate { /** * The updatable properties of the Application. */ + @extension("x-ms-client-flatten", true) properties?: ApplicationUpdateProperties; } @@ -306,6 +310,7 @@ model BusinessProcessUpdate { /** * The updatable properties of the BusinessProcess. */ + @extension("x-ms-client-flatten", true) properties?: BusinessProcessUpdateProperties; } @@ -542,6 +547,7 @@ model ApplicationResource extends ProxyResource { * The resource-specific properties for this resource. */ @visibility("read", "create") + @extension("x-ms-client-flatten", true) properties?: ApplicationResourceProperties; } @@ -578,6 +584,7 @@ model ApplicationResourceUpdate { /** * The updatable properties of the ApplicationResource. */ + @extension("x-ms-client-flatten", true) properties?: ApplicationResourceUpdateProperties; } @@ -644,6 +651,7 @@ model InfrastructureResourceUpdate { /** * The updatable properties of the InfrastructureResource. */ + @extension("x-ms-client-flatten", true) properties?: InfrastructureResourceUpdateProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/tspconfig.yaml index 3c7a890db..7768960f4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-azureintegrationspaces/tsp-output/tspconfig.yaml @@ -8,6 +8,7 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" examples-directory: "{project-root}/examples" + arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-resource-manager/all" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/AvailabilitySet.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/AvailabilitySet.tsp index 4d0fe58b9..e8f0f768e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/AvailabilitySet.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/AvailabilitySet.tsp @@ -13,10 +13,8 @@ namespace Microsoft.Compute; /** * Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability set. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model AvailabilitySet extends Resource { +model AvailabilitySet + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = AvailabilitySet, KeyName = "availabilitySetName", @@ -28,12 +26,6 @@ model AvailabilitySet extends Resource { * Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. */ sku?: Sku; - - /** - * The instance view of a resource. - */ - @extension("x-ms-client-flatten", true) - properties?: AvailabilitySetProperties; } @armResourceOperations @@ -93,6 +85,7 @@ interface AvailabilitySets { } @@doc(AvailabilitySet.name, "The name of the availability set."); +@@doc(AvailabilitySet.properties, "The instance view of a resource."); @@encodedName(AvailabilitySets.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservation.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservation.tsp index 92cb8200f..533496de7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservation.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservation.tsp @@ -14,11 +14,9 @@ namespace Microsoft.Compute; /** * Specifies information about the capacity reservation. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(CapacityReservationGroup) -@includeInapplicableMetadataInPayload(false) -model CapacityReservation extends Resource { +model CapacityReservation + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = CapacityReservation, KeyName = "capacityReservationName", @@ -35,12 +33,6 @@ model CapacityReservation extends Resource { * Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the list of zones specified during the capacity reservation group creation. The zone can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If provided, enforces VM/VMSS using this capacity reservation to be in same zone. */ zones?: string[]; - - /** - * Properties of the Capacity reservation. - */ - @extension("x-ms-client-flatten", true) - properties?: CapacityReservationProperties; } @armResourceOperations @@ -89,6 +81,9 @@ interface CapacityReservations { } @@doc(CapacityReservation.name, "The name of the capacity reservation."); +@@doc(CapacityReservation.properties, + "Properties of the Capacity reservation." +); @@encodedName(CapacityReservations.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservationGroup.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservationGroup.tsp index 2a49b1a68..573ef91c5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservationGroup.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CapacityReservationGroup.tsp @@ -13,10 +13,8 @@ namespace Microsoft.Compute; /** * Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation cannot be added or moved to another capacity reservation group. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model CapacityReservationGroup extends Resource { +model CapacityReservationGroup + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = CapacityReservationGroup, KeyName = "capacityReservationGroupName", @@ -28,12 +26,6 @@ model CapacityReservationGroup extends Resource { * Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. If not provided, the group supports only regional resources in the region. If provided, enforces each capacity reservation in the group to be in one of the zones. */ zones?: string[]; - - /** - * capacity reservation group Properties. - */ - @extension("x-ms-client-flatten", true) - properties?: CapacityReservationGroupProperties; } @armResourceOperations @@ -101,6 +93,9 @@ interface CapacityReservationGroups { @@doc(CapacityReservationGroup.name, "The name of the capacity reservation group." ); +@@doc(CapacityReservationGroup.properties, + "capacity reservation group Properties." +); @@encodedName(CapacityReservationGroups.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CloudService.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CloudService.tsp index b70b95131..8a2ef4cbb 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CloudService.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CloudService.tsp @@ -13,10 +13,8 @@ namespace Microsoft.Compute; /** * Describes the cloud service. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model CloudService { +model CloudService + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = CloudService, KeyName = "cloudServiceName", @@ -57,12 +55,6 @@ model CloudService { * List of logical availability zone of the resource. List should contain only 1 zone where cloud service should be provisioned. This field is optional. */ zones?: string[]; - - /** - * Cloud service properties - */ - @extension("x-ms-client-flatten", true) - properties?: CloudServiceProperties; } @armResourceOperations @@ -202,6 +194,7 @@ interface CloudServices { } @@doc(CloudService.name, "Name of the cloud service."); +@@doc(CloudService.properties, "Cloud service properties"); @@encodedName(CloudServices.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CloudServiceRole.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CloudServiceRole.tsp index 06f22cade..9e43847e9 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CloudServiceRole.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CloudServiceRole.tsp @@ -14,11 +14,9 @@ namespace Microsoft.Compute; /** * Describes a role of the cloud service. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(CloudService) -@includeInapplicableMetadataInPayload(false) -model CloudServiceRole { +model CloudServiceRole + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = CloudServiceRole, KeyName = "roleName", @@ -48,12 +46,6 @@ model CloudServiceRole { * Describes the cloud service role sku. */ sku?: CloudServiceRoleSku; - - /** - * The cloud service role properties. - */ - @extension("x-ms-client-flatten", true) - properties?: CloudServiceRoleProperties; } @armResourceOperations @@ -72,3 +64,4 @@ interface CloudServiceRoles { } @@doc(CloudServiceRole.name, "Name of the role."); +@@doc(CloudServiceRole.properties, "The cloud service role properties."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGallery.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGallery.tsp index 62f9f5285..54a4d928c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGallery.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGallery.tsp @@ -14,22 +14,15 @@ namespace Microsoft.Compute; /** * Specifies information about the Community Gallery that you want to create or update. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @subscriptionResource @parentResource(SubscriptionLocationResource) -@includeInapplicableMetadataInPayload(false) -model CommunityGallery extends PirCommunityGalleryResource { +model CommunityGallery is Azure.ResourceManager.ProxyResource<{}> { ...ResourceNameParameter< Resource = CommunityGallery, KeyName = "publicGalleryName", SegmentName = "communityGalleries", NamePattern = "" >; - - @extension("x-ms-client-flatten", true) - @visibility("read,create") - properties?: {}; } @armResourceOperations diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImage.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImage.tsp index 445b8464e..ccdb0708f 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImage.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImage.tsp @@ -14,23 +14,15 @@ namespace Microsoft.Compute; /** * Specifies information about the gallery image definition that you want to create or update. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(CommunityGallery) -@includeInapplicableMetadataInPayload(false) -model CommunityGalleryImage extends PirCommunityGalleryResource { +model CommunityGalleryImage + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = CommunityGalleryImage, KeyName = "galleryImageName", SegmentName = "images", NamePattern = "" >; - - /** - * Describes the properties of a gallery image definition. - */ - @extension("x-ms-client-flatten", true) - properties?: CommunityGalleryImageProperties; } @armResourceOperations @@ -51,3 +43,6 @@ interface CommunityGalleryImages { @@doc(CommunityGalleryImage.name, "The name of the community gallery image definition." ); +@@doc(CommunityGalleryImage.properties, + "Describes the properties of a gallery image definition." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImageVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImageVersion.tsp index 1dab76b03..a0a86bbc6 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImageVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/CommunityGalleryImageVersion.tsp @@ -14,23 +14,15 @@ namespace Microsoft.Compute; /** * Specifies information about the gallery image version that you want to create or update. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(CommunityGalleryImage) -@includeInapplicableMetadataInPayload(false) -model CommunityGalleryImageVersion extends PirCommunityGalleryResource { +model CommunityGalleryImageVersion + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = CommunityGalleryImageVersion, KeyName = "galleryImageVersionName", SegmentName = "versions", NamePattern = "" >; - - /** - * Describes the properties of a gallery image version. - */ - @extension("x-ms-client-flatten", true) - properties?: CommunityGalleryImageVersionProperties; } @armResourceOperations @@ -51,3 +43,6 @@ interface CommunityGalleryImageVersions { @@doc(CommunityGalleryImageVersion.name, "The name of the community gallery image version. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: .." ); +@@doc(CommunityGalleryImageVersion.properties, + "Describes the properties of a gallery image version." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHost.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHost.tsp index 4a0f3a382..888d5ca57 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHost.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHost.tsp @@ -14,11 +14,9 @@ namespace Microsoft.Compute; /** * Specifies information about the Dedicated host. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(DedicatedHostGroup) -@includeInapplicableMetadataInPayload(false) -model DedicatedHost extends Resource { +model DedicatedHost + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = DedicatedHost, KeyName = "hostName", @@ -30,12 +28,6 @@ model DedicatedHost extends Resource { * SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute SKUs for a list of possible values. */ sku: Sku; - - /** - * Properties of the dedicated host. - */ - @extension("x-ms-client-flatten", true) - properties?: DedicatedHostProperties; } @armResourceOperations @@ -116,6 +108,7 @@ interface DedicatedHosts { } @@doc(DedicatedHost.name, "The name of the dedicated host."); +@@doc(DedicatedHost.properties, "Properties of the dedicated host."); @@encodedName(DedicatedHosts.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHostGroup.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHostGroup.tsp index a5589e9cb..941b9f465 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHostGroup.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DedicatedHostGroup.tsp @@ -13,10 +13,8 @@ namespace Microsoft.Compute; /** * Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another dedicated host group. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model DedicatedHostGroup extends Resource { +model DedicatedHostGroup + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = DedicatedHostGroup, KeyName = "hostGroupName", @@ -28,12 +26,6 @@ model DedicatedHostGroup extends Resource { * Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. */ zones?: string[]; - - /** - * Dedicated Host Group Properties. - */ - @extension("x-ms-client-flatten", true) - properties?: DedicatedHostGroupProperties; } @armResourceOperations @@ -85,6 +77,7 @@ interface DedicatedHostGroups { } @@doc(DedicatedHostGroup.name, "The name of the dedicated host group."); +@@doc(DedicatedHostGroup.properties, "Dedicated Host Group Properties."); @@encodedName(DedicatedHostGroups.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Disk.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Disk.tsp index 2d1a3d49b..1735a562b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Disk.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Disk.tsp @@ -13,10 +13,7 @@ namespace Microsoft.Compute; /** * Disk resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model Disk extends Resource { +model Disk is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = Disk, KeyName = "diskName", @@ -50,12 +47,6 @@ model Disk extends Resource { * The extended location where the disk will be created. Extended location cannot be changed. */ extendedLocation?: ExtendedLocation; - - /** - * Disk resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: DiskProperties; } @armResourceOperations @@ -110,6 +101,7 @@ interface Disks { @@doc(Disk.name, "The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters." ); +@@doc(Disk.properties, "Disk resource properties."); @@encodedName(Disks.createOrUpdate::parameters.resource, "application/json", "disk" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskAccess.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskAccess.tsp index 7cabeefca..dba917b60 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskAccess.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskAccess.tsp @@ -13,10 +13,8 @@ namespace Microsoft.Compute; /** * disk access resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model DiskAccess extends Resource { +model DiskAccess + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = DiskAccess, KeyName = "diskAccessName", @@ -28,9 +26,6 @@ model DiskAccess extends Resource { * The extended location where the disk access will be created. Extended location cannot be changed. */ extendedLocation?: ExtendedLocation; - - @extension("x-ms-client-flatten", true) - properties?: DiskAccessProperties; } @armResourceOperations @@ -93,6 +88,7 @@ interface DiskAccesses { @@doc(DiskAccess.name, "The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters." ); +@@doc(DiskAccess.properties, ""); @@encodedName(DiskAccesses.createOrUpdate::parameters.resource, "application/json", "diskAccess" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskEncryptionSet.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskEncryptionSet.tsp index 4f124857d..2a5989021 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskEncryptionSet.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskEncryptionSet.tsp @@ -13,10 +13,8 @@ namespace Microsoft.Compute; /** * disk encryption set resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model DiskEncryptionSet extends Resource { +model DiskEncryptionSet + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = DiskEncryptionSet, KeyName = "diskEncryptionSetName", @@ -28,9 +26,6 @@ model DiskEncryptionSet extends Resource { * The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. */ identity?: EncryptionSetIdentity; - - @extension("x-ms-client-flatten", true) - properties?: EncryptionSetProperties; } @armResourceOperations @@ -93,6 +88,7 @@ interface DiskEncryptionSets { @@doc(DiskEncryptionSet.name, "The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters." ); +@@doc(DiskEncryptionSet.properties, ""); @@encodedName(DiskEncryptionSets.createOrUpdate::parameters.resource, "application/json", "diskEncryptionSet" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskRestorePoint.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskRestorePoint.tsp index 7d4431f97..8fa92c4b9 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskRestorePoint.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/DiskRestorePoint.tsp @@ -14,23 +14,15 @@ namespace Microsoft.Compute; /** * Properties of disk restore point */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(RestorePoint) -@includeInapplicableMetadataInPayload(false) -model DiskRestorePoint extends ProxyOnlyResource { +model DiskRestorePoint + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = DiskRestorePoint, KeyName = "diskRestorePointName", SegmentName = "diskRestorePoints", NamePattern = "" >; - - /** - * Properties of an incremental disk restore point - */ - @extension("x-ms-client-flatten", true) - properties?: DiskRestorePointProperties; } @armResourceOperations @@ -113,6 +105,9 @@ interface DiskRestorePoints { } @@doc(DiskRestorePoint.name, "The name of the disk restore point created."); +@@doc(DiskRestorePoint.properties, + "Properties of an incremental disk restore point" +); @@encodedName(DiskRestorePoints.grantAccess::parameters.body, "application/json", "grantAccessData" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Gallery.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Gallery.tsp index 7817ee0fb..de0b6fdb9 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Gallery.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Gallery.tsp @@ -13,22 +13,13 @@ namespace Microsoft.Compute; /** * Specifies information about the Shared Image Gallery that you want to create or update. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model Gallery extends Resource { +model Gallery is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = Gallery, KeyName = "galleryName", SegmentName = "galleries", NamePattern = "" >; - - /** - * Describes the properties of a Shared Image Gallery. - */ - @extension("x-ms-client-flatten", true) - properties?: GalleryProperties; } @armResourceOperations @@ -95,6 +86,9 @@ interface Galleries { } @@doc(Gallery.name, "The name of the Shared Image Gallery."); +@@doc(Gallery.properties, + "Describes the properties of a Shared Image Gallery." +); @@encodedName(Galleries.createOrUpdate::parameters.resource, "application/json", "gallery" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplication.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplication.tsp index 982fa80fd..a26a8c33c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplication.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplication.tsp @@ -14,23 +14,15 @@ namespace Microsoft.Compute; /** * Specifies information about the gallery Application Definition that you want to create or update. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Gallery) -@includeInapplicableMetadataInPayload(false) -model GalleryApplication extends Resource { +model GalleryApplication + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = GalleryApplication, KeyName = "galleryApplicationName", SegmentName = "applications", NamePattern = "" >; - - /** - * Describes the properties of a gallery Application Definition. - */ - @extension("x-ms-client-flatten", true) - properties?: GalleryApplicationProperties; } @armResourceOperations @@ -70,6 +62,9 @@ interface GalleryApplications { @@doc(GalleryApplication.name, "The name of the gallery Application Definition to be retrieved." ); +@@doc(GalleryApplication.properties, + "Describes the properties of a gallery Application Definition." +); @@encodedName(GalleryApplications.createOrUpdate::parameters.resource, "application/json", "galleryApplication" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplicationVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplicationVersion.tsp index c01275617..984864424 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplicationVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryApplicationVersion.tsp @@ -14,23 +14,15 @@ namespace Microsoft.Compute; /** * Specifies information about the gallery Application Version that you want to create or update. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(GalleryApplication) -@includeInapplicableMetadataInPayload(false) -model GalleryApplicationVersion extends Resource { +model GalleryApplicationVersion + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = GalleryApplicationVersion, KeyName = "galleryApplicationVersionName", SegmentName = "versions", NamePattern = "" >; - - /** - * Describes the properties of a gallery image version. - */ - @extension("x-ms-client-flatten", true) - properties?: GalleryApplicationVersionProperties; } @armResourceOperations @@ -84,6 +76,9 @@ interface GalleryApplicationVersions { @@doc(GalleryApplicationVersion.name, "The name of the gallery Application Version to be retrieved." ); +@@doc(GalleryApplicationVersion.properties, + "Describes the properties of a gallery image version." +); @@encodedName(GalleryApplicationVersions.createOrUpdate::parameters.resource, "application/json", "galleryApplicationVersion" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImage.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImage.tsp index 7bf5c6c00..97fa72312 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImage.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImage.tsp @@ -14,23 +14,15 @@ namespace Microsoft.Compute; /** * Specifies information about the gallery image definition that you want to create or update. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Gallery) -@includeInapplicableMetadataInPayload(false) -model GalleryImage extends Resource { +model GalleryImage + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = GalleryImage, KeyName = "galleryImageName", SegmentName = "images", NamePattern = "" >; - - /** - * Describes the properties of a gallery image definition. - */ - @extension("x-ms-client-flatten", true) - properties?: GalleryImageProperties; } @armResourceOperations @@ -70,6 +62,9 @@ interface GalleryImages { @@doc(GalleryImage.name, "The name of the gallery image definition to be retrieved." ); +@@doc(GalleryImage.properties, + "Describes the properties of a gallery image definition." +); @@encodedName(GalleryImages.createOrUpdate::parameters.resource, "application/json", "galleryImage" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImageVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImageVersion.tsp index f0c2c5d71..2ab9540ab 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImageVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/GalleryImageVersion.tsp @@ -14,23 +14,15 @@ namespace Microsoft.Compute; /** * Specifies information about the gallery image version that you want to create or update. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(GalleryImage) -@includeInapplicableMetadataInPayload(false) -model GalleryImageVersion extends Resource { +model GalleryImageVersion + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = GalleryImageVersion, KeyName = "galleryImageVersionName", SegmentName = "versions", NamePattern = "" >; - - /** - * Describes the properties of a gallery image version. - */ - @extension("x-ms-client-flatten", true) - properties?: GalleryImageVersionProperties; } @armResourceOperations @@ -81,6 +73,9 @@ interface GalleryImageVersions { @@doc(GalleryImageVersion.name, "The name of the gallery image version to be retrieved." ); +@@doc(GalleryImageVersion.properties, + "Describes the properties of a gallery image version." +); @@encodedName(GalleryImageVersions.createOrUpdate::parameters.resource, "application/json", "galleryImageVersion" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Image.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Image.tsp index 49e9e1c03..d7f0c8468 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Image.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Image.tsp @@ -13,10 +13,7 @@ namespace Microsoft.Compute; /** * The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model Image extends Resource { +model Image is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = Image, KeyName = "imageName", @@ -28,12 +25,6 @@ model Image extends Resource { * The extended location of the Image. */ extendedLocation?: ExtendedLocation; - - /** - * Describes the properties of an Image. - */ - @extension("x-ms-client-flatten", true) - properties?: ImageProperties; } @armResourceOperations @@ -87,6 +78,7 @@ interface Images { } @@doc(Image.name, "The name of the image."); +@@doc(Image.properties, "Describes the properties of an Image."); @@encodedName(Images.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/OSFamily.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/OSFamily.tsp index 3a160028b..96f54a2f4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/OSFamily.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/OSFamily.tsp @@ -13,12 +13,9 @@ namespace Microsoft.Compute; /** * Describes a cloud service OS family. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @subscriptionResource @parentResource(SubscriptionLocationResource) -@includeInapplicableMetadataInPayload(false) -model OSFamily { +model OSFamily is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = OSFamily, KeyName = "osFamilyName", @@ -43,12 +40,6 @@ model OSFamily { */ @visibility("read") location?: string; - - /** - * OS family properties. - */ - @extension("x-ms-client-flatten", true) - properties?: OSFamilyProperties; } @armResourceOperations @@ -69,3 +60,4 @@ interface OSFamilies { } @@doc(OSFamily.name, "Name of the OS family."); +@@doc(OSFamily.properties, "OS family properties."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/OSVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/OSVersion.tsp index a9ed67810..7cc03e22a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/OSVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/OSVersion.tsp @@ -13,12 +13,9 @@ namespace Microsoft.Compute; /** * Describes a cloud service OS version. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @subscriptionResource @parentResource(SubscriptionLocationResource) -@includeInapplicableMetadataInPayload(false) -model OSVersion { +model OSVersion is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = OSVersion, KeyName = "osVersionName", @@ -43,12 +40,6 @@ model OSVersion { */ @visibility("read") location?: string; - - /** - * OS version properties. - */ - @extension("x-ms-client-flatten", true) - properties?: OSVersionProperties; } @armResourceOperations @@ -69,3 +60,4 @@ interface OSVersions { } @@doc(OSVersion.name, "Name of the OS version."); +@@doc(OSVersion.properties, "OS version properties."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/PrivateEndpointConnection.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/PrivateEndpointConnection.tsp index 825860245..d6f89c993 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/PrivateEndpointConnection.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/PrivateEndpointConnection.tsp @@ -14,11 +14,9 @@ namespace Microsoft.Compute; /** * The Private Endpoint Connection resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(DiskAccess) -@includeInapplicableMetadataInPayload(false) -model PrivateEndpointConnection { +model PrivateEndpointConnection + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = PrivateEndpointConnection, KeyName = "privateEndpointConnectionName", @@ -37,12 +35,6 @@ model PrivateEndpointConnection { */ @visibility("read") type?: string; - - /** - * Resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: PrivateEndpointConnectionProperties; } @armResourceOperations @@ -82,6 +74,7 @@ interface PrivateEndpointConnections { @@doc(PrivateEndpointConnection.name, "The name of the private endpoint connection." ); +@@doc(PrivateEndpointConnection.properties, "Resource properties."); @@encodedName(PrivateEndpointConnections.updateAPrivateEndpointConnection::parameters.resource, "application/json", "privateEndpointConnection" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/ProximityPlacementGroup.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/ProximityPlacementGroup.tsp index 3133eb079..1606d6f7a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/ProximityPlacementGroup.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/ProximityPlacementGroup.tsp @@ -13,10 +13,8 @@ namespace Microsoft.Compute; /** * Specifies information about the proximity placement group. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model ProximityPlacementGroup extends Resource { +model ProximityPlacementGroup + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = ProximityPlacementGroup, KeyName = "proximityPlacementGroupName", @@ -28,12 +26,6 @@ model ProximityPlacementGroup extends Resource { * Specifies the Availability Zone where virtual machine, virtual machine scale set or availability set associated with the proximity placement group can be created. */ zones?: string[]; - - /** - * Describes the properties of a Proximity Placement Group. - */ - @extension("x-ms-client-flatten", true) - properties?: ProximityPlacementGroupProperties; } @armResourceOperations @@ -90,6 +82,9 @@ interface ProximityPlacementGroups { @@doc(ProximityPlacementGroup.name, "The name of the proximity placement group." ); +@@doc(ProximityPlacementGroup.properties, + "Describes the properties of a Proximity Placement Group." +); @@encodedName(ProximityPlacementGroups.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePoint.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePoint.tsp index 6f3a9e336..6602c4f5d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePoint.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePoint.tsp @@ -14,23 +14,15 @@ namespace Microsoft.Compute; /** * Restore Point details. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(RestorePointCollection) -@includeInapplicableMetadataInPayload(false) -model RestorePoint extends ProxyResource { +model RestorePoint + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = RestorePoint, KeyName = "restorePointName", SegmentName = "restorePoints", NamePattern = "" >; - - /** - * The restore point properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RestorePointProperties; } @armResourceOperations @@ -94,6 +86,7 @@ interface RestorePoints { } @@doc(RestorePoint.name, "The name of the restore point."); +@@doc(RestorePoint.properties, "The restore point properties."); @@encodedName(RestorePoints.create::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePointCollection.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePointCollection.tsp index a28f44991..332cba77d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePointCollection.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RestorePointCollection.tsp @@ -13,22 +13,14 @@ namespace Microsoft.Compute; /** * Create or update Restore Point collection parameters. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model RestorePointCollection extends Resource { +model RestorePointCollection + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = RestorePointCollection, KeyName = "restorePointCollectionName", SegmentName = "restorePointCollections", NamePattern = "" >; - - /** - * The restore point collection properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RestorePointCollectionProperties; } @armResourceOperations @@ -122,6 +114,9 @@ interface RestorePointCollections { } @@doc(RestorePointCollection.name, "The name of the restore point collection."); +@@doc(RestorePointCollection.properties, + "The restore point collection properties." +); @@encodedName(RestorePointCollections.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RoleInstance.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RoleInstance.tsp index acbcf7ef4..4e070b2aa 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RoleInstance.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RoleInstance.tsp @@ -14,11 +14,9 @@ namespace Microsoft.Compute; /** * Describes the cloud service role instance. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(CloudService) -@includeInapplicableMetadataInPayload(false) -model RoleInstance { +model RoleInstance + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = RoleInstance, KeyName = "roleInstanceName", @@ -55,12 +53,6 @@ model RoleInstance { * The role instance SKU. */ sku?: InstanceSku; - - /** - * Role instance properties. - */ - @extension("x-ms-client-flatten", true) - properties?: RoleInstanceProperties; } @armResourceOperations @@ -196,3 +188,4 @@ interface RoleInstances { } @@doc(RoleInstance.name, "Name of the role instance."); +@@doc(RoleInstance.properties, "Role instance properties."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RollingUpgradeStatusInfo.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RollingUpgradeStatusInfo.tsp index 385a3f829..4545c427a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RollingUpgradeStatusInfo.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/RollingUpgradeStatusInfo.tsp @@ -14,24 +14,16 @@ namespace Microsoft.Compute; /** * The status of the latest virtual machine scale set rolling upgrade. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @singleton("latest") @parentResource(VirtualMachineScaleSet) -@includeInapplicableMetadataInPayload(false) -model RollingUpgradeStatusInfo extends Resource { +model RollingUpgradeStatusInfo + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = RollingUpgradeStatusInfo, KeyName = "rollingUpgrade", SegmentName = "rollingUpgrades", NamePattern = "" >; - - /** - * The status of the latest virtual machine scale set rolling upgrade. - */ - @extension("x-ms-client-flatten", true) - properties?: RollingUpgradeStatusInfoProperties; } @armResourceOperations @@ -56,3 +48,6 @@ interface RollingUpgradeStatusInfos { } @@doc(RollingUpgradeStatusInfo.name, ""); +@@doc(RollingUpgradeStatusInfo.properties, + "The status of the latest virtual machine scale set rolling upgrade." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGallery.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGallery.tsp index bbbf96826..d6790ef8e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGallery.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGallery.tsp @@ -14,22 +14,15 @@ namespace Microsoft.Compute; /** * Specifies information about the Shared Gallery that you want to create or update. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @subscriptionResource @parentResource(SubscriptionLocationResource) -@includeInapplicableMetadataInPayload(false) -model SharedGallery extends PirSharedGalleryResource { +model SharedGallery is Azure.ResourceManager.ProxyResource<{}> { ...ResourceNameParameter< Resource = SharedGallery, KeyName = "galleryUniqueName", SegmentName = "sharedGalleries", NamePattern = "" >; - - @extension("x-ms-client-flatten", true) - @visibility("read,create") - properties?: {}; } @armResourceOperations diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImage.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImage.tsp index fb3b34cc3..e3494e5f9 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImage.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImage.tsp @@ -14,23 +14,15 @@ namespace Microsoft.Compute; /** * Specifies information about the gallery image definition that you want to create or update. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(SharedGallery) -@includeInapplicableMetadataInPayload(false) -model SharedGalleryImage extends PirSharedGalleryResource { +model SharedGalleryImage + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = SharedGalleryImage, KeyName = "galleryImageName", SegmentName = "images", NamePattern = "" >; - - /** - * Describes the properties of a gallery image definition. - */ - @extension("x-ms-client-flatten", true) - properties?: SharedGalleryImageProperties; } @armResourceOperations @@ -62,3 +54,6 @@ interface SharedGalleryImages { @@doc(SharedGalleryImage.name, "The name of the Shared Gallery Image Definition from which the Image Versions are to be listed." ); +@@doc(SharedGalleryImage.properties, + "Describes the properties of a gallery image definition." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImageVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImageVersion.tsp index e1d5af2fd..8e4fb0149 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImageVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SharedGalleryImageVersion.tsp @@ -14,23 +14,15 @@ namespace Microsoft.Compute; /** * Specifies information about the gallery image version that you want to create or update. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(SharedGalleryImage) -@includeInapplicableMetadataInPayload(false) -model SharedGalleryImageVersion extends PirSharedGalleryResource { +model SharedGalleryImageVersion + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = SharedGalleryImageVersion, KeyName = "galleryImageVersionName", SegmentName = "versions", NamePattern = "" >; - - /** - * Describes the properties of a gallery image version. - */ - @extension("x-ms-client-flatten", true) - properties?: SharedGalleryImageVersionProperties; } @armResourceOperations @@ -62,3 +54,6 @@ interface SharedGalleryImageVersions { @@doc(SharedGalleryImageVersion.name, "The name of the gallery image version to be created. Needs to follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. Format: .." ); +@@doc(SharedGalleryImageVersion.properties, + "Describes the properties of a gallery image version." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Snapshot.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Snapshot.tsp index b5d84b9cf..6f8ccc808 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Snapshot.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/Snapshot.tsp @@ -13,10 +13,7 @@ namespace Microsoft.Compute; /** * Snapshot resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model Snapshot extends Resource { +model Snapshot is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = Snapshot, KeyName = "snapshotName", @@ -39,12 +36,6 @@ model Snapshot extends Resource { * The extended location where the snapshot will be created. Extended location cannot be changed. */ extendedLocation?: ExtendedLocation; - - /** - * Snapshot resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: SnapshotProperties; } @armResourceOperations @@ -99,6 +90,7 @@ interface Snapshots { @@doc(Snapshot.name, "The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters." ); +@@doc(Snapshot.properties, "Snapshot resource properties."); @@encodedName(Snapshots.createOrUpdate::parameters.resource, "application/json", "snapshot" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SshPublicKeyResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SshPublicKeyResource.tsp index ccd902cf8..1c02ca4b5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SshPublicKeyResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/SshPublicKeyResource.tsp @@ -13,22 +13,14 @@ namespace Microsoft.Compute; /** * Specifies information about the SSH public key. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model SshPublicKeyResource extends Resource { +model SshPublicKeyResource + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = SshPublicKeyResource, KeyName = "sshPublicKeyName", SegmentName = "sshPublicKeys", NamePattern = "" >; - - /** - * Properties of the SSH public key. - */ - @extension("x-ms-client-flatten", true) - properties?: SshPublicKeyResourceProperties; } @armResourceOperations @@ -93,6 +85,7 @@ interface SshPublicKeyResources { } @@doc(SshPublicKeyResource.name, "The name of the SSH public key."); +@@doc(SshPublicKeyResource.properties, "Properties of the SSH public key."); @@encodedName(SshPublicKeyResources.create::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachine.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachine.tsp index 8a840751d..a4ba3eb4b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachine.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachine.tsp @@ -13,10 +13,8 @@ namespace Microsoft.Compute; /** * Describes a Virtual Machine. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model VirtualMachine extends Resource { +model VirtualMachine + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = VirtualMachine, KeyName = "vmName", @@ -49,12 +47,6 @@ model VirtualMachine extends Resource { * The extended location of the Virtual Machine. */ extendedLocation?: ExtendedLocation; - - /** - * Describes the properties of a Virtual Machine. - */ - @extension("x-ms-client-flatten", true) - properties?: VirtualMachineProperties; } @armResourceOperations @@ -325,6 +317,9 @@ interface VirtualMachines { } @@doc(VirtualMachine.name, "The name of the virtual machine."); +@@doc(VirtualMachine.properties, + "Describes the properties of a Virtual Machine." +); @@encodedName(VirtualMachines.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineExtension.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineExtension.tsp index 0d5d5c826..ae7931c93 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineExtension.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineExtension.tsp @@ -14,23 +14,15 @@ namespace Microsoft.Compute; /** * Describes a Virtual Machine Extension. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(VirtualMachine) -@includeInapplicableMetadataInPayload(false) -model VirtualMachineExtension extends ResourceWithOptionalLocation { +model VirtualMachineExtension + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = VirtualMachineExtension, KeyName = "vmExtensionName", SegmentName = "extensions", NamePattern = "" >; - - /** - * Describes the properties of a Virtual Machine Extension. - */ - @extension("x-ms-client-flatten", true) - properties?: VirtualMachineExtensionProperties; } @armResourceOperations @@ -95,6 +87,9 @@ interface VirtualMachineExtensions { @@doc(VirtualMachineExtension.name, "The name of the virtual machine extension." ); +@@doc(VirtualMachineExtension.properties, + "Describes the properties of a Virtual Machine Extension." +); @@encodedName(VirtualMachineExtensions.createOrUpdate::parameters.resource, "application/json", "extensionParameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineExtensionImage.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineExtensionImage.tsp index 9a7d8f7cd..37c66e420 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineExtensionImage.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineExtensionImage.tsp @@ -13,24 +13,16 @@ namespace Microsoft.Compute; /** * Describes a Virtual Machine Extension Image. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @subscriptionResource @parentResource(SubscriptionLocationResource) -@includeInapplicableMetadataInPayload(false) -model VirtualMachineExtensionImage extends Resource { +model VirtualMachineExtensionImage + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = VirtualMachineExtensionImage, KeyName = "version", SegmentName = "versions", NamePattern = "" >; - - /** - * Describes the properties of a Virtual Machine Extension Image. - */ - @extension("x-ms-client-flatten", true) - properties?: VirtualMachineExtensionImageProperties; } @armResourceOperations @@ -49,3 +41,6 @@ interface VirtualMachineExtensionImages { } @@doc(VirtualMachineExtensionImage.name, ""); +@@doc(VirtualMachineExtensionImage.properties, + "Describes the properties of a Virtual Machine Extension Image." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineRunCommand.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineRunCommand.tsp index a2365897f..75fff05cf 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineRunCommand.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineRunCommand.tsp @@ -14,23 +14,15 @@ namespace Microsoft.Compute; /** * Describes a Virtual Machine run command. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(VirtualMachine) -@includeInapplicableMetadataInPayload(false) -model VirtualMachineRunCommand extends Resource { +model VirtualMachineRunCommand + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = VirtualMachineRunCommand, KeyName = "runCommandName", SegmentName = "runCommands", NamePattern = "" >; - - /** - * Describes the properties of a Virtual Machine run command. - */ - @extension("x-ms-client-flatten", true) - properties?: VirtualMachineRunCommandProperties; } @armResourceOperations @@ -107,6 +99,9 @@ interface VirtualMachineRunCommands { @@doc(VirtualMachineRunCommand.name, "The name of the virtual machine run command." ); +@@doc(VirtualMachineRunCommand.properties, + "Describes the properties of a Virtual Machine run command." +); @@encodedName(VirtualMachineRunCommands.createOrUpdate::parameters.resource, "application/json", "runCommand" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSet.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSet.tsp index 24e35c9ec..faeab77c5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSet.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSet.tsp @@ -13,10 +13,8 @@ namespace Microsoft.Compute; /** * Describes a Virtual Machine Scale Set. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model VirtualMachineScaleSet extends Resource { +model VirtualMachineScaleSet + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = VirtualMachineScaleSet, KeyName = "vmScaleSetName", @@ -48,12 +46,6 @@ model VirtualMachineScaleSet extends Resource { * The extended location of the Virtual Machine Scale Set. */ extendedLocation?: ExtendedLocation; - - /** - * Describes the properties of a Virtual Machine Scale Set. - */ - @extension("x-ms-client-flatten", true) - properties?: VirtualMachineScaleSetProperties; } @armResourceOperations @@ -572,6 +564,9 @@ interface VirtualMachineScaleSets { } @@doc(VirtualMachineScaleSet.name, "The name of the VM scale set."); +@@doc(VirtualMachineScaleSet.properties, + "Describes the properties of a Virtual Machine Scale Set." +); @@encodedName(VirtualMachineScaleSets.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetExtension.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetExtension.tsp index 8900700d2..4e7938302 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetExtension.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetExtension.tsp @@ -14,11 +14,9 @@ namespace Microsoft.Compute; /** * Describes a Virtual Machine Scale Set Extension. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(VirtualMachineScaleSet) -@includeInapplicableMetadataInPayload(false) -model VirtualMachineScaleSetExtension extends SubResourceReadOnly { +model VirtualMachineScaleSetExtension + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = VirtualMachineScaleSetExtension, KeyName = "vmssExtensionName", @@ -31,12 +29,6 @@ model VirtualMachineScaleSetExtension extends SubResourceReadOnly { */ @visibility("read") type?: string; - - /** - * Describes the properties of a Virtual Machine Scale Set Extension. - */ - @extension("x-ms-client-flatten", true) - properties?: VirtualMachineScaleSetExtensionProperties; } @armResourceOperations @@ -138,6 +130,9 @@ interface VirtualMachineScaleSetExtensions { @@doc(VirtualMachineScaleSetExtension.name, "The name of the VM scale set extension." ); +@@doc(VirtualMachineScaleSetExtension.properties, + "Describes the properties of a Virtual Machine Scale Set Extension." +); @@encodedName(VirtualMachineScaleSetExtensions.createOrUpdate::parameters.resource, "application/json", "extensionParameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVM.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVM.tsp index fd96c022b..212da798e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVM.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVM.tsp @@ -14,11 +14,9 @@ namespace Microsoft.Compute; /** * Describes a virtual machine scale set virtual machine. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(VirtualMachineScaleSet) -@includeInapplicableMetadataInPayload(false) -model VirtualMachineScaleSetVM extends Resource { +model VirtualMachineScaleSetVM + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = VirtualMachineScaleSetVM, KeyName = "instanceId", @@ -59,12 +57,6 @@ model VirtualMachineScaleSetVM extends Resource { * The identity of the virtual machine, if configured. */ identity?: VirtualMachineIdentity; - - /** - * Describes the properties of a virtual machine scale set virtual machine. - */ - @extension("x-ms-client-flatten", true) - properties?: VirtualMachineScaleSetVMProperties; } @armResourceOperations @@ -428,6 +420,9 @@ interface VirtualMachineScaleSetVMS { } @@doc(VirtualMachineScaleSetVM.name, "The instance ID of the virtual machine."); +@@doc(VirtualMachineScaleSetVM.properties, + "Describes the properties of a virtual machine scale set virtual machine." +); @@encodedName(VirtualMachineScaleSetVMS.update::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVMExtension.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVMExtension.tsp index 0fd06f412..f118c1911 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVMExtension.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/VirtualMachineScaleSetVMExtension.tsp @@ -14,11 +14,9 @@ namespace Microsoft.Compute; /** * Describes a VMSS VM Extension. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(VirtualMachineScaleSetVM) -@includeInapplicableMetadataInPayload(false) -model VirtualMachineScaleSetVMExtension extends SubResourceReadOnly { +model VirtualMachineScaleSetVMExtension + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = VirtualMachineScaleSetVMExtension, KeyName = "vmExtensionName", @@ -37,12 +35,6 @@ model VirtualMachineScaleSetVMExtension extends SubResourceReadOnly { */ @visibility("read", "create") location?: string; - - /** - * Describes the properties of a Virtual Machine Extension. - */ - @extension("x-ms-client-flatten", true) - properties?: VirtualMachineExtensionProperties; } @armResourceOperations @@ -158,6 +150,9 @@ interface VirtualMachineScaleSetVMExtensions { @@doc(VirtualMachineScaleSetVMExtension.name, "The name of the virtual machine extension." ); +@@doc(VirtualMachineScaleSetVMExtension.properties, + "Describes the properties of a Virtual Machine Extension." +); @@encodedName(VirtualMachineScaleSetVMExtensions.createOrUpdate::parameters.resource, "application/json", "extensionParameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/client.tsp index 5c39dd94a..e96d66ae6 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/client.tsp @@ -125,3 +125,120 @@ using Microsoft.Compute; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(Extension.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(VirtualMachineScaleSet.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(VirtualMachineScaleSetExtension.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(VirtualMachineExtension.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RollingUpgradeStatusInfo.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(VirtualMachineScaleSetVMExtension.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(VirtualMachineScaleSetVM.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(VirtualMachine.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(VirtualMachineExtensionImage.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(AvailabilitySet.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(ProximityPlacementGroup.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(DedicatedHostGroup.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(DedicatedHost.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(SshPublicKeyResource.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(Image.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RestorePointCollection.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RestorePoint.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(CapacityReservationGroup.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(CapacityReservation.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(VirtualMachineRunCommand.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(Disk.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(DiskAccess.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(PrivateEndpointConnection.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(DiskEncryptionSet.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(DiskRestorePoint.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(Snapshot.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(Gallery.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(GalleryImage.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(GalleryImageVersion.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(GalleryApplication.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(GalleryApplicationVersion.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(SharedGalleryImage.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(SharedGalleryImageVersion.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(CommunityGalleryImage.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(CommunityGalleryImageVersion.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(RoleInstance.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(CloudServiceRole.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(CloudService.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(OSVersion.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(OSFamily.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/models.tsp index 0f2e126c5..dd1060269 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/models.tsp @@ -1,10 +1,12 @@ import "@typespec/rest"; import "@typespec/http"; +import "@typespec/openapi"; import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-azure-resource-manager"; using TypeSpec.Rest; using TypeSpec.Http; +using TypeSpec.OpenAPI; using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; @@ -1560,6 +1562,7 @@ model ComputeOperationValue { /** * Describes the properties of a Compute Operation Value Display. */ + @extension("x-ms-client-flatten", true) display?: ComputeOperationValueDisplay; } @@ -2709,6 +2712,7 @@ model VirtualMachineScaleSetNetworkConfiguration { /** * Describes a virtual machine scale set network profile's IP configuration. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineScaleSetNetworkConfigurationProperties; } @@ -2795,6 +2799,7 @@ model VirtualMachineScaleSetIPConfiguration { /** * Describes a virtual machine scale set network profile's IP configuration properties. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineScaleSetIPConfigurationProperties; } @@ -2855,6 +2860,7 @@ model VirtualMachineScaleSetPublicIPAddressConfiguration { /** * Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineScaleSetPublicIPAddressConfigurationProperties; /** @@ -3597,6 +3603,7 @@ model VirtualMachineScaleSetUpdate extends UpdateResource { /** * Describes the properties of a Virtual Machine Scale Set. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineScaleSetUpdateProperties; /** @@ -3847,6 +3854,7 @@ model VirtualMachineScaleSetUpdateNetworkConfiguration { /** * Describes a virtual machine scale set updatable network profile's IP configuration.Use this object for updating network profile's IP Configuration. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineScaleSetUpdateNetworkConfigurationProperties; } @@ -3923,6 +3931,7 @@ model VirtualMachineScaleSetUpdateIPConfiguration { /** * Describes a virtual machine scale set network profile's IP configuration properties. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineScaleSetUpdateIPConfigurationProperties; } @@ -3983,6 +3992,7 @@ model VirtualMachineScaleSetUpdatePublicIPAddressConfiguration { /** * Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties; } @@ -4156,6 +4166,7 @@ model VirtualMachineScaleSetExtensionUpdate extends SubResourceReadOnly { /** * Describes the properties of a Virtual Machine Scale Set Extension. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineScaleSetExtensionProperties; } @@ -4532,6 +4543,7 @@ model VirtualMachineScaleSetVMExtensionUpdate extends SubResourceReadOnly { /** * Describes the properties of a Virtual Machine Extension. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineExtensionUpdateProperties; } @@ -5240,6 +5252,7 @@ model NetworkInterfaceReference extends SubResource { /** * Describes a network interface reference properties. */ + @extension("x-ms-client-flatten", true) properties?: NetworkInterfaceReferenceProperties; } @@ -5270,6 +5283,7 @@ model VirtualMachineNetworkInterfaceConfiguration { /** * Describes a virtual machine network profile's IP configuration. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineNetworkInterfaceConfigurationProperties; } @@ -5358,6 +5372,7 @@ model VirtualMachineNetworkInterfaceIPConfiguration { /** * Describes a virtual machine network interface IP configuration properties. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineNetworkInterfaceIPConfigurationProperties; } @@ -5413,6 +5428,7 @@ model VirtualMachinePublicIPAddressConfiguration { /** * Describes a virtual machines IP Configuration's PublicIPAddress configuration */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachinePublicIPAddressConfigurationProperties; /** @@ -5570,6 +5586,7 @@ model VirtualMachineExtensionUpdate extends UpdateResource { /** * Describes the properties of a Virtual Machine Extension. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineExtensionUpdateProperties; } @@ -6016,6 +6033,7 @@ model VirtualMachineUpdate extends UpdateResource { /** * Describes the properties of a Virtual Machine. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineProperties; /** @@ -6359,6 +6377,7 @@ model VirtualMachineImage extends VirtualMachineImageResource { /** * Describes the properties of a Virtual Machine Image. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineImageProperties; } @@ -6633,6 +6652,7 @@ model AvailabilitySetUpdate extends UpdateResource { /** * The instance view of a resource. */ + @extension("x-ms-client-flatten", true) properties?: AvailabilitySetProperties; /** @@ -6818,6 +6838,7 @@ model DedicatedHostGroupUpdate extends UpdateResource { /** * Dedicated Host Group Properties. */ + @extension("x-ms-client-flatten", true) properties?: DedicatedHostGroupProperties; /** @@ -6891,6 +6912,7 @@ model DedicatedHostUpdate extends UpdateResource { /** * Properties of the dedicated host. */ + @extension("x-ms-client-flatten", true) properties?: DedicatedHostProperties; /** @@ -6929,6 +6951,7 @@ model SshPublicKeyUpdateResource extends UpdateResource { /** * Properties of the SSH public key. */ + @extension("x-ms-client-flatten", true) properties?: SshPublicKeyResourceProperties; } @@ -7071,6 +7094,7 @@ model ImageUpdate extends UpdateResource { /** * Describes the properties of an Image. */ + @extension("x-ms-client-flatten", true) properties?: ImageProperties; } @@ -7444,6 +7468,7 @@ model RestorePointCollectionUpdate extends UpdateResource { /** * The restore point collection properties. */ + @extension("x-ms-client-flatten", true) properties?: RestorePointCollectionProperties; } @@ -7531,6 +7556,7 @@ model CapacityReservationGroupUpdate extends UpdateResource { /** * capacity reservation group Properties. */ + @extension("x-ms-client-flatten", true) properties?: CapacityReservationGroupProperties; } @@ -7590,6 +7616,7 @@ model CapacityReservationUpdate extends UpdateResource { /** * Properties of the Capacity reservation. */ + @extension("x-ms-client-flatten", true) properties?: CapacityReservationProperties; /** @@ -7972,6 +7999,7 @@ model VirtualMachineRunCommandUpdate extends UpdateResource { /** * Describes the properties of a Virtual Machine run command. */ + @extension("x-ms-client-flatten", true) properties?: VirtualMachineRunCommandProperties; } @@ -8439,6 +8467,7 @@ model DiskUpdate { /** * Disk resource update properties. */ + @extension("x-ms-client-flatten", true) properties?: DiskUpdateProperties; /** @@ -8705,6 +8734,7 @@ model PrivateLinkResource { /** * Resource properties. */ + @extension("x-ms-client-flatten", true) properties?: PrivateLinkResourceProperties; /** @@ -8846,6 +8876,7 @@ model DiskEncryptionSetUpdate { /** * disk encryption set resource update properties. */ + @extension("x-ms-client-flatten", true) properties?: DiskEncryptionSetUpdateProperties; /** @@ -9177,6 +9208,7 @@ model SnapshotUpdate { /** * Snapshot resource update properties. */ + @extension("x-ms-client-flatten", true) properties?: SnapshotUpdateProperties; /** @@ -9684,6 +9716,7 @@ model GalleryUpdate extends UpdateResourceDefinition { /** * Describes the properties of a Shared Image Gallery. */ + @extension("x-ms-client-flatten", true) properties?: GalleryProperties; } @@ -9901,6 +9934,7 @@ model GalleryImageUpdate extends UpdateResourceDefinition { /** * Describes the properties of a gallery image definition. */ + @extension("x-ms-client-flatten", true) properties?: GalleryImageProperties; } @@ -10312,6 +10346,7 @@ model GalleryImageVersionUpdate extends UpdateResourceDefinition { /** * Describes the properties of a gallery image version. */ + @extension("x-ms-client-flatten", true) properties?: GalleryImageVersionProperties; } @@ -10420,6 +10455,7 @@ model GalleryApplicationUpdate extends UpdateResourceDefinition { /** * Describes the properties of a gallery Application Definition. */ + @extension("x-ms-client-flatten", true) properties?: GalleryApplicationProperties; } @@ -10545,6 +10581,7 @@ model GalleryApplicationVersionUpdate extends UpdateResourceDefinition { /** * Describes the properties of a gallery image version. */ + @extension("x-ms-client-flatten", true) properties?: GalleryApplicationVersionProperties; } @@ -10571,6 +10608,7 @@ model PirSharedGalleryResource extends PirResource { /** * The identifier information of shared gallery. */ + @extension("x-ms-client-flatten", true) identifier?: SharedGalleryIdentifier; } @@ -10767,6 +10805,7 @@ model PirCommunityGalleryResource { /** * The identifier information of community gallery. */ + @extension("x-ms-client-flatten", true) identifier?: CommunityGalleryIdentifier; } @@ -11205,6 +11244,7 @@ model LoadBalancerConfiguration { /** * Properties of the load balancer configuration. */ + @extension("x-ms-client-flatten", true) properties: LoadBalancerConfigurationProperties; } @@ -11231,6 +11271,7 @@ model LoadBalancerFrontendIpConfiguration { /** * Properties of load balancer frontend ip configuration. */ + @extension("x-ms-client-flatten", true) properties: LoadBalancerFrontendIpConfigurationProperties; } @@ -11277,6 +11318,7 @@ model Extension { /** * Extension Properties. */ + @extension("x-ms-client-flatten", true) properties?: CloudServiceExtensionProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/tspconfig.yaml index 3c7a890db..7768960f4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-compute/tsp-output/tspconfig.yaml @@ -8,6 +8,7 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" examples-directory: "{project-root}/examples" + arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-resource-manager/all" diff --git a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsRecord.tsp b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsRecord.tsp index eb90f1780..68d641104 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsRecord.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsRecord.tsp @@ -14,11 +14,8 @@ namespace Azure.ResourceManager.Dns; /** * Describes a DNS record set (a collection of DNS records with the same name and type). */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(DnsZone) -@includeInapplicableMetadataInPayload(false) -model DnsRecord { +model DnsRecord is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = DnsRecord, KeyName = "relativeRecordSetName", @@ -42,12 +39,6 @@ model DnsRecord { * The etag of the record set. */ etag?: string; - - /** - * The properties of the record set. - */ - @extension("x-ms-client-flatten", true) - properties?: RecordSetProperties; } @armResourceOperations @@ -185,6 +176,7 @@ interface DnsRecords { @@doc(DnsRecord.name, "The name of the record set, relative to the name of the zone." ); +@@doc(DnsRecord.properties, "The properties of the record set."); @@encodedName(DnsRecords.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsZone.tsp b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsZone.tsp index 3f6b82d09..74c8bfa7d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsZone.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/DnsZone.tsp @@ -13,10 +13,7 @@ namespace Azure.ResourceManager.Dns; /** * Describes a DNS zone. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -model DnsZone extends Resource { +model DnsZone is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = DnsZone, KeyName = "zoneName", @@ -28,12 +25,6 @@ model DnsZone extends Resource { * The etag of the zone. */ etag?: string; - - /** - * The properties of the zone. - */ - @extension("x-ms-client-flatten", true) - properties?: ZoneProperties; } @armResourceOperations @@ -170,6 +161,7 @@ interface DnsZones { } @@doc(DnsZone.name, "The name of the DNS zone (without a terminating dot)."); +@@doc(DnsZone.properties, "The properties of the zone."); @@encodedName(DnsZones.createOrUpdate::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/client.tsp index b9af34ef3..2e8041957 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/client.tsp @@ -9,3 +9,9 @@ using Azure.ResourceManager.Dns; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(DnsResourceReferenceResult.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(DnsRecord.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(DnsZone.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/models.tsp index 4d099813c..3d25f46a6 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/models.tsp @@ -1,9 +1,11 @@ import "@typespec/rest"; import "@typespec/http"; +import "@typespec/openapi"; import "@azure-tools/typespec-azure-resource-manager"; using TypeSpec.Rest; using TypeSpec.Http; +using TypeSpec.OpenAPI; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; @@ -438,6 +440,7 @@ model DnsResourceReferenceRequest { /** * The properties of the Resource Reference Request. */ + @extension("x-ms-client-flatten", true) properties?: DnsResourceReferenceRequestProperties; } @@ -458,6 +461,7 @@ model DnsResourceReferenceResult { /** * The result of dns resource reference request. Returns a list of dns resource references for each of the azure resource in the request. */ + @extension("x-ms-client-flatten", true) properties?: DnsResourceReferenceResultProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/tspconfig.yaml index 49cc3480b..c8535e3d0 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-dns/tsp-output/tspconfig.yaml @@ -8,6 +8,7 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/dns.json" examples-directory: "{project-root}/examples" + arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-resource-manager/all" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchDeploymentTrackedResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchDeploymentTrackedResource.tsp index 16183906d..4353a2a1a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchDeploymentTrackedResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchDeploymentTrackedResource.tsp @@ -12,12 +12,9 @@ using TypeSpec.OpenAPI; namespace Azure.ResourceManager.MachineLearning; -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(BatchEndpointTrackedResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(BatchDeployment) -model BatchDeploymentTrackedResource extends Foundations.TrackedResource { +model BatchDeploymentTrackedResource + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = BatchDeploymentTrackedResource, KeyName = "deploymentName", @@ -30,12 +27,6 @@ model BatchDeploymentTrackedResource extends Foundations.TrackedResource { */ kind?: string; - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: BatchDeployment; - ...Azure.ResourceManager.ManagedServiceIdentityProperty; ...Azure.ResourceManager.ResourceSkuProperty; } @@ -111,6 +102,9 @@ interface BatchDeploymentTrackedResources { @@doc(BatchDeploymentTrackedResource.name, "The identifier for the Batch deployments." ); +@@doc(BatchDeploymentTrackedResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(BatchDeploymentTrackedResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchEndpointTrackedResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchEndpointTrackedResource.tsp index e719fc879..88976ddf5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchEndpointTrackedResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/BatchEndpointTrackedResource.tsp @@ -12,12 +12,9 @@ using TypeSpec.OpenAPI; namespace Azure.ResourceManager.MachineLearning; -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Workspace) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(BatchEndpoint) -model BatchEndpointTrackedResource extends Foundations.TrackedResource { +model BatchEndpointTrackedResource + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = BatchEndpointTrackedResource, KeyName = "endpointName", @@ -30,12 +27,6 @@ model BatchEndpointTrackedResource extends Foundations.TrackedResource { */ kind?: string; - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: BatchEndpoint; - ...Azure.ResourceManager.ManagedServiceIdentityProperty; ...Azure.ResourceManager.ResourceSkuProperty; } @@ -114,6 +105,9 @@ interface BatchEndpointTrackedResources { } @@doc(BatchEndpointTrackedResource.name, "Name for the Batch Endpoint."); +@@doc(BatchEndpointTrackedResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(BatchEndpointTrackedResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeContainerResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeContainerResource.tsp index 27b9b62dc..1c3b813b3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeContainerResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeContainerResource.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Registry) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(CodeContainer) -model CodeContainerResource extends Foundations.ProxyResource { +model CodeContainerResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = CodeContainerResource, KeyName = "codeName", SegmentName = "codes", NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: CodeContainer; } @armResourceOperations @@ -80,6 +71,9 @@ interface CodeContainerResources { } @@doc(CodeContainerResource.name, "Container name."); +@@doc(CodeContainerResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(CodeContainerResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeVersionResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeVersionResource.tsp index 8bcb15bf4..6872a54ee 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeVersionResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/CodeVersionResource.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(CodeContainerResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(CodeVersion) -model CodeVersionResource extends Foundations.ProxyResource { +model CodeVersionResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = CodeVersionResource, KeyName = "version", SegmentName = "versions", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: CodeVersion; } @armResourceOperations @@ -103,6 +94,9 @@ interface CodeVersionResources { } @@doc(CodeVersionResource.name, "Version identifier."); +@@doc(CodeVersionResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(CodeVersionResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentContainerResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentContainerResource.tsp index e76a7c4da..cda3051fa 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentContainerResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentContainerResource.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Registry) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(ComponentContainer) -model ComponentContainerResource extends Foundations.ProxyResource { +model ComponentContainerResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = ComponentContainerResource, KeyName = "componentName", SegmentName = "components", NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: ComponentContainer; } @armResourceOperations @@ -80,6 +71,9 @@ interface ComponentContainerResources { } @@doc(ComponentContainerResource.name, "Container name."); +@@doc(ComponentContainerResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(ComponentContainerResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentVersionResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentVersionResource.tsp index 46c791f7d..7b4363ff5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentVersionResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ComponentVersionResource.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ComponentContainerResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(ComponentVersion) -model ComponentVersionResource extends Foundations.ProxyResource { +model ComponentVersionResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = ComponentVersionResource, KeyName = "version", SegmentName = "versions", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: ComponentVersion; } @armResourceOperations @@ -98,6 +89,9 @@ interface ComponentVersionResources { } @@doc(ComponentVersionResource.name, "Version identifier."); +@@doc(ComponentVersionResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(ComponentVersionResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DataContainerResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DataContainerResource.tsp index 3a8e21792..73c1e3f62 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DataContainerResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DataContainerResource.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Registry) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(DataContainer) -model DataContainerResource extends Foundations.ProxyResource { +model DataContainerResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = DataContainerResource, KeyName = "name", SegmentName = "data", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: DataContainer; } @armResourceOperations @@ -86,6 +77,9 @@ interface DataContainerResources { } @@doc(DataContainerResource.name, "Container name."); +@@doc(DataContainerResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(DataContainerResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DataVersionBaseResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DataVersionBaseResource.tsp index 9163da2e5..11a576a1d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DataVersionBaseResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DataVersionBaseResource.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(DataContainerResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(DataVersionBase) -model DataVersionBaseResource extends Foundations.ProxyResource { +model DataVersionBaseResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = DataVersionBaseResource, KeyName = "version", SegmentName = "versions", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: DataVersionBase; } @armResourceOperations @@ -116,6 +107,9 @@ interface DataVersionBaseResources { } @@doc(DataVersionBaseResource.name, "Version identifier."); +@@doc(DataVersionBaseResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(DataVersionBaseResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DatastoreResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DatastoreResource.tsp index 0ff28bf21..c231b6785 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DatastoreResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/DatastoreResource.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Workspace) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(Datastore) -model DatastoreResource extends Foundations.ProxyResource { +model DatastoreResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = DatastoreResource, KeyName = "name", SegmentName = "datastores", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: Datastore; } @armResourceOperations @@ -139,6 +130,9 @@ interface DatastoreResources { } @@doc(DatastoreResource.name, "Datastore name."); +@@doc(DatastoreResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(DatastoreResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentContainerResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentContainerResource.tsp index eaeec1318..4f098f99f 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentContainerResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentContainerResource.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Registry) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(EnvironmentContainer) -model EnvironmentContainerResource extends Foundations.ProxyResource { +model EnvironmentContainerResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = EnvironmentContainerResource, KeyName = "environmentName", SegmentName = "environments", NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: EnvironmentContainer; } @armResourceOperations @@ -88,6 +79,9 @@ interface EnvironmentContainerResources { @@doc(EnvironmentContainerResource.name, "Container name. This is case-sensitive." ); +@@doc(EnvironmentContainerResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(EnvironmentContainerResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentVersionResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentVersionResource.tsp index 97aff6e55..e2b3f1571 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentVersionResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/EnvironmentVersionResource.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(EnvironmentContainerResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(EnvironmentVersion) -model EnvironmentVersionResource extends Foundations.ProxyResource { +model EnvironmentVersionResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = EnvironmentVersionResource, KeyName = "version", SegmentName = "versions", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: EnvironmentVersion; } @armResourceOperations @@ -106,6 +97,9 @@ interface EnvironmentVersionResources { @@doc(EnvironmentVersionResource.name, "Version identifier. This is case-sensitive." ); +@@doc(EnvironmentVersionResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(EnvironmentVersionResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Feature.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Feature.tsp index 0c6a3f8e1..474849811 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Feature.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Feature.tsp @@ -14,24 +14,14 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(FeaturesetVersion) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(FeatureProperties) -model Feature extends Foundations.ProxyResource { +model Feature is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = Feature, KeyName = "featureName", SegmentName = "features", NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: FeatureProperties; } @armResourceOperations @@ -73,3 +63,4 @@ interface Features { } @@doc(Feature.name, "Feature Name. This is case-sensitive."); +@@doc(Feature.properties, "[Required] Additional attributes of the entity."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetContainer.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetContainer.tsp index 15816a2ef..f7cc41266 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetContainer.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetContainer.tsp @@ -14,26 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Workspace) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - FeaturesetContainerProperties -) -model FeaturesetContainer extends Foundations.ProxyResource { +model FeaturesetContainer + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = FeaturesetContainer, KeyName = "name", SegmentName = "featuresets", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: FeaturesetContainerProperties; } @armResourceOperations @@ -106,6 +95,9 @@ interface FeaturesetContainers { } @@doc(FeaturesetContainer.name, "Container name. This is case-sensitive."); +@@doc(FeaturesetContainer.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(FeaturesetContainers.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetVersion.tsp index cf459a40a..843766750 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturesetVersion.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(FeaturesetContainer) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(FeaturesetVersionProperties) -model FeaturesetVersion extends Foundations.ProxyResource { +model FeaturesetVersion + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = FeaturesetVersion, KeyName = "version", SegmentName = "versions", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: FeaturesetVersionProperties; } @armResourceOperations @@ -161,6 +152,9 @@ interface FeaturesetVersions { } @@doc(FeaturesetVersion.name, "Version identifier. This is case-sensitive."); +@@doc(FeaturesetVersion.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(FeaturesetVersions.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityContainer.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityContainer.tsp index 91e84c517..746262b59 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityContainer.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityContainer.tsp @@ -14,26 +14,18 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Workspace) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - FeaturestoreEntityContainerProperties -) -model FeaturestoreEntityContainer extends Foundations.ProxyResource { +model FeaturestoreEntityContainer + is Azure.ResourceManager.ProxyResource< + FeaturestoreEntityContainerProperties, + false + > { ...ResourceNameParameter< Resource = FeaturestoreEntityContainer, KeyName = "name", SegmentName = "featurestoreEntities", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: FeaturestoreEntityContainerProperties; } @armResourceOperations @@ -108,6 +100,9 @@ interface FeaturestoreEntityContainers { @@doc(FeaturestoreEntityContainer.name, "Container name. This is case-sensitive." ); +@@doc(FeaturestoreEntityContainer.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(FeaturestoreEntityContainers.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityVersion.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityVersion.tsp index 6f8a63066..6c0c9ed16 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityVersion.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/FeaturestoreEntityVersion.tsp @@ -14,26 +14,18 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(FeaturestoreEntityContainer) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - FeaturestoreEntityVersionProperties -) -model FeaturestoreEntityVersion extends Foundations.ProxyResource { +model FeaturestoreEntityVersion + is Azure.ResourceManager.ProxyResource< + FeaturestoreEntityVersionProperties, + false + > { ...ResourceNameParameter< Resource = FeaturestoreEntityVersion, KeyName = "version", SegmentName = "versions", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: FeaturestoreEntityVersionProperties; } @armResourceOperations @@ -120,6 +112,9 @@ interface FeaturestoreEntityVersions { @@doc(FeaturestoreEntityVersion.name, "Version identifier. This is case-sensitive." ); +@@doc(FeaturestoreEntityVersion.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(FeaturestoreEntityVersions.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/JobBaseResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/JobBaseResource.tsp index cbbbe83d6..108b5de6f 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/JobBaseResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/JobBaseResource.tsp @@ -14,24 +14,14 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Workspace) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(JobBase) -model JobBaseResource extends Foundations.ProxyResource { +model JobBaseResource is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = JobBaseResource, KeyName = "id", SegmentName = "jobs", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: JobBase; } @armResourceOperations @@ -133,6 +123,9 @@ interface JobBaseResources { @@doc(JobBaseResource.name, "The name and identifier for the Job. This is case-sensitive." ); +@@doc(JobBaseResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(JobBaseResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/LabelingJob.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/LabelingJob.tsp index 10122c318..dac1c0bd6 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/LabelingJob.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/LabelingJob.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Workspace) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(LabelingJobProperties) -model LabelingJob extends Foundations.ProxyResource { +model LabelingJob + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = LabelingJob, KeyName = "id", SegmentName = "labelingJobs", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: LabelingJobProperties; } @armResourceOperations @@ -114,6 +105,9 @@ interface LabelingJobs { } @@doc(LabelingJob.name, "The name and identifier for the LabelingJob."); +@@doc(LabelingJob.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(LabelingJobs.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelContainerResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelContainerResource.tsp index f613f042a..af7713cc5 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelContainerResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelContainerResource.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Registry) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(ModelContainer) -model ModelContainerResource extends Foundations.ProxyResource { +model ModelContainerResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = ModelContainerResource, KeyName = "modelName", SegmentName = "models", NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: ModelContainer; } @armResourceOperations @@ -86,6 +77,9 @@ interface ModelContainerResources { } @@doc(ModelContainerResource.name, "Container name. This is case-sensitive."); +@@doc(ModelContainerResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(ModelContainerResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelVersionResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelVersionResource.tsp index cdeabddf0..f25792fe2 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelVersionResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/ModelVersionResource.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(ModelContainerResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(ModelVersion) -model ModelVersionResource extends Foundations.ProxyResource { +model ModelVersionResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = ModelVersionResource, KeyName = "version", SegmentName = "versions", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: ModelVersion; } @armResourceOperations @@ -138,6 +129,9 @@ interface ModelVersionResources { } @@doc(ModelVersionResource.name, "Version identifier. This is case-sensitive."); +@@doc(ModelVersionResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(ModelVersionResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineDeploymentTrackedResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineDeploymentTrackedResource.tsp index a3fa5ea10..ea28006d2 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineDeploymentTrackedResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineDeploymentTrackedResource.tsp @@ -12,12 +12,9 @@ using TypeSpec.OpenAPI; namespace Azure.ResourceManager.MachineLearning; -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(OnlineEndpointTrackedResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(OnlineDeployment) -model OnlineDeploymentTrackedResource extends Foundations.TrackedResource { +model OnlineDeploymentTrackedResource + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = OnlineDeploymentTrackedResource, KeyName = "deploymentName", @@ -30,12 +27,6 @@ model OnlineDeploymentTrackedResource extends Foundations.TrackedResource { */ kind?: string; - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: OnlineDeployment; - ...Azure.ResourceManager.ManagedServiceIdentityProperty; ...Azure.ResourceManager.ResourceSkuProperty; } @@ -168,6 +159,9 @@ interface OnlineDeploymentTrackedResources { @@doc(OnlineDeploymentTrackedResource.name, "Inference Endpoint Deployment name." ); +@@doc(OnlineDeploymentTrackedResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(OnlineDeploymentTrackedResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineEndpointTrackedResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineEndpointTrackedResource.tsp index 6204e55d8..a36942b8d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineEndpointTrackedResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OnlineEndpointTrackedResource.tsp @@ -12,12 +12,9 @@ using TypeSpec.OpenAPI; namespace Azure.ResourceManager.MachineLearning; -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Workspace) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(OnlineEndpoint) -model OnlineEndpointTrackedResource extends Foundations.TrackedResource { +model OnlineEndpointTrackedResource + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = OnlineEndpointTrackedResource, KeyName = "endpointName", @@ -30,12 +27,6 @@ model OnlineEndpointTrackedResource extends Foundations.TrackedResource { */ kind?: string; - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: OnlineEndpoint; - ...Azure.ResourceManager.ManagedServiceIdentityProperty; ...Azure.ResourceManager.ResourceSkuProperty; } @@ -166,6 +157,9 @@ interface OnlineEndpointTrackedResources { } @@doc(OnlineEndpointTrackedResource.name, "Online Endpoint name."); +@@doc(OnlineEndpointTrackedResource.properties, + "[Required] Additional attributes of the entity." +); @@encodedName(OnlineEndpointTrackedResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OutboundRuleBasicResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OutboundRuleBasicResource.tsp index d32389ce2..c4f6441e3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OutboundRuleBasicResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/OutboundRuleBasicResource.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Outbound Rule Basic Resource for the managed network of a machine learning workspace. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Workspace) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(OutboundRule) -model OutboundRuleBasicResource extends Foundations.ProxyResource { +model OutboundRuleBasicResource + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = OutboundRuleBasicResource, KeyName = "ruleName", SegmentName = "outboundRules", NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$" >; - - /** - * Outbound Rule for the managed network of a machine learning workspace. - */ - @extension("x-ms-client-flatten", true) - properties: OutboundRule; } @armResourceOperations @@ -71,6 +62,9 @@ interface OutboundRuleBasicResources { @@doc(OutboundRuleBasicResource.name, "Name of the workspace managed network outbound rule" ); +@@doc(OutboundRuleBasicResource.properties, + "Outbound Rule for the managed network of a machine learning workspace." +); @@encodedName(OutboundRuleBasicResources.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/PrivateEndpointConnection.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/PrivateEndpointConnection.tsp index 7a2854f9f..b59cf986f 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/PrivateEndpointConnection.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/PrivateEndpointConnection.tsp @@ -14,27 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * The Private Endpoint Connection resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Workspace) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - PrivateEndpointConnectionProperties -) -model PrivateEndpointConnection extends Foundations.TrackedResource { +model PrivateEndpointConnection + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = PrivateEndpointConnection, KeyName = "privateEndpointConnectionName", SegmentName = "privateEndpointConnections", NamePattern = "" >; - - /** - * Private endpoint connection properties. - */ - @extension("x-ms-client-flatten", true) - properties?: PrivateEndpointConnectionProperties; - ...Azure.ResourceManager.ManagedServiceIdentityProperty; ...Azure.ResourceManager.ResourceSkuProperty; } @@ -67,6 +55,9 @@ interface PrivateEndpointConnections { } @@doc(PrivateEndpointConnection.name, "NRP Private Endpoint Connection Name"); +@@doc(PrivateEndpointConnection.properties, + "Private endpoint connection properties." +); @@encodedName(PrivateEndpointConnections.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Registry.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Registry.tsp index fbdc7fecd..4f5557f8c 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Registry.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Registry.tsp @@ -11,11 +11,8 @@ using TypeSpec.OpenAPI; namespace Azure.ResourceManager.MachineLearning; -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(RegistryProperties) -model Registry extends Foundations.TrackedResource { +model Registry + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = Registry, KeyName = "registryName", @@ -28,12 +25,6 @@ model Registry extends Foundations.TrackedResource { */ kind?: string; - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: RegistryProperties; - ...Azure.ResourceManager.ManagedServiceIdentityProperty; ...Azure.ResourceManager.ResourceSkuProperty; } @@ -85,6 +76,7 @@ interface Registries { @@doc(Registry.name, "Name of Azure Machine Learning registry. This is case-insensitive" ); +@@doc(Registry.properties, "[Required] Additional attributes of the entity."); @@encodedName(Registries.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Schedule.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Schedule.tsp index 0d088e7d7..17c970607 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Schedule.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Schedule.tsp @@ -14,24 +14,15 @@ namespace Azure.ResourceManager.MachineLearning; /** * Azure Resource Manager resource envelope. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Workspace) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(ScheduleProperties) -model Schedule extends Foundations.ProxyResource { +model Schedule + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = Schedule, KeyName = "name", SegmentName = "schedules", NamePattern = "" >; - - /** - * [Required] Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: ScheduleProperties; } @armResourceOperations @@ -80,6 +71,7 @@ interface Schedules { } @@doc(Schedule.name, "Schedule name."); +@@doc(Schedule.properties, "[Required] Additional attributes of the entity."); @@encodedName(Schedules.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Workspace.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Workspace.tsp index 2594e836a..d26af7360 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Workspace.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/Workspace.tsp @@ -13,11 +13,8 @@ namespace Azure.ResourceManager.MachineLearning; /** * An object that represents a machine learning workspace. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(WorkspaceProperties) -model Workspace extends Foundations.TrackedResource { +model Workspace + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = Workspace, KeyName = "workspaceName", @@ -25,13 +22,6 @@ model Workspace extends Foundations.TrackedResource { NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$" >; kind?: string; - - /** - * Additional attributes of the entity. - */ - @extension("x-ms-client-flatten", true) - properties: WorkspaceProperties; - ...Azure.ResourceManager.ManagedServiceIdentityProperty; ...Azure.ResourceManager.ResourceSkuProperty; } @@ -243,6 +233,7 @@ interface Workspaces { } @@doc(Workspace.name, "Name of Azure Machine Learning workspace."); +@@doc(Workspace.properties, "Additional attributes of the entity."); @@encodedName(Workspaces.createOrUpdate::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/WorkspaceConnectionPropertiesV2BasicResource.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/WorkspaceConnectionPropertiesV2BasicResource.tsp index 6d9ad094c..fc0b6759a 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/WorkspaceConnectionPropertiesV2BasicResource.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/WorkspaceConnectionPropertiesV2BasicResource.tsp @@ -12,24 +12,18 @@ using TypeSpec.OpenAPI; namespace Azure.ResourceManager.MachineLearning; -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(Workspace) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - WorkspaceConnectionPropertiesV2 -) model WorkspaceConnectionPropertiesV2BasicResource - extends Foundations.ProxyResource { + is Azure.ResourceManager.ProxyResource< + WorkspaceConnectionPropertiesV2, + false + > { ...ResourceNameParameter< Resource = WorkspaceConnectionPropertiesV2BasicResource, KeyName = "connectionName", SegmentName = "connections", NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$" >; - - @extension("x-ms-client-flatten", true) - properties: WorkspaceConnectionPropertiesV2; } @armResourceOperations @@ -106,6 +100,7 @@ interface WorkspaceConnectionPropertiesV2BasicResources { @@doc(WorkspaceConnectionPropertiesV2BasicResource.name, "Friendly name of the workspace connection" ); +@@doc(WorkspaceConnectionPropertiesV2BasicResource.properties, ""); @@encodedName(WorkspaceConnectionPropertiesV2BasicResources.create::parameters.resource, "application/json", "body" diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/client.tsp index 63692ccb9..f8a383ff4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/client.tsp @@ -18,3 +18,12 @@ using Azure.ResourceManager.MachineLearning; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(PrivateLinkResource.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(Registry.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(Workspace.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(PrivateEndpointConnection.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/models.tsp index 137622712..8b51364ee 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/models.tsp @@ -1,10 +1,12 @@ import "@typespec/rest"; import "@typespec/http"; import "@azure-tools/typespec-azure-core"; +import "@typespec/openapi"; import "@azure-tools/typespec-azure-resource-manager"; using TypeSpec.Rest; using TypeSpec.Http; +using TypeSpec.OpenAPI; using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; @@ -3317,6 +3319,7 @@ model ClusterUpdateParameters { /** * The properties of the amlCompute. */ + @extension("x-ms-client-flatten", true) properties?: ClusterUpdateProperties; } @@ -5849,6 +5852,7 @@ model RegistryPrivateEndpointConnection { /** * Properties of the Private Endpoint Connection */ + @extension("x-ms-client-flatten", true) properties?: RegistryPrivateEndpointConnectionProperties; } @@ -6513,6 +6517,7 @@ model SharedPrivateLinkResource { /** * Properties of a shared private link resource. */ + @extension("x-ms-client-flatten", true) properties?: SharedPrivateLinkResourceProperty; } @@ -6561,6 +6566,7 @@ model WorkspaceUpdateParameters { /** * The properties that the machine learning workspace will be updated with. */ + @extension("x-ms-client-flatten", true) properties?: WorkspacePropertiesUpdateParameters; /** @@ -6952,6 +6958,7 @@ model PrivateLinkResource extends Resource { /** * Properties of a private link resource. */ + @extension("x-ms-client-flatten", true) properties?: PrivateLinkResourceProperties; /** diff --git a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/tspconfig.yaml index 3c7a890db..7768960f4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-machinelearningservices/tsp-output/tspconfig.yaml @@ -8,6 +8,7 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" examples-directory: "{project-root}/examples" + arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-resource-manager/all" diff --git a/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/swagger-output/swagger.json b/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/swagger-output/swagger.json index 7aab42171..c37d10640 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/swagger-output/swagger.json +++ b/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/swagger-output/swagger.json @@ -1571,8 +1571,7 @@ "properties": { "properties": { "$ref": "#/definitions/DataProductProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." }, "identity": { "$ref": "../../common-types/resource-management/v3/managedidentity.json#/definitions/ManagedServiceIdentity", @@ -1950,8 +1949,7 @@ "properties": { "properties": { "$ref": "#/definitions/DataProductsCatalogProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ @@ -2009,8 +2007,7 @@ "properties": { "properties": { "$ref": "#/definitions/DataTypeProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ diff --git a/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/DataProduct.tsp b/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/DataProduct.tsp index 434f771fe..c3aae2b59 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/DataProduct.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/DataProduct.tsp @@ -101,3 +101,6 @@ interface DataProducts { @@maxLength(DataProduct.name, 63); @@minLength(DataProduct.name, 3); @@doc(DataProduct.name, "The data product resource name"); +@@doc(DataProduct.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/DataProductsCatalog.tsp b/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/DataProductsCatalog.tsp index daedb003d..8f2862a66 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/DataProductsCatalog.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/DataProductsCatalog.tsp @@ -43,3 +43,6 @@ interface DataProductsCatalogs { } @@doc(DataProductsCatalog.name, ""); +@@doc(DataProductsCatalog.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/DataType.tsp b/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/DataType.tsp index d2017361f..21ea59da2 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/DataType.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/DataType.tsp @@ -73,3 +73,6 @@ interface DataTypes { @@maxLength(DataType.name, 63); @@minLength(DataType.name, 3); @@doc(DataType.name, "The data type name."); +@@doc(DataType.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/client.tsp deleted file mode 100644 index 0082dd568..000000000 --- a/packages/extensions/openapi-to-typespec/test/arm-networkanalytics/tsp-output/client.tsp +++ /dev/null @@ -1,11 +0,0 @@ -import "./main.tsp"; -import "@azure-tools/typespec-client-generator-core"; - -using Azure.ClientGenerator.Core; -using Microsoft.NetworkAnalytics; - -#suppress "deprecated" "@flattenProperty decorator is not recommended to use." -@@flattenProperty(DataProductUpdate.properties); - -#suppress "deprecated" "@flattenProperty decorator is not recommended to use." -@@flattenProperty(DataTypeUpdate.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/swagger-output/examples/Quotas_ListBySubscription.json b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/swagger-output/examples/Quotas_ListBySubscription.json new file mode 100644 index 000000000..1b47a7e38 --- /dev/null +++ b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/swagger-output/examples/Quotas_ListBySubscription.json @@ -0,0 +1,34 @@ +{ + "operationId": "Quotas_ListBySubscription", + "parameters": { + "api-version": "2023-10-01-preview", + "location": "eastus", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "title": "Quotas_ListBySubscription", + "responses": { + "200": { + "body": { + "value": [ + { + "name": "ScalableExecution", + "type": "Microsoft.AzurePlaywrightService/Locations/Quotas", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzurePlaywrightService/locations/eastus/quotas/ScalableExecution", + "properties": { + "freeTrial": { + "accountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "allocatedValue": 0, + "createdAt": "2023-08-31T10:19:36.081Z", + "expiryAt": "2023-08-31T10:19:36.081Z", + "percentageUsed": 100, + "state": "Active", + "usedValue": 0 + }, + "provisioningState": "Succeeded" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/swagger-output/swagger.json b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/swagger-output/swagger.json index 6e8af8fa0..18226b7d4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/swagger-output/swagger.json +++ b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/swagger-output/swagger.json @@ -123,7 +123,7 @@ }, "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas": { "get": { - "operationId": "Quotas_ListByLocation", + "operationId": "Quotas_ListBySubscription", "tags": [ "Quotas" ], @@ -153,6 +153,11 @@ } } }, + "x-ms-examples": { + "Quotas_ListBySubscription": { + "$ref": "./examples/Quotas_ListBySubscription.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -357,6 +362,10 @@ "$ref": "#/definitions/Account" }, "headers": { + "Azure-AsyncOperation": { + "type": "string", + "description": "A link to the status monitor" + }, "Retry-After": { "type": "integer", "format": "int32", @@ -471,14 +480,14 @@ "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." - }, - "Location": { - "type": "string", - "description": "The Location header contains the URL where the status of the long running operation can be checked." } } }, @@ -511,12 +520,7 @@ "properties": { "properties": { "$ref": "#/definitions/AccountProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "description": "The resource-specific properties for this resource." } }, "allOf": [ @@ -763,12 +767,7 @@ "properties": { "properties": { "$ref": "#/definitions/QuotaProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] + "description": "The resource-specific properties for this resource." } }, "allOf": [ diff --git a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/Account.tsp b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/Account.tsp index f5c5384b8..339a27bfe 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/Account.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/Account.tsp @@ -6,7 +6,6 @@ import "./models.tsp"; using TypeSpec.Rest; using Azure.ResourceManager; -using Azure.ResourceManager.Foundations; using TypeSpec.Http; using TypeSpec.OpenAPI; @@ -14,18 +13,13 @@ namespace Microsoft.AzurePlaywrightService; /** * An account resource */ -model Account is TrackedResource { - /** - * Name of account - */ - @maxLength(64) - @minLength(3) - @pattern("^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$") - @path - @key("name") - @segment("accounts") - @visibility("read") - name: string; +model Account is Azure.ResourceManager.TrackedResource { + ...ResourceNameParameter< + Resource = Account, + KeyName = "name", + SegmentName = "accounts", + NamePattern = "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$" + >; } @armResourceOperations @@ -43,7 +37,7 @@ interface Accounts { /** * Update a Account */ - @parameterVisibility("read") + @parameterVisibility update is ArmCustomPatchSync; /** @@ -61,3 +55,10 @@ interface Accounts { */ listBySubscription is ArmListBySubscription; } + +@@maxLength(Account.name, 64); +@@minLength(Account.name, 3); +@@doc(Account.name, "Name of account"); +@@doc(Account.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/Quota.tsp b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/Quota.tsp index b3dab533b..33aa9b776 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/Quota.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/Quota.tsp @@ -6,7 +6,6 @@ import "./models.tsp"; using TypeSpec.Rest; using Azure.ResourceManager; -using Azure.ResourceManager.Foundations; using TypeSpec.Http; using TypeSpec.OpenAPI; @@ -16,15 +15,14 @@ namespace Microsoft.AzurePlaywrightService; */ @subscriptionResource @parentResource(SubscriptionLocationResource) -model Quota is ProxyResource { - /** - * The quota name. - */ - @path - @key("name") - @segment("quotas") - @visibility("read") - name: QuotaNames; +model Quota is Azure.ResourceManager.ProxyResource { + ...ResourceNameParameter< + Resource = Quota, + KeyName = "name", + SegmentName = "quotas", + NamePattern = "", + Type = QuotaNames + >; } @armResourceOperations @@ -39,3 +37,6 @@ interface Quotas { */ listBySubscription is ArmResourceListByParent; } + +@@doc(Quota.name, "The quota name."); +@@doc(Quota.properties, "The resource-specific properties for this resource."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/client.tsp deleted file mode 100644 index 86fff102a..000000000 --- a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/client.tsp +++ /dev/null @@ -1,8 +0,0 @@ -import "./main.tsp"; -import "@azure-tools/typespec-client-generator-core"; - -using Azure.ClientGenerator.Core; -using Microsoft.AzurePlaywrightService; - -#suppress "deprecated" "@flattenProperty decorator is not recommended to use." -@@flattenProperty(AccountUpdate.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/main.tsp b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/main.tsp index 6f7f5efd8..578b84b64 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/main.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/main.tsp @@ -1,3 +1,9 @@ +/** + * PLEASE DO NOT REMOVE - USED FOR CONVERTER METRICS + * Generated by package: @autorest/openapi-to-typespec + * Version: Not generated in test + * Date: Not generated in test + */ import "@typespec/rest"; import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; diff --git a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/models.tsp index 2d2460c99..a79263adc 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-playwrighttesting/tsp-output/models.tsp @@ -20,12 +20,12 @@ union EnablementStatus { /** * The feature is Enabled. */ - "Enabled", + Enabled: "Enabled", /** * The feature is Disabled. */ - "Disabled", + Disabled: "Disabled", } /** @@ -37,27 +37,27 @@ union ProvisioningState { /** * Resource has been created. */ - "Succeeded", + Succeeded: "Succeeded", /** * Resource creation failed. */ - "Failed", + Failed: "Failed", /** * Resource creation was canceled. */ - "Canceled", + Canceled: "Canceled", /** * Deletion in progress */ - "Deleting", + Deleting: "Deleting", /** * Change accepted for processing */ - "Accepted", + Accepted: "Accepted", } /** @@ -69,12 +69,12 @@ union FreeTrialState { /** * The free-trial is Active. */ - "Active", + Active: "Active", /** * The free-trial is Expired. */ - "Expired", + Expired: "Expired", } union QuotaNames { @@ -83,7 +83,7 @@ union QuotaNames { /** * The quota details for scalable execution feature. When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations. */ - "ScalableExecution", + ScalableExecution: "ScalableExecution", } /** diff --git a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/swagger-output/swagger.json b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/swagger-output/swagger.json index 9dc6eb5ae..2fcf16fd9 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/swagger-output/swagger.json +++ b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/swagger-output/swagger.json @@ -975,8 +975,7 @@ "properties": { "properties": { "$ref": "#/definitions/AssociationProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ @@ -1104,8 +1103,7 @@ "properties": { "properties": { "$ref": "#/definitions/FrontendProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ @@ -1230,8 +1228,7 @@ "properties": { "properties": { "$ref": "#/definitions/TrafficControllerProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ diff --git a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/Association.tsp b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/Association.tsp index 137687085..80c1e5bac 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/Association.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/Association.tsp @@ -55,3 +55,6 @@ interface Associations { } @@doc(Association.name, "Name of Association"); +@@doc(Association.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/Frontend.tsp b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/Frontend.tsp index 0f02fe472..48cb6836d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/Frontend.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/Frontend.tsp @@ -54,3 +54,6 @@ interface Frontends { } @@doc(Frontend.name, "Frontends"); +@@doc(Frontend.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/TrafficController.tsp b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/TrafficController.tsp index 378fc406e..0401c5b88 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/TrafficController.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/TrafficController.tsp @@ -58,3 +58,6 @@ interface TrafficControllers { } @@doc(TrafficController.name, "traffic controller name for path"); +@@doc(TrafficController.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/client.tsp deleted file mode 100644 index 973870e6f..000000000 --- a/packages/extensions/openapi-to-typespec/test/arm-servicenetworking/tsp-output/client.tsp +++ /dev/null @@ -1,8 +0,0 @@ -import "./main.tsp"; -import "@azure-tools/typespec-client-generator-core"; - -using Azure.ClientGenerator.Core; -using Microsoft.ServiceNetworking; - -#suppress "deprecated" "@flattenProperty decorator is not recommended to use." -@@flattenProperty(AssociationUpdate.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/swagger-output/swagger.json b/packages/extensions/openapi-to-typespec/test/arm-sphere/swagger-output/swagger.json index d961fb417..770eacf14 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/swagger-output/swagger.json +++ b/packages/extensions/openapi-to-typespec/test/arm-sphere/swagger-output/swagger.json @@ -3301,8 +3301,7 @@ "properties": { "properties": { "$ref": "#/definitions/CatalogProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ @@ -3362,8 +3361,7 @@ "properties": { "properties": { "$ref": "#/definitions/CertificateProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ @@ -3528,8 +3526,7 @@ "properties": { "properties": { "$ref": "#/definitions/DeploymentProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ @@ -3601,8 +3598,7 @@ "properties": { "properties": { "$ref": "#/definitions/DeviceProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ @@ -3617,8 +3613,7 @@ "properties": { "properties": { "$ref": "#/definitions/DeviceGroupProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ @@ -3880,8 +3875,7 @@ "properties": { "properties": { "$ref": "#/definitions/ImageProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ @@ -4189,8 +4183,7 @@ "properties": { "properties": { "$ref": "#/definitions/ProductProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Catalog.tsp b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Catalog.tsp index 64176f7a2..a5312b375 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Catalog.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Catalog.tsp @@ -206,6 +206,9 @@ interface Catalogs { } @@doc(Catalog.name, "Name of catalog"); +@@doc(Catalog.properties, + "The resource-specific properties for this resource." +); @@doc(Catalogs.listDeviceGroups::parameters.body, "List device groups for catalog." ); diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Certificate.tsp b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Certificate.tsp index c90d0f307..4cc7ccf8b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Certificate.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Certificate.tsp @@ -88,6 +88,9 @@ interface Certificates { @@doc(Certificate.name, "Serial number of the certificate. Use '.default' to get current active certificate." ); +@@doc(Certificate.properties, + "The resource-specific properties for this resource." +); @@doc(Certificates.retrieveProofOfPossessionNonce::parameters.body, "Proof of possession nonce request body " ); diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Deployment.tsp b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Deployment.tsp index bf6aed77a..d80b62ca8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Deployment.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Deployment.tsp @@ -79,3 +79,6 @@ interface Deployments { @@doc(Deployment.name, "Deployment name. Use .default for deployment creation and to get the current deployment for the associated device group." ); +@@doc(Deployment.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Device.tsp b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Device.tsp index 7f07c7482..6a791594f 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Device.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Device.tsp @@ -63,6 +63,7 @@ interface Devices { } @@doc(Device.name, "Device name"); +@@doc(Device.properties, "The resource-specific properties for this resource."); @@doc(Devices.generateCapabilityImage::parameters.body, "Generate capability image request body." ); diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/DeviceGroup.tsp b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/DeviceGroup.tsp index cb861df6a..894db0a7e 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/DeviceGroup.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/DeviceGroup.tsp @@ -97,6 +97,9 @@ interface DeviceGroups { } @@doc(DeviceGroup.name, "Name of device group."); +@@doc(DeviceGroup.properties, + "The resource-specific properties for this resource." +); @@doc(DeviceGroups.claimDevices::parameters.body, "Bulk claim devices request body." ); diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Image.tsp b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Image.tsp index 4e1adb517..09c05c0c7 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Image.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Image.tsp @@ -77,3 +77,4 @@ interface Images { } @@doc(Image.name, "Image name. Use .default for image creation."); +@@doc(Image.properties, "The resource-specific properties for this resource."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Product.tsp b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Product.tsp index a230c77ee..6b72e52f3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Product.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-sphere/tsp-output/Product.tsp @@ -68,3 +68,6 @@ interface Products { } @@doc(Product.name, "Name of product."); +@@doc(Product.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/swagger-output/swagger.json b/packages/extensions/openapi-to-typespec/test/arm-storage/swagger-output/swagger.json index b079d1b6d..b9be7c1c6 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/swagger-output/swagger.json +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/swagger-output/swagger.json @@ -5886,42 +5886,6 @@ ] } }, - "Azure.ResourceManager.CommonTypes.SkuTier": { - "type": "string", - "description": "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.", - "enum": [ - "Free", - "Basic", - "Standard", - "Premium" - ], - "x-ms-enum": { - "name": "SkuTier", - "modelAsString": false, - "values": [ - { - "name": "Free", - "value": "Free", - "description": "The Free service tier." - }, - { - "name": "Basic", - "value": "Basic", - "description": "The Basic service tier." - }, - { - "name": "Standard", - "value": "Standard", - "description": "The Standard service tier." - }, - { - "name": "Premium", - "value": "Premium", - "description": "The Premium service tier." - } - ] - } - }, "AzureEntityResource": { "type": "object", "description": "The resource model definition for an Azure Resource Manager resource with an etag.", @@ -7242,7 +7206,8 @@ "properties": { "properties": { "$ref": "#/definitions/FileShareProperties", - "description": "The file share properties be listed out." + "description": "The file share properties be listed out.", + "x-ms-client-flatten": true } }, "allOf": [ @@ -7575,7 +7540,8 @@ "properties": { "properties": { "$ref": "#/definitions/ImmutabilityPolicyProperty", - "description": "The properties of an ImmutabilityPolicy of a blob container." + "description": "The properties of an ImmutabilityPolicy of a blob container.", + "x-ms-client-flatten": true }, "etag": { "type": "string", @@ -8216,7 +8182,8 @@ "properties": { "properties": { "$ref": "#/definitions/ContainerProperties", - "description": "The blob container properties be listed out." + "description": "The blob container properties be listed out.", + "x-ms-client-flatten": true } }, "allOf": [ @@ -8231,6 +8198,7 @@ "properties": { "$ref": "#/definitions/ListQueueProperties", "description": "List Queue resource properties.", + "x-ms-client-flatten": true, "x-ms-client-name": "queueProperties" } }, @@ -9104,7 +9072,8 @@ "properties": { "properties": { "$ref": "#/definitions/PrivateLinkResourceProperties", - "description": "Resource properties." + "description": "Resource properties.", + "x-ms-client-flatten": true } }, "allOf": [ @@ -9832,7 +9801,7 @@ "description": "The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType." }, "tier": { - "$ref": "#/definitions/Azure.ResourceManager.CommonTypes.SkuTier", + "$ref": "../../common-types/resource-management/v3/types.json#/definitions/SkuTier", "description": "The SKU tier. This is based on the SKU name.", "readOnly": true } @@ -9878,7 +9847,7 @@ "description": "The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType." }, "tier": { - "$ref": "#/definitions/Azure.ResourceManager.CommonTypes.SkuTier", + "$ref": "../../common-types/resource-management/v3/types.json#/definitions/SkuTier", "description": "The SKU tier. This is based on the SKU name.", "readOnly": true }, @@ -10055,6 +10024,11 @@ "type": "object", "description": "The storage account.", "properties": { + "properties": { + "$ref": "#/definitions/StorageAccountProperties", + "description": "Properties of the storage account.", + "x-ms-client-flatten": true + }, "kind": { "$ref": "#/definitions/Kind", "description": "Gets the Kind.", @@ -10064,11 +10038,6 @@ "$ref": "#/definitions/ExtendedLocation", "description": "The extendedLocation of the resource." }, - "properties": { - "$ref": "#/definitions/StorageAccountProperties", - "description": "Properties of the storage account.", - "x-ms-client-flatten": true - }, "identity": { "$ref": "../../common-types/resource-management/v3/managedidentity.json#/definitions/ManagedServiceIdentity", "description": "The managed service identities assigned to this resource." @@ -10577,7 +10546,8 @@ }, "properties": { "$ref": "#/definitions/StorageAccountPropertiesUpdateParameters", - "description": "The parameters used when updating a storage account." + "description": "The parameters used when updating a storage account.", + "x-ms-client-flatten": true }, "kind": { "$ref": "#/definitions/Kind", @@ -10587,6 +10557,7 @@ }, "StorageQueue": { "type": "object", + "description": "Concrete proxy resource types can be created by aliasing this type using a specific property type.", "properties": { "properties": { "$ref": "#/definitions/QueueProperties", diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobContainer.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobContainer.tsp index 85124f2ec..86cf7644f 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobContainer.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobContainer.tsp @@ -14,24 +14,15 @@ namespace Microsoft.Storage; /** * Properties of the blob container, including Id, resource name, resource type, Etag. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(BlobServiceProperties) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(ContainerProperties) -model BlobContainer extends Foundations.ProxyResource { +model BlobContainer + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = BlobContainer, KeyName = "containerName", SegmentName = "containers", NamePattern = "" >; - - /** - * Properties of the blob container. - */ - @extension("x-ms-client-flatten", true) - properties?: ContainerProperties; } @armResourceOperations @@ -118,6 +109,7 @@ interface BlobContainers { @@doc(BlobContainer.name, "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number." ); +@@doc(BlobContainer.properties, "Properties of the blob container."); @@encodedName(BlobContainers.create::parameters.resource, "application/json", "blobContainer" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobInventoryPolicy.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobInventoryPolicy.tsp index 443d812a4..84bf48528 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobInventoryPolicy.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobInventoryPolicy.tsp @@ -14,27 +14,16 @@ namespace Microsoft.Storage; /** * The storage account blob inventory policy. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @singleton("default") @parentResource(StorageAccount) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - BlobInventoryPolicyProperties -) -model BlobInventoryPolicy extends Foundations.ProxyResource { +model BlobInventoryPolicy + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = BlobInventoryPolicy, KeyName = "inventoryPolicy", SegmentName = "inventoryPolicies", NamePattern = "" >; - - /** - * Returns the storage account blob inventory policy rules. - */ - @extension("x-ms-client-flatten", true) - properties?: BlobInventoryPolicyProperties; } @armResourceOperations @@ -64,6 +53,9 @@ interface BlobInventoryPolicies { } @@doc(BlobInventoryPolicy.name, ""); +@@doc(BlobInventoryPolicy.properties, + "Returns the storage account blob inventory policy rules." +); @@encodedName(BlobInventoryPolicies.createOrUpdate::parameters.resource, "application/json", "properties" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobServiceProperties.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobServiceProperties.tsp index a3264ce86..c4d651f70 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobServiceProperties.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/BlobServiceProperties.tsp @@ -14,28 +14,16 @@ namespace Microsoft.Storage; /** * The properties of a storage account’s Blob service. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @singleton("default") @parentResource(StorageAccount) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - BlobServicePropertiesProperties -) -model BlobServiceProperties extends Foundations.ProxyResource { +model BlobServiceProperties + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = BlobServiceProperties, KeyName = "blobService", SegmentName = "blobServices", NamePattern = "" >; - - /** - * The properties of a storage account’s Blob service. - */ - @extension("x-ms-client-flatten", true) - properties?: BlobServicePropertiesProperties; - ...Azure.ResourceManager.ResourceSkuProperty; } @@ -64,6 +52,9 @@ interface BlobServicePropertiesOperationGroup { } @@doc(BlobServiceProperties.name, ""); +@@doc(BlobServiceProperties.properties, + "The properties of a storage account’s Blob service." +); @@encodedName(BlobServicePropertiesOperationGroup.setServiceProperties::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/DeletedAccount.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/DeletedAccount.tsp index b32a49693..e846d809f 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/DeletedAccount.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/DeletedAccount.tsp @@ -13,25 +13,16 @@ namespace Microsoft.Storage; /** * Deleted storage account */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @subscriptionResource @parentResource(SubscriptionLocationResource) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(DeletedAccountProperties) -model DeletedAccount extends Foundations.ProxyResource { +model DeletedAccount + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = DeletedAccount, KeyName = "deletedAccountName", SegmentName = "deletedAccounts", NamePattern = "" >; - - /** - * Properties of the deleted account. - */ - @extension("x-ms-client-flatten", true) - properties?: DeletedAccountProperties; } @armResourceOperations @@ -50,3 +41,4 @@ interface DeletedAccounts { @@maxLength(DeletedAccount.name, 24); @@minLength(DeletedAccount.name, 3); @@doc(DeletedAccount.name, "Name of the deleted storage account."); +@@doc(DeletedAccount.properties, "Properties of the deleted account."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/EncryptionScope.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/EncryptionScope.tsp index 2dfb2c6dc..fbddc2db9 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/EncryptionScope.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/EncryptionScope.tsp @@ -14,24 +14,15 @@ namespace Microsoft.Storage; /** * The Encryption Scope resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(StorageAccount) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(EncryptionScopeProperties) -model EncryptionScope extends Foundations.ProxyResource { +model EncryptionScope + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = EncryptionScope, KeyName = "encryptionScopeName", SegmentName = "encryptionScopes", NamePattern = "" >; - - /** - * Properties of the encryption scope. - */ - @extension("x-ms-client-flatten", true) - properties?: EncryptionScopeProperties; } @armResourceOperations @@ -90,6 +81,7 @@ interface EncryptionScopes { @@doc(EncryptionScope.name, "The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number." ); +@@doc(EncryptionScope.properties, "Properties of the encryption scope."); @@encodedName(EncryptionScopes.put::parameters.resource, "application/json", "encryptionScope" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileServiceProperties.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileServiceProperties.tsp index a62b048f7..8017c2276 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileServiceProperties.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileServiceProperties.tsp @@ -14,28 +14,16 @@ namespace Microsoft.Storage; /** * The properties of File services in storage account. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @singleton("default") @parentResource(StorageAccount) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - FileServicePropertiesProperties -) -model FileServiceProperties extends Foundations.ProxyResource { +model FileServiceProperties + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = FileServiceProperties, KeyName = "fileService", SegmentName = "fileServices", NamePattern = "" >; - - /** - * The properties of File services in storage account. - */ - @extension("x-ms-client-flatten", true) - properties?: FileServicePropertiesProperties; - ...Azure.ResourceManager.ResourceSkuProperty; } @@ -64,6 +52,9 @@ interface FileServicePropertiesOperationGroup { } @@doc(FileServiceProperties.name, ""); +@@doc(FileServiceProperties.properties, + "The properties of File services in storage account." +); @@encodedName(FileServicePropertiesOperationGroup.setServiceProperties::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileShare.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileShare.tsp index 390dd5cb5..a7e1478d4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileShare.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/FileShare.tsp @@ -14,24 +14,14 @@ namespace Microsoft.Storage; /** * Properties of the file share, including Id, resource name, resource type, Etag. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(FileServiceProperties) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(FileShareProperties) -model FileShare extends Foundations.ProxyResource { +model FileShare is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = FileShare, KeyName = "shareName", SegmentName = "shares", NamePattern = "" >; - - /** - * Properties of the file share. - */ - @extension("x-ms-client-flatten", true) - properties?: FileShareProperties; } @armResourceOperations @@ -162,6 +152,7 @@ interface FileShares { @@doc(FileShare.name, "The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number." ); +@@doc(FileShare.properties, "Properties of the file share."); @@encodedName(FileShares.create::parameters.resource, "application/json", "fileShare" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ImmutabilityPolicy.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ImmutabilityPolicy.tsp index 79233ed0d..9b630e781 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ImmutabilityPolicy.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ImmutabilityPolicy.tsp @@ -14,25 +14,16 @@ namespace Microsoft.Storage; /** * The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @singleton("default") @parentResource(BlobContainer) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(ImmutabilityPolicyProperty) -model ImmutabilityPolicy extends Foundations.ProxyResource { +model ImmutabilityPolicy + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = ImmutabilityPolicy, KeyName = "immutabilityPolicy", SegmentName = "immutabilityPolicies", NamePattern = "" >; - - /** - * The properties of an ImmutabilityPolicy of a blob container. - */ - @extension("x-ms-client-flatten", true) - properties: ImmutabilityPolicyProperty; } @armResourceOperations @@ -134,6 +125,9 @@ interface ImmutabilityPolicies { } @@doc(ImmutabilityPolicy.name, ""); +@@doc(ImmutabilityPolicy.properties, + "The properties of an ImmutabilityPolicy of a blob container." +); @@encodedName(ImmutabilityPolicies.createOrUpdateImmutabilityPolicy::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/LocalUser.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/LocalUser.tsp index 9568a5e39..ccc54a987 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/LocalUser.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/LocalUser.tsp @@ -14,24 +14,14 @@ namespace Microsoft.Storage; /** * The local user associated with the storage accounts. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(StorageAccount) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(LocalUserProperties) -model LocalUser extends Foundations.ProxyResource { +model LocalUser is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = LocalUser, KeyName = "username", SegmentName = "localUsers", NamePattern = "" >; - - /** - * Storage account local user properties. - */ - @extension("x-ms-client-flatten", true) - properties?: LocalUserProperties; } @armResourceOperations @@ -79,6 +69,7 @@ interface LocalUsers { @@doc(LocalUser.name, "The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account." ); +@@doc(LocalUser.properties, "Storage account local user properties."); @@encodedName(LocalUsers.createOrUpdate::parameters.resource, "application/json", "properties" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ManagementPolicy.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ManagementPolicy.tsp index 8252dff72..a4212161b 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ManagementPolicy.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ManagementPolicy.tsp @@ -14,25 +14,16 @@ namespace Microsoft.Storage; /** * The Get Storage Account ManagementPolicies operation response. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @singleton("default") @parentResource(StorageAccount) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(ManagementPolicyProperties) -model ManagementPolicy extends Foundations.ProxyResource { +model ManagementPolicy + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = ManagementPolicy, KeyName = "managementPolicy", SegmentName = "managementPolicies", NamePattern = "" >; - - /** - * Returns the Storage Account Data Policies Rules. - */ - @extension("x-ms-client-flatten", true) - properties?: ManagementPolicyProperties; } @armResourceOperations @@ -55,6 +46,9 @@ interface ManagementPolicies { } @@doc(ManagementPolicy.name, ""); +@@doc(ManagementPolicy.properties, + "Returns the Storage Account Data Policies Rules." +); @@encodedName(ManagementPolicies.createOrUpdate::parameters.resource, "application/json", "properties" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ObjectReplicationPolicy.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ObjectReplicationPolicy.tsp index 2ec940969..7442fb7a1 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ObjectReplicationPolicy.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/ObjectReplicationPolicy.tsp @@ -14,26 +14,15 @@ namespace Microsoft.Storage; /** * The replication policy between two storage accounts. Multiple rules can be defined in one policy. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(StorageAccount) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - ObjectReplicationPolicyProperties -) -model ObjectReplicationPolicy extends Foundations.ProxyResource { +model ObjectReplicationPolicy + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = ObjectReplicationPolicy, KeyName = "objectReplicationPolicyId", SegmentName = "objectReplicationPolicies", NamePattern = "" >; - - /** - * Returns the Storage Account Object Replication Policy. - */ - @extension("x-ms-client-flatten", true) - properties?: ObjectReplicationPolicyProperties; } @armResourceOperations @@ -66,6 +55,9 @@ interface ObjectReplicationPolicies { @@doc(ObjectReplicationPolicy.name, "For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file." ); +@@doc(ObjectReplicationPolicy.properties, + "Returns the Storage Account Object Replication Policy." +); @@encodedName(ObjectReplicationPolicies.createOrUpdate::parameters.resource, "application/json", "properties" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/PrivateEndpointConnection.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/PrivateEndpointConnection.tsp index 0210bd0e5..bdbeda4a2 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/PrivateEndpointConnection.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/PrivateEndpointConnection.tsp @@ -14,26 +14,15 @@ namespace Microsoft.Storage; /** * The Private Endpoint Connection resource. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(StorageAccount) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - PrivateEndpointConnectionProperties -) -model PrivateEndpointConnection extends Foundations.ProxyResource { +model PrivateEndpointConnection + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = PrivateEndpointConnection, KeyName = "privateEndpointConnectionName", SegmentName = "privateEndpointConnections", NamePattern = "" >; - - /** - * Resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: PrivateEndpointConnectionProperties; } @armResourceOperations @@ -65,6 +54,7 @@ interface PrivateEndpointConnections { @@doc(PrivateEndpointConnection.name, "The name of the private endpoint connection associated with the Azure resource" ); +@@doc(PrivateEndpointConnection.properties, "Resource properties."); @@encodedName(PrivateEndpointConnections.put::parameters.resource, "application/json", "properties" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/QueueServiceProperties.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/QueueServiceProperties.tsp index b15ffb2b2..c335e7381 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/QueueServiceProperties.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/QueueServiceProperties.tsp @@ -14,27 +14,16 @@ namespace Microsoft.Storage; /** * The properties of a storage account’s Queue service. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @singleton("default") @parentResource(StorageAccount) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - QueueServicePropertiesProperties -) -model QueueServiceProperties extends Foundations.ProxyResource { +model QueueServiceProperties + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = QueueServiceProperties, KeyName = "queueService", SegmentName = "queueServices", NamePattern = "" >; - - /** - * The properties of a storage account’s Queue service. - */ - @extension("x-ms-client-flatten", true) - properties?: QueueServicePropertiesProperties; } @armResourceOperations @@ -62,6 +51,9 @@ interface QueueServicePropertiesOperationGroup { } @@doc(QueueServiceProperties.name, ""); +@@doc(QueueServiceProperties.properties, + "The properties of a storage account’s Queue service." +); @@encodedName(QueueServicePropertiesOperationGroup.setServiceProperties::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageAccount.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageAccount.tsp index 8a4ca2d7b..40a8bbb90 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageAccount.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageAccount.tsp @@ -13,11 +13,8 @@ namespace Microsoft.Storage; /** * The storage account. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(StorageAccountProperties) -model StorageAccount extends Foundations.TrackedResource { +model StorageAccount + is Azure.ResourceManager.TrackedResource { ...ResourceNameParameter< Resource = StorageAccount, KeyName = "accountName", @@ -36,12 +33,6 @@ model StorageAccount extends Foundations.TrackedResource { */ extendedLocation?: ExtendedLocation; - /** - * Properties of the storage account. - */ - @extension("x-ms-client-flatten", true) - properties?: StorageAccountProperties; - ...Azure.ResourceManager.ManagedServiceIdentityProperty; ...Azure.ResourceManager.ResourceSkuProperty; } @@ -238,6 +229,7 @@ interface StorageAccounts { @@doc(StorageAccount.name, "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only." ); +@@doc(StorageAccount.properties, "Properties of the storage account."); @@encodedName(StorageAccounts.create::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageQueue.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageQueue.tsp index c7126ade0..56f1b5ba8 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageQueue.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/StorageQueue.tsp @@ -12,24 +12,14 @@ using TypeSpec.OpenAPI; namespace Microsoft.Storage; -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(QueueServiceProperties) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(QueueProperties) -model StorageQueue extends Foundations.ProxyResource { +model StorageQueue is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = StorageQueue, KeyName = "queueName", SegmentName = "queues", NamePattern = "^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$" >; - - /** - * Queue resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: QueueProperties; } @armResourceOperations @@ -94,6 +84,7 @@ interface StorageQueues { @@doc(StorageQueue.name, "A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters." ); +@@doc(StorageQueue.properties, "Queue resource properties."); @@encodedName(StorageQueues.create::parameters.resource, "application/json", "queue" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/Table.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/Table.tsp index 4f0bae4e9..b139d6eeb 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/Table.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/Table.tsp @@ -14,24 +14,14 @@ namespace Microsoft.Storage; /** * Properties of the table, including Id, resource name, resource type. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @parentResource(TableServiceProperties) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal(TableProperties) -model Table extends Foundations.ProxyResource { +model Table is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = Table, KeyName = "tableName", SegmentName = "tables", NamePattern = "^[A-Za-z][A-Za-z0-9]{2,62}$" >; - - /** - * Table resource properties. - */ - @extension("x-ms-client-flatten", true) - properties?: TableProperties; } @armResourceOperations @@ -79,6 +69,7 @@ interface Tables { @@doc(Table.name, "A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character." ); +@@doc(Table.properties, "Table resource properties."); @@encodedName(Tables.create::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/TableServiceProperties.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/TableServiceProperties.tsp index af269d304..8fb88d2e0 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/TableServiceProperties.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/TableServiceProperties.tsp @@ -14,27 +14,16 @@ namespace Microsoft.Storage; /** * The properties of a storage account’s Table service. */ -#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "For backward compatibility" -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "For backward compatibility" @singleton("default") @parentResource(StorageAccount) -@includeInapplicableMetadataInPayload(false) -@Azure.ResourceManager.Private.armResourceInternal( - TableServicePropertiesProperties -) -model TableServiceProperties extends Foundations.ProxyResource { +model TableServiceProperties + is Azure.ResourceManager.ProxyResource { ...ResourceNameParameter< Resource = TableServiceProperties, KeyName = "tableService", SegmentName = "tableServices", NamePattern = "" >; - - /** - * The properties of a storage account’s Table service. - */ - @extension("x-ms-client-flatten", true) - properties?: TableServicePropertiesProperties; } @armResourceOperations @@ -62,6 +51,9 @@ interface TableServicePropertiesOperationGroup { } @@doc(TableServiceProperties.name, ""); +@@doc(TableServiceProperties.properties, + "The properties of a storage account’s Table service." +); @@encodedName(TableServicePropertiesOperationGroup.setServiceProperties::parameters.resource, "application/json", "parameters" diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/client.tsp index 8798a5fc0..20d7d2345 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/client.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/client.tsp @@ -25,10 +25,57 @@ using Microsoft.Storage; #suppress "deprecated" "@flattenProperty decorator is not recommended to use." @@flattenProperty(ListQueue.queueProperties); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(StorageAccount.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(PrivateEndpointConnection.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(DeletedAccount.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(ManagementPolicy.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(BlobInventoryPolicy.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(ObjectReplicationPolicy.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(LocalUser.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(EncryptionScope.properties); + @@clientName(BlobServicePropertiesOperationGroup, "BlobServiceProperties"); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(BlobServiceProperties.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(BlobContainer.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(ImmutabilityPolicy.properties); @@clientName(FileServicePropertiesOperationGroup, "FileServiceProperties"); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(FileServiceProperties.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(FileShare.properties); @@clientName(QueueServicePropertiesOperationGroup, "QueueServiceProperties"); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(QueueServiceProperties.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(StorageQueue.properties); @@clientName(TableServicePropertiesOperationGroup, "TableServiceProperties"); +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(TableServiceProperties.properties); + +#suppress "deprecated" "@flattenProperty decorator is not recommended to use." +@@flattenProperty(Table.properties); diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/models.tsp index 10da6ea0e..3772f1ea4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/models.tsp @@ -1,11 +1,13 @@ import "@typespec/rest"; import "@typespec/http"; import "@azure-tools/typespec-azure-core"; +import "@typespec/openapi"; import "@azure-tools/typespec-azure-resource-manager"; using TypeSpec.Rest; using TypeSpec.Http; using Azure.Core; +using TypeSpec.OpenAPI; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; @@ -870,6 +872,7 @@ model StorageAccountCreateParameters { /** * The parameters used to create the storage account. */ + @extension("x-ms-client-flatten", true) properties?: StorageAccountPropertiesCreateParameters; } @@ -2010,6 +2013,7 @@ model StorageAccountUpdateParameters { /** * The parameters used when updating a storage account. */ + @extension("x-ms-client-flatten", true) properties?: StorageAccountPropertiesUpdateParameters; /** @@ -2936,6 +2940,7 @@ model PrivateLinkResource extends Resource { /** * Resource properties. */ + @extension("x-ms-client-flatten", true) properties?: PrivateLinkResourceProperties; } @@ -3500,6 +3505,7 @@ model ImmutabilityPolicyProperties { /** * The properties of an ImmutabilityPolicy of a blob container. */ + @extension("x-ms-client-flatten", true) properties?: ImmutabilityPolicyProperty; /** @@ -4134,6 +4140,7 @@ model ListContainerItem extends AzureEntityResource { /** * The blob container properties be listed out. */ + @extension("x-ms-client-flatten", true) properties?: ContainerProperties; } @@ -4144,6 +4151,7 @@ model FileShareItem extends AzureEntityResource { /** * The file share properties be listed out. */ + @extension("x-ms-client-flatten", true) properties?: FileShareProperties; } @@ -4152,6 +4160,7 @@ model ListQueue extends Resource { * List Queue resource properties. */ @encodedName("application/json", "properties") + @extension("x-ms-client-flatten", true) queueProperties?: ListQueueProperties; } diff --git a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/tspconfig.yaml b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/tspconfig.yaml index 3c7a890db..7768960f4 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/tspconfig.yaml +++ b/packages/extensions/openapi-to-typespec/test/arm-storage/tsp-output/tspconfig.yaml @@ -8,6 +8,7 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" examples-directory: "{project-root}/examples" + arm-resource-flattening: true linter: extends: - "@azure-tools/typespec-azure-resource-manager/all" diff --git a/packages/extensions/openapi-to-typespec/test/arm-test/swagger-output/swagger.json b/packages/extensions/openapi-to-typespec/test/arm-test/swagger-output/swagger.json index b2e092d43..767b17e69 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-test/swagger-output/swagger.json +++ b/packages/extensions/openapi-to-typespec/test/arm-test/swagger-output/swagger.json @@ -362,7 +362,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Test/employees/{employeeName}/arraydefaults": { "get": { - "operationId": "ArrayDefaults_ListByEmployee", + "operationId": "ArrayDefaults_ListByResourceGroup", "tags": [ "ArrayDefaults" ], @@ -457,7 +457,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Test/employees/{employeeName}/dictproperties": { "get": { - "operationId": "DictProperties_ListByEmployee", + "operationId": "DictProperties_ListByResourceGroup", "tags": [ "DictProperties" ], @@ -600,8 +600,7 @@ "properties": { "properties": { "$ref": "#/definitions/ArrayDefaultProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ @@ -656,8 +655,7 @@ "properties": { "type": "object", "description": "The resource-specific properties for this resource.", - "additionalProperties": {}, - "x-ms-client-flatten": true + "additionalProperties": {} } }, "allOf": [ @@ -693,8 +691,7 @@ "properties": { "properties": { "$ref": "#/definitions/EmployeeProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ @@ -792,8 +789,7 @@ "properties": { "properties": { "$ref": "#/definitions/EnrollProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true + "description": "The resource-specific properties for this resource." } }, "allOf": [ diff --git a/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/ArrayDefault.tsp b/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/ArrayDefault.tsp index f400ed0c0..1fba62732 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/ArrayDefault.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/ArrayDefault.tsp @@ -39,3 +39,6 @@ interface ArrayDefaults { } @@doc(ArrayDefault.name, "Name of resource"); +@@doc(ArrayDefault.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/DictProperty.tsp b/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/DictProperty.tsp index 0bae3f98d..61a85e4e3 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/DictProperty.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/DictProperty.tsp @@ -38,3 +38,6 @@ interface DictProperties { } @@doc(DictProperty.name, "Name of resource"); +@@doc(DictProperty.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/Employee.tsp b/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/Employee.tsp index c092aca3a..65affea41 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/Employee.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/Employee.tsp @@ -57,3 +57,6 @@ interface Employees { } @@doc(Employee.name, "Name of employee"); +@@doc(Employee.properties, + "The resource-specific properties for this resource." +); diff --git a/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/Enroll.tsp b/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/Enroll.tsp index 70abd51ce..d1c513a0d 100644 --- a/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/Enroll.tsp +++ b/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/Enroll.tsp @@ -34,3 +34,4 @@ interface Enrolls { } @@doc(Enroll.name, ""); +@@doc(Enroll.properties, "The resource-specific properties for this resource."); diff --git a/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/client.tsp deleted file mode 100644 index 16e9c423e..000000000 --- a/packages/extensions/openapi-to-typespec/test/arm-test/tsp-output/client.tsp +++ /dev/null @@ -1,8 +0,0 @@ -import "./main.tsp"; -import "@azure-tools/typespec-client-generator-core"; - -using Azure.ClientGenerator.Core; -using Microsoft.Test; - -#suppress "deprecated" "@flattenProperty decorator is not recommended to use." -@@flattenProperty(EmployeeUpdate.properties); diff --git a/packages/extensions/openapi-to-typespec/test/bodyComplex/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/bodyComplex/tsp-output/client.tsp deleted file mode 100644 index 43b9f4f06..000000000 --- a/packages/extensions/openapi-to-typespec/test/bodyComplex/tsp-output/client.tsp +++ /dev/null @@ -1,8 +0,0 @@ -import "./main.tsp"; -import "@azure-tools/typespec-client-generator-core"; - -using Azure.ClientGenerator.Core; -using AutoRestComplexTestService; - -#suppress "deprecated" "@flattenProperty decorator is not recommended to use." -@@flattenProperty(MyBaseType.helper); diff --git a/packages/extensions/openapi-to-typespec/test/keyvault/tsp-output/client.tsp b/packages/extensions/openapi-to-typespec/test/keyvault/tsp-output/client.tsp deleted file mode 100644 index d79437e7a..000000000 --- a/packages/extensions/openapi-to-typespec/test/keyvault/tsp-output/client.tsp +++ /dev/null @@ -1,8 +0,0 @@ -import "./main.tsp"; -import "@azure-tools/typespec-client-generator-core"; - -using Azure.ClientGenerator.Core; -using Azure.Keyvault; - -#suppress "deprecated" "@flattenProperty decorator is not recommended to use." -@@flattenProperty(RoleDefinition.properties); diff --git a/packages/extensions/openapi-to-typespec/test/search/tsp-output/main.tsp b/packages/extensions/openapi-to-typespec/test/search/tsp-output/main.tsp index 7b57f7000..122dfe454 100644 --- a/packages/extensions/openapi-to-typespec/test/search/tsp-output/main.tsp +++ b/packages/extensions/openapi-to-typespec/test/search/tsp-output/main.tsp @@ -38,8 +38,8 @@ namespace Azure.Search; */ enum Versions { /** - * The 2024-07-01 API version. + * The 2024-09-01-preview API version. */ @useDependency(Azure.Core.Versions.v1_0_Preview_1) - v2024_07_01: "2024-07-01", + v2024_09_01_preview: "2024-09-01-preview", } diff --git a/packages/extensions/openapi-to-typespec/test/search/tsp-output/models.tsp b/packages/extensions/openapi-to-typespec/test/search/tsp-output/models.tsp index 306176568..c887649b4 100644 --- a/packages/extensions/openapi-to-typespec/test/search/tsp-output/models.tsp +++ b/packages/extensions/openapi-to-typespec/test/search/tsp-output/models.tsp @@ -36,7 +36,9 @@ namespace Azure.Search; * Indicates a MySql datasource. */"MySql": "mysql", /** * Indicates an ADLS Gen2 datasource. -*/"AdlsGen2": "adlsgen2" +*/"AdlsGen2": "adlsgen2", /** +* Indicates a Microsoft Fabric OneLake datasource. +*/"OneLake": "onelake" } /** @@ -143,6 +145,31 @@ namespace Azure.Search; */"private": "private" } +/** +* Details the status of an individual indexer execution. +*/ + union IndexerExecutionStatusDetail { + string, + + /** +* Indicates that the reset that occurred was for a call to ResetDocs. +*/"ResetDocs": "resetDocs" + } + +/** +* Represents the mode the indexer is executing in. +*/ + union IndexingMode { + string, + + /** +* The indexer is indexing all documents in the datasource. +*/"IndexingAllDocs": "indexingAllDocs", /** +* The indexer is indexing selective, reset documents in the datasource. The +* documents being indexed are defined on indexer status. +*/"indexingResetDocs": "indexingResetDocs" + } + /** * Defines behavior of the index projections in relation to the rest of the * indexer. @@ -405,6 +432,33 @@ namespace Azure.Search; */"Whitespace": "whitespace" } +/** +* Defines the names of all text normalizers supported by the search engine. +*/ + union LexicalNormalizerName { + string, + + /** +* Converts alphabetic, numeric, and symbolic Unicode characters which are not in +* the first 127 ASCII characters (the "Basic Latin" Unicode block) into their +* ASCII equivalents, if such equivalents exist. See +* http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/miscellaneous/ASCIIFoldingFilter.html +*/"AsciiFolding": "asciifolding", /** +* Removes elisions. For example, "l'avion" (the plane) will be converted to +* "avion" (plane). See +* http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/util/ElisionFilter.html +*/"Elision": "elision", /** +* Normalizes token text to lowercase. See +* https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/LowerCaseFilter.html +*/"Lowercase": "lowercase", /** +* Standard normalizer, which consists of lowercase and asciifolding. See +* http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/reverse/ReverseStringFilter.html +*/"Standard": "standard", /** +* Normalizes token text to uppercase. See +* https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/UpperCaseFilter.html +*/"Uppercase": "uppercase" + } + /** * The encoding format for interpreting vector field contents. */ @@ -440,7 +494,13 @@ namespace Azure.Search; * Generate embeddings using an Azure OpenAI resource at query time. */"AzureOpenAI": "azureOpenAI", /** * Generate embeddings using a custom web endpoint at query time. -*/"CustomWebApi": "customWebApi" +*/"CustomWebApi": "customWebApi", /** +* Generate embeddings for an image or text input at query time using the Azure AI +* Services Vision Vectorize API. +*/"AIServicesVision": "aiServicesVision", /** +* Generate embeddings using an Azure Machine Learning endpoint deployed via the +* Azure AI Studio Model Catalog at query time. +*/"AML": "aml" } /** @@ -703,6 +763,199 @@ namespace Azure.Search; */"Extractive": "extractive" } +/** +* Enables a debugging tool that can be used to further explore your search +* results. +*/ + union QueryDebugMode { + string, + + /** +* No query debugging information will be returned. +*/"Disabled": "disabled", /** +* Allows the user to further explore their reranked results. +*/"Semantic": "semantic" + } + +/** +* The language of the query. +*/ + union QueryLanguage { + string, + + /** +* Query language not specified. +*/"None": "none", /** +* Query language value for English (United States). +*/"EnUs": "en-us", /** +* Query language value for English (Great Britain). +*/"EnGb": "en-gb", /** +* Query language value for English (India). +*/"EnIn": "en-in", /** +* Query language value for English (Canada). +*/"EnCa": "en-ca", /** +* Query language value for English (Australia). +*/"EnAu": "en-au", /** +* Query language value for French (France). +*/"FrFr": "fr-fr", /** +* Query language value for French (Canada). +*/"FrCa": "fr-ca", /** +* Query language value for German (Germany). +*/"DeDe": "de-de", /** +* Query language value for Spanish (Spain). +*/"EsEs": "es-es", /** +* Query language value for Spanish (Mexico). +*/"EsMx": "es-mx", /** +* Query language value for Chinese (China). +*/"ZhCn": "zh-cn", /** +* Query language value for Chinese (Taiwan). +*/"ZhTw": "zh-tw", /** +* Query language value for Portuguese (Brazil). +*/"PtBr": "pt-br", /** +* Query language value for Portuguese (Portugal). +*/"PtPt": "pt-pt", /** +* Query language value for Italian (Italy). +*/"ItIt": "it-it", /** +* Query language value for Japanese (Japan). +*/"JaJp": "ja-jp", /** +* Query language value for Korean (Korea). +*/"KoKr": "ko-kr", /** +* Query language value for Russian (Russia). +*/"RuRu": "ru-ru", /** +* Query language value for Czech (Czech Republic). +*/"CsCz": "cs-cz", /** +* Query language value for Dutch (Belgium). +*/"NlBe": "nl-be", /** +* Query language value for Dutch (Netherlands). +*/"NlNl": "nl-nl", /** +* Query language value for Hungarian (Hungary). +*/"HuHu": "hu-hu", /** +* Query language value for Polish (Poland). +*/"PlPl": "pl-pl", /** +* Query language value for Swedish (Sweden). +*/"SvSe": "sv-se", /** +* Query language value for Turkish (Turkey). +*/"TrTr": "tr-tr", /** +* Query language value for Hindi (India). +*/"HiIn": "hi-in", /** +* Query language value for Arabic (Saudi Arabia). +*/"ArSa": "ar-sa", /** +* Query language value for Arabic (Egypt). +*/"ArEg": "ar-eg", /** +* Query language value for Arabic (Morocco). +*/"ArMa": "ar-ma", /** +* Query language value for Arabic (Kuwait). +*/"ArKw": "ar-kw", /** +* Query language value for Arabic (Jordan). +*/"ArJo": "ar-jo", /** +* Query language value for Danish (Denmark). +*/"DaDk": "da-dk", /** +* Query language value for Norwegian (Norway). +*/"NoNo": "no-no", /** +* Query language value for Bulgarian (Bulgaria). +*/"BgBg": "bg-bg", /** +* Query language value for Croatian (Croatia). +*/"HrHr": "hr-hr", /** +* Query language value for Croatian (Bosnia and Herzegovina). +*/"HrBa": "hr-ba", /** +* Query language value for Malay (Malaysia). +*/"MsMy": "ms-my", /** +* Query language value for Malay (Brunei Darussalam). +*/"MsBn": "ms-bn", /** +* Query language value for Slovenian (Slovenia). +*/"SlSl": "sl-sl", /** +* Query language value for Tamil (India). +*/"TaIn": "ta-in", /** +* Query language value for Vietnamese (Viet Nam). +*/"ViVn": "vi-vn", /** +* Query language value for Greek (Greece). +*/"ElGr": "el-gr", /** +* Query language value for Romanian (Romania). +*/"RoRo": "ro-ro", /** +* Query language value for Icelandic (Iceland). +*/"IsIs": "is-is", /** +* Query language value for Indonesian (Indonesia). +*/"IdId": "id-id", /** +* Query language value for Thai (Thailand). +*/"ThTh": "th-th", /** +* Query language value for Lithuanian (Lithuania). +*/"LtLt": "lt-lt", /** +* Query language value for Ukrainian (Ukraine). +*/"UkUa": "uk-ua", /** +* Query language value for Latvian (Latvia). +*/"LvLv": "lv-lv", /** +* Query language value for Estonian (Estonia). +*/"EtEe": "et-ee", /** +* Query language value for Catalan. +*/"CaEs": "ca-es", /** +* Query language value for Finnish (Finland). +*/"FiFi": "fi-fi", /** +* Query language value for Serbian (Bosnia and Herzegovina). +*/"SrBa": "sr-ba", /** +* Query language value for Serbian (Montenegro). +*/"SrMe": "sr-me", /** +* Query language value for Serbian (Serbia). +*/"SrRs": "sr-rs", /** +* Query language value for Slovak (Slovakia). +*/"SkSk": "sk-sk", /** +* Query language value for Norwegian (Norway). +*/"NbNo": "nb-no", /** +* Query language value for Armenian (Armenia). +*/"HyAm": "hy-am", /** +* Query language value for Bengali (India). +*/"BnIn": "bn-in", /** +* Query language value for Basque. +*/"EuEs": "eu-es", /** +* Query language value for Galician. +*/"GlEs": "gl-es", /** +* Query language value for Gujarati (India). +*/"GuIn": "gu-in", /** +* Query language value for Hebrew (Israel). +*/"HeIl": "he-il", /** +* Query language value for Irish (Ireland). +*/"GaIe": "ga-ie", /** +* Query language value for Kannada (India). +*/"KnIn": "kn-in", /** +* Query language value for Malayalam (India). +*/"MlIn": "ml-in", /** +* Query language value for Marathi (India). +*/"MrIn": "mr-in", /** +* Query language value for Persian (U.A.E.). +*/"FaAe": "fa-ae", /** +* Query language value for Punjabi (India). +*/"PaIn": "pa-in", /** +* Query language value for Telugu (India). +*/"TeIn": "te-in", /** +* Query language value for Urdu (Pakistan). +*/"UrPk": "ur-pk" + } + + + union Speller { + string, + + /** +* Speller not enabled. +*/"None": "none", /** +* Speller corrects individual query terms using a static lexicon for the language +* specified by the queryLanguage parameter. +*/"Lexicon": "lexicon" + } + +/** +* Improve search recall by spell-correcting individual search query terms. +*/ + union QuerySpellerType { + string, + + /** +* Speller not enabled. +*/"None": "none", /** +* Speller corrects individual query terms using a static lexicon for the language +* specified by the queryLanguage parameter. +*/"Lexicon": "lexicon" + } + /** * The kind of vector query being performed. */ @@ -713,7 +966,31 @@ namespace Azure.Search; * Vector query where a raw vector value is provided. */"Vector": "vector", /** * Vector query where a text value that needs to be vectorized is provided. -*/"Text": "text" +*/"Text": "text", /** +* Vector query where an url that represents an image value that needs to be +* vectorized is provided. +*/"ImageUrl": "imageUrl", /** +* Vector query where a base 64 encoded binary of an image that needs to be +* vectorized is provided. +*/"ImageBinary": "imageBinary" + } + +/** +* The kind of vector query being performed. +*/ + union VectorThresholdKind { + string, + + /** +* The results of the vector query will be filtered based on the vector similarity +* metric. Note this is the canonical definition of similarity metric, not the +* 'distance' version. The threshold direction (larger or smaller) will be chosen +* automatically according to the metric used by the field. +*/"VectorSimilarity": "vectorSimilarity", @doc(""" +The results of the vector query will filter based on the '@search.score' value. +Note this is the @search.score returned as part of the search response. The +threshold direction will be chosen for higher @search.score. +""")"SearchScore": "searchScore" } /** @@ -732,6 +1009,39 @@ namespace Azure.Search; */"PreFilter": "preFilter" } +/** +* Determines whether the count and facets should includes all documents that +* matched the search query, or only the documents that are retrieved within the +* 'maxTextRecallSize' window. The default value is 'countAllResults'. +*/ + union HybridCountAndFacetMode { + string, + + /** +* Only include documents that were matched within the 'maxTextRecallSize' +* retrieval window when computing 'count' and 'facets'. +*/"CountRetrievableResults": "countRetrievableResults", /** +* Include all documents that were matched by the search query when computing +* 'count' and 'facets', regardless of whether or not those documents are within +* the 'maxTextRecallSize' retrieval window. +*/"CountAllResults": "countAllResults" + } + +/** +* The way the field was used for the semantic enrichment process. +*/ + union SemanticFieldState { + string, + + /** +* The field was fully used for semantic enrichment. +*/"Used": "used", /** +* The field was not used for semantic enrichment. +*/"Unused": "unused", /** +* The field was partially used for semantic enrichment. +*/"Partial": "partial" + } + /** * Reason that a partial response was returned for a semantic ranking request. */ @@ -830,6 +1140,16 @@ namespace Azure.Search; "TextEmbeddingAda002": "text-embedding-ada-002", "TextEmbedding3Large": "text-embedding-3-large", "TextEmbedding3Small": "text-embedding-3-small" } +/** +* The name of the embedding model from the Azure AI Studio Catalog that will be +* called. +*/ + union AIStudioModelCatalogName { + string, + + "OpenAI_CLIP_Image_Text_Embeddings_vit_base_patch32": "OpenAI-CLIP-Image-Text-Embeddings-vit-base-patch32", "OpenAI_CLIP_Image_Text_Embeddings_ViT_Large_Patch14_336": "OpenAI-CLIP-Image-Text-Embeddings-ViT-Large-Patch14-336", "Facebook_DinoV2_Image_Embeddings_ViT_Base": "Facebook-DinoV2-Image-Embeddings-ViT-Base", "Facebook_DinoV2_Image_Embeddings_ViT_Giant": "Facebook-DinoV2-Image-Embeddings-ViT-Giant", "Cohere_embed_v3_english": "Cohere-embed-v3-english", "Cohere_embed_v3_multilingual": "Cohere-embed-v3-multilingual" + } + /** * The language codes supported for input text by KeyPhraseExtractionSkill. */ @@ -1610,6 +1930,39 @@ namespace Azure.Search; */"Sentences": "sentences" } +/** +* A value indicating which unit to use. +*/ + union SplitSkillUnit { + string, + + /** +* The length will be measured by character. +*/"Characters": "characters", /** +* The length will be measured by an AzureOpenAI tokenizer from the tiktoken +* library. +*/"AzureOpenAITokens": "azureOpenAITokens" + } + +/** +* A value indicating which tokenizer to use. +*/ + union SplitSkillEncoderModelName { + string, + + /** +* Refers to a base model trained with a 50,000 token vocabulary, often used in +* general natural language processing tasks. +*/"R50kBase": "r50k_base", /** +* A base model with a 50,000 token vocabulary, optimized for prompt-based tasks. +*/"P50kBase": "p50k_base", /** +* Similar to p50k_base but fine-tuned for editing or rephrasing tasks with a +* 50,000 token vocabulary. +*/"P50kEdit": "p50k_edit", /** +* A base model with a 100,000 token vocabulary. +*/"CL100kBase": "cl100k_base" + } + /** * The language codes supported for input text by CustomEntityLookupSkill. */ @@ -1861,7 +2214,8 @@ namespace Azure.Search; /** * Specifies the syntax of the search query. The default is 'simple'. Use 'full' -* if your query uses the Lucene query syntax. +* if your query uses the Lucene query syntax and 'semantic' if query syntax is +* not needed. */ enum QueryType { /** @@ -2494,6 +2848,13 @@ model SearchIndexerDataSource { */ "container": SearchIndexerDataContainer; /** +* An explicit managed identity to use for this datasource. If not specified and +* the connection string is a managed identity, the system-assigned managed +* identity is used. If not specified, the value remains unchanged. If "none" is +* specified, the value of this property is cleared. +*/ +"identity"?: SearchIndexerDataIdentity; +/** * The data change detection policy for the datasource. */ "dataChangeDetectionPolicy"?: DataChangeDetectionPolicy; @@ -2550,6 +2911,13 @@ model SearchIndexerDataContainer { "query"?: string; } +/** +* Abstract base type for data identities. +*/ +@discriminator("@odata.type") +model SearchIndexerDataIdentity { +} + /** * Base type for data change detection policies. */ @@ -2592,6 +2960,14 @@ model SearchResourceEncryptionKey { * Vault. Not required if using managed identity instead. */ "accessCredentials"?: AzureActiveDirectoryApplicationCredentials; +/** +* An explicit managed identity to use for this encryption key. If not specified +* and the access credentials property is null, the system-assigned managed +* identity is used. On update to the resource, if the explicit identity is +* unspecified, it remains unchanged. If "none" is specified, the value of this +* property is cleared. +*/ +"identity"?: SearchIndexerDataIdentity; } /** @@ -2689,6 +3065,18 @@ model ListDataSourcesResult { "dataSources": SearchIndexerDataSource[]; } + +model DocumentKeysOrIds { +/** +* document keys to be reset +*/ +"documentKeys"?: string[]; +/** +* datasource document identifiers to be reset +*/ +"datasourceDocumentIds"?: string[]; +} + /** * Represents an indexer. */ @@ -2757,6 +3145,11 @@ model SearchIndexer { * services created on or after January 1, 2019. */ "encryptionKey"?: SearchResourceEncryptionKey; +/** +* Adds caching to an enrichment pipeline to allow for incremental modification +* steps without having to rebuild the index every time. +*/ +"cache"?: SearchIndexerCache; } /** @@ -2933,6 +3326,27 @@ model FieldMappingFunction { "parameters"?: Record; } + +model SearchIndexerCache { +/** +* The connection string to the storage account where the cache data will be +* persisted. +*/ +"storageConnectionString"?: string; +/** +* Specifies whether incremental reprocessing is enabled. +*/ +"enableReprocessing"?: boolean; +/** +* The user-assigned managed identity used for connections to the enrichment +* cache. If the connection string indicates an identity (ResourceId) and it's +* not specified, the system-assigned managed identity is used. On updates to the +* indexer, if the identity is unspecified, the value remains unchanged. If set to +* "none", the value of this property is cleared. +*/ +"identity"?: SearchIndexerDataIdentity; +} + /** * Response from a List Indexers request. If successful, it includes the full * definitions of all indexers. @@ -2986,6 +3400,16 @@ model IndexerExecutionResult { @visibility("read") "status": IndexerExecutionStatus; /** +* The outcome of this indexer execution. +*/ +@visibility("read") +"statusDetail"?: IndexerExecutionStatusDetail; +/** +* All of the state that defines and dictates the indexer's current execution. +*/ +@visibility("read") +"currentState"?: IndexerCurrentState; +/** * The error message indicating the top-level error, if any. */ @visibility("read") @@ -3038,6 +3462,56 @@ model IndexerExecutionResult { "finalTrackingState"?: string; } +/** +* Represents all of the state that defines and dictates the indexer's current +* execution. +*/ +model IndexerCurrentState { +/** +* The mode the indexer is running in. +*/ +@visibility("read") +"mode"?: IndexingMode; +/** +* Change tracking state used when indexing starts on all documents in the +* datasource. +*/ +@visibility("read") +"allDocsInitialChangeTrackingState"?: string; +/** +* Change tracking state value when indexing finishes on all documents in the +* datasource. +*/ +@visibility("read") +"allDocsFinalChangeTrackingState"?: string; +/** +* Change tracking state used when indexing starts on select, reset documents in +* the datasource. +*/ +@visibility("read") +"resetDocsInitialChangeTrackingState"?: string; +/** +* Change tracking state value when indexing finishes on select, reset documents +* in the datasource. +*/ +@visibility("read") +"resetDocsFinalChangeTrackingState"?: string; +/** +* The list of document keys that have been reset. The document key is the +* document's unique identifier for the data in the search index. The indexer will +* prioritize selectively re-ingesting these keys. +*/ +@visibility("read") +"resetDocumentKeys"?: string[]; +/** +* The list of datasource document ids that have been reset. The datasource +* document id is the unique identifier for the data in the datasource. The +* indexer will prioritize selectively re-ingesting these ids. +*/ +@visibility("read") +"resetDatasourceDocumentIds"?: string[]; +} + /** * Represents an item- or document-level indexing error. */ @@ -3284,6 +3758,20 @@ model SearchIndexerKnowledgeStore { * A list of additional projections to perform during indexing. */ "projections": SearchIndexerKnowledgeStoreProjection[]; +/** +* The user-assigned managed identity used for connections to Azure Storage when +* writing knowledge store projections. If the connection string indicates an +* identity (ResourceId) and it's not specified, the system-assigned managed +* identity is used. On updates to the indexer, if the identity is unspecified, +* the value remains unchanged. If set to "none", the value of this property is +* cleared. +*/ +"identity"?: SearchIndexerDataIdentity; +/** +* A dictionary of knowledge store-specific configuration properties. Each name is +* the name of a specific property. Each value must be of a primitive type. +*/ +"parameters"?: SearchIndexerKnowledgeStoreParameters; } /** @@ -3362,6 +3850,19 @@ model SearchIndexerKnowledgeStoreBlobProjectionSelector extends SearchIndexerKno model SearchIndexerKnowledgeStoreFileProjectionSelector extends SearchIndexerKnowledgeStoreBlobProjectionSelector { } +/** +* A dictionary of knowledge store-specific configuration properties. Each name is +* the name of a specific property. Each value must be of a primitive type. +*/ +model SearchIndexerKnowledgeStoreParameters { +...Record; +/** +* Whether or not projections should synthesize a generated key name if one isn't +* already present. +*/ +"synthesizeGeneratedKeyName"?: boolean; +} + /** * Definition of additional projections to secondary search indexes. */ @@ -3431,6 +3932,14 @@ model ListSkillsetsResult { "skillsets": SearchIndexerSkillset[]; } + +model SkillNames { +/** +* the names of skills to be reset. +*/ +"skillNames"?: string[]; +} + /** * Represents a synonym map definition. */ @@ -3536,6 +4045,10 @@ model SearchIndex { */ "charFilters"?: CharFilter[]; /** +* The normalizers for the index. +*/ +"normalizers"?: LexicalNormalizer[]; +/** * A description of an encryption key that you create in Azure Key Vault. This key * is used to provide an additional level of encryption-at-rest for your data when * you want full assurance that no one, not even Microsoft, can decrypt your data. @@ -3690,6 +4203,13 @@ model SearchField { */ "indexAnalyzer"?: LexicalAnalyzerName; /** +* The name of the normalizer to use for the field. This option can be used only +* with fields with filterable, sortable, or facetable enabled. Once the +* normalizer is chosen, it cannot be changed for the field. Must be null for +* complex fields. +*/ +"normalizer"?: LexicalNormalizerName; +/** * The dimensionality of the vector field. */ @maxValue(2048) @@ -3868,6 +4388,20 @@ model CharFilter { "name": string; } +/** +* Base type for normalizers. +*/ +@discriminator("@odata.type") +model LexicalNormalizer { +/** +* The name of the normalizer. It must only contain letters, digits, spaces, +* dashes or underscores, can only start and end with alphanumeric characters, and +* is limited to 128 characters. It cannot end in '.microsoft' nor '.lucene', nor +* be named 'asciifolding', 'standard', 'lowercase', 'uppercase', or 'elision'. +*/ +"name": string; +} + /** * Base type for similarity algorithms. Similarity algorithms are used to * calculate scores that tie queries to documents. The higher the score, the more @@ -4049,6 +4583,16 @@ model VectorSearchCompressionConfiguration { * values improve recall at the expense of latency. */ "defaultOversampling"?: float64; +/** +* The number of dimensions to truncate the vectors to. Truncating the vectors +* reduces the size of the vectors and the amount of data that needs to be +* transferred during search. This can save storage cost and improve search +* performance at the expense of recall. It should be only used for embeddings +* trained with Matryoshka Representation Learning (MRL) such as OpenAI +* text-embedding-3-large (small). The default value is null, which means no +* truncation. +*/ +"truncationDimension"?: int32; } /** @@ -4111,6 +4655,10 @@ model AnalyzeRequest { */ "tokenizer"?: LexicalTokenizerName; /** +* The name of the normalizer to use to normalize the given text. +*/ +"normalizer"?: LexicalNormalizerName; +/** * An optional list of token filters to use when breaking the given text. This * parameter can only be set when using the tokenizer parameter. */ @@ -4163,6 +4711,45 @@ model AnalyzedTokenInfo { "position": int32; } +/** +* Represents an index alias, which describes a mapping from the alias name to an +* index. The alias name can be used in place of the index name for supported +* operations. +*/ +@resource("aliases") +model SearchAlias { +/** +* The name of the alias. +*/ +// FIXME: (resource-key-guessing) - Verify that this property is the resource key, if not please update the model with the right one +@key +"name": string; +/** +* The name of the index this alias maps to. Only one index name may be specified. +*/ +"indexes": string[]; +/** +* The ETag of the alias. +*/ +@encodedName("application/json", "@odata.etag") +"eTag"?: string; +} + +/** +* Response from a List Aliases request. If successful, it includes the associated +* index mappings for all aliases. +*/ +@pagedResult +model ListAliasesResult { +/** +* The aliases in the Search service. +*/ +@visibility("read") +@items +@encodedName("application/json", "value") +"aliases": SearchAlias[]; +} + /** * Response from a get service statistics request. If successful, it includes * service level counters and limits. @@ -4185,6 +4772,11 @@ model ServiceStatistics { */ model ServiceCounters { /** +* Total number of aliases. +*/ +@encodedName("application/json", "aliasesCount") +"aliasCounter": ResourceCounter; +/** * Total number of documents across all indexes in the service. */ @encodedName("application/json", "documentCount") @@ -4482,6 +5074,11 @@ model SearchRequest { */ "scoringProfile"?: string; /** +* Enables a debugging tool that can be used to further explore your reranked +* results. +*/ +"debug"?: QueryDebugMode; +/** * A full-text search query expression; Use "*" or omit this parameter to match * all documents. */ @@ -4500,6 +5097,15 @@ model SearchRequest { */ "searchMode"?: SearchMode; /** +* A value that specifies the language of the search query. +*/ +"queryLanguage"?: QueryLanguage; +/** +* A value that specified the type of the speller to use to spell-correct +* individual search query terms. +*/ +"speller"?: QuerySpellerType; +/** * The comma-separated list of fields to retrieve. If unspecified, all fields * marked as retrievable in the schema are included. */ @@ -4553,6 +5159,10 @@ model SearchRequest { */ "captions"?: QueryCaptionType; /** +* The comma-separated list of field names used for semantic ranking. +*/ +"semanticFields"?: string; +/** * The query parameters for vector and hybrid search queries. */ "vectorQueries"?: VectorQuery[]; @@ -4561,6 +5171,10 @@ model SearchRequest { * is performed. Default is 'preFilter' for new indexes. */ "vectorFilterMode"?: VectorFilterMode; +/** +* The query parameters to configure hybrid search behaviors. +*/ +"hybridSearch"?: HybridSearch; } /** @@ -4600,6 +5214,46 @@ model VectorQuery { * larger than zero. */ "weight"?: float32; +/** +* The threshold used for vector queries. Note this can only be set if all +* 'fields' use the same similarity metric. +*/ +"threshold"?: VectorThreshold; +/** +* The OData filter expression to apply to this specific vector query. If no +* filter expression is defined at the vector level, the expression defined in the +* top level filter parameter is used instead. +*/ +"filterOverride"?: string; +} + +/** +* The threshold used for vector queries. +*/ +@discriminator("kind") +model VectorThreshold { +} + +/** +* TThe query parameters to configure hybrid search behaviors. +*/ +model HybridSearch { +/** +* Determines the maximum number of documents to be retrieved by the text query +* portion of a hybrid search request. Those documents will be combined with the +* documents matching the vector queries to produce a single final list of +* results. Choosing a larger maxTextRecallSize value will allow retrieving and +* paging through more documents (using the top and skip parameters), at the cost +* of higher resource utilization and higher latency. The value needs to be +* between 1 and 10,000. Default is 1000. +*/ +"maxTextRecallSize"?: int32; +/** +* Determines whether the count and facets should includes all documents that +* matched the search query, or only the documents that are retrieved within the +* 'maxTextRecallSize' window. +*/ +"countAndFacetMode"?: HybridCountAndFacetMode; } /** @@ -4638,6 +5292,13 @@ model SearchResult { @visibility("read") @encodedName("application/json", "@search.captions") "captions"?: QueryCaptionResult[]; +/** +* Contains debugging information that can be used to further explore your search +* results. +*/ +@visibility("read") +@encodedName("application/json", "@search.documentDebugInfo") +"documentDebugInfo"?: DocumentDebugInfo[]; } /** @@ -4661,6 +5322,153 @@ model QueryCaptionResult { "highlights"?: string; } +/** +* Contains debugging information that can be used to further explore your search +* results. +*/ +model DocumentDebugInfo { +/** +* Contains debugging information specific to semantic ranking requests. +*/ +@visibility("read") +"semantic"?: SemanticDebugInfo; +/** +* Contains debugging information specific to vector and hybrid search. +*/ +@visibility("read") +"vectors"?: VectorsDebugInfo; +} + + +model SemanticDebugInfo { +/** +* The title field that was sent to the semantic enrichment process, as well as +* how it was used +*/ +@visibility("read") +"titleField"?: QueryResultDocumentSemanticField; +/** +* The content fields that were sent to the semantic enrichment process, as well +* as how they were used +*/ +@visibility("read") +"contentFields"?: QueryResultDocumentSemanticField[]; +/** +* The keyword fields that were sent to the semantic enrichment process, as well +* as how they were used +*/ +@visibility("read") +"keywordFields"?: QueryResultDocumentSemanticField[]; +/** +* The raw concatenated strings that were sent to the semantic enrichment process. +*/ +@visibility("read") +"rerankerInput"?: QueryResultDocumentRerankerInput; +} + +/** +* Description of fields that were sent to the semantic enrichment process, as +* well as how they were used +*/ +model QueryResultDocumentSemanticField { +/** +* The name of the field that was sent to the semantic enrichment process +*/ +@visibility("read") +"name"?: string; +/** +* The way the field was used for the semantic enrichment process (fully used, +* partially used, or unused) +*/ +@visibility("read") +"state"?: SemanticFieldState; +} + +/** +* The raw concatenated strings that were sent to the semantic enrichment process. +*/ +model QueryResultDocumentRerankerInput { +/** +* The raw string for the title field that was used for semantic enrichment. +*/ +@visibility("read") +"title"?: string; +/** +* The raw concatenated strings for the content fields that were used for semantic +* enrichment. +*/ +@visibility("read") +"content"?: string; +/** +* The raw concatenated strings for the keyword fields that were used for semantic +* enrichment. +*/ +@visibility("read") +"keywords"?: string; +} + + +model VectorsDebugInfo { +/** +* The breakdown of subscores of the document prior to the chosen result set +* fusion/combination method such as RRF. +*/ +@visibility("read") +"subscores"?: QueryResultDocumentSubscores; +} + +/** +* The breakdown of subscores between the text and vector query components of the +* search query for this document. Each vector query is shown as a separate object +* in the same order they were received. +*/ +model QueryResultDocumentSubscores { +/** +* The BM25 or Classic score for the text portion of the query. +*/ +@visibility("read") +"text"?: TextResult; +@doc("The vector similarity and @search.score values for each vector query.") +@visibility("read") +"vectors"?: Record[]; +/** +* The BM25 or Classic score for the text portion of the query. +*/ +@visibility("read") +"documentBoost"?: float64; +} + +/** +* The BM25 or Classic score for the text portion of the query. +*/ +model TextResult { +/** +* The BM25 or Classic score for the text portion of the query. +*/ +@visibility("read") +"searchScore"?: float64; +} + +@doc(""" +A single vector field result. Both @search.score and vector similarity values +are returned. Vector similarity is related to @search.score by an equation. +""") +model SingleVectorFieldResult { +@doc(""" +The @search.score value that is calculated from the vector similarity score. +This is the score that's visible in a pure single-field single-vector query. +""") +@visibility("read") +"searchScore"?: float64; +/** +* The vector similarity score for this document. Note this is the canonical +* definition of similarity metric, not the 'distance' version. For example, +* cosine similarity instead of cosine distance. +*/ +@visibility("read") +"vectorSimilarity"?: float64; +} + /** * Response containing suggestion query results from an index. */ @@ -5040,6 +5848,31 @@ model StopAnalyzer extends LexicalAnalyzer { "@odata.type": "#Microsoft.Azure.Search.StopAnalyzer"; } +/** +* Allows you to configure normalization for filterable, sortable, and facetable +* fields, which by default operate with strict matching. This is a user-defined +* configuration consisting of at least one or more filters, which modify the +* token that is stored. +*/ +model CustomNormalizer extends LexicalNormalizer { +/** +* A list of token filters used to filter out or modify the input token. For +* example, you can specify a lowercase filter that converts all characters to +* lowercase. The filters are run in the order in which they are listed. +*/ +"tokenFilters"?: TokenFilterName[]; +/** +* A list of character filters used to prepare input text before it is processed. +* For instance, they can replace certain characters or symbols. The filters are +* run in the order in which they are listed. +*/ +"charFilters"?: CharFilterName[]; +/** +* A URI fragment specifying the type of normalizer. +*/ +"@odata.type": "#Microsoft.Azure.Search.CustomNormalizer"; +} + /** * Grammar-based tokenizer that is suitable for processing most European-language * documents. This tokenizer is implemented using Apache Lucene. @@ -6153,13 +6986,6 @@ model AzureOpenAIParameters { "modelName"?: AzureOpenAIModelName; } -/** -* Abstract base type for data identities. -*/ -@discriminator("@odata.type") -model SearchIndexerDataIdentity { -} - /** * Specifies a user-defined vectorizer for generating the vector embedding of a * query string. Integration of an external vectorizer is achieved using the @@ -6218,6 +7044,106 @@ model WebApiParameters { "authIdentity"?: SearchIndexerDataIdentity; } +/** +* Specifies the AI Services Vision parameters for vectorizing a query image or +* text. +*/ +model AIServicesVisionVectorizer extends VectorSearchVectorizer { +/** +* Contains the parameters specific to AI Services Vision embedding vectorization. +*/ +@encodedName("application/json", "aiServicesVisionParameters") +"AIServicesVisionParameters"?: AIServicesVisionParameters; +/** +* The name of the kind of vectorization method being configured for use with +* vector search. +*/ +"kind": "aiServicesVision"; +} + +/** +* Specifies the AI Services Vision parameters for vectorizing a query image or +* text. +*/ +model AIServicesVisionParameters { +/** +* The version of the model to use when calling the AI Services Vision service. It +* will default to the latest available when not specified. +*/ +"modelVersion": string; +/** +* The resource URI of the AI Services resource. +*/ +"resourceUri": url; +/** +* API key of the designated AI Services resource. +*/ +"apiKey"?: string; +/** +* The user-assigned managed identity used for outbound connections. If an +* authResourceId is provided and it's not specified, the system-assigned managed +* identity is used. On updates to the index, if the identity is unspecified, the +* value remains unchanged. If set to "none", the value of this property is +* cleared. +*/ +"authIdentity"?: SearchIndexerDataIdentity; +} + +/** +* Specifies an Azure Machine Learning endpoint deployed via the Azure AI Studio +* Model Catalog for generating the vector embedding of a query string. +*/ +model AMLVectorizer extends VectorSearchVectorizer { +/** +* Specifies the properties of the AML vectorizer. +*/ +@encodedName("application/json", "amlParameters") +"AMLParameters"?: AMLParameters; +/** +* The name of the kind of vectorization method being configured for use with +* vector search. +*/ +"kind": "aml"; +} + +/** +* Specifies the properties for connecting to an AML vectorizer. +*/ +model AMLParameters { +/** +* (Required for no authentication or key authentication) The scoring URI of the +* AML service to which the JSON payload will be sent. Only the https URI scheme +* is allowed. +*/ +@encodedName("application/json", "uri") +"scoringUri": url; +/** +* (Required for key authentication) The key for the AML service. +*/ +@encodedName("application/json", "key") +"authenticationKey"?: string; +/** +* (Required for token authentication). The Azure Resource Manager resource ID of +* the AML service. It should be in the format +* subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.MachineLearningServices/workspaces/{workspace-name}/services/{service_name}. +*/ +"resourceId"?: string; +/** +* (Optional) When specified, indicates the timeout for the http client making the +* API call. +*/ +"timeout"?: duration; +/** +* (Optional for token authentication). The region the AML service is deployed in. +*/ +"region"?: string; +/** +* The name of the embedding model from the Azure AI Studio Catalog that is +* deployed at the provided endpoint. +*/ +"modelName"?: AIStudioModelCatalogName; +} + /** * Clears the identity property of a datasource. */ @@ -6291,6 +7217,17 @@ model SoftDeleteColumnDeletionDetectionPolicy extends DataDeletionDetectionPolic "@odata.type": "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy"; } +/** +* Defines a data deletion detection policy utilizing Azure Blob Storage's native +* soft delete feature for deletion detection. +*/ +model NativeBlobSoftDeleteDeletionDetectionPolicy extends DataDeletionDetectionPolicy { +/** +* A URI fragment specifying the type of data deletion detection policy. +*/ +"@odata.type": "#Microsoft.Azure.Search.NativeBlobSoftDeleteDeletionDetectionPolicy"; +} + /** * Defines a function that boosts scores based on distance from a geographic * location. @@ -6414,19 +7351,6 @@ model TagScoringParameters { "tagsParameter": string; } -/** -* A dictionary of knowledge store-specific configuration properties. Each name is -* the name of a specific property. Each value must be of a primitive type. -*/ -model SearchIndexerKnowledgeStoreParameters { -...Record; -/** -* Whether or not projections should synthesize a generated key name if one isn't -* already present. -*/ -"synthesizeGeneratedKeyName"?: boolean; -} - /** * An empty object that represents the default Azure AI service resource for a * skillset. @@ -6903,11 +7827,41 @@ model SplitSkill extends SearchIndexerSkill { */ "maximumPagesToTake"?: int32; /** +* Only applies if textSplitMode is set to pages. There are two possible values. +* The choice of the values will decide the length (maximumPageLength and +* pageOverlapLength) measurement. The default is 'characters', which means the +* length will be measured by character. +*/ +"unit"?: SplitSkillUnit; +/** +* Only applies if the unit is set to azureOpenAITokens. If specified, the +* splitSkill will use these parameters when performing the tokenization. The +* parameters are a valid 'encoderModelName' and an optional +* 'allowedSpecialTokens' property. +*/ +"azureOpenAITokenizerParameters"?: AzureOpenAITokenizerParameters; +/** * A URI fragment specifying the type of skill. */ "@odata.type": "#Microsoft.Skills.Text.SplitSkill"; } + +model AzureOpenAITokenizerParameters { +/** +* Only applies if the unit is set to azureOpenAITokens. Options include +* 'R50k_base', 'P50k_base', 'P50k_edit' and 'CL100k_base'. The default value is +* 'CL100k_base'. +*/ +"encoderModelName"?: SplitSkillEncoderModelName; +/** +* (Optional) Only applies if the unit is set to azureOpenAITokens. This parameter +* defines a collection of special tokens that are permitted within the +* tokenization process. +*/ +"allowedSpecialTokens"?: string[]; +} + /** * A skill looks for text from a custom, user-defined list of words and phrases. */ @@ -7050,6 +8004,54 @@ model WebApiSkill extends SearchIndexerSkill { "@odata.type": "#Microsoft.Skills.Custom.WebApiSkill"; } +/** +* The AML skill allows you to extend AI enrichment with a custom Azure Machine +* Learning (AML) model. Once an AML model is trained and deployed, an AML skill +* integrates it into AI enrichment. +*/ +model AzureMachineLearningSkill extends SearchIndexerSkill { +/** +* (Required for no authentication or key authentication) The scoring URI of the +* AML service to which the JSON payload will be sent. Only the https URI scheme +* is allowed. +*/ +@encodedName("application/json", "uri") +"scoringUri"?: url; +/** +* (Required for key authentication) The key for the AML service. +*/ +@encodedName("application/json", "key") +"authenticationKey"?: string; +/** +* (Required for token authentication). The Azure Resource Manager resource ID of +* the AML service. It should be in the format +* subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.MachineLearningServices/workspaces/{workspace-name}/services/{service_name}. +*/ +"resourceId"?: string; +/** +* (Optional) When specified, indicates the timeout for the http client making the +* API call. +*/ +"timeout"?: duration; +/** +* (Optional for token authentication). The region the AML service is deployed in. +*/ +"region"?: string; +/** +* (Optional) When specified, indicates the number of calls the indexer will make +* in parallel to the endpoint you have provided. You can decrease this value if +* your endpoint is failing under too high of a request load, or raise it if your +* endpoint is able to accept more requests and you would like an increase in the +* performance of the indexer. If not set, a default value of 5 is used. The +* degreeOfParallelism can be set to a maximum of 10 and a minimum of 1. +*/ +"degreeOfParallelism"?: int32; +/** +* A URI fragment specifying the type of skill. +*/ +"@odata.type": "#Microsoft.Skills.Custom.AmlSkill"; +} + /** * Allows you to generate a vector embedding for a given text input using the * Azure OpenAI resource. @@ -7067,6 +8069,22 @@ model AzureOpenAIEmbeddingSkill extends SearchIndexerSkill { "@odata.type": "#Microsoft.Skills.Text.AzureOpenAIEmbeddingSkill"; } +/** +* Allows you to generate a vector embedding for a given image or text input using +* the Azure AI Services Vision Vectorize API. +*/ +model VisionVectorizeSkill extends SearchIndexerSkill { +/** +* The version of the model to use when calling the AI Services Vision service. It +* will default to the latest available when not specified. +*/ +"modelVersion": string; +/** +* A URI fragment specifying the type of skill. +*/ +"@odata.type": "#Microsoft.Skills.Vision.VectorizeSkill"; +} + /** * The query parameters to use for vector search when a raw vector value is * provided. @@ -7095,4 +8113,73 @@ model VectorizableTextQuery extends VectorQuery { * The kind of vector query being performed. */ "kind": "text"; +} + +/** +* The query parameters to use for vector search when an url that represents an +* image value that needs to be vectorized is provided. +*/ +model VectorizableImageUrlQuery extends VectorQuery { +/** +* The URL of an image to be vectorized to perform a vector search query. +*/ +"url"?: string; +/** +* The kind of vector query being performed. +*/ +"kind": "imageUrl"; +} + +/** +* The query parameters to use for vector search when a base 64 encoded binary of +* an image that needs to be vectorized is provided. +*/ +model VectorizableImageBinaryQuery extends VectorQuery { +/** +* The base 64 encoded binary of an image to be vectorized to perform a vector +* search query. +*/ +"base64Image"?: string; +/** +* The kind of vector query being performed. +*/ +"kind": "imageBinary"; +} + +/** +* The results of the vector query will be filtered based on the vector similarity +* metric. Note this is the canonical definition of similarity metric, not the +* 'distance' version. The threshold direction (larger or smaller) will be chosen +* automatically according to the metric used by the field. +*/ +model VectorSimilarityThreshold extends VectorThreshold { +/** +* The threshold will filter based on the similarity metric value. Note this is +* the canonical definition of similarity metric, not the 'distance' version. The +* threshold direction (larger or smaller) will be chosen automatically according +* to the metric used by the field. +*/ +"value": float64; +/** +* The kind of threshold used to filter vector queries +*/ +"kind": "vectorSimilarity"; +} + +@doc(""" +The results of the vector query will filter based on the '@search.score' value. +Note this is the @search.score returned as part of the search response. The +threshold direction will be chosen for higher @search.score. +""") +model SearchScoreThreshold extends VectorThreshold { +@doc(""" +The threshold will filter based on the '@search.score' value. Note this is the +@search.score returned as part of the search response. The threshold direction +will be chosen for higher @search.score. +""") +"value": float64; +/** +* The kind of threshold used to filter vector queries +*/ +"kind": "searchScore"; } \ No newline at end of file diff --git a/packages/extensions/openapi-to-typespec/test/search/tsp-output/routes.tsp b/packages/extensions/openapi-to-typespec/test/search/tsp-output/routes.tsp index 65216cd11..672ad8919 100644 --- a/packages/extensions/openapi-to-typespec/test/search/tsp-output/routes.tsp +++ b/packages/extensions/openapi-to-typespec/test/search/tsp-output/routes.tsp @@ -38,7 +38,12 @@ interface DataSourcesOperations { * resource on success. */ @header -"Prefer": }}>; +"Prefer": +/** +* Ignores cache reset requirements. +*/ +@query("ignoreResetRequirements") +"skipIndexerResetRequirementForCache"?: boolean}}>; @@ -129,6 +134,33 @@ interface IndexersOperations { +/** +* Resets specific documents in the datasource to be selectively re-ingested by +* the indexer. +*/ +@route("/indexers('{indexerName}')/search.resetdocs") +@post op `resetDocs` is Azure.Core.Foundations.Operation<{/** +* The name of the indexer to reset documents for. +*/ +@path +"indexerName": string +/** +* If false, keys or ids will be appended to existing ones. If true, only the keys +* or ids in this payload will be queued to be re-ingested. +*/ +@query("overwrite") +"overwrite"?: boolean +/** +* The tracking ID sent with the request to help with debugging. +*/ +@header +"x-ms-client-request-id"?: string + +@body +"keysOrIds"?: DocumentKeysOrIds}, void>; + + + /** * Runs an indexer on-demand. */ @@ -172,7 +204,17 @@ interface IndexersOperations { * resource on success. */ @header -"Prefer": }}>; +"Prefer": +/** +* Ignores cache reset requirements. +*/ +@query("ignoreResetRequirements") +"skipIndexerResetRequirementForCache"?: boolean +/** +* Disables cache reprocessing change detection. +*/ +@query("disableCacheReprocessingChangeDetection") +"disableCacheReprocessingChangeDetection"?: boolean}}>; @@ -290,7 +332,17 @@ interface SkillsetsOperations { * resource on success. */ @header -"Prefer": }}>; +"Prefer": +/** +* Ignores cache reset requirements. +*/ +@query("ignoreResetRequirements") +"skipIndexerResetRequirementForCache"?: boolean +/** +* Disables cache reprocessing change detection. +*/ +@query("disableCacheReprocessingChangeDetection") +"disableCacheReprocessingChangeDetection"?: boolean}}>; @@ -361,6 +413,28 @@ interface SkillsetsOperations { +/** +* Reset an existing skillset in a search service. +*/ +@route("/skillsets('{skillsetName}')/search.resetskills") +@post op `resetSkills` is Azure.Core.Foundations.Operation<{/** +* The name of the skillset to reset. +*/ +@path +"skillsetName": string +/** +* The tracking ID sent with the request to help with debugging. +*/ +@header +"x-ms-client-request-id"?: string +/** +* The names of skills to reset. +*/ +@body +"skillNames": SkillNames}, void>; + + + } interface SynonymMapsOperations { @@ -613,6 +687,101 @@ interface IndexesOperations { +} + +interface AliasesOperations { +/** +* Creates a new search alias. +*/ + +`create` is Azure.Core.ResourceCreateWithServiceProvidedName; + + + +/** +* Lists all aliases available for a search service. +*/ + +`list` is Azure.Core.ResourceList; + + + +/** +* Creates a new search alias or updates an alias if it already exists. +*/ + +`createOrUpdate` is Azure.Core.ResourceCreateOrReplace; + + + +/** +* Deletes a search alias and its associated mapping to an index. This operation +* is permanent, with no recovery option. The mapped index is untouched by this +* operation. +*/ + +`delete` is Azure.Core.ResourceDelete; + + + +/** +* Retrieves an alias definition. +*/ + +`get` is Azure.Core.ResourceRead; + + + } /** @@ -834,7 +1003,28 @@ interface DocumentsOperations { * ranking phase, and the L2 semantic phase. */ @query("semanticQuery") -"semanticQuery"?: string}, SearchDocumentsResult>; +"semanticQuery"?: string +/** +* Enables a debugging tool that can be used to further explore your search +* results. +*/ +@query("debug") +"debug"?: QueryDebugMode +/** +* The language of the query. +*/ +@query("queryLanguage") +"queryLanguage"?: QueryLanguage +/** +* Improve search recall by spell-correcting individual search query terms. +*/ +@query("speller") +"speller"?: Speller +/** +* The list of field names used for semantic ranking. +*/ +@query({name: "semanticFields", format: "csv"}) +"semanticFields"?: string[]}, SearchDocumentsResult>; diff --git a/packages/extensions/openapi-to-typespec/test/utils/generate-typespec.ts b/packages/extensions/openapi-to-typespec/test/utils/generate-typespec.ts index 19a783c3a..2d24b5ccc 100644 --- a/packages/extensions/openapi-to-typespec/test/utils/generate-typespec.ts +++ b/packages/extensions/openapi-to-typespec/test/utils/generate-typespec.ts @@ -106,8 +106,6 @@ async function main() { for (let i = 0; i < folders.length; i++) { const folder = folders[i]; - // https://github.com/Azure/typespec-azure/issues/862 - if (folder === "arm-playwrighttesting") continue; try { await generateTypespec(repoRoot, folder, debug); if (swagger) {