-
Notifications
You must be signed in to change notification settings - Fork 81
Add the cloudSetting option for ARM Modular SDK
#3233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
9fb6730
Add the cloud setting option for ARM modular SDK
MaryGao 7877136
Update the idea
MaryGao 40c8971
Merge branch 'main' into support-multi-cloud-modular
MaryGao 2b05dec
Build the cloud setting enum in model.ts
MaryGao ff301ca
Update the comments
MaryGao e98f8d8
Fix the generation issues
MaryGao a38ee5d
Refactor code a little to remove duplications
MaryGao 5bfb860
Update the integration testings
MaryGao 3705a0c
Fix the thrown exception messages
MaryGao 7612429
Update the formats
MaryGao 2711920
Directly use tcgc arm option
MaryGao 4cb037a
Fix the UTs
MaryGao ed48054
Merge branch 'main' into support-multi-cloud-modular
MaryGao 045ccbc
Update packages/typespec-ts/src/modular/buildClientContext.ts
MaryGao 94d31cb
Regen the smoke with copilot comments
MaryGao 5a63c55
Regen with smoke testing
MaryGao 98680a0
Merge branch 'main' into support-multi-cloud-modular
MaryGao 0f521eb
Merge branch 'main' into support-multi-cloud-modular
MaryGao a212372
Merge main into pr/MaryGao/3233 - resolved conflicts in cloud setting…
MaryGao abc02ad
Move the helper into our static helper folder
MaryGao b8a37b7
Remove the baseurl
MaryGao 21cbaee
Update the un-necessary codes
MaryGao ca885b7
Update the un-necessary codes
MaryGao 4183b3a
Fix the UTs
MaryGao c66ce82
Fix the UTs
MaryGao d8258cc
Update packages/typespec-ts/src/modular/buildRootIndex.ts
MaryGao 8df5e7d
Update the comments
MaryGao 2824202
Merge branch 'support-multi-cloud-modular' of https://github.com/mary…
MaryGao d2ba539
Update the copilot suggestion
MaryGao 5ce951b
Update the git diff
MaryGao 99a0b4f
Regen modular integration test
MaryGao 03ebf2c
Update packages/typespec-test/test/NetworkAnalytics.Management/genera…
MaryGao e24c68d
Update packages/typespec-test/test/NetworkAnalytics.Management/genera…
MaryGao c213829
Refresh the smoke test and integration test
MaryGao 5d5610d
Update the index file
MaryGao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...agement/generated/typespec-ts/sdk/test/arm-test/src/static-helpers/cloudSettingHelpers.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| /** An enum to describe Azure Cloud. */ | ||
| export enum AzureClouds { | ||
| /** Azure public cloud, which is the default cloud for Azure SDKs. */ | ||
| AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", | ||
| /** Azure China cloud */ | ||
| AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", | ||
| /** Azure US government cloud */ | ||
| AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT", | ||
| } | ||
|
|
||
| /** The supported values for cloud setting as a string literal type */ | ||
| export type AzureSupportedClouds = `${AzureClouds}`; | ||
|
|
||
| export function getArmEndpoint( | ||
| cloudSetting?: AzureSupportedClouds, | ||
| ): string | undefined { | ||
| if (cloudSetting === undefined) { | ||
| return undefined; | ||
| } | ||
| const cloudEndpoints: Record<keyof typeof AzureClouds, string> = { | ||
| AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/", | ||
| AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/", | ||
| AZURE_PUBLIC_CLOUD: "https://management.azure.com/", | ||
| }; | ||
| if (cloudSetting in cloudEndpoints) { | ||
| return cloudEndpoints[cloudSetting]; | ||
| } else { | ||
| throw new Error( | ||
| `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`, | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.