Skip to content

Commit 2b7a56b

Browse files
Copilotv-jiaodi
andauthored
Improve TSDoc documentation for Azure Cloud helpers (#3474)
* Initial plan * Improve TSDoc documentation for Azure Cloud helpers with @enum, @param, @returns, and @throws tags Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com> * Fix CI error: Update generated NetworkAnalytics.Management package files Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
1 parent c33e1ae commit 2b7a56b

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/sdk/test/arm-test/src/static-helpers/cloudSettingHelpers.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
/** An enum to describe Azure Cloud. */
4+
/**
5+
* An enum to describe Azure Cloud environments.
6+
* @enum {string}
7+
*/
58
export enum AzureClouds {
69
/** Azure public cloud, which is the default cloud for Azure SDKs. */
710
AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD",
@@ -14,6 +17,12 @@ export enum AzureClouds {
1417
/** The supported values for cloud setting as a string literal type */
1518
export type AzureSupportedClouds = `${AzureClouds}`;
1619

20+
/**
21+
* Gets the Azure Resource Manager endpoint URL for the specified cloud setting.
22+
* @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.
23+
* @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.
24+
* @throws {Error} Throws an error if an unknown cloud setting is provided.
25+
*/
1726
export function getArmEndpoint(
1827
cloudSetting?: AzureSupportedClouds,
1928
): string | undefined {

packages/typespec-ts/static/static-helpers/cloudSettingHelpers.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
/** An enum to describe Azure Cloud. */
1+
/**
2+
* An enum to describe Azure Cloud environments.
3+
* @enum {string}
4+
*/
25
export enum AzureClouds {
36
/** Azure public cloud, which is the default cloud for Azure SDKs. */
47
AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD",
@@ -11,6 +14,12 @@ export enum AzureClouds {
1114
/** The supported values for cloud setting as a string literal type */
1215
export type AzureSupportedClouds = `${AzureClouds}`;
1316

17+
/**
18+
* Gets the Azure Resource Manager endpoint URL for the specified cloud setting.
19+
* @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.
20+
* @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.
21+
* @throws {Error} Throws an error if an unknown cloud setting is provided.
22+
*/
1423
export function getArmEndpoint(
1524
cloudSetting?: AzureSupportedClouds
1625
): string | undefined {

0 commit comments

Comments
 (0)