diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 535b0b55f611..9e4df5ba8b75 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1211,6 +1211,19 @@ packages: - supports-color dev: false + /@azure-tools/test-credential@1.1.0: + resolution: {integrity: sha512-KFICQ9ke2OIQms3ZCoidKmH/opUsP9rHub4pdH8JTHh4atiYq2AKviMIgMyBC3ZYdOfsFfnMrm5PcH+0VDRafw==} + engines: {node: '>=18.0.0'} + dependencies: + '@azure-tools/test-recorder': 3.2.0 + '@azure/core-auth': 1.7.2 + '@azure/core-util': 1.9.0 + '@azure/identity': 4.2.0 + tslib: 2.6.2 + transitivePeerDependencies: + - supports-color + dev: false + /@azure-tools/test-recorder@3.2.0: resolution: {integrity: sha512-Y7e3H4isrxCdc6Qjc2bXPIgW8dP/aD387mQ6w7W07eRFZLqAj7sGSQWQ6UrMUkS3Bv9k6JEyjO4WSNrSKEFpaA==} engines: {node: '>=18.0.0'} @@ -17024,11 +17037,11 @@ packages: dev: false file:projects/arm-selfhelp.tgz: - resolution: {integrity: sha512-AV9E4kptyBbma5l1sQ/Dm8IfaZrP9hQCZ66bU6RgOhGnF82HlylansZ1Im/Lo72udfTnRVT9NrUZSba9afXzXQ==, tarball: file:projects/arm-selfhelp.tgz} + resolution: {integrity: sha512-2hUPoU+gKUGR3eMSfcruhUC9Jv2icxCwcimPRk86Wskq2kETMxkklFwiI8y4E7OoJ8iftpbqBzp8RJTGlhdIaA==, tarball: file:projects/arm-selfhelp.tgz} name: '@rush-temp/arm-selfhelp' version: 0.0.0 dependencies: - '@azure-tools/test-credential': 1.0.4 + '@azure-tools/test-credential': 1.1.0 '@azure-tools/test-recorder': 3.2.0 '@azure/abort-controller': 1.1.0 '@azure/core-lro': 2.7.2 @@ -17040,6 +17053,7 @@ packages: chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.4.5 + esm: 3.2.25 mkdirp: 3.0.1 mocha: 10.4.0 rimraf: 5.0.5 diff --git a/sdk/selfhelp/arm-selfhelp/CHANGELOG.md b/sdk/selfhelp/arm-selfhelp/CHANGELOG.md index 03042d8bce1e..51504bbbc665 100644 --- a/sdk/selfhelp/arm-selfhelp/CHANGELOG.md +++ b/sdk/selfhelp/arm-selfhelp/CHANGELOG.md @@ -1,15 +1,124 @@ # Release History + +## 2.0.0-beta.4 (2024-05-10) + +**Features** -## 2.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation group CheckNameAvailability + - Added operation group DiscoverySolutionNLPSubscriptionScope + - Added operation group DiscoverySolutionNLPTenantScope + - Added operation group SimplifiedSolutions + - Added operation group Solution + - Added operation group SolutionSelfHelp + - Added operation group Troubleshooters + - Added Interface AutomatedCheckResult + - Added Interface CheckNameAvailabilityPostOptionalParams + - Added Interface ClassificationService + - Added Interface ContinueRequestBody + - Added Interface DiscoveryNlpRequest + - Added Interface DiscoveryNlpResponse + - Added Interface DiscoverySolutionNLPSubscriptionScopePostOptionalParams + - Added Interface DiscoverySolutionNLPTenantScopePostOptionalParams + - Added Interface Filter + - Added Interface FilterGroup + - Added Interface MetricsBasedChart + - Added Interface ReplacementMaps + - Added Interface ReplacementMapsSelfHelp + - Added Interface ResponseOption + - Added Interface ResponseValidationProperties + - Added Interface RestartTroubleshooterResponse + - Added Interface SearchResult + - Added Interface Section + - Added Interface SectionSelfHelp + - Added Interface SimplifiedSolutionsCreateOptionalParams + - Added Interface SimplifiedSolutionsGetOptionalParams + - Added Interface SimplifiedSolutionsResource + - Added Interface SolutionCreateOptionalParams + - Added Interface SolutionGetOptionalParams + - Added Interface SolutionMetadataProperties + - Added Interface SolutionNlpMetadataResource + - Added Interface SolutionPatchRequestBody + - Added Interface SolutionResource + - Added Interface SolutionResourceSelfHelp + - Added Interface SolutionsDiagnostic + - Added Interface SolutionSelfHelpGetOptionalParams + - Added Interface SolutionsTroubleshooters + - Added Interface SolutionUpdateHeaders + - Added Interface SolutionUpdateOptionalParams + - Added Interface SolutionWarmUpOptionalParams + - Added Interface SolutionWarmUpRequestBody + - Added Interface Step + - Added Interface StepInput + - Added Interface TriggerCriterion + - Added Interface TroubleshooterResource + - Added Interface TroubleshooterResponse + - Added Interface TroubleshootersContinueHeaders + - Added Interface TroubleshootersContinueOptionalParams + - Added Interface TroubleshootersCreateOptionalParams + - Added Interface TroubleshootersEndHeaders + - Added Interface TroubleshootersEndOptionalParams + - Added Interface TroubleshootersGetOptionalParams + - Added Interface TroubleshootersRestartHeaders + - Added Interface TroubleshootersRestartOptionalParams + - Added Interface Video + - Added Interface VideoGroup + - Added Interface VideoGroupVideo + - Added Interface WebResult + - Added Type Alias AggregationType + - Added Type Alias AutomatedCheckResultType + - Added Type Alias CheckNameAvailabilityPostResponse + - Added Type Alias Confidence + - Added Type Alias DiagnosticProvisioningState + - Added Type Alias DiscoverySolutionNLPSubscriptionScopePostResponse + - Added Type Alias DiscoverySolutionNLPTenantScopePostResponse + - Added Type Alias ExecutionStatus + - Added Type Alias Name + - Added Type Alias QuestionContentType + - Added Type Alias QuestionType + - Added Type Alias ResultType + - Added Type Alias SimplifiedSolutionsCreateResponse + - Added Type Alias SimplifiedSolutionsGetResponse + - Added Type Alias SolutionCreateResponse + - Added Type Alias SolutionGetResponse + - Added Type Alias SolutionProvisioningState + - Added Type Alias SolutionSelfHelpGetResponse + - Added Type Alias SolutionType + - Added Type Alias SolutionUpdateResponse + - Added Type Alias TroubleshooterProvisioningState + - Added Type Alias TroubleshootersContinueResponse + - Added Type Alias TroubleshootersCreateResponse + - Added Type Alias TroubleshootersEndResponse + - Added Type Alias TroubleshootersGetResponse + - Added Type Alias TroubleshootersRestartResponse + - Added Type Alias Type + - Added Type Alias ValidationScope + - Interface SolutionMetadataResource has a new optional parameter solutions + - Added Enum KnownAggregationType + - Added Enum KnownAutomatedCheckResultType + - Added Enum KnownConfidence + - Added Enum KnownDiagnosticProvisioningState + - Added Enum KnownExecutionStatus + - Added Enum KnownName + - Added Enum KnownQuestionContentType + - Added Enum KnownQuestionType + - Added Enum KnownResultType + - Added Enum KnownSolutionProvisioningState + - Added Enum KnownSolutionType + - Added Enum KnownTroubleshooterProvisioningState + - Added Enum KnownType + - Added Enum KnownValidationScope -### Other Changes +**Breaking Changes** + - Removed operation Diagnostics.checkNameAvailability + - Operation DiscoverySolution.list has a new signature + - Interface SolutionMetadataResource no longer has parameter description + - Interface SolutionMetadataResource no longer has parameter requiredParameterSets + - Interface SolutionMetadataResource no longer has parameter solutionId + - Interface SolutionMetadataResource no longer has parameter solutionType + - Type of parameter provisioningState of interface DiagnosticResource is changed from ProvisioningState to DiagnosticProvisioningState + - Removed Enum KnownProvisioningState + ## 2.0.0-beta.3 (2024-04-19) **Features** diff --git a/sdk/selfhelp/arm-selfhelp/README.md b/sdk/selfhelp/arm-selfhelp/README.md index 9c0564d0523d..79fe7daaaf54 100644 --- a/sdk/selfhelp/arm-selfhelp/README.md +++ b/sdk/selfhelp/arm-selfhelp/README.md @@ -53,15 +53,14 @@ const { HelpRP } = require("@azure/arm-selfhelp"); const { DefaultAzureCredential } = require("@azure/identity"); // For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new HelpRP(new DefaultAzureCredential(), subscriptionId); +const client = new HelpRP(new DefaultAzureCredential()); // For client-side applications running in the browser, use this code instead: // const credential = new InteractiveBrowserCredential({ // tenantId: "", // clientId: "" // }); -// const client = new HelpRP(credential, subscriptionId); +// const client = new HelpRP(credential); ``` diff --git a/sdk/selfhelp/arm-selfhelp/_meta.json b/sdk/selfhelp/arm-selfhelp/_meta.json index 273566d39e0c..e318a883ca01 100644 --- a/sdk/selfhelp/arm-selfhelp/_meta.json +++ b/sdk/selfhelp/arm-selfhelp/_meta.json @@ -1,8 +1,8 @@ { - "commit": "db6282dd0d04c5f13375e98e88b09d04c2009ae8", + "commit": "68c8da604a93740f5f074046f9d8ffe23c5a2f41", "readme": "specification/help/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\help\\resource-manager\\readme.md --use=@autorest/typescript@6.0.20 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\help\\resource-manager\\readme.md --use=@autorest/typescript@6.0.21 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.5", - "use": "@autorest/typescript@6.0.20" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.7", + "use": "@autorest/typescript@6.0.21" } \ No newline at end of file diff --git a/sdk/selfhelp/arm-selfhelp/assets.json b/sdk/selfhelp/arm-selfhelp/assets.json index 57ba70dd4e6d..042a040cf53c 100644 --- a/sdk/selfhelp/arm-selfhelp/assets.json +++ b/sdk/selfhelp/arm-selfhelp/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/selfhelp/arm-selfhelp", - "Tag": "js/selfhelp/arm-selfhelp_56bdb44654" + "Tag": "js/selfhelp/arm-selfhelp_0b7f76cb88" } diff --git a/sdk/selfhelp/arm-selfhelp/package.json b/sdk/selfhelp/arm-selfhelp/package.json index 9ebd86f281e3..072c5a10b0fb 100644 --- a/sdk/selfhelp/arm-selfhelp/package.json +++ b/sdk/selfhelp/arm-selfhelp/package.json @@ -37,9 +37,10 @@ "@azure/dev-tool": "^1.0.0", "@azure/identity": "^4.0.1", "@azure-tools/test-recorder": "^3.0.0", - "@azure-tools/test-credential": "^1.0.0", + "@azure-tools/test-credential": "^1.1.0", "mocha": "^10.0.0", "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", @@ -75,7 +76,7 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "prepack": "npm run build", "pack": "npm pack 2>&1", - "extract-api": "dev-tool run extract-api", + "extract-api": "api-extractor run --local", "lint": "echo skipped", "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", diff --git a/sdk/selfhelp/arm-selfhelp/review/arm-selfhelp.api.md b/sdk/selfhelp/arm-selfhelp/review/arm-selfhelp.api.md index 556373ef59b1..5c548eac5b75 100644 --- a/sdk/selfhelp/arm-selfhelp/review/arm-selfhelp.api.md +++ b/sdk/selfhelp/arm-selfhelp/review/arm-selfhelp.api.md @@ -169,7 +169,7 @@ export type DiscoverySolutionListResponse = DiscoveryResponse; // @public export interface DiscoverySolutionNLPSubscriptionScope { - post(options?: DiscoverySolutionNLPSubscriptionScopePostOptionalParams): Promise; + post(subscriptionId: string, options?: DiscoverySolutionNLPSubscriptionScopePostOptionalParams): Promise; } // @public @@ -243,7 +243,6 @@ export function getContinuationToken(page: unknown): string | undefined; export class HelpRP extends coreClient.ServiceClient { // (undocumented) $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: HelpRPOptionalParams); constructor(credentials: coreAuth.TokenCredential, options?: HelpRPOptionalParams); // (undocumented) apiVersion: string; @@ -266,8 +265,6 @@ export class HelpRP extends coreClient.ServiceClient { // (undocumented) solutionSelfHelp: SolutionSelfHelp; // (undocumented) - subscriptionId?: string; - // (undocumented) troubleshooters: Troubleshooters; } diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpSubscriptionScopePostSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpSubscriptionScopePostSample.ts index c7d32debd129..7467e7aa1aba 100644 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpSubscriptionScopePostSample.ts +++ b/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpSubscriptionScopePostSample.ts @@ -25,9 +25,7 @@ dotenv.config(); * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json */ async function discoverySolutionsUsingIssueSummaryAndServiceId() { - const subscriptionId = - process.env["SELFHELP_SUBSCRIPTION_ID"] || - "0d0fcd2e-c4fd-4349-8497-200edb3923c6"; + const subscriptionId = "0d0fcd2e-c4fd-4349-8497-200edb3923c6"; const discoverSolutionRequest: DiscoveryNlpRequest = { issueSummary: "how to retrieve certs from deleted keyvault.", resourceId: @@ -38,9 +36,11 @@ async function discoverySolutionsUsingIssueSummaryAndServiceId() { discoverSolutionRequest, }; const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential, subscriptionId); - const result = - await client.discoverySolutionNLPSubscriptionScope.post(options); + const client = new HelpRP(credential); + const result = await client.discoverySolutionNLPSubscriptionScope.post( + subscriptionId, + options, + ); console.log(result); } diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpTenantScopePostSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpTenantScopePostSample.ts index 814c0dd868dd..8ff73c657ce4 100644 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpTenantScopePostSample.ts +++ b/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpTenantScopePostSample.ts @@ -27,8 +27,6 @@ dotenv.config(); async function discoverySolutionsUsingIssueSummaryAndServiceId() { const discoverSolutionRequest: DiscoveryNlpRequest = { issueSummary: "how to retrieve certs from deleted keyvault.", - resourceId: - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read", serviceId: "0d0fcd2e-c4fd-4349-8497-200edb39s3ca", }; const options: DiscoverySolutionNLPTenantScopePostOptionalParams = { diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/operationsListSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/operationsListSample.ts index 9e8ff943912b..93369e64861b 100644 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/operationsListSample.ts +++ b/sdk/selfhelp/arm-selfhelp/samples-dev/operationsListSample.ts @@ -21,11 +21,8 @@ dotenv.config(); * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json */ async function listAllOperations() { - const subscriptionId = - process.env["SELFHELP_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential, subscriptionId); + const client = new HelpRP(credential); const resArray = new Array(); for await (let item of client.operations.list()) { resArray.push(item); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpSubscriptionScopePostSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpSubscriptionScopePostSample.js index 8d5bf2bb3d5a..5d55d618fdbc 100644 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpSubscriptionScopePostSample.js +++ b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpSubscriptionScopePostSample.js @@ -19,8 +19,7 @@ require("dotenv").config(); * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json */ async function discoverySolutionsUsingIssueSummaryAndServiceId() { - const subscriptionId = - process.env["SELFHELP_SUBSCRIPTION_ID"] || "0d0fcd2e-c4fd-4349-8497-200edb3923c6"; + const subscriptionId = "0d0fcd2e-c4fd-4349-8497-200edb3923c6"; const discoverSolutionRequest = { issueSummary: "how to retrieve certs from deleted keyvault.", resourceId: @@ -31,8 +30,8 @@ async function discoverySolutionsUsingIssueSummaryAndServiceId() { discoverSolutionRequest, }; const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential, subscriptionId); - const result = await client.discoverySolutionNLPSubscriptionScope.post(options); + const client = new HelpRP(credential); + const result = await client.discoverySolutionNLPSubscriptionScope.post(subscriptionId, options); console.log(result); } diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpTenantScopePostSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpTenantScopePostSample.js index a99209417f40..3efbc7eeb2a3 100644 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpTenantScopePostSample.js +++ b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpTenantScopePostSample.js @@ -21,8 +21,6 @@ require("dotenv").config(); async function discoverySolutionsUsingIssueSummaryAndServiceId() { const discoverSolutionRequest = { issueSummary: "how to retrieve certs from deleted keyvault.", - resourceId: - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read", serviceId: "0d0fcd2e-c4fd-4349-8497-200edb39s3ca", }; const options = { diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/operationsListSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/operationsListSample.js index a259555e1d9f..862a27fb3119 100644 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/operationsListSample.js +++ b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/operationsListSample.js @@ -19,10 +19,8 @@ require("dotenv").config(); * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json */ async function listAllOperations() { - const subscriptionId = - process.env["SELFHELP_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential, subscriptionId); + const client = new HelpRP(credential); const resArray = new Array(); for await (let item of client.operations.list()) { resArray.push(item); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpSubscriptionScopePostSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpSubscriptionScopePostSample.ts index c7d32debd129..7467e7aa1aba 100644 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpSubscriptionScopePostSample.ts +++ b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpSubscriptionScopePostSample.ts @@ -25,9 +25,7 @@ dotenv.config(); * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json */ async function discoverySolutionsUsingIssueSummaryAndServiceId() { - const subscriptionId = - process.env["SELFHELP_SUBSCRIPTION_ID"] || - "0d0fcd2e-c4fd-4349-8497-200edb3923c6"; + const subscriptionId = "0d0fcd2e-c4fd-4349-8497-200edb3923c6"; const discoverSolutionRequest: DiscoveryNlpRequest = { issueSummary: "how to retrieve certs from deleted keyvault.", resourceId: @@ -38,9 +36,11 @@ async function discoverySolutionsUsingIssueSummaryAndServiceId() { discoverSolutionRequest, }; const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential, subscriptionId); - const result = - await client.discoverySolutionNLPSubscriptionScope.post(options); + const client = new HelpRP(credential); + const result = await client.discoverySolutionNLPSubscriptionScope.post( + subscriptionId, + options, + ); console.log(result); } diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpTenantScopePostSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpTenantScopePostSample.ts index 814c0dd868dd..8ff73c657ce4 100644 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpTenantScopePostSample.ts +++ b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpTenantScopePostSample.ts @@ -27,8 +27,6 @@ dotenv.config(); async function discoverySolutionsUsingIssueSummaryAndServiceId() { const discoverSolutionRequest: DiscoveryNlpRequest = { issueSummary: "how to retrieve certs from deleted keyvault.", - resourceId: - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read", serviceId: "0d0fcd2e-c4fd-4349-8497-200edb39s3ca", }; const options: DiscoverySolutionNLPTenantScopePostOptionalParams = { diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/operationsListSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/operationsListSample.ts index 9e8ff943912b..93369e64861b 100644 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/operationsListSample.ts +++ b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/operationsListSample.ts @@ -21,11 +21,8 @@ dotenv.config(); * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json */ async function listAllOperations() { - const subscriptionId = - process.env["SELFHELP_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential, subscriptionId); + const client = new HelpRP(credential); const resArray = new Array(); for await (let item of client.operations.list()) { resArray.push(item); diff --git a/sdk/selfhelp/arm-selfhelp/src/helpRP.ts b/sdk/selfhelp/arm-selfhelp/src/helpRP.ts index 01895c2b192b..fe8136657848 100644 --- a/sdk/selfhelp/arm-selfhelp/src/helpRP.ts +++ b/sdk/selfhelp/arm-selfhelp/src/helpRP.ts @@ -43,40 +43,20 @@ import { HelpRPOptionalParams } from "./models"; export class HelpRP extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId?: string; /** * Initializes a new instance of the HelpRP class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, - subscriptionId: string, - options?: HelpRPOptionalParams, - ); - constructor( - credentials: coreAuth.TokenCredential, - options?: HelpRPOptionalParams, - ); - constructor( - credentials: coreAuth.TokenCredential, - subscriptionIdOrOptions?: HelpRPOptionalParams | string, options?: HelpRPOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - let subscriptionId: string | undefined; - - if (typeof subscriptionIdOrOptions === "string") { - subscriptionId = subscriptionIdOrOptions; - } else if (typeof subscriptionIdOrOptions === "object") { - options = subscriptionIdOrOptions; - } - // Initializing default values for options if (!options) { options = {}; @@ -135,8 +115,6 @@ export class HelpRP extends coreClient.ServiceClient { }), ); } - // Parameter assignments - this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; diff --git a/sdk/selfhelp/arm-selfhelp/src/models/index.ts b/sdk/selfhelp/arm-selfhelp/src/models/index.ts index 5f0a7c519d1a..b8d284e04a6e 100644 --- a/sdk/selfhelp/arm-selfhelp/src/models/index.ts +++ b/sdk/selfhelp/arm-selfhelp/src/models/index.ts @@ -576,7 +576,7 @@ export interface SectionSelfHelp { export interface DiscoveryNlpRequest { /** Natural language description of the issue. */ issueSummary: string; - /** ARM resource Id of the resource that is having the issue. */ + /** ARM resource Id of the resource that is having the issue. Only applicable for Discovery Solution NLP Subscription Scope. */ resourceId?: string; /** ARM service Id of the service that is having the issue. For more information on service Id see https://learn.microsoft.com/rest/api/support/services/list?tabs=HTTP. */ serviceId?: string; diff --git a/sdk/selfhelp/arm-selfhelp/src/models/parameters.ts b/sdk/selfhelp/arm-selfhelp/src/models/parameters.ts index ef784e4bbf6e..50a5268376bc 100644 --- a/sdk/selfhelp/arm-selfhelp/src/models/parameters.ts +++ b/sdk/selfhelp/arm-selfhelp/src/models/parameters.ts @@ -246,7 +246,8 @@ export const subscriptionId: OperationURLParameter = { serializedName: "subscriptionId", required: true, type: { - name: "Uuid", + name: "String", }, }, + skipEncoding: true, }; diff --git a/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolutionNLPSubscriptionScope.ts b/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolutionNLPSubscriptionScope.ts index c56e9cdaaed0..c1a8e31af060 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolutionNLPSubscriptionScope.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolutionNLPSubscriptionScope.ts @@ -33,12 +33,17 @@ export class DiscoverySolutionNLPSubscriptionScopeImpl /** * Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue * summary and subscription. + * @param subscriptionId The Azure subscription ID. * @param options The options parameters. */ post( + subscriptionId: string, options?: DiscoverySolutionNLPSubscriptionScopePostOptionalParams, ): Promise { - return this.client.sendOperationRequest({ options }, postOperationSpec); + return this.client.sendOperationRequest( + { subscriptionId, options }, + postOperationSpec, + ); } } // Operation Specifications diff --git a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.ts b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.ts index bf1b101f3ab1..15d315584f9a 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.ts @@ -16,9 +16,11 @@ export interface DiscoverySolutionNLPSubscriptionScope { /** * Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue * summary and subscription. + * @param subscriptionId The Azure subscription ID. * @param options The options parameters. */ post( + subscriptionId: string, options?: DiscoverySolutionNLPSubscriptionScopePostOptionalParams, ): Promise; } diff --git a/sdk/selfhelp/arm-selfhelp/test/selfhelp_operations_test.spec.ts b/sdk/selfhelp/arm-selfhelp/test/selfhelp_operations_test.spec.ts index f1d2ac659a4b..2df4a909b4ab 100644 --- a/sdk/selfhelp/arm-selfhelp/test/selfhelp_operations_test.spec.ts +++ b/sdk/selfhelp/arm-selfhelp/test/selfhelp_operations_test.spec.ts @@ -33,7 +33,7 @@ export const testPollingOptions = { updateIntervalInMs: isPlaybackMode() ? 0 : undefined, }; -describe.skip("help test", () => { +describe("help test", () => { let recorder: Recorder; let subscriptionId: string; let client: HelpRP; @@ -89,4 +89,7 @@ describe.skip("help test", () => { assert.notEqual(resArray.length, 0) }); + it("discoverySolutionNLPSubscriptionScope post test", async function () { + const res = await client.discoverySolutionNLPSubscriptionScope.post(subscriptionId, { discoverSolutionRequest: { issueSummary: "how to retrieve certs from deleted keyvault." } }); + }); })