From 03bc5a38346866c602c82a3bd25101032896a369 Mon Sep 17 00:00:00 2001 From: bsomeshekar <99467336+bsomeshekar@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:08:50 +0530 Subject: [PATCH] Updating namespace names as per the review (#31206) * Updating namespace names as per the review https://github.com/Azure/azure-sdk-pr/issues/1889 * Setting namespace for java sdk * Fixing pipeline errors * Adding emitter for python * Fixing pipeline errors * Adding service-dir to fix pipeline error * Fixing pipeline errors * Revert "Fixing pipeline errors" This reverts commit f638130e5d083b27e8679100b70c122a83a4e8c2. * Adding configs in typescript file * update * disable sample generation for csharp * disable sample generation of csharp for sitemanager * Removing emitter-output-dir based on review comments --------- Co-authored-by: Yuchao Yan Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Co-authored-by: Wei Hu Co-authored-by: Wei Hu --- .../Microsoft.Edge.Management/tspconfig.yaml | 49 ++++++++++++++++++ .../tspconfig.yaml | 50 +++++++++++++++++++ .../Microsoft.Edge/edge/readme.az.md | 20 ++++---- .../Microsoft.Edge/edge/readme.csharp.md | 2 +- .../Microsoft.Edge/edge/readme.go.md | 2 +- .../Microsoft.Edge/edge/readme.java.md | 12 +++++ .../Microsoft.Edge/edge/readme.md | 13 +++-- .../Microsoft.Edge/edge/readme.python.md | 6 +-- .../Microsoft.Edge/edge/readme.typescript.md | 4 +- .../Microsoft.Edge/sites/readme.az.md | 20 ++++---- .../Microsoft.Edge/sites/readme.csharp.md | 2 +- .../Microsoft.Edge/sites/readme.go.md | 2 +- .../Microsoft.Edge/sites/readme.java.md | 12 +++++ .../Microsoft.Edge/sites/readme.md | 4 ++ .../Microsoft.Edge/sites/readme.python.md | 6 +-- .../Microsoft.Edge/sites/readme.typescript.md | 4 +- 16 files changed, 170 insertions(+), 38 deletions(-) create mode 100644 specification/edge/resource-manager/Microsoft.Edge/edge/readme.java.md create mode 100644 specification/edge/resource-manager/Microsoft.Edge/sites/readme.java.md diff --git a/specification/edge/Microsoft.Edge.Management/tspconfig.yaml b/specification/edge/Microsoft.Edge.Management/tspconfig.yaml index eab6dfa143ab..5f82fdff7ce7 100644 --- a/specification/edge/Microsoft.Edge.Management/tspconfig.yaml +++ b/specification/edge/Microsoft.Edge.Management/tspconfig.yaml @@ -1,3 +1,12 @@ +parameters: + "service-dir": + default: "sdk/commonedgesitemanageroperations" + "python-sdk-folder": + default: "{project-root}/azure-sdk-for-python/" + "java-sdk-folder": + default: "{project-root}/azure-sdk-for-java/" + "service-directory-name": + default: "commonedgesitemanageroperations" emit: - "@azure-tools/typespec-autorest" options: @@ -7,6 +16,46 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/edge/{version-status}/{version}/operations.json" arm-types-dir: "{project-root}/../../common-types/resource-management" + "@azure-tools/typespec-java": + package-dir: "azure-resourcemanager-commonedgesitemanageroperations" + namespace: "com.azure.resourcemanager.commonedgesitemanageroperations" + emitter-output-dir: "{java-sdk-folder}/sdk/{service-directory-name}/azure-resourcemanager-commonedgesitemanageroperations" + flavor: azure + "@azure-tools/typespec-python": + package-dir: "azure-mgmt-commonedgesitemanageroperations" + package-name: "{package-dir}" + emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" + generate-test: true + generate-sample: true + flavor: azure + "@azure-tools/typespec-ts": + azureSdkForJs: true + isModularLibrary: true + generateMetadata: true + hierarchyClient: false + experimentalExtensibleEnums: true + enableOperationGroup: true + flavor: azure + package-dir: "arm-commonedgesitemanageroperations" + packageDetails: + name: "@azure/arm-commonedgesitemanageroperations" + "@azure-tools/typespec-csharp": + package-dir: "Azure.ResourceManager.CommonEdgeSiteManagerOperations" + namespace: "{package-dir}" + clear-output-folder: true + model-namespace: false + flavor: azure + "@azure-tools/typespec-go": + service-dir: "sdk/resourcemanager/commonedgesitemanageroperations" + package-dir: "armcommonedgesitemanageroperations" + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/{package-dir}" + fix-const-stuttering: true + flavor: "azure" + generate-examples: true + generate-fakes: true + head-as-boolean: true + inject-spans: true + remove-unreferenced-types: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/specification/edge/Microsoft.Edge.Sites.Management/tspconfig.yaml b/specification/edge/Microsoft.Edge.Sites.Management/tspconfig.yaml index f19226f18685..a40975d3745a 100644 --- a/specification/edge/Microsoft.Edge.Sites.Management/tspconfig.yaml +++ b/specification/edge/Microsoft.Edge.Sites.Management/tspconfig.yaml @@ -1,3 +1,12 @@ +parameters: + "service-dir": + default: "sdk/sitemanager" + "python-sdk-folder": + default: "{project-root}/azure-sdk-for-python/" + "java-sdk-folder": + default: "{project-root}/azure-sdk-for-java/" + "service-directory-name": + default: "sitemanager" emit: - "@azure-tools/typespec-autorest" options: @@ -7,6 +16,47 @@ options: azure-resource-provider-folder: "resource-manager" output-file: "{azure-resource-provider-folder}/{service-name}/sites/{version-status}/{version}/sites.json" arm-types-dir: "{project-root}/../../common-types/resource-management" + "@azure-tools/typespec-java": + package-dir: "azure-resourcemanager-sitemanager" + namespace: "com.azure.resourcemanager.sitemanager" + emitter-output-dir: "{java-sdk-folder}/sdk/{service-directory-name}/azure-resourcemanager-sitemanager" + flavor: azure + "@azure-tools/typespec-python": + package-dir: "azure-mgmt-sitemanager" + package-name: "{package-dir}" + emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" + generate-test: true + generate-sample: true + flavor: azure + "@azure-tools/typespec-ts": + azureSdkForJs: true + isModularLibrary: true + generateMetadata: true + hierarchyClient: false + experimentalExtensibleEnums: true + enableOperationGroup: true + flavor: azure + package-dir: "arm-sitemanager" + packageDetails: + name: "@azure/arm-sitemanager" + "@azure-tools/typespec-csharp": + package-dir: "Azure.ResourceManager.SiteManager" + namespace: "{package-dir}" + clear-output-folder: true + model-namespace: false + flavor: azure + generate-sample-project: false + "@azure-tools/typespec-go": + service-dir: "sdk/resourcemanager/sitemanager" + package-dir: "armsitemanager" + module: "github.com/Azure/azure-sdk-for-go/{service-dir}/{package-dir}" + fix-const-stuttering: true + flavor: "azure" + generate-examples: true + generate-fakes: true + head-as-boolean: true + inject-spans: true + remove-unreferenced-types: true linter: extends: - "@azure-tools/typespec-azure-rulesets/resource-manager" diff --git a/specification/edge/resource-manager/Microsoft.Edge/edge/readme.az.md b/specification/edge/resource-manager/Microsoft.Edge/edge/readme.az.md index 3a913718257c..dd4e0f0cabaa 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/edge/readme.az.md +++ b/specification/edge/resource-manager/Microsoft.Edge/edge/readme.az.md @@ -6,11 +6,11 @@ For new Resource Provider. It is highly recommended to onboard Azure CLI extensi ``` yaml $(az) && $(target-mode) != 'core' az: - extensions: edgeupdates - namespace: azure.mgmt.edgeupdates - package-name: azure-mgmt-edgeupdates -az-output-folder: $(azure-cli-extension-folder)/src/edgeupdates -python-sdk-output-folder: "$(az-output-folder)/azext_edgeupdates/vendored_sdks/edgeupdates" + extensions: commonedgesitemanageroperations + namespace: azure.mgmt.commonedgesitemanageroperations + package-name: azure-mgmt-commonedgesitemanageroperations +az-output-folder: $(azure-cli-extension-folder)/src/commonedgesitemanageroperations +python-sdk-output-folder: "$(az-output-folder)/azext_commonedgesitemanageroperations/vendored_sdks/commonedgesitemanageroperations" # add additional configuration here specific for Azure CLI # refer to the faq.md for more details ``` @@ -20,9 +20,9 @@ python-sdk-output-folder: "$(az-output-folder)/azext_edgeupdates/vendored_sdks/e This is for command modules that already in azure cli main repo. ``` yaml $(az) && $(target-mode) == 'core' az: - extensions: edgeupdates - namespace: azure.mgmt.edgeupdates - package-name: azure-mgmt-edgeupdates -az-output-folder: $(azure-cli-folder)/src/azure-cli/azure/cli/command_modules/edgeupdates -python-sdk-output-folder: "$(az-output-folder)/vendored_sdks/edgeupdates" + extensions: commonedgesitemanageroperations + namespace: azure.mgmt.commonedgesitemanageroperations + package-name: azure-mgmt-commonedgesitemanageroperations +az-output-folder: $(azure-cli-folder)/src/azure-cli/azure/cli/command_modules/commonedgesitemanageroperations +python-sdk-output-folder: "$(az-output-folder)/vendored_sdks/commonedgesitemanageroperations" ``` \ No newline at end of file diff --git a/specification/edge/resource-manager/Microsoft.Edge/edge/readme.csharp.md b/specification/edge/resource-manager/Microsoft.Edge/edge/readme.csharp.md index 17306261f4f0..ce153bb60ca5 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/edge/readme.csharp.md +++ b/specification/edge/resource-manager/Microsoft.Edge/edge/readme.csharp.md @@ -11,5 +11,5 @@ csharp: clear-output-folder: true client-side-validation: false namespace: Microsoft.Edge - output-folder: $(csharp-sdks-folder)/edgeupdates/management/Microsoft.Edge/GeneratedProtocol + output-folder: $(csharp-sdks-folder)/commonedgesitemanageroperations/management/Microsoft.Edge/GeneratedProtocol ``` \ No newline at end of file diff --git a/specification/edge/resource-manager/Microsoft.Edge/edge/readme.go.md b/specification/edge/resource-manager/Microsoft.Edge/edge/readme.go.md index 44597e30919a..43fa0763cf5c 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/edge/readme.go.md +++ b/specification/edge/resource-manager/Microsoft.Edge/edge/readme.go.md @@ -5,7 +5,7 @@ These settings apply only when `--go` is specified on the command line. ```yaml $(go) && $(track2) azure-arm: true license-header: MICROSOFT_MIT_NO_VERSION -module-name: sdk/resourcemanager/edgeupdates/armedgeupdates +module-name: sdk/resourcemanager/commonedgesitemanageroperations/armcommonedgesitemanageroperations module: github.com/Azure/azure-sdk-for-go/$(module-name) output-folder: $(go-sdk-folder)/$(module-name) ``` \ No newline at end of file diff --git a/specification/edge/resource-manager/Microsoft.Edge/edge/readme.java.md b/specification/edge/resource-manager/Microsoft.Edge/edge/readme.java.md new file mode 100644 index 000000000000..38efe778cd63 --- /dev/null +++ b/specification/edge/resource-manager/Microsoft.Edge/edge/readme.java.md @@ -0,0 +1,12 @@ +## Java + +These settings apply only when `--java` is specified on the command line. +Please also specify `--azure-libraries-for-java-folder=`. + +``` yaml $(java) +azure-arm: true +namespace: com.azure.resourcemanager.commonedgesitemanageroperations +license-header: MICROSOFT_MIT_NO_VERSION +payload-flattening-threshold: 1 +output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-commonedgesitemanageroperations +``` \ No newline at end of file diff --git a/specification/edge/resource-manager/Microsoft.Edge/edge/readme.md b/specification/edge/resource-manager/Microsoft.Edge/edge/readme.md index 45063be20a28..fcf490afd284 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/edge/readme.md +++ b/specification/edge/resource-manager/Microsoft.Edge/edge/readme.md @@ -27,14 +27,14 @@ These are the global settings for the edge. ```yaml openapi-type: arm openapi-subtype: providerHub -tag: updates-package-2024-02-01-preview +tag: package-2024-02-01-preview ``` -### Tag: updates-package-2024-02-01-preview +### Tag: package-2024-02-01-preview -These settings apply only when `--tag=updates-package-2024-02-01-preview` is specified on the command line. +These settings apply only when `--tag=package-2024-02-01-preview` is specified on the command line. -```yaml $(tag) == 'updates-package-2024-02-01-preview' +```yaml $(tag) == 'package-2024-02-01-preview' input-file: - preview/2024-02-01-preview/operations.json ``` @@ -51,6 +51,7 @@ This is not used by Autorest itself. swagger-to-sdk: - repo: azure-sdk-for-python - repo: azure-sdk-for-java + - repo: azure-sdk-for-go - repo: azure-sdk-for-js - repo: azure-resource-manager-schemas - repo: azure-cli-extensions @@ -77,3 +78,7 @@ See configuration in [readme.typescript.md](./readme.typescript.md) See configuration in [readme.csharp.md](./readme.csharp.md) +## Java + +See configuration in [readme.java.md](./readme.java.md) + diff --git a/specification/edge/resource-manager/Microsoft.Edge/edge/readme.python.md b/specification/edge/resource-manager/Microsoft.Edge/edge/readme.python.md index d0219bf5fcd6..4aa7d619ff3f 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/edge/readme.python.md +++ b/specification/edge/resource-manager/Microsoft.Edge/edge/readme.python.md @@ -6,13 +6,13 @@ Please also specify `--python-sdks-folder=`. + +``` yaml $(java) +azure-arm: true +namespace: com.azure.resourcemanager.sitemanager +license-header: MICROSOFT_MIT_NO_VERSION +payload-flattening-threshold: 1 +output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-sitemanager +``` \ No newline at end of file diff --git a/specification/edge/resource-manager/Microsoft.Edge/sites/readme.md b/specification/edge/resource-manager/Microsoft.Edge/sites/readme.md index 86d64c575a6d..8995c5c1fbec 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/sites/readme.md +++ b/specification/edge/resource-manager/Microsoft.Edge/sites/readme.md @@ -86,3 +86,7 @@ See configuration in [readme.typescript.md](./readme.typescript.md) ## CSharp See configuration in [readme.csharp.md](./readme.csharp.md) + +## Java + +See configuration in [readme.java.md](./readme.java.md) diff --git a/specification/edge/resource-manager/Microsoft.Edge/sites/readme.python.md b/specification/edge/resource-manager/Microsoft.Edge/sites/readme.python.md index b0a6463f78da..d2d9ecf4f9b4 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/sites/readme.python.md +++ b/specification/edge/resource-manager/Microsoft.Edge/sites/readme.python.md @@ -6,13 +6,13 @@ Please also specify `--python-sdks-folder=