diff --git a/sdk/selfhelp/arm-selfhelp/CHANGELOG.md b/sdk/selfhelp/arm-selfhelp/CHANGELOG.md index 4295d064a65e..33ffebd2752f 100644 --- a/sdk/selfhelp/arm-selfhelp/CHANGELOG.md +++ b/sdk/selfhelp/arm-selfhelp/CHANGELOG.md @@ -1,15 +1,127 @@ # Release History - -## 2.0.0-beta.6 (Unreleased) - + +## 2.0.0-beta.6 (2025-05-09) +Compared with version 1.0.0 + ### Features Added -### Breaking Changes - -### Bugs Fixed + - Added operation group CheckNameAvailability + - Added operation group DiscoverySolutionNLP + - Added operation group SimplifiedSolutions + - Added operation group Solution + - Added operation group SolutionSelfHelp + - Added operation group Troubleshooters + - Added Interface AutomatedCheckResult + - Added Interface CheckNameAvailabilityCheckAvailabilityOptionalParams + - Added Interface ClassificationService + - Added Interface ContinueRequestBody + - Added Interface DiagnosticsCreateHeaders + - Added Interface DiscoveryNlpRequest + - Added Interface DiscoveryNlpResponse + - Added Interface DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams + - Added Interface DiscoverySolutionNLPDiscoverSolutionsOptionalParams + - 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 SimplifiedSolutionsCreateHeaders + - Added Interface SimplifiedSolutionsCreateOptionalParams + - Added Interface SimplifiedSolutionsGetOptionalParams + - Added Interface SimplifiedSolutionsResource + - Added Interface SolutionCreateHeaders + - 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 TroubleshootersContinueOptionalParams + - Added Interface TroubleshootersCreateOptionalParams + - Added Interface TroubleshootersEndOptionalParams + - Added Interface TroubleshootersGetOptionalParams + - 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 CheckNameAvailabilityCheckAvailabilityResponse + - Added Type Alias Confidence + - Added Type Alias DiagnosticProvisioningState + - Added Type Alias DiscoverySolutionNLPDiscoverSolutionsBySubscriptionResponse + - Added Type Alias DiscoverySolutionNLPDiscoverSolutionsResponse + - 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 TroubleshootersCreateResponse + - 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 Diagnostics.beginCreate has a new signature + - Operation Diagnostics.beginCreateAndWait has a new signature + - Operation DiscoverySolution.list has a new signature + - Interface DiagnosticsCreateOptionalParams no longer has parameter diagnosticResourceRequest + - 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 + - Parameter value of interface DiscoveryResponse is now required + - Type of parameter provisioningState of interface DiagnosticResource is changed from ProvisioningState to DiagnosticProvisioningState + - Removed Enum KnownProvisioningState + + ## 2.0.0-beta.5 (2024-06-26) Compared with version 1.0.0 diff --git a/sdk/selfhelp/arm-selfhelp/LICENSE b/sdk/selfhelp/arm-selfhelp/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/selfhelp/arm-selfhelp/LICENSE +++ b/sdk/selfhelp/arm-selfhelp/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/selfhelp/arm-selfhelp/README.md b/sdk/selfhelp/arm-selfhelp/README.md index 767f01b0bbb3..a2070e7b8d9f 100644 --- a/sdk/selfhelp/arm-selfhelp/README.md +++ b/sdk/selfhelp/arm-selfhelp/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure HelpRP** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). @@ -55,7 +54,7 @@ import { HelpRP } from "@azure/arm-selfhelp"; import { DefaultAzureCredential } from "@azure/identity"; const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new HelpRP(new DefaultAzureCredential()); +const client = new HelpRP(new DefaultAzureCredential(), subscriptionId); ``` For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. @@ -64,16 +63,14 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { HelpRP } from "@azure/arm-selfhelp"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", - clientId: "", -}); -const client = new HelpRP(credential); + clientId: "" + }); +const client = new HelpRP(credential, subscriptionId); ``` ### JavaScript Bundle - To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -109,7 +106,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - [azure_cli]: https://learn.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/selfhelp/arm-selfhelp/_meta.json b/sdk/selfhelp/arm-selfhelp/_meta.json index 0b51b2de584f..5d970c228599 100644 --- a/sdk/selfhelp/arm-selfhelp/_meta.json +++ b/sdk/selfhelp/arm-selfhelp/_meta.json @@ -1,8 +1,8 @@ { - "commit": "1c63635d66ae38cff18045ab416a6572d3e15f6e", + "commit": "51be344f3e6ae8e3e9b2a8b4c2676ee74c31bd4a", "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.23 --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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/help/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.10", - "use": "@autorest/typescript@6.0.23" -} \ No newline at end of file + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.26", + "use": "@autorest/typescript@^6.0.12" +} diff --git a/sdk/selfhelp/arm-selfhelp/api-extractor.json b/sdk/selfhelp/arm-selfhelp/api-extractor.json index 748bc76c330e..5e573d5601c5 100644 --- a/sdk/selfhelp/arm-selfhelp/api-extractor.json +++ b/sdk/selfhelp/arm-selfhelp/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/selfhelp/arm-selfhelp/assets.json b/sdk/selfhelp/arm-selfhelp/assets.json deleted file mode 100644 index 886b6d078457..000000000000 --- a/sdk/selfhelp/arm-selfhelp/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/selfhelp/arm-selfhelp", - "Tag": "js/selfhelp/arm-selfhelp_8081492142" -} diff --git a/sdk/selfhelp/arm-selfhelp/package.json b/sdk/selfhelp/arm-selfhelp/package.json index 32de85fed1ce..64af4bbd33d0 100644 --- a/sdk/selfhelp/arm-selfhelp/package.json +++ b/sdk/selfhelp/arm-selfhelp/package.json @@ -10,10 +10,10 @@ "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", + "@azure/core-client": "^1.9.4", "@azure/core-lro": "^2.5.4", "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.19.0", + "@azure/core-rest-pipeline": "^1.20.0", "tslib": "^2.8.1" }, "keywords": [ @@ -21,31 +21,30 @@ "azure", "typescript", "browser", - "isomorphic" + "isomorphic", + "cloud" ], "license": "MIT", "main": "./dist/commonjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", + "type": "module", "devDependencies": { "@azure-tools/test-credential": "^2.0.0", "@azure-tools/test-recorder": "^4.1.0", "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.6.0", - "@azure/logger": "^1.1.4", + "@azure/identity": "^4.9.1", + "@azure/logger": "^1.2.0", "@types/node": "^18.0.0", "@vitest/browser": "^3.0.9", "@vitest/coverage-istanbul": "^3.0.9", "dotenv": "^16.0.0", - "playwright": "^1.50.1", + "playwright": "^1.52.0", "typescript": "~5.8.2", "vitest": "^3.0.9" }, - "repository": { - "type": "git", - "url": "https://github.com/Azure/azure-sdk-for-js.git" - }, + "repository": "github:Azure/azure-sdk-for-js", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, @@ -58,20 +57,30 @@ ], "scripts": { "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", + "build:browser": "echo skipped", + "build:node": "echo skipped", "build:samples": "echo skipped.", - "check-format": "echo skipped", + "build:test": "echo skipped", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", "extract-api": "dev-tool run extract-api", - "format": "echo skipped", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:browser": "echo skipped", + "integration-test:node": "dev-tool run test:vitest --esm", "lint": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "pack": "npm pack 2>&1", "prepack": "npm run build", - "test": "npm run test:node && npm run test:browser", + "test": "npm run integration-test", "test:browser": "echo skipped", "test:node": "dev-tool run test:vitest", - "test:node:esm": "dev-tool run test:vitest --esm", - "update-snippets": "dev-tool run update-snippets" + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:browser": "echo skipped", + "unit-test:node": "dev-tool run test:vitest", + "update-snippets": "dev-tool run update-snippets", + "test:node:esm": "dev-tool run test:vitest --esm" }, "sideEffects": false, "//metadata": { @@ -83,16 +92,9 @@ ] }, "autoPublish": true, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/selfhelp/arm-selfhelp", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-selfhelp?view=azure-node-preview" - }, - "type": "module", "tshy": { "project": "./tsconfig.src.json", "exports": { @@ -109,8 +111,6 @@ ], "selfLink": false }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -132,4 +132,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/selfhelp/arm-selfhelp/review/arm-selfhelp.api.md b/sdk/selfhelp/arm-selfhelp/review/arm-selfhelp.api.md index 9fdcd1b7a66e..bb8e23d99bb6 100644 --- a/sdk/selfhelp/arm-selfhelp/review/arm-selfhelp.api.md +++ b/sdk/selfhelp/arm-selfhelp/review/arm-selfhelp.api.md @@ -105,14 +105,19 @@ export interface DiagnosticResource extends ProxyResource { // @public export interface Diagnostics { - beginCreate(scope: string, diagnosticsResourceName: string, options?: DiagnosticsCreateOptionalParams): Promise, DiagnosticsCreateResponse>>; - beginCreateAndWait(scope: string, diagnosticsResourceName: string, options?: DiagnosticsCreateOptionalParams): Promise; + beginCreate(scope: string, diagnosticsResourceName: string, diagnosticResourceRequest: DiagnosticResource, options?: DiagnosticsCreateOptionalParams): Promise, DiagnosticsCreateResponse>>; + beginCreateAndWait(scope: string, diagnosticsResourceName: string, diagnosticResourceRequest: DiagnosticResource, options?: DiagnosticsCreateOptionalParams): Promise; get(scope: string, diagnosticsResourceName: string, options?: DiagnosticsGetOptionalParams): Promise; } +// @public +export interface DiagnosticsCreateHeaders { + azureAsyncOperation?: string; + retryAfter?: number; +} + // @public export interface DiagnosticsCreateOptionalParams extends coreClient.OperationOptions { - diagnosticResourceRequest?: DiagnosticResource; resumeFrom?: string; updateIntervalInMs?: number; } @@ -143,7 +148,7 @@ export interface DiscoveryNlpResponse { // @public export interface DiscoveryResponse { nextLink?: string; - value?: SolutionMetadataResource[]; + value: SolutionMetadataResource[]; } // @public @@ -169,13 +174,12 @@ export type DiscoverySolutionListResponse = DiscoveryResponse; // @public export interface DiscoverySolutionNLP { - discoverSolutions(options?: DiscoverySolutionNLPDiscoverSolutionsOptionalParams): Promise; - discoverSolutionsBySubscription(subscriptionId: string, options?: DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams): Promise; + discoverSolutions(discoverSolutionRequest: DiscoveryNlpRequest, options?: DiscoverySolutionNLPDiscoverSolutionsOptionalParams): Promise; + discoverSolutionsBySubscription(discoverSolutionRequest: DiscoveryNlpRequest, options?: DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams): Promise; } // @public export interface DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams extends coreClient.OperationOptions { - discoverSolutionRequest?: DiscoveryNlpRequest; } // @public @@ -183,7 +187,6 @@ export type DiscoverySolutionNLPDiscoverSolutionsBySubscriptionResponse = Discov // @public export interface DiscoverySolutionNLPDiscoverSolutionsOptionalParams extends coreClient.OperationOptions { - discoverSolutionRequest?: DiscoveryNlpRequest; } // @public @@ -239,6 +242,7 @@ 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; @@ -259,6 +263,8 @@ export class HelpRP extends coreClient.ServiceClient { // (undocumented) solutionSelfHelp: SolutionSelfHelp; // (undocumented) + subscriptionId?: string; + // (undocumented) troubleshooters: Troubleshooters; } @@ -575,15 +581,20 @@ export interface SectionSelfHelp { // @public export interface SimplifiedSolutions { - beginCreate(scope: string, simplifiedSolutionsResourceName: string, options?: SimplifiedSolutionsCreateOptionalParams): Promise, SimplifiedSolutionsCreateResponse>>; - beginCreateAndWait(scope: string, simplifiedSolutionsResourceName: string, options?: SimplifiedSolutionsCreateOptionalParams): Promise; + beginCreate(scope: string, simplifiedSolutionsResourceName: string, simplifiedSolutionsRequestBody: SimplifiedSolutionsResource, options?: SimplifiedSolutionsCreateOptionalParams): Promise, SimplifiedSolutionsCreateResponse>>; + beginCreateAndWait(scope: string, simplifiedSolutionsResourceName: string, simplifiedSolutionsRequestBody: SimplifiedSolutionsResource, options?: SimplifiedSolutionsCreateOptionalParams): Promise; get(scope: string, simplifiedSolutionsResourceName: string, options?: SimplifiedSolutionsGetOptionalParams): Promise; } +// @public +export interface SimplifiedSolutionsCreateHeaders { + azureAsyncOperation?: string; + retryAfter?: number; +} + // @public export interface SimplifiedSolutionsCreateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; - simplifiedSolutionsRequestBody?: SimplifiedSolutionsResource; updateIntervalInMs?: number; } @@ -613,18 +624,23 @@ export interface SimplifiedSolutionsResource extends ProxyResource { // @public export interface Solution { - beginCreate(scope: string, solutionResourceName: string, options?: SolutionCreateOptionalParams): Promise, SolutionCreateResponse>>; - beginCreateAndWait(scope: string, solutionResourceName: string, options?: SolutionCreateOptionalParams): Promise; - beginUpdate(scope: string, solutionResourceName: string, options?: SolutionUpdateOptionalParams): Promise, SolutionUpdateResponse>>; - beginUpdateAndWait(scope: string, solutionResourceName: string, options?: SolutionUpdateOptionalParams): Promise; + beginCreate(scope: string, solutionResourceName: string, solutionRequestBody: SolutionResource, options?: SolutionCreateOptionalParams): Promise, SolutionCreateResponse>>; + beginCreateAndWait(scope: string, solutionResourceName: string, solutionRequestBody: SolutionResource, options?: SolutionCreateOptionalParams): Promise; + beginUpdate(scope: string, solutionResourceName: string, solutionPatchRequestBody: SolutionPatchRequestBody, options?: SolutionUpdateOptionalParams): Promise, SolutionUpdateResponse>>; + beginUpdateAndWait(scope: string, solutionResourceName: string, solutionPatchRequestBody: SolutionPatchRequestBody, options?: SolutionUpdateOptionalParams): Promise; get(scope: string, solutionResourceName: string, options?: SolutionGetOptionalParams): Promise; warmUp(scope: string, solutionResourceName: string, options?: SolutionWarmUpOptionalParams): Promise; } +// @public +export interface SolutionCreateHeaders { + azureAsyncOperation?: string; + retryAfter?: number; +} + // @public export interface SolutionCreateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; - solutionRequestBody?: SolutionResource; updateIntervalInMs?: number; } @@ -736,19 +752,17 @@ export type SolutionType = string; // @public export interface SolutionUpdateHeaders { - // (undocumented) - location?: string; + azureAsyncOperation?: string; } // @public export interface SolutionUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; - solutionPatchRequestBody?: SolutionPatchRequestBody; updateIntervalInMs?: number; } // @public -export type SolutionUpdateResponse = SolutionUpdateHeaders & SolutionResource; +export type SolutionUpdateResponse = SolutionResource; // @public export interface SolutionWarmUpOptionalParams extends coreClient.OperationOptions { @@ -836,48 +850,29 @@ export interface TroubleshooterResponse { // @public export interface Troubleshooters { - continue(scope: string, troubleshooterName: string, options?: TroubleshootersContinueOptionalParams): Promise; - create(scope: string, troubleshooterName: string, options?: TroubleshootersCreateOptionalParams): Promise; - end(scope: string, troubleshooterName: string, options?: TroubleshootersEndOptionalParams): Promise; + continue(scope: string, troubleshooterName: string, options?: TroubleshootersContinueOptionalParams): Promise; + create(scope: string, troubleshooterName: string, createTroubleshooterRequestBody: TroubleshooterResource, options?: TroubleshootersCreateOptionalParams): Promise; + end(scope: string, troubleshooterName: string, options?: TroubleshootersEndOptionalParams): Promise; get(scope: string, troubleshooterName: string, options?: TroubleshootersGetOptionalParams): Promise; restart(scope: string, troubleshooterName: string, options?: TroubleshootersRestartOptionalParams): Promise; } -// @public -export interface TroubleshootersContinueHeaders { - // (undocumented) - location?: string; -} - // @public export interface TroubleshootersContinueOptionalParams extends coreClient.OperationOptions { continueRequestBody?: ContinueRequestBody; } -// @public -export type TroubleshootersContinueResponse = TroubleshootersContinueHeaders; - // @public export interface TroubleshootersCreateOptionalParams extends coreClient.OperationOptions { - createTroubleshooterRequestBody?: TroubleshooterResource; } // @public export type TroubleshootersCreateResponse = TroubleshooterResource; -// @public -export interface TroubleshootersEndHeaders { - // (undocumented) - location?: string; -} - // @public export interface TroubleshootersEndOptionalParams extends coreClient.OperationOptions { } -// @public -export type TroubleshootersEndResponse = TroubleshootersEndHeaders; - // @public export interface TroubleshootersGetOptionalParams extends coreClient.OperationOptions { } @@ -885,18 +880,12 @@ export interface TroubleshootersGetOptionalParams extends coreClient.OperationOp // @public export type TroubleshootersGetResponse = TroubleshooterResource; -// @public -export interface TroubleshootersRestartHeaders { - // (undocumented) - location?: string; -} - // @public export interface TroubleshootersRestartOptionalParams extends coreClient.OperationOptions { } // @public -export type TroubleshootersRestartResponse = TroubleshootersRestartHeaders & RestartTroubleshooterResponse; +export type TroubleshootersRestartResponse = RestartTroubleshooterResponse; // @public export type Type = string; diff --git a/sdk/selfhelp/arm-selfhelp/sample.env b/sdk/selfhelp/arm-selfhelp/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/selfhelp/arm-selfhelp/sample.env +++ b/sdk/selfhelp/arm-selfhelp/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/checkNameAvailabilityCheckAvailabilitySample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/checkNameAvailabilityCheckAvailabilitySample.ts deleted file mode 100644 index cba962bf190a..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/checkNameAvailabilityCheckAvailabilitySample.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { - CheckNameAvailabilityRequest, - CheckNameAvailabilityCheckAvailabilityOptionalParams, -} from "@azure/arm-selfhelp"; -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * - * @summary This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json - */ -async function exampleWhenNameIsAvailableForADiagnosticResource(): Promise { - const scope = "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const checkNameAvailabilityRequest: CheckNameAvailabilityRequest = { - name: "sampleName", - type: "Microsoft.Help/diagnostics", - }; - const options: CheckNameAvailabilityCheckAvailabilityOptionalParams = { - checkNameAvailabilityRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.checkNameAvailability.checkAvailability(scope, options); - console.log(result); -} - -/** - * This sample demonstrates how to This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * - * @summary This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsNotAvailable.json - */ -async function exampleWhenNameIsNotAvailableForADiagnosticResource(): Promise { - const scope = "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const checkNameAvailabilityRequest: CheckNameAvailabilityRequest = { - name: "sampleName", - type: "Microsoft.Help/diagnostics", - }; - const options: CheckNameAvailabilityCheckAvailabilityOptionalParams = { - checkNameAvailabilityRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.checkNameAvailability.checkAvailability(scope, options); - console.log(result); -} - -async function main(): Promise { - await exampleWhenNameIsAvailableForADiagnosticResource(); - await exampleWhenNameIsNotAvailableForADiagnosticResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsCreateSample.ts deleted file mode 100644 index 49503be5b679..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsCreateSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates a diagnostic for the specific resource using solutionId from discovery solutions.
Diagnostics are powerful solutions that access product resources or other relevant data and provide the root cause of the issue and the steps to address the issue.

- * - * @summary Creates a diagnostic for the specific resource using solutionId from discovery solutions.
Diagnostics are powerful solutions that access product resources or other relevant data and provide the root cause of the issue and the steps to address the issue.

- * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CreateDiagnosticForKeyVaultResource.json - */ -async function createsADiagnosticForAKeyVaultResource(): Promise { - const scope = - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read"; - const diagnosticsResourceName = "VMNotWorkingInsight"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.diagnostics.beginCreateAndWait(scope, diagnosticsResourceName); - console.log(result); -} - -async function main(): Promise { - await createsADiagnosticForAKeyVaultResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsGetSample.ts deleted file mode 100644 index 4ee327197169..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/diagnosticsGetSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * - * @summary Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/GetDiagnosticForKeyVaultResource.json - */ -async function getsADiagnosticForAKeyVaultResource(): Promise { - const scope = - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read"; - const diagnosticsResourceName = "VMNotWorkingInsight"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.diagnostics.get(scope, diagnosticsResourceName); - console.log(result); -} - -async function main(): Promise { - await getsADiagnosticForAKeyVaultResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionListSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionListSample.ts deleted file mode 100644 index 165b0f46d32b..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionListSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { DiscoverySolutionListOptionalParams } from "@azure/arm-selfhelp"; -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. - * - * @summary Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListDiscoverySolutionsAtTenantScope.json - */ -async function listDiscoverySolutionsAtResourceScope(): Promise { - const filter = "ProblemClassificationId eq 'SampleProblemClassificationId1'"; - const options: DiscoverySolutionListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const resArray = new Array(); - for await (const item of client.discoverySolution.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listDiscoverySolutionsAtResourceScope(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.ts deleted file mode 100644 index 74efd2723ae6..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { - DiscoveryNlpRequest, - DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams, -} from "@azure/arm-selfhelp"; -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. - * - * @summary Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json - */ -async function discoverySolutionsUsingIssueSummaryAndServiceId(): Promise { - const subscriptionId = "0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - 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: DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams = { - discoverSolutionRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.discoverySolutionNLP.discoverSolutionsBySubscription( - subscriptionId, - options, - ); - console.log(result); -} - -async function main(): Promise { - await discoverySolutionsUsingIssueSummaryAndServiceId(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpDiscoverSolutionsSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpDiscoverSolutionsSample.ts deleted file mode 100644 index c2fbe2e6f292..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/discoverySolutionNlpDiscoverSolutionsSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { - DiscoveryNlpRequest, - DiscoverySolutionNLPDiscoverSolutionsOptionalParams, -} from "@azure/arm-selfhelp"; -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. - * - * @summary Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtTenantScope.json - */ -async function discoverySolutionsUsingIssueSummaryAndServiceId(): Promise { - const discoverSolutionRequest: DiscoveryNlpRequest = { - issueSummary: "how to retrieve certs from deleted keyvault.", - serviceId: "0d0fcd2e-c4fd-4349-8497-200edb39s3ca", - }; - const options: DiscoverySolutionNLPDiscoverSolutionsOptionalParams = { - discoverSolutionRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.discoverySolutionNLP.discoverSolutions(options); - console.log(result); -} - -async function main(): Promise { - await discoverySolutionsUsingIssueSummaryAndServiceId(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/operationsListSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/operationsListSample.ts deleted file mode 100644 index 1dddb3a0b91c..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns list of operations. - * - * @summary Returns list of operations. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json - */ -async function listAllOperations(): Promise { - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const resArray = new Array(); - for await (const item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listAllOperations(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/simplifiedSolutionsCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/simplifiedSolutionsCreateSample.ts deleted file mode 100644 index f5bfc241a086..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/simplifiedSolutionsCreateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { - SimplifiedSolutionsResource, - SimplifiedSolutionsCreateOptionalParams, -} from "@azure/arm-selfhelp"; -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
- * - * @summary Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
- * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Create.json - */ -async function solutionCreate(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const simplifiedSolutionsResourceName = "simplifiedSolutionsResourceName1"; - const simplifiedSolutionsRequestBody: SimplifiedSolutionsResource = { - parameters: { - resourceUri: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - solutionId: "sampleSolutionId", - }; - const options: SimplifiedSolutionsCreateOptionalParams = { - simplifiedSolutionsRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.simplifiedSolutions.beginCreateAndWait( - scope, - simplifiedSolutionsResourceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - await solutionCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/simplifiedSolutionsGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/simplifiedSolutionsGetSample.ts deleted file mode 100644 index 5f1905e2d915..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/simplifiedSolutionsGetSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. - * - * @summary Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Get.json - */ -async function solutionGet(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const simplifiedSolutionsResourceName = "simplifiedSolutionsResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.simplifiedSolutions.get(scope, simplifiedSolutionsResourceName); - console.log(result); -} - -async function main(): Promise { - await solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/solutionCreateSample.ts deleted file mode 100644 index e15945f620cb..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionCreateSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { SolutionResource, SolutionCreateOptionalParams } from "@azure/arm-selfhelp"; -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
Azure solutions comprise a comprehensive library of self-help resources that have been thoughtfully curated by Azure engineers to aid customers in resolving typical troubleshooting issues. These solutions encompass:
(1.) Dynamic and context-aware diagnostics, guided troubleshooting wizards, and data visualizations.
(2.) Rich instructional video tutorials and illustrative diagrams and images.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. - * - * @summary Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
Azure solutions comprise a comprehensive library of self-help resources that have been thoughtfully curated by Azure engineers to aid customers in resolving typical troubleshooting issues. These solutions encompass:
(1.) Dynamic and context-aware diagnostics, guided troubleshooting wizards, and data visualizations.
(2.) Rich instructional video tutorials and illustrative diagrams and images.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Create.json - */ -async function solutionCreate(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const solutionRequestBody: SolutionResource = { - parameters: { - resourceUri: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - triggerCriteria: [{ name: "SolutionId", value: "SolutionId1" }], - }; - const options: SolutionCreateOptionalParams = { solutionRequestBody }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.beginCreateAndWait(scope, solutionResourceName, options); - console.log(result); -} - -async function main(): Promise { - await solutionCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/solutionGetSample.ts deleted file mode 100644 index 4e591619e580..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionGetSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get the solution using the applicable solutionResourceName while creating the solution. - * - * @summary Get the solution using the applicable solutionResourceName while creating the solution. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Get.json - */ -async function solutionGet(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResource1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.get(scope, solutionResourceName); - console.log(result); -} - -async function main(): Promise { - await solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionSelfHelpGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/solutionSelfHelpGetSample.ts deleted file mode 100644 index 1ed289ec8ff7..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionSelfHelpGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. - * - * @summary Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SelfHelpSolution_Get.json - */ -async function solutionGet(): Promise { - const solutionId = "SolutionId1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solutionSelfHelp.get(solutionId); - console.log(result); -} - -async function main(): Promise { - await solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionUpdateSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/solutionUpdateSample.ts deleted file mode 100644 index 6142688e2b68..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionUpdateSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update the requiredInputs or additional information needed to execute the solution - * - * @summary Update the requiredInputs or additional information needed to execute the solution - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Update.json - */ -async function solutionUpdate(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.beginUpdateAndWait(scope, solutionResourceName); - console.log(result); -} - -async function main(): Promise { - await solutionUpdate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionWarmUpSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/solutionWarmUpSample.ts deleted file mode 100644 index c1f03d19dfb5..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/solutionWarmUpSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Warm up the solution resource by preloading asynchronous diagnostics results into cache - * - * @summary Warm up the solution resource by preloading asynchronous diagnostics results into cache - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_WarmUp.json - */ -async function solutionWarmUp(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.warmUp(scope, solutionResourceName); - console.log(result); -} - -async function main(): Promise { - await solutionWarmUp(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersContinueSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersContinueSample.ts deleted file mode 100644 index 47e6e999cbc4..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersContinueSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { - ContinueRequestBody, - TroubleshootersContinueOptionalParams, -} from "@azure/arm-selfhelp"; -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
Continue API is used to provide inputs that are required for the specific troubleshooter to progress into the next step in the process. This API is used after the Troubleshooter has been created using the Create API. - * - * @summary Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
Continue API is used to provide inputs that are required for the specific troubleshooter to progress into the next step in the process. This API is used after the Troubleshooter has been created using the Create API. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Continue.json - */ -async function troubleshooterContinue(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const continueRequestBody: ContinueRequestBody = { - stepId: "SampleStepId", - responses: [ - { - questionId: "SampleQuestionId", - questionType: "Text", - response: "Connection exception", - }, - ], - }; - const options: TroubleshootersContinueOptionalParams = { - continueRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.continue(scope, troubleshooterName, options); - console.log(result); -} - -async function main(): Promise { - await troubleshooterContinue(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersCreateSample.ts deleted file mode 100644 index f2132e879b29..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersCreateSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import type { - TroubleshooterResource, - TroubleshootersCreateOptionalParams, -} from "@azure/arm-selfhelp"; -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
Azure Troubleshooters help with hard to classify issues, reducing the gap between customer observed problems and solutions by guiding the user effortlessly through the troubleshooting process. Each Troubleshooter flow represents a problem area within Azure and has a complex tree-like structure that addresses many root causes. These flows are prepared with the help of Subject Matter experts and customer support engineers by carefully considering previous support requests raised by customers. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. - * - * @summary Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
Azure Troubleshooters help with hard to classify issues, reducing the gap between customer observed problems and solutions by guiding the user effortlessly through the troubleshooting process. Each Troubleshooter flow represents a problem area within Azure and has a complex tree-like structure that addresses many root causes. These flows are prepared with the help of Subject Matter experts and customer support engineers by carefully considering previous support requests raised by customers. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Create.json - */ -async function troubleshootersCreate(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const createTroubleshooterRequestBody: TroubleshooterResource = { - parameters: { - resourceURI: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - solutionId: "SampleTroubleshooterSolutionId", - }; - const options: TroubleshootersCreateOptionalParams = { - createTroubleshooterRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.create(scope, troubleshooterName, options); - console.log(result); -} - -async function main(): Promise { - await troubleshootersCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersEndSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersEndSample.ts deleted file mode 100644 index fb46a14e775e..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersEndSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Ends the troubleshooter action - * - * @summary Ends the troubleshooter action - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_End.json - */ -async function troubleshootersEnd(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.end(scope, troubleshooterName); - console.log(result); -} - -async function main(): Promise { - await troubleshootersEnd(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersGetSample.ts deleted file mode 100644 index 22bc3ff912f8..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersGetSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow. This API requires the Troubleshooter resource name that was created using the Create API. - * - * @summary Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow. This API requires the Troubleshooter resource name that was created using the Create API. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Get.json - */ -async function troubleshootersGet(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.get(scope, troubleshooterName); - console.log(result); -} - -async function main(): Promise { - await troubleshootersGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersRestartSample.ts b/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersRestartSample.ts deleted file mode 100644 index cc29e3962797..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples-dev/troubleshootersRestartSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. - * - * @summary Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Restart.json - */ -async function troubleshootersRestart(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.restart(scope, troubleshooterName); - console.log(result); -} - -async function main(): Promise { - await troubleshootersRestart(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/README.md b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/README.md deleted file mode 100644 index 56806d099ea8..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [checkNameAvailabilityCheckAvailabilitySample.js][checknameavailabilitycheckavailabilitysample] | This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json | -| [diagnosticsCreateSample.js][diagnosticscreatesample] | Creates a diagnostic for the specific resource using solutionId from discovery solutions.
Diagnostics are powerful solutions that access product resources or other relevant data and provide the root cause of the issue and the steps to address the issue.

x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CreateDiagnosticForKeyVaultResource.json | -| [diagnosticsGetSample.js][diagnosticsgetsample] | Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/GetDiagnosticForKeyVaultResource.json | -| [discoverySolutionListSample.js][discoverysolutionlistsample] | Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListDiscoverySolutionsAtTenantScope.json | -| [discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.js][discoverysolutionnlpdiscoversolutionsbysubscriptionsample] | Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json | -| [discoverySolutionNlpDiscoverSolutionsSample.js][discoverysolutionnlpdiscoversolutionssample] | Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtTenantScope.json | -| [operationsListSample.js][operationslistsample] | Returns list of operations. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json | -| [simplifiedSolutionsCreateSample.js][simplifiedsolutionscreatesample] | Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Create.json | -| [simplifiedSolutionsGetSample.js][simplifiedsolutionsgetsample] | Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Get.json | -| [solutionCreateSample.js][solutioncreatesample] | Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
Azure solutions comprise a comprehensive library of self-help resources that have been thoughtfully curated by Azure engineers to aid customers in resolving typical troubleshooting issues. These solutions encompass:
(1.) Dynamic and context-aware diagnostics, guided troubleshooting wizards, and data visualizations.
(2.) Rich instructional video tutorials and illustrative diagrams and images.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Create.json | -| [solutionGetSample.js][solutiongetsample] | Get the solution using the applicable solutionResourceName while creating the solution. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Get.json | -| [solutionSelfHelpGetSample.js][solutionselfhelpgetsample] | Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SelfHelpSolution_Get.json | -| [solutionUpdateSample.js][solutionupdatesample] | Update the requiredInputs or additional information needed to execute the solution x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Update.json | -| [solutionWarmUpSample.js][solutionwarmupsample] | Warm up the solution resource by preloading asynchronous diagnostics results into cache x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_WarmUp.json | -| [troubleshootersContinueSample.js][troubleshooterscontinuesample] | Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
Continue API is used to provide inputs that are required for the specific troubleshooter to progress into the next step in the process. This API is used after the Troubleshooter has been created using the Create API. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Continue.json | -| [troubleshootersCreateSample.js][troubleshooterscreatesample] | Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
Azure Troubleshooters help with hard to classify issues, reducing the gap between customer observed problems and solutions by guiding the user effortlessly through the troubleshooting process. Each Troubleshooter flow represents a problem area within Azure and has a complex tree-like structure that addresses many root causes. These flows are prepared with the help of Subject Matter experts and customer support engineers by carefully considering previous support requests raised by customers. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Create.json | -| [troubleshootersEndSample.js][troubleshootersendsample] | Ends the troubleshooter action x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_End.json | -| [troubleshootersGetSample.js][troubleshootersgetsample] | Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow. This API requires the Troubleshooter resource name that was created using the Create API. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Get.json | -| [troubleshootersRestartSample.js][troubleshootersrestartsample] | Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Restart.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node checkNameAvailabilityCheckAvailabilitySample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env node checkNameAvailabilityCheckAvailabilitySample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[checknameavailabilitycheckavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/checkNameAvailabilityCheckAvailabilitySample.js -[diagnosticscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsCreateSample.js -[diagnosticsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsGetSample.js -[discoverysolutionlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionListSample.js -[discoverysolutionnlpdiscoversolutionsbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.js -[discoverysolutionnlpdiscoversolutionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpDiscoverSolutionsSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/operationsListSample.js -[simplifiedsolutionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsCreateSample.js -[simplifiedsolutionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsGetSample.js -[solutioncreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionCreateSample.js -[solutiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionGetSample.js -[solutionselfhelpgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionSelfHelpGetSample.js -[solutionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionUpdateSample.js -[solutionwarmupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionWarmUpSample.js -[troubleshooterscontinuesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersContinueSample.js -[troubleshooterscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersCreateSample.js -[troubleshootersendsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersEndSample.js -[troubleshootersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersGetSample.js -[troubleshootersrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersRestartSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-selfhelp?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/selfhelp/arm-selfhelp/README.md diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/checkNameAvailabilityCheckAvailabilitySample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/checkNameAvailabilityCheckAvailabilitySample.js deleted file mode 100644 index 883fc191147a..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/checkNameAvailabilityCheckAvailabilitySample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * - * @summary This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json - */ -async function exampleWhenNameIsAvailableForADiagnosticResource() { - const scope = "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const checkNameAvailabilityRequest = { - name: "sampleName", - type: "Microsoft.Help/diagnostics", - }; - const options = { - checkNameAvailabilityRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.checkNameAvailability.checkAvailability(scope, options); - console.log(result); -} - -/** - * This sample demonstrates how to This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * - * @summary This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsNotAvailable.json - */ -async function exampleWhenNameIsNotAvailableForADiagnosticResource() { - const scope = "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const checkNameAvailabilityRequest = { - name: "sampleName", - type: "Microsoft.Help/diagnostics", - }; - const options = { - checkNameAvailabilityRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.checkNameAvailability.checkAvailability(scope, options); - console.log(result); -} - -async function main() { - exampleWhenNameIsAvailableForADiagnosticResource(); - exampleWhenNameIsNotAvailableForADiagnosticResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsCreateSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsCreateSample.js deleted file mode 100644 index 748de90b45df..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsCreateSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates a diagnostic for the specific resource using solutionId from discovery solutions.
Diagnostics are powerful solutions that access product resources or other relevant data and provide the root cause of the issue and the steps to address the issue.

- * - * @summary Creates a diagnostic for the specific resource using solutionId from discovery solutions.
Diagnostics are powerful solutions that access product resources or other relevant data and provide the root cause of the issue and the steps to address the issue.

- * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CreateDiagnosticForKeyVaultResource.json - */ -async function createsADiagnosticForAKeyVaultResource() { - const scope = - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read"; - const diagnosticsResourceName = "VMNotWorkingInsight"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.diagnostics.beginCreateAndWait(scope, diagnosticsResourceName); - console.log(result); -} - -async function main() { - createsADiagnosticForAKeyVaultResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsGetSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsGetSample.js deleted file mode 100644 index d2fb71b875e3..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/diagnosticsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * - * @summary Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/GetDiagnosticForKeyVaultResource.json - */ -async function getsADiagnosticForAKeyVaultResource() { - const scope = - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read"; - const diagnosticsResourceName = "VMNotWorkingInsight"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.diagnostics.get(scope, diagnosticsResourceName); - console.log(result); -} - -async function main() { - getsADiagnosticForAKeyVaultResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionListSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionListSample.js deleted file mode 100644 index 26fca18443f5..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. - * - * @summary Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListDiscoverySolutionsAtTenantScope.json - */ -async function listDiscoverySolutionsAtResourceScope() { - const filter = "ProblemClassificationId eq 'SampleProblemClassificationId1'"; - const options = { filter }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const resArray = new Array(); - for await (let item of client.discoverySolution.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDiscoverySolutionsAtResourceScope(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.js deleted file mode 100644 index 476074376172..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. - * - * @summary Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json - */ -async function discoverySolutionsUsingIssueSummaryAndServiceId() { - const subscriptionId = "0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - 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 = { discoverSolutionRequest }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.discoverySolutionNLP.discoverSolutionsBySubscription( - subscriptionId, - options, - ); - console.log(result); -} - -async function main() { - discoverySolutionsUsingIssueSummaryAndServiceId(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpDiscoverSolutionsSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpDiscoverSolutionsSample.js deleted file mode 100644 index 59e943c9b05b..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/discoverySolutionNlpDiscoverSolutionsSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. - * - * @summary Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtTenantScope.json - */ -async function discoverySolutionsUsingIssueSummaryAndServiceId() { - const discoverSolutionRequest = { - issueSummary: "how to retrieve certs from deleted keyvault.", - serviceId: "0d0fcd2e-c4fd-4349-8497-200edb39s3ca", - }; - const options = { - discoverSolutionRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.discoverySolutionNLP.discoverSolutions(options); - console.log(result); -} - -async function main() { - discoverySolutionsUsingIssueSummaryAndServiceId(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/operationsListSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/operationsListSample.js deleted file mode 100644 index 862a27fb3119..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/operationsListSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Returns list of operations. - * - * @summary Returns list of operations. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json - */ -async function listAllOperations() { - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllOperations(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/package.json b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/package.json deleted file mode 100644 index e9f4e249ab7a..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-selfhelp-js-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/selfhelp/arm-selfhelp" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/selfhelp/arm-selfhelp", - "dependencies": { - "@azure/arm-selfhelp": "next", - "dotenv": "latest", - "@azure/identity": "^4.0.1" - } -} diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/sample.env b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsCreateSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsCreateSample.js deleted file mode 100644 index 6d1a23796fd4..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsCreateSample.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
- * - * @summary Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
- * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Create.json - */ -async function solutionCreate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const simplifiedSolutionsResourceName = "simplifiedSolutionsResourceName1"; - const simplifiedSolutionsRequestBody = { - parameters: { - resourceUri: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - solutionId: "sampleSolutionId", - }; - const options = { - simplifiedSolutionsRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.simplifiedSolutions.beginCreateAndWait( - scope, - simplifiedSolutionsResourceName, - options, - ); - console.log(result); -} - -async function main() { - solutionCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsGetSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsGetSample.js deleted file mode 100644 index af14dad740e1..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/simplifiedSolutionsGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. - * - * @summary Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Get.json - */ -async function solutionGet() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const simplifiedSolutionsResourceName = "simplifiedSolutionsResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.simplifiedSolutions.get(scope, simplifiedSolutionsResourceName); - console.log(result); -} - -async function main() { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionCreateSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionCreateSample.js deleted file mode 100644 index 85f661a9b342..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionCreateSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
Azure solutions comprise a comprehensive library of self-help resources that have been thoughtfully curated by Azure engineers to aid customers in resolving typical troubleshooting issues. These solutions encompass:
(1.) Dynamic and context-aware diagnostics, guided troubleshooting wizards, and data visualizations.
(2.) Rich instructional video tutorials and illustrative diagrams and images.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. - * - * @summary Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
Azure solutions comprise a comprehensive library of self-help resources that have been thoughtfully curated by Azure engineers to aid customers in resolving typical troubleshooting issues. These solutions encompass:
(1.) Dynamic and context-aware diagnostics, guided troubleshooting wizards, and data visualizations.
(2.) Rich instructional video tutorials and illustrative diagrams and images.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Create.json - */ -async function solutionCreate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const solutionRequestBody = { - parameters: { - resourceUri: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - triggerCriteria: [{ name: "SolutionId", value: "SolutionId1" }], - }; - const options = { solutionRequestBody }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.beginCreateAndWait(scope, solutionResourceName, options); - console.log(result); -} - -async function main() { - solutionCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionGetSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionGetSample.js deleted file mode 100644 index ae2116f6c09e..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the solution using the applicable solutionResourceName while creating the solution. - * - * @summary Get the solution using the applicable solutionResourceName while creating the solution. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Get.json - */ -async function solutionGet() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResource1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.get(scope, solutionResourceName); - console.log(result); -} - -async function main() { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionSelfHelpGetSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionSelfHelpGetSample.js deleted file mode 100644 index cd356f786d7f..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionSelfHelpGetSample.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. - * - * @summary Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SelfHelpSolution_Get.json - */ -async function solutionGet() { - const solutionId = "SolutionId1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solutionSelfHelp.get(solutionId); - console.log(result); -} - -async function main() { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionUpdateSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionUpdateSample.js deleted file mode 100644 index 459bc7224289..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionUpdateSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update the requiredInputs or additional information needed to execute the solution - * - * @summary Update the requiredInputs or additional information needed to execute the solution - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Update.json - */ -async function solutionUpdate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.beginUpdateAndWait(scope, solutionResourceName); - console.log(result); -} - -async function main() { - solutionUpdate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionWarmUpSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionWarmUpSample.js deleted file mode 100644 index f5ece4a45041..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/solutionWarmUpSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Warm up the solution resource by preloading asynchronous diagnostics results into cache - * - * @summary Warm up the solution resource by preloading asynchronous diagnostics results into cache - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_WarmUp.json - */ -async function solutionWarmUp() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.warmUp(scope, solutionResourceName); - console.log(result); -} - -async function main() { - solutionWarmUp(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersContinueSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersContinueSample.js deleted file mode 100644 index eda841f20f50..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersContinueSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
Continue API is used to provide inputs that are required for the specific troubleshooter to progress into the next step in the process. This API is used after the Troubleshooter has been created using the Create API. - * - * @summary Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
Continue API is used to provide inputs that are required for the specific troubleshooter to progress into the next step in the process. This API is used after the Troubleshooter has been created using the Create API. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Continue.json - */ -async function troubleshooterContinue() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const continueRequestBody = { - stepId: "SampleStepId", - responses: [ - { - questionId: "SampleQuestionId", - questionType: "Text", - response: "Connection exception", - }, - ], - }; - const options = { - continueRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.continue(scope, troubleshooterName, options); - console.log(result); -} - -async function main() { - troubleshooterContinue(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersCreateSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersCreateSample.js deleted file mode 100644 index 3c8ae61f530e..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersCreateSample.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
Azure Troubleshooters help with hard to classify issues, reducing the gap between customer observed problems and solutions by guiding the user effortlessly through the troubleshooting process. Each Troubleshooter flow represents a problem area within Azure and has a complex tree-like structure that addresses many root causes. These flows are prepared with the help of Subject Matter experts and customer support engineers by carefully considering previous support requests raised by customers. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. - * - * @summary Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
Azure Troubleshooters help with hard to classify issues, reducing the gap between customer observed problems and solutions by guiding the user effortlessly through the troubleshooting process. Each Troubleshooter flow represents a problem area within Azure and has a complex tree-like structure that addresses many root causes. These flows are prepared with the help of Subject Matter experts and customer support engineers by carefully considering previous support requests raised by customers. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Create.json - */ -async function troubleshootersCreate() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const createTroubleshooterRequestBody = { - parameters: { - resourceURI: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - solutionId: "SampleTroubleshooterSolutionId", - }; - const options = { - createTroubleshooterRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.create(scope, troubleshooterName, options); - console.log(result); -} - -async function main() { - troubleshootersCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersEndSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersEndSample.js deleted file mode 100644 index 014c22874594..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersEndSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Ends the troubleshooter action - * - * @summary Ends the troubleshooter action - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_End.json - */ -async function troubleshootersEnd() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.end(scope, troubleshooterName); - console.log(result); -} - -async function main() { - troubleshootersEnd(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersGetSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersGetSample.js deleted file mode 100644 index e22dbbb6cee4..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow. This API requires the Troubleshooter resource name that was created using the Create API. - * - * @summary Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow. This API requires the Troubleshooter resource name that was created using the Create API. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Get.json - */ -async function troubleshootersGet() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.get(scope, troubleshooterName); - console.log(result); -} - -async function main() { - troubleshootersGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersRestartSample.js b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersRestartSample.js deleted file mode 100644 index 95956ee83d13..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/javascript/troubleshootersRestartSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. - * - * @summary Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Restart.json - */ -async function troubleshootersRestart() { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.restart(scope, troubleshooterName); - console.log(result); -} - -async function main() { - troubleshootersRestart(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/README.md b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/README.md deleted file mode 100644 index f50eac0fb1db..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/README.md +++ /dev/null @@ -1,99 +0,0 @@ -# client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [checkNameAvailabilityCheckAvailabilitySample.ts][checknameavailabilitycheckavailabilitysample] | This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json | -| [diagnosticsCreateSample.ts][diagnosticscreatesample] | Creates a diagnostic for the specific resource using solutionId from discovery solutions.
Diagnostics are powerful solutions that access product resources or other relevant data and provide the root cause of the issue and the steps to address the issue.

x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CreateDiagnosticForKeyVaultResource.json | -| [diagnosticsGetSample.ts][diagnosticsgetsample] | Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/GetDiagnosticForKeyVaultResource.json | -| [discoverySolutionListSample.ts][discoverysolutionlistsample] | Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListDiscoverySolutionsAtTenantScope.json | -| [discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.ts][discoverysolutionnlpdiscoversolutionsbysubscriptionsample] | Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json | -| [discoverySolutionNlpDiscoverSolutionsSample.ts][discoverysolutionnlpdiscoversolutionssample] | Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtTenantScope.json | -| [operationsListSample.ts][operationslistsample] | Returns list of operations. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json | -| [simplifiedSolutionsCreateSample.ts][simplifiedsolutionscreatesample] | Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Create.json | -| [simplifiedSolutionsGetSample.ts][simplifiedsolutionsgetsample] | Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Get.json | -| [solutionCreateSample.ts][solutioncreatesample] | Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
Azure solutions comprise a comprehensive library of self-help resources that have been thoughtfully curated by Azure engineers to aid customers in resolving typical troubleshooting issues. These solutions encompass:
(1.) Dynamic and context-aware diagnostics, guided troubleshooting wizards, and data visualizations.
(2.) Rich instructional video tutorials and illustrative diagrams and images.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Create.json | -| [solutionGetSample.ts][solutiongetsample] | Get the solution using the applicable solutionResourceName while creating the solution. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Get.json | -| [solutionSelfHelpGetSample.ts][solutionselfhelpgetsample] | Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SelfHelpSolution_Get.json | -| [solutionUpdateSample.ts][solutionupdatesample] | Update the requiredInputs or additional information needed to execute the solution x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Update.json | -| [solutionWarmUpSample.ts][solutionwarmupsample] | Warm up the solution resource by preloading asynchronous diagnostics results into cache x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_WarmUp.json | -| [troubleshootersContinueSample.ts][troubleshooterscontinuesample] | Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
Continue API is used to provide inputs that are required for the specific troubleshooter to progress into the next step in the process. This API is used after the Troubleshooter has been created using the Create API. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Continue.json | -| [troubleshootersCreateSample.ts][troubleshooterscreatesample] | Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
Azure Troubleshooters help with hard to classify issues, reducing the gap between customer observed problems and solutions by guiding the user effortlessly through the troubleshooting process. Each Troubleshooter flow represents a problem area within Azure and has a complex tree-like structure that addresses many root causes. These flows are prepared with the help of Subject Matter experts and customer support engineers by carefully considering previous support requests raised by customers. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Create.json | -| [troubleshootersEndSample.ts][troubleshootersendsample] | Ends the troubleshooter action x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_End.json | -| [troubleshootersGetSample.ts][troubleshootersgetsample] | Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow. This API requires the Troubleshooter resource name that was created using the Create API. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Get.json | -| [troubleshootersRestartSample.ts][troubleshootersrestartsample] | Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Restart.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/checkNameAvailabilityCheckAvailabilitySample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env node dist/checkNameAvailabilityCheckAvailabilitySample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[checknameavailabilitycheckavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/checkNameAvailabilityCheckAvailabilitySample.ts -[diagnosticscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsCreateSample.ts -[diagnosticsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsGetSample.ts -[discoverysolutionlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionListSample.ts -[discoverysolutionnlpdiscoversolutionsbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.ts -[discoverysolutionnlpdiscoversolutionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpDiscoverSolutionsSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/operationsListSample.ts -[simplifiedsolutionscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsCreateSample.ts -[simplifiedsolutionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsGetSample.ts -[solutioncreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionCreateSample.ts -[solutiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionGetSample.ts -[solutionselfhelpgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionSelfHelpGetSample.ts -[solutionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionUpdateSample.ts -[solutionwarmupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionWarmUpSample.ts -[troubleshooterscontinuesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersContinueSample.ts -[troubleshooterscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersCreateSample.ts -[troubleshootersendsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersEndSample.ts -[troubleshootersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersGetSample.ts -[troubleshootersrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersRestartSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-selfhelp?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/selfhelp/arm-selfhelp/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/package.json b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/package.json deleted file mode 100644 index d1b7395a8fbc..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-selfhelp-ts-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/selfhelp/arm-selfhelp" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/selfhelp/arm-selfhelp", - "dependencies": { - "@azure/arm-selfhelp": "next", - "dotenv": "latest", - "@azure/identity": "^4.0.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.8.2", - "rimraf": "latest" - } -} diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/sample.env b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/checkNameAvailabilityCheckAvailabilitySample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/checkNameAvailabilityCheckAvailabilitySample.ts deleted file mode 100644 index fe4cab562ccd..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/checkNameAvailabilityCheckAvailabilitySample.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CheckNameAvailabilityRequest, - CheckNameAvailabilityCheckAvailabilityOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * - * @summary This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json - */ -async function exampleWhenNameIsAvailableForADiagnosticResource(): Promise { - const scope = "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const checkNameAvailabilityRequest: CheckNameAvailabilityRequest = { - name: "sampleName", - type: "Microsoft.Help/diagnostics", - }; - const options: CheckNameAvailabilityCheckAvailabilityOptionalParams = { - checkNameAvailabilityRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.checkNameAvailability.checkAvailability( - scope, - options, - ); - console.log(result); -} - -/** - * This sample demonstrates how to This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * - * @summary This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or solutions - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsNotAvailable.json - */ -async function exampleWhenNameIsNotAvailableForADiagnosticResource(): Promise { - const scope = "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - const checkNameAvailabilityRequest: CheckNameAvailabilityRequest = { - name: "sampleName", - type: "Microsoft.Help/diagnostics", - }; - const options: CheckNameAvailabilityCheckAvailabilityOptionalParams = { - checkNameAvailabilityRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.checkNameAvailability.checkAvailability( - scope, - options, - ); - console.log(result); -} - -async function main(): Promise { - exampleWhenNameIsAvailableForADiagnosticResource(); - exampleWhenNameIsNotAvailableForADiagnosticResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsCreateSample.ts deleted file mode 100644 index 51047012bc83..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsCreateSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates a diagnostic for the specific resource using solutionId from discovery solutions.
Diagnostics are powerful solutions that access product resources or other relevant data and provide the root cause of the issue and the steps to address the issue.

- * - * @summary Creates a diagnostic for the specific resource using solutionId from discovery solutions.
Diagnostics are powerful solutions that access product resources or other relevant data and provide the root cause of the issue and the steps to address the issue.

- * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/CreateDiagnosticForKeyVaultResource.json - */ -async function createsADiagnosticForAKeyVaultResource(): Promise { - const scope = - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read"; - const diagnosticsResourceName = "VMNotWorkingInsight"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.diagnostics.beginCreateAndWait( - scope, - diagnosticsResourceName, - ); - console.log(result); -} - -async function main(): Promise { - createsADiagnosticForAKeyVaultResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsGetSample.ts deleted file mode 100644 index e485ad744ac0..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/diagnosticsGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * - * @summary Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/GetDiagnosticForKeyVaultResource.json - */ -async function getsADiagnosticForAKeyVaultResource(): Promise { - const scope = - "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourceGroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read"; - const diagnosticsResourceName = "VMNotWorkingInsight"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.diagnostics.get(scope, diagnosticsResourceName); - console.log(result); -} - -async function main(): Promise { - getsADiagnosticForAKeyVaultResource(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionListSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionListSample.ts deleted file mode 100644 index 279818a8fc10..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DiscoverySolutionListOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. - * - * @summary Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND resourceUri or resourceType.
Discovery Solutions is the initial entry point within Help API, which identifies relevant Azure diagnostics and solutions.

Required Input : problemClassificationId (Use the [problemClassification API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP))
Optional input: resourceUri OR resource Type

Note: ‘requiredInputs’ from Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics and Solutions API. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListDiscoverySolutionsAtTenantScope.json - */ -async function listDiscoverySolutionsAtResourceScope(): Promise { - const filter = "ProblemClassificationId eq 'SampleProblemClassificationId1'"; - const options: DiscoverySolutionListOptionalParams = { filter }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const resArray = new Array(); - for await (let item of client.discoverySolution.list(options)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - listDiscoverySolutionsAtResourceScope(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.ts deleted file mode 100644 index 95c0b013e93e..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpDiscoverSolutionsBySubscriptionSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DiscoveryNlpRequest, - DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. - * - * @summary Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary and subscription. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtSubscriptionScope.json - */ -async function discoverySolutionsUsingIssueSummaryAndServiceId(): Promise { - const subscriptionId = "0d0fcd2e-c4fd-4349-8497-200edb3923c6"; - 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: DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams = - { discoverSolutionRequest }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = - await client.discoverySolutionNLP.discoverSolutionsBySubscription( - subscriptionId, - options, - ); - console.log(result); -} - -async function main(): Promise { - discoverySolutionsUsingIssueSummaryAndServiceId(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpDiscoverSolutionsSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpDiscoverSolutionsSample.ts deleted file mode 100644 index 091c61ffb928..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/discoverySolutionNlpDiscoverSolutionsSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DiscoveryNlpRequest, - DiscoverySolutionNLPDiscoverSolutionsOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. - * - * @summary Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue summary. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/DiscoverSolutionsAtTenantScope.json - */ -async function discoverySolutionsUsingIssueSummaryAndServiceId(): Promise { - const discoverSolutionRequest: DiscoveryNlpRequest = { - issueSummary: "how to retrieve certs from deleted keyvault.", - serviceId: "0d0fcd2e-c4fd-4349-8497-200edb39s3ca", - }; - const options: DiscoverySolutionNLPDiscoverSolutionsOptionalParams = { - discoverSolutionRequest, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.discoverySolutionNLP.discoverSolutions(options); - console.log(result); -} - -async function main(): Promise { - discoverySolutionsUsingIssueSummaryAndServiceId(); -} - -main().catch(console.error); 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 deleted file mode 100644 index a0a4e7418d0f..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Returns list of operations. - * - * @summary Returns list of operations. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/ListOperations.json - */ -async function listAllOperations(): Promise { - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - listAllOperations(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsCreateSample.ts deleted file mode 100644 index 5dfa02474abc..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SimplifiedSolutionsResource, - SimplifiedSolutionsCreateOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
- * - * @summary Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions as the input.

Simplified Solutions API makes the consumption of solutions APIs easier while still providing access to the same powerful solutions rendered in Solutions API. With Simplified Solutions, users don't have to worry about stitching together the article using replacement maps and can use the content in the API response to directly render as HTML content.
- * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Create.json - */ -async function solutionCreate(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const simplifiedSolutionsResourceName = "simplifiedSolutionsResourceName1"; - const simplifiedSolutionsRequestBody: SimplifiedSolutionsResource = { - parameters: { - resourceUri: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - solutionId: "sampleSolutionId", - }; - const options: SimplifiedSolutionsCreateOptionalParams = { - simplifiedSolutionsRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.simplifiedSolutions.beginCreateAndWait( - scope, - simplifiedSolutionsResourceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - solutionCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsGetSample.ts deleted file mode 100644 index 04163a4fa8c2..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/simplifiedSolutionsGetSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. - * - * @summary Get the simplified Solutions using the applicable solutionResourceName while creating the simplified Solutions. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SimplifiedSolutions_Get.json - */ -async function solutionGet(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const simplifiedSolutionsResourceName = "simplifiedSolutionsResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.simplifiedSolutions.get( - scope, - simplifiedSolutionsResourceName, - ); - console.log(result); -} - -async function main(): Promise { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionCreateSample.ts deleted file mode 100644 index e365a54b9c49..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionCreateSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SolutionResource, - SolutionCreateOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
Azure solutions comprise a comprehensive library of self-help resources that have been thoughtfully curated by Azure engineers to aid customers in resolving typical troubleshooting issues. These solutions encompass:
(1.) Dynamic and context-aware diagnostics, guided troubleshooting wizards, and data visualizations.
(2.) Rich instructional video tutorials and illustrative diagrams and images.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. - * - * @summary Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and requiredInputs’ from discovery solutions.
Azure solutions comprise a comprehensive library of self-help resources that have been thoughtfully curated by Azure engineers to aid customers in resolving typical troubleshooting issues. These solutions encompass:
(1.) Dynamic and context-aware diagnostics, guided troubleshooting wizards, and data visualizations.
(2.) Rich instructional video tutorials and illustrative diagrams and images.
(3.) Thoughtfully assembled textual troubleshooting instructions.
All these components are seamlessly converged into unified solutions tailored to address a specific support problem area. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Create.json - */ -async function solutionCreate(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const solutionRequestBody: SolutionResource = { - parameters: { - resourceUri: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - triggerCriteria: [{ name: "SolutionId", value: "SolutionId1" }], - }; - const options: SolutionCreateOptionalParams = { solutionRequestBody }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.beginCreateAndWait( - scope, - solutionResourceName, - options, - ); - console.log(result); -} - -async function main(): Promise { - solutionCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionGetSample.ts deleted file mode 100644 index 1859f8586195..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Get the solution using the applicable solutionResourceName while creating the solution. - * - * @summary Get the solution using the applicable solutionResourceName while creating the solution. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Get.json - */ -async function solutionGet(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResource1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.get(scope, solutionResourceName); - console.log(result); -} - -async function main(): Promise { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionSelfHelpGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionSelfHelpGetSample.ts deleted file mode 100644 index 5c1add17ec82..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionSelfHelpGetSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. - * - * @summary Gets Self Help Solutions for a given solutionId. Self Help Solutions consist of rich instructional video tutorials, links and guides to public documentation related to a specific problem that enables users to troubleshoot Azure issues. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/SelfHelpSolution_Get.json - */ -async function solutionGet(): Promise { - const solutionId = "SolutionId1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solutionSelfHelp.get(solutionId); - console.log(result); -} - -async function main(): Promise { - solutionGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionUpdateSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionUpdateSample.ts deleted file mode 100644 index 380b3ec7b50f..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionUpdateSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update the requiredInputs or additional information needed to execute the solution - * - * @summary Update the requiredInputs or additional information needed to execute the solution - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_Update.json - */ -async function solutionUpdate(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.beginUpdateAndWait( - scope, - solutionResourceName, - ); - console.log(result); -} - -async function main(): Promise { - solutionUpdate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionWarmUpSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionWarmUpSample.ts deleted file mode 100644 index 23e74104619f..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/solutionWarmUpSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Warm up the solution resource by preloading asynchronous diagnostics results into cache - * - * @summary Warm up the solution resource by preloading asynchronous diagnostics results into cache - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Solution_WarmUp.json - */ -async function solutionWarmUp(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const solutionResourceName = "SolutionResourceName1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.solution.warmUp(scope, solutionResourceName); - console.log(result); -} - -async function main(): Promise { - solutionWarmUp(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersContinueSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersContinueSample.ts deleted file mode 100644 index 57aeea50f6ab..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersContinueSample.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ContinueRequestBody, - TroubleshootersContinueOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
Continue API is used to provide inputs that are required for the specific troubleshooter to progress into the next step in the process. This API is used after the Troubleshooter has been created using the Create API. - * - * @summary Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the respective troubleshooter resource name.
Continue API is used to provide inputs that are required for the specific troubleshooter to progress into the next step in the process. This API is used after the Troubleshooter has been created using the Create API. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Continue.json - */ -async function troubleshooterContinue(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const continueRequestBody: ContinueRequestBody = { - stepId: "SampleStepId", - responses: [ - { - questionId: "SampleQuestionId", - questionType: "Text", - response: "Connection exception", - }, - ], - }; - const options: TroubleshootersContinueOptionalParams = { - continueRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.continue( - scope, - troubleshooterName, - options, - ); - console.log(result); -} - -async function main(): Promise { - troubleshooterContinue(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersCreateSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersCreateSample.ts deleted file mode 100644 index 2e9aabaf3bde..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - TroubleshooterResource, - TroubleshootersCreateOptionalParams, - HelpRP, -} from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
Azure Troubleshooters help with hard to classify issues, reducing the gap between customer observed problems and solutions by guiding the user effortlessly through the troubleshooting process. Each Troubleshooter flow represents a problem area within Azure and has a complex tree-like structure that addresses many root causes. These flows are prepared with the help of Subject Matter experts and customer support engineers by carefully considering previous support requests raised by customers. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. - * - * @summary Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ and ‘properties.parameters’ as the trigger.
Azure Troubleshooters help with hard to classify issues, reducing the gap between customer observed problems and solutions by guiding the user effortlessly through the troubleshooting process. Each Troubleshooter flow represents a problem area within Azure and has a complex tree-like structure that addresses many root causes. These flows are prepared with the help of Subject Matter experts and customer support engineers by carefully considering previous support requests raised by customers. Troubleshooters terminate at a well curated solution based off of resource backend signals and customer manual selections. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Create.json - */ -async function troubleshootersCreate(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const createTroubleshooterRequestBody: TroubleshooterResource = { - parameters: { - resourceURI: - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp", - }, - solutionId: "SampleTroubleshooterSolutionId", - }; - const options: TroubleshootersCreateOptionalParams = { - createTroubleshooterRequestBody, - }; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.create( - scope, - troubleshooterName, - options, - ); - console.log(result); -} - -async function main(): Promise { - troubleshootersCreate(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersEndSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersEndSample.ts deleted file mode 100644 index 715350711d97..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersEndSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Ends the troubleshooter action - * - * @summary Ends the troubleshooter action - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_End.json - */ -async function troubleshootersEnd(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.end(scope, troubleshooterName); - console.log(result); -} - -async function main(): Promise { - troubleshootersEnd(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersGetSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersGetSample.ts deleted file mode 100644 index 90af4d4e545e..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersGetSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow. This API requires the Troubleshooter resource name that was created using the Create API. - * - * @summary Gets troubleshooter instance result which includes the step status/result of the troubleshooter resource name that is being executed.
Get API is used to retrieve the result of a Troubleshooter instance, which includes the status and result of each step in the Troubleshooter workflow. This API requires the Troubleshooter resource name that was created using the Create API. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Get.json - */ -async function troubleshootersGet(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.get(scope, troubleshooterName); - console.log(result); -} - -async function main(): Promise { - troubleshootersGet(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersRestartSample.ts b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersRestartSample.ts deleted file mode 100644 index 28fe58306607..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/src/troubleshootersRestartSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { HelpRP } from "@azure/arm-selfhelp"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. - * - * @summary Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It returns new resource name which should be used in subsequent request. The old resource name is obsolete after this API is invoked. - * x-ms-original-file: specification/help/resource-manager/Microsoft.Help/preview/2024-03-01-preview/examples/Troubleshooter_Restart.json - */ -async function troubleshootersRestart(): Promise { - const scope = - "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-rp"; - const troubleshooterName = "abf168ed-1b54-454a-86f6-e4b62253d3b1"; - const credential = new DefaultAzureCredential(); - const client = new HelpRP(credential); - const result = await client.troubleshooters.restart( - scope, - troubleshooterName, - ); - console.log(result); -} - -async function main(): Promise { - troubleshootersRestart(); -} - -main().catch(console.error); diff --git a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/tsconfig.json b/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/selfhelp/arm-selfhelp/samples/v2-beta/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} diff --git a/sdk/selfhelp/arm-selfhelp/src/helpRP.ts b/sdk/selfhelp/arm-selfhelp/src/helpRP.ts index 5c1e93f79ae2..8dafeb6fcb89 100644 --- a/sdk/selfhelp/arm-selfhelp/src/helpRP.ts +++ b/sdk/selfhelp/arm-selfhelp/src/helpRP.ts @@ -8,53 +8,66 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import { - PipelineRequest, - PipelineResponse, - SendRequest, -} from "@azure/core-rest-pipeline"; +import { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { - OperationsImpl, CheckNameAvailabilityImpl, DiagnosticsImpl, - DiscoverySolutionImpl, - SolutionImpl, SimplifiedSolutionsImpl, + SolutionImpl, TroubleshootersImpl, - SolutionSelfHelpImpl, DiscoverySolutionNLPImpl, + DiscoverySolutionImpl, + OperationsImpl, + SolutionSelfHelpImpl, } from "./operations/index.js"; import { - Operations, CheckNameAvailability, Diagnostics, - DiscoverySolution, - Solution, SimplifiedSolutions, + Solution, Troubleshooters, - SolutionSelfHelp, DiscoverySolutionNLP, + DiscoverySolution, + Operations, + SolutionSelfHelp, } from "./operationsInterfaces/index.js"; import { HelpRPOptionalParams } from "./models/index.js"; 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 = {}; @@ -76,8 +89,7 @@ export class HelpRP extends coreClient.ServiceClient { userAgentOptions: { userAgentPrefix, }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com", + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); @@ -87,8 +99,7 @@ export class HelpRP extends coreClient.ServiceClient { options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName, + pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -104,28 +115,28 @@ export class HelpRP extends coreClient.ServiceClient { coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, + optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge, + authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, }, }), ); } + // Parameter assignments + this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; this.apiVersion = options.apiVersion || "2024-03-01-preview"; - this.operations = new OperationsImpl(this); this.checkNameAvailability = new CheckNameAvailabilityImpl(this); this.diagnostics = new DiagnosticsImpl(this); - this.discoverySolution = new DiscoverySolutionImpl(this); - this.solution = new SolutionImpl(this); this.simplifiedSolutions = new SimplifiedSolutionsImpl(this); + this.solution = new SolutionImpl(this); this.troubleshooters = new TroubleshootersImpl(this); - this.solutionSelfHelp = new SolutionSelfHelpImpl(this); this.discoverySolutionNLP = new DiscoverySolutionNLPImpl(this); + this.discoverySolution = new DiscoverySolutionImpl(this); + this.operations = new OperationsImpl(this); + this.solutionSelfHelp = new SolutionSelfHelpImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -136,10 +147,7 @@ export class HelpRP extends coreClient.ServiceClient { } const apiVersionPolicy = { name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest, - ): Promise { + async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const param = request.url.split("?"); if (param.length > 1) { const newParams = param[1].split("&").map((item) => { @@ -157,13 +165,13 @@ export class HelpRP extends coreClient.ServiceClient { this.pipeline.addPolicy(apiVersionPolicy); } - operations: Operations; checkNameAvailability: CheckNameAvailability; diagnostics: Diagnostics; - discoverySolution: DiscoverySolution; - solution: Solution; simplifiedSolutions: SimplifiedSolutions; + solution: Solution; troubleshooters: Troubleshooters; - solutionSelfHelp: SolutionSelfHelp; discoverySolutionNLP: DiscoverySolutionNLP; + discoverySolution: DiscoverySolution; + operations: Operations; + solutionSelfHelp: SolutionSelfHelp; } diff --git a/sdk/selfhelp/arm-selfhelp/src/lroImpl.ts b/sdk/selfhelp/arm-selfhelp/src/lroImpl.ts index d8bc98987053..1b3a95e6c540 100644 --- a/sdk/selfhelp/arm-selfhelp/src/lroImpl.ts +++ b/sdk/selfhelp/arm-selfhelp/src/lroImpl.ts @@ -5,6 +5,7 @@ * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ + import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; @@ -22,10 +23,7 @@ export function createLroSpec(inputs: { requestMethod: spec.httpMethod, requestPath: spec.path!, sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: ( - path: string, - options?: { abortSignal?: AbortSignalLike }, - ) => { + sendPollRequest: (path: string, options?: { abortSignal?: AbortSignalLike }) => { const { requestBody, ...restSpec } = spec; return sendOperationFn(args, { ...restSpec, diff --git a/sdk/selfhelp/arm-selfhelp/src/models/index.ts b/sdk/selfhelp/arm-selfhelp/src/models/index.ts index dabbb890b1e6..0feb3bbf77ca 100644 --- a/sdk/selfhelp/arm-selfhelp/src/models/index.ts +++ b/sdk/selfhelp/arm-selfhelp/src/models/index.ts @@ -8,68 +8,22 @@ import * as coreClient from "@azure/core-client"; -/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ -export interface OperationListResult { - /** - * List of operations supported by the resource provider - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Operation[]; - /** - * URL to get the next set of operation list results (if there are any). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Details of a REST API operation, returned from the Resource Provider Operations API */ -export interface Operation { - /** - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDataAction?: boolean; - /** Localized display information for this particular operation. */ - display?: OperationDisplay; - /** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly origin?: Origin; - /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly actionType?: ActionType; +/** The check availability request body. */ +export interface CheckNameAvailabilityRequest { + /** The name of the resource for which availability needs to be checked. */ + name?: string; + /** The resource type. */ + type?: string; } -/** Localized display information for this particular operation. */ -export interface OperationDisplay { - /** - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provider?: string; - /** - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resource?: string; - /** - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operation?: string; - /** - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; +/** Response for whether the requested resource name is available or not. */ +export interface CheckNameAvailabilityResponse { + /** Returns true or false depending on the availability of the name */ + nameAvailable?: boolean; + /** Reason for why value is not available. This field is returned if nameAvailable is false. */ + reason?: string; + /** Gets an error message explaining the 'reason' value with more details. This field is returned iif nameAvailable is false. */ + message?: string; } /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ @@ -121,24 +75,6 @@ export interface ErrorAdditionalInfo { readonly info?: Record; } -/** The check availability request body. */ -export interface CheckNameAvailabilityRequest { - /** The name of the resource for which availability needs to be checked. */ - name?: string; - /** The resource type. */ - type?: string; -} - -/** Response for whether the requested resource name is available or not. */ -export interface CheckNameAvailabilityResponse { - /** Returns true or false depending on the availability of the name */ - nameAvailable?: boolean; - /** Reason for why value is not available. This field is returned if nameAvailable is false. */ - reason?: string; - /** Gets an error message explaining the 'reason' value with more details. This field is returned iif nameAvailable is false. */ - message?: string; -} - /** Solution Invocation with additional params needed for invocation. */ export interface DiagnosticInvocation { /** Solution Id to invoke. */ @@ -232,35 +168,6 @@ export interface SystemData { lastModifiedAt?: Date; } -/** Discovery response. */ -export interface DiscoveryResponse { - /** The list of metadata. */ - value?: SolutionMetadataResource[]; - /** The link used to get the next page of solution metadata. */ - nextLink?: string; -} - -/** Metadata Properties */ -export interface SolutionMetadataProperties { - /** Solution Id. */ - solutionId?: string; - /** - * Solution Type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly solutionType?: SolutionType; - /** - * A detailed description of solution. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; - /** - * Required parameters for invoking this particular solution. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly requiredInputs?: string[]; -} - /** Solution request trigger criterion. SolutionId/ProblemClassificationId is the only supported trigger type for Solution PUT request. ReplacementKey is the only supported trigger type for Solution PATCH request. */ export interface TriggerCriterion { /** Trigger criterion name. */ @@ -552,26 +459,6 @@ export interface RestartTroubleshooterResponse { readonly troubleshooterResourceName?: string; } -/** Solution replacement maps. */ -export interface ReplacementMapsSelfHelp { - /** Solution AzureKB results */ - webResults?: WebResult[]; - /** Video solutions, which have the power to engage the customer by stimulating their senses */ - videos?: Video[]; - /** Group of Videos */ - videoGroups?: VideoGroup[]; -} - -/** Part of the solution and are dividers in the solution rendering. */ -export interface SectionSelfHelp { - /** Solution sections title. */ - title?: string; - /** Solution sections content. */ - content?: string; - /** Solution replacement maps. */ - replacementMaps?: ReplacementMapsSelfHelp; -} - /** Discover NLP request. */ export interface DiscoveryNlpRequest { /** Natural language description of the issue. */ @@ -590,6 +477,27 @@ export interface DiscoveryNlpResponse { value?: SolutionNlpMetadataResource[]; } +/** Metadata Properties */ +export interface SolutionMetadataProperties { + /** Solution Id. */ + solutionId?: string; + /** + * Solution Type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly solutionType?: SolutionType; + /** + * A detailed description of solution. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * Required parameters for invoking this particular solution. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredInputs?: string[]; +} + /** Service Classification result object. */ export interface ClassificationService { /** @@ -606,135 +514,174 @@ export interface ClassificationService { resourceTypes?: string[]; } -/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResource extends Resource {} - -/** Video detail */ -export interface Video extends VideoGroupVideo { - /** Place holder used in HTML Content replace control with the insight content */ - replacementKey?: string; +/** Discovery response. */ +export interface DiscoveryResponse { + /** The SolutionMetadataResource items on this page */ + value: SolutionMetadataResource[]; + /** The link to the next page of items */ + nextLink?: string; } -/** Diagnostic resource */ -export interface DiagnosticResource extends ProxyResource { - /** Global parameters is an optional map which can be used to add key and value to request body to improve the diagnostics results */ - globalParameters?: { [propertyName: string]: string }; - /** SolutionIds that are needed to be invoked. */ - insights?: DiagnosticInvocation[]; - /** - * Diagnostic Request Accepted time. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly acceptedAt?: string; +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { /** - * Status of diagnostic provisioning. + * List of operations supported by the resource provider * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: DiagnosticProvisioningState; + readonly value?: Operation[]; /** - * Array of Diagnostics. + * URL to get the next set of operation list results (if there are any). * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly diagnostics?: Diagnostic[]; -} - -/** Metadata resource */ -export interface SolutionMetadataResource extends ProxyResource { - /** List of metadata. */ - solutions?: SolutionMetadataProperties[]; + readonly nextLink?: string; } -/** Solution response. */ -export interface SolutionResource extends ProxyResource { - /** Solution request trigger criteria */ - triggerCriteria?: TriggerCriterion[]; - /** Client input parameters to run Solution */ - parameters?: { [propertyName: string]: string }; - /** - * Solution Id to identify single solution. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly solutionId?: string; - /** - * Status of solution provisioning. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: SolutionProvisioningState; +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { /** - * The title. + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly title?: string; + readonly name?: string; /** - * The HTML content that needs to be rendered and shown to customer. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly content?: string; + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; /** - * Solution replacement maps. + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly replacementMaps?: ReplacementMaps; + readonly origin?: Origin; /** - * List of section object. + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly sections?: Section[]; + readonly actionType?: ActionType; } -/** Simplified Solutions response. */ -export interface SimplifiedSolutionsResource extends ProxyResource { - /** Solution Id to identify single Simplified Solution. */ - solutionId?: string; - /** Client input parameters to run Simplified Solutions */ - parameters?: { [propertyName: string]: string }; +/** Localized display information for this particular operation. */ +export interface OperationDisplay { /** - * The title. + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly title?: string; + readonly provider?: string; /** - * Additional parameter response for Simplified Solutions + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly appendix?: { [propertyName: string]: string }; + readonly resource?: string; /** - * The HTML content that needs to be rendered and shown to customer. + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly content?: string; + readonly operation?: string; /** - * Status of Simplified Solution provisioning. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: SolutionProvisioningState; + readonly description?: string; } -/** Troubleshooter response. */ -export interface TroubleshooterResource extends ProxyResource { - /** Solution Id to identify single troubleshooter. */ +/** Solution replacement maps. */ +export interface ReplacementMapsSelfHelp { + /** Solution AzureKB results */ + webResults?: WebResult[]; + /** Video solutions, which have the power to engage the customer by stimulating their senses */ + videos?: Video[]; + /** Group of Videos */ + videoGroups?: VideoGroup[]; +} + +/** Part of the solution and are dividers in the solution rendering. */ +export interface SectionSelfHelp { + /** Solution sections title. */ + title?: string; + /** Solution sections content. */ + content?: string; + /** Solution replacement maps. */ + replacementMaps?: ReplacementMapsSelfHelp; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** Video detail */ +export interface Video extends VideoGroupVideo { + /** Place holder used in HTML Content replace control with the insight content */ + replacementKey?: string; +} + +/** Diagnostic resource */ +export interface DiagnosticResource extends ProxyResource { + /** Global parameters is an optional map which can be used to add key and value to request body to improve the diagnostics results */ + globalParameters?: { [propertyName: string]: string }; + /** SolutionIds that are needed to be invoked. */ + insights?: DiagnosticInvocation[]; + /** + * Diagnostic Request Accepted time. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly acceptedAt?: string; + /** + * Status of diagnostic provisioning. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: DiagnosticProvisioningState; + /** + * Array of Diagnostics. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly diagnostics?: Diagnostic[]; +} + +/** Simplified Solutions response. */ +export interface SimplifiedSolutionsResource extends ProxyResource { + /** Solution Id to identify single Simplified Solution. */ solutionId?: string; - /** Client input parameters to run Troubleshooter Resource */ + /** Client input parameters to run Simplified Solutions */ parameters?: { [propertyName: string]: string }; /** - * Status of troubleshooter provisioning. + * The title. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: TroubleshooterProvisioningState; + readonly title?: string; /** - * List of step object. + * Additional parameter response for Simplified Solutions * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly steps?: Step[]; + readonly appendix?: { [propertyName: string]: string }; + /** + * The HTML content that needs to be rendered and shown to customer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly content?: string; + /** + * Status of Simplified Solution provisioning. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: SolutionProvisioningState; } -/** Self Help Solution response. */ -export interface SolutionResourceSelfHelp extends ProxyResource { +/** Solution response. */ +export interface SolutionResource extends ProxyResource { + /** Solution request trigger criteria */ + triggerCriteria?: TriggerCriterion[]; + /** Client input parameters to run Solution */ + parameters?: { [propertyName: string]: string }; /** - * SolutionId is a unique id to identify a solution. You can retrieve the solution id using the Discovery api - https://learn.microsoft.com/en-us/rest/api/help/discovery-solution/list?view=rest-help-2023-09-01-preview&tabs=HTTP + * Solution Id to identify single solution. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly solutionId?: string; + /** + * Status of solution provisioning. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: SolutionProvisioningState; /** * The title. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -749,12 +696,30 @@ export interface SolutionResourceSelfHelp extends ProxyResource { * Solution replacement maps. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly replacementMaps?: ReplacementMapsSelfHelp; + readonly replacementMaps?: ReplacementMaps; /** * List of section object. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly sections?: SectionSelfHelp[]; + readonly sections?: Section[]; +} + +/** Troubleshooter response. */ +export interface TroubleshooterResource extends ProxyResource { + /** Solution Id to identify single troubleshooter. */ + solutionId?: string; + /** Client input parameters to run Troubleshooter Resource */ + parameters?: { [propertyName: string]: string }; + /** + * Status of troubleshooter provisioning. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: TroubleshooterProvisioningState; + /** + * List of step object. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly steps?: Step[]; } /** Nlp Metadata resource */ @@ -773,62 +738,71 @@ export interface SolutionNlpMetadataResource extends ProxyResource { relatedServices?: ClassificationService[]; } -/** Defines headers for Solution_update operation. */ -export interface SolutionUpdateHeaders { - location?: string; +/** Metadata resource */ +export interface SolutionMetadataResource extends ProxyResource { + /** List of metadata. */ + solutions?: SolutionMetadataProperties[]; } -/** Defines headers for Troubleshooters_continue operation. */ -export interface TroubleshootersContinueHeaders { - location?: string; +/** Self Help Solution response. */ +export interface SolutionResourceSelfHelp extends ProxyResource { + /** + * SolutionId is a unique id to identify a solution. You can retrieve the solution id using the Discovery api - https://learn.microsoft.com/en-us/rest/api/help/discovery-solution/list?view=rest-help-2023-09-01-preview&tabs=HTTP + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly solutionId?: string; + /** + * The title. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly title?: string; + /** + * The HTML content that needs to be rendered and shown to customer. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly content?: string; + /** + * Solution replacement maps. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly replacementMaps?: ReplacementMapsSelfHelp; + /** + * List of section object. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sections?: SectionSelfHelp[]; } -/** Defines headers for Troubleshooters_end operation. */ -export interface TroubleshootersEndHeaders { - location?: string; +/** Defines headers for Diagnostics_create operation. */ +export interface DiagnosticsCreateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; } -/** Defines headers for Troubleshooters_restart operation. */ -export interface TroubleshootersRestartHeaders { - location?: string; +/** Defines headers for SimplifiedSolutions_create operation. */ +export interface SimplifiedSolutionsCreateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; } -/** Known values of {@link Origin} that the service accepts. */ -export enum KnownOrigin { - /** User */ - User = "user", - /** System */ - System = "system", - /** UserSystem */ - UserSystem = "user,system", +/** Defines headers for Solution_create operation. */ +export interface SolutionCreateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; } -/** - * Defines values for Origin. \ - * {@link KnownOrigin} can be used interchangeably with Origin, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **user** \ - * **system** \ - * **user,system** - */ -export type Origin = string; - -/** Known values of {@link ActionType} that the service accepts. */ -export enum KnownActionType { - /** Internal */ - Internal = "Internal", +/** Defines headers for Solution_update operation. */ +export interface SolutionUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; } -/** - * Defines values for ActionType. \ - * {@link KnownActionType} can be used interchangeably with ActionType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Internal** - */ -export type ActionType = string; - /** Known values of {@link DiagnosticProvisioningState} that the service accepts. */ export enum KnownDiagnosticProvisioningState { /** All Diagnostics in the Batch succeeded. */ @@ -928,29 +902,32 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; -/** Known values of {@link SolutionType} that the service accepts. */ -export enum KnownSolutionType { - /** Diagnostics resource type. */ - Diagnostics = "Diagnostics", - /** Solutions resource type. */ - Solutions = "Solutions", - /** Troubleshooters resource type. */ - Troubleshooters = "Troubleshooters", - /** SelfHelp resource type. */ - SelfHelp = "SelfHelp", +/** Known values of {@link SolutionProvisioningState} that the service accepts. */ +export enum KnownSolutionProvisioningState { + /** All Solutions in the Batch succeeded. */ + Succeeded = "Succeeded", + /** Some Solutions are still running or failed. */ + PartialComplete = "PartialComplete", + /** All Solutions failed to run. */ + Failed = "Failed", + /** All Solutions are still running. */ + Running = "Running", + /** When Solutions request gets canceled. */ + Canceled = "Canceled", } /** - * Defines values for SolutionType. \ - * {@link KnownSolutionType} can be used interchangeably with SolutionType, + * Defines values for SolutionProvisioningState. \ + * {@link KnownSolutionProvisioningState} can be used interchangeably with SolutionProvisioningState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Diagnostics**: Diagnostics resource type. \ - * **Solutions**: Solutions resource type. \ - * **Troubleshooters**: Troubleshooters resource type. \ - * **SelfHelp**: SelfHelp resource type. + * **Succeeded**: All Solutions in the Batch succeeded. \ + * **PartialComplete**: Some Solutions are still running or failed. \ + * **Failed**: All Solutions failed to run. \ + * **Running**: All Solutions are still running. \ + * **Canceled**: When Solutions request gets canceled. */ -export type SolutionType = string; +export type SolutionProvisioningState = string; /** Known values of {@link Name} that the service accepts. */ export enum KnownName { @@ -973,33 +950,6 @@ export enum KnownName { */ export type Name = string; -/** Known values of {@link SolutionProvisioningState} that the service accepts. */ -export enum KnownSolutionProvisioningState { - /** All Solutions in the Batch succeeded. */ - Succeeded = "Succeeded", - /** Some Solutions are still running or failed. */ - PartialComplete = "PartialComplete", - /** All Solutions failed to run. */ - Failed = "Failed", - /** All Solutions are still running. */ - Running = "Running", - /** When Solutions request gets canceled. */ - Canceled = "Canceled", -} - -/** - * Defines values for SolutionProvisioningState. \ - * {@link KnownSolutionProvisioningState} can be used interchangeably with SolutionProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Succeeded**: All Solutions in the Batch succeeded. \ - * **PartialComplete**: Some Solutions are still running or failed. \ - * **Failed**: All Solutions failed to run. \ - * **Running**: All Solutions are still running. \ - * **Canceled**: When Solutions request gets canceled. - */ -export type SolutionProvisioningState = string; - /** Known values of {@link Confidence} that the service accepts. */ export enum KnownConfidence { /** Low */ @@ -1246,19 +1196,65 @@ export enum KnownAutomatedCheckResultType { */ export type AutomatedCheckResultType = string; -/** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} +/** Known values of {@link SolutionType} that the service accepts. */ +export enum KnownSolutionType { + /** Diagnostics resource type. */ + Diagnostics = "Diagnostics", + /** Solutions resource type. */ + Solutions = "Solutions", + /** Troubleshooters resource type. */ + Troubleshooters = "Troubleshooters", + /** SelfHelp resource type. */ + SelfHelp = "SelfHelp", +} -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; +/** + * Defines values for SolutionType. \ + * {@link KnownSolutionType} can be used interchangeably with SolutionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Diagnostics**: Diagnostics resource type. \ + * **Solutions**: Solutions resource type. \ + * **Troubleshooters**: Troubleshooters resource type. \ + * **SelfHelp**: SelfHelp resource type. + */ +export type SolutionType = string; -/** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system", +} -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal", +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; /** Optional parameters. */ export interface CheckNameAvailabilityCheckAvailabilityOptionalParams @@ -1268,14 +1264,16 @@ export interface CheckNameAvailabilityCheckAvailabilityOptionalParams } /** Contains response data for the checkAvailability operation. */ -export type CheckNameAvailabilityCheckAvailabilityResponse = - CheckNameAvailabilityResponse; +export type CheckNameAvailabilityCheckAvailabilityResponse = CheckNameAvailabilityResponse; /** Optional parameters. */ -export interface DiagnosticsCreateOptionalParams - extends coreClient.OperationOptions { - /** The required request body for this insightResource invocation. */ - diagnosticResourceRequest?: DiagnosticResource; +export interface DiagnosticsGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DiagnosticsGetResponse = DiagnosticResource; + +/** Optional parameters. */ +export interface DiagnosticsCreateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -1286,36 +1284,30 @@ export interface DiagnosticsCreateOptionalParams export type DiagnosticsCreateResponse = DiagnosticResource; /** Optional parameters. */ -export interface DiagnosticsGetOptionalParams - extends coreClient.OperationOptions {} +export interface SimplifiedSolutionsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type DiagnosticsGetResponse = DiagnosticResource; +export type SimplifiedSolutionsGetResponse = SimplifiedSolutionsResource; /** Optional parameters. */ -export interface DiscoverySolutionListOptionalParams - extends coreClient.OperationOptions { - /** 'ProblemClassificationId' is a mandatory filter to get solutions ids. It also supports optional 'ResourceType' and 'SolutionType' filters. The [$filter](https://learn.microsoft.com/en-us/odata/webapi/first-odata-api#filter) supports only 'and', 'or' and 'eq' operators. Example: $filter=ProblemClassificationId eq '1ddda5b4-cf6c-4d4f-91ad-bc38ab0e811e' */ - filter?: string; - /** Skiptoken is only used if a previous operation returned a partial result. */ - skiptoken?: string; +export interface SimplifiedSolutionsCreateOptionalParams extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; } -/** Contains response data for the list operation. */ -export type DiscoverySolutionListResponse = DiscoveryResponse; +/** Contains response data for the create operation. */ +export type SimplifiedSolutionsCreateResponse = SimplifiedSolutionsResource; /** Optional parameters. */ -export interface DiscoverySolutionListNextOptionalParams - extends coreClient.OperationOptions {} +export interface SolutionGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type DiscoverySolutionListNextResponse = DiscoveryResponse; +/** Contains response data for the get operation. */ +export type SolutionGetResponse = SolutionResource; /** Optional parameters. */ -export interface SolutionCreateOptionalParams - extends coreClient.OperationOptions { - /** The required request body for this solution resource creation. */ - solutionRequestBody?: SolutionResource; +export interface SolutionCreateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -1326,17 +1318,7 @@ export interface SolutionCreateOptionalParams export type SolutionCreateResponse = SolutionResource; /** Optional parameters. */ -export interface SolutionGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type SolutionGetResponse = SolutionResource; - -/** Optional parameters. */ -export interface SolutionUpdateOptionalParams - extends coreClient.OperationOptions { - /** The required request body for updating a solution resource. */ - solutionPatchRequestBody?: SolutionPatchRequestBody; +export interface SolutionUpdateOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -1344,106 +1326,89 @@ export interface SolutionUpdateOptionalParams } /** Contains response data for the update operation. */ -export type SolutionUpdateResponse = SolutionUpdateHeaders & SolutionResource; +export type SolutionUpdateResponse = SolutionResource; /** Optional parameters. */ -export interface SolutionWarmUpOptionalParams - extends coreClient.OperationOptions { +export interface SolutionWarmUpOptionalParams extends coreClient.OperationOptions { /** The required request body for warming up a solution resource. */ solutionWarmUpRequestBody?: SolutionWarmUpRequestBody; } /** Optional parameters. */ -export interface SimplifiedSolutionsCreateOptionalParams - extends coreClient.OperationOptions { - /** The required request body for simplified Solutions resource creation. */ - simplifiedSolutionsRequestBody?: SimplifiedSolutionsResource; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the create operation. */ -export type SimplifiedSolutionsCreateResponse = SimplifiedSolutionsResource; - -/** Optional parameters. */ -export interface SimplifiedSolutionsGetOptionalParams - extends coreClient.OperationOptions {} +export interface TroubleshootersGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type SimplifiedSolutionsGetResponse = SimplifiedSolutionsResource; +export type TroubleshootersGetResponse = TroubleshooterResource; /** Optional parameters. */ -export interface TroubleshootersCreateOptionalParams - extends coreClient.OperationOptions { - /** The required request body for this Troubleshooter resource creation. */ - createTroubleshooterRequestBody?: TroubleshooterResource; -} +export interface TroubleshootersCreateOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the create operation. */ export type TroubleshootersCreateResponse = TroubleshooterResource; /** Optional parameters. */ -export interface TroubleshootersGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type TroubleshootersGetResponse = TroubleshooterResource; - -/** Optional parameters. */ -export interface TroubleshootersContinueOptionalParams - extends coreClient.OperationOptions { +export interface TroubleshootersContinueOptionalParams extends coreClient.OperationOptions { /** The required request body for going to next step in Troubleshooter resource. */ continueRequestBody?: ContinueRequestBody; } -/** Contains response data for the continue operation. */ -export type TroubleshootersContinueResponse = TroubleshootersContinueHeaders; +/** Optional parameters. */ +export interface TroubleshootersEndOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface TroubleshootersEndOptionalParams - extends coreClient.OperationOptions {} +export interface TroubleshootersRestartOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the end operation. */ -export type TroubleshootersEndResponse = TroubleshootersEndHeaders; +/** Contains response data for the restart operation. */ +export type TroubleshootersRestartResponse = RestartTroubleshooterResponse; /** Optional parameters. */ -export interface TroubleshootersRestartOptionalParams +export interface DiscoverySolutionNLPDiscoverSolutionsOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the restart operation. */ -export type TroubleshootersRestartResponse = TroubleshootersRestartHeaders & - RestartTroubleshooterResponse; +/** Contains response data for the discoverSolutions operation. */ +export type DiscoverySolutionNLPDiscoverSolutionsResponse = DiscoveryNlpResponse; /** Optional parameters. */ -export interface SolutionSelfHelpGetOptionalParams +export interface DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the get operation. */ -export type SolutionSelfHelpGetResponse = SolutionResourceSelfHelp; +/** Contains response data for the discoverSolutionsBySubscription operation. */ +export type DiscoverySolutionNLPDiscoverSolutionsBySubscriptionResponse = DiscoveryNlpResponse; /** Optional parameters. */ -export interface DiscoverySolutionNLPDiscoverSolutionsOptionalParams - extends coreClient.OperationOptions { - /** Request body for discovering solutions using NLP. */ - discoverSolutionRequest?: DiscoveryNlpRequest; +export interface DiscoverySolutionListOptionalParams extends coreClient.OperationOptions { + /** 'ProblemClassificationId' is a mandatory filter to get solutions ids. It also supports optional 'ResourceType' and 'SolutionType' filters. The [$filter](https://learn.microsoft.com/en-us/odata/webapi/first-odata-api#filter) supports only 'and', 'or' and 'eq' operators. Example: $filter=ProblemClassificationId eq '1ddda5b4-cf6c-4d4f-91ad-bc38ab0e811e' */ + filter?: string; + /** Skiptoken is only used if a previous operation returned a partial result. */ + skiptoken?: string; } -/** Contains response data for the discoverSolutions operation. */ -export type DiscoverySolutionNLPDiscoverSolutionsResponse = - DiscoveryNlpResponse; +/** Contains response data for the list operation. */ +export type DiscoverySolutionListResponse = DiscoveryResponse; /** Optional parameters. */ -export interface DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams - extends coreClient.OperationOptions { - /** Request body for discovering solutions using NLP. */ - discoverSolutionRequest?: DiscoveryNlpRequest; -} +export interface DiscoverySolutionListNextOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the discoverSolutionsBySubscription operation. */ -export type DiscoverySolutionNLPDiscoverSolutionsBySubscriptionResponse = - DiscoveryNlpResponse; +/** Contains response data for the listNext operation. */ +export type DiscoverySolutionListNextResponse = DiscoveryResponse; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface SolutionSelfHelpGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type SolutionSelfHelpGetResponse = SolutionResourceSelfHelp; /** Optional parameters. */ export interface HelpRPOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/selfhelp/arm-selfhelp/src/models/mappers.ts b/sdk/selfhelp/arm-selfhelp/src/models/mappers.ts index 6594090b41c0..eb2d399102c5 100644 --- a/sdk/selfhelp/arm-selfhelp/src/models/mappers.ts +++ b/sdk/selfhelp/arm-selfhelp/src/models/mappers.ts @@ -8,71 +8,19 @@ import * as coreClient from "@azure/core-client"; -export const OperationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Operation: coreClient.CompositeMapper = { +export const CheckNameAvailabilityRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Operation", + className: "CheckNameAvailabilityRequest", modelProperties: { name: { serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - isDataAction: { - serializedName: "isDataAction", - readOnly: true, - type: { - name: "Boolean", - }, - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay", - }, - }, - origin: { - serializedName: "origin", - readOnly: true, type: { name: "String", }, }, - actionType: { - serializedName: "actionType", - readOnly: true, + type: { + serializedName: "type", type: { name: "String", }, @@ -81,35 +29,25 @@ export const Operation: coreClient.CompositeMapper = { }, }; -export const OperationDisplay: coreClient.CompositeMapper = { +export const CheckNameAvailabilityResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationDisplay", + className: "CheckNameAvailabilityResponse", modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, - type: { - name: "String", - }, - }, - resource: { - serializedName: "resource", - readOnly: true, + nameAvailable: { + serializedName: "nameAvailable", type: { - name: "String", + name: "Boolean", }, }, - operation: { - serializedName: "operation", - readOnly: true, + reason: { + serializedName: "reason", type: { name: "String", }, }, - description: { - serializedName: "description", - readOnly: true, + message: { + serializedName: "message", type: { name: "String", }, @@ -214,54 +152,6 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { }, }; -export const CheckNameAvailabilityRequest: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CheckNameAvailabilityRequest", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CheckNameAvailabilityResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CheckNameAvailabilityResponse", - modelProperties: { - nameAvailable: { - serializedName: "nameAvailable", - type: { - name: "Boolean", - }, - }, - reason: { - serializedName: "reason", - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - type: { - name: "String", - }, - }, - }, - }, -}; - export const DiagnosticInvocation: coreClient.CompositeMapper = { type: { name: "Composite", @@ -481,74 +371,6 @@ export const SystemData: coreClient.CompositeMapper = { }, }; -export const DiscoveryResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiscoveryResponse", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SolutionMetadataResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SolutionMetadataProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SolutionMetadataProperties", - modelProperties: { - solutionId: { - serializedName: "solutionId", - type: { - name: "String", - }, - }, - solutionType: { - serializedName: "solutionType", - readOnly: true, - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String", - }, - }, - requiredInputs: { - serializedName: "requiredInputs", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - export const TriggerCriterion: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1420,105 +1242,156 @@ export const RestartTroubleshooterResponse: coreClient.CompositeMapper = { }, }; -export const ReplacementMapsSelfHelp: coreClient.CompositeMapper = { +export const DiscoveryNlpRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ReplacementMapsSelfHelp", + className: "DiscoveryNlpRequest", modelProperties: { - webResults: { - serializedName: "webResults", + issueSummary: { + serializedName: "issueSummary", + required: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "WebResult", - }, - }, + name: "String", }, }, - videos: { - serializedName: "videos", + resourceId: { + serializedName: "resourceId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Video", - }, - }, + name: "String", }, }, - videoGroups: { - serializedName: "videoGroups", + serviceId: { + serializedName: "serviceId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VideoGroup", - }, - }, + name: "String", + }, + }, + additionalContext: { + serializedName: "additionalContext", + type: { + name: "String", }, }, }, }, }; -export const SectionSelfHelp: coreClient.CompositeMapper = { +export const DiscoveryNlpResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SectionSelfHelp", + className: "DiscoveryNlpResponse", modelProperties: { - title: { - serializedName: "title", + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SolutionNlpMetadataResource", + }, + }, + }, + }, + }, + }, +}; + +export const SolutionMetadataProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SolutionMetadataProperties", + modelProperties: { + solutionId: { + serializedName: "solutionId", type: { name: "String", }, }, - content: { - serializedName: "content", + solutionType: { + serializedName: "solutionType", + readOnly: true, type: { name: "String", }, }, - replacementMaps: { - serializedName: "replacementMaps", + description: { + serializedName: "description", + readOnly: true, type: { - name: "Composite", - className: "ReplacementMapsSelfHelp", + name: "String", + }, + }, + requiredInputs: { + serializedName: "requiredInputs", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, }, }, }; -export const DiscoveryNlpRequest: coreClient.CompositeMapper = { +export const ClassificationService: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DiscoveryNlpRequest", + className: "ClassificationService", modelProperties: { - issueSummary: { - serializedName: "issueSummary", - required: true, + serviceId: { + serializedName: "serviceId", + readOnly: true, type: { name: "String", }, }, - resourceId: { - serializedName: "resourceId", + displayName: { + serializedName: "displayName", + readOnly: true, type: { name: "String", }, }, - serviceId: { - serializedName: "serviceId", + resourceTypes: { + serializedName: "resourceTypes", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, - additionalContext: { - serializedName: "additionalContext", + }, + }, +}; + +export const DiscoveryResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiscoveryResponse", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SolutionMetadataResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", type: { name: "String", }, @@ -1527,53 +1400,153 @@ export const DiscoveryNlpRequest: coreClient.CompositeMapper = { }, }; -export const DiscoveryNlpResponse: coreClient.CompositeMapper = { +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DiscoveryNlpResponse", + className: "OperationListResult", modelProperties: { value: { serializedName: "value", + readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "SolutionNlpMetadataResource", + className: "Operation", }, }, }, }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, }, }, }; -export const ClassificationService: coreClient.CompositeMapper = { +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClassificationService", + className: "Operation", modelProperties: { - serviceId: { - serializedName: "serviceId", + name: { + serializedName: "name", readOnly: true, type: { name: "String", }, }, - displayName: { - serializedName: "displayName", + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean", + }, + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay", + }, + }, + origin: { + serializedName: "origin", readOnly: true, type: { name: "String", }, }, - resourceTypes: { - serializedName: "resourceTypes", + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String", + }, + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String", + }, + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ReplacementMapsSelfHelp: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ReplacementMapsSelfHelp", + modelProperties: { + webResults: { + serializedName: "webResults", type: { name: "Sequence", element: { type: { - name: "String", + name: "Composite", + className: "WebResult", + }, + }, + }, + }, + videos: { + serializedName: "videos", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Video", + }, + }, + }, + }, + videoGroups: { + serializedName: "videoGroups", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VideoGroup", }, }, }, @@ -1582,6 +1555,34 @@ export const ClassificationService: coreClient.CompositeMapper = { }, }; +export const SectionSelfHelp: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SectionSelfHelp", + modelProperties: { + title: { + serializedName: "title", + type: { + name: "String", + }, + }, + content: { + serializedName: "content", + type: { + name: "String", + }, + }, + replacementMaps: { + serializedName: "replacementMaps", + type: { + name: "Composite", + className: "ReplacementMapsSelfHelp", + }, + }, + }, + }, +}; + export const ProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1664,22 +1665,52 @@ export const DiagnosticResource: coreClient.CompositeMapper = { }, }; -export const SolutionMetadataResource: coreClient.CompositeMapper = { +export const SimplifiedSolutionsResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SolutionMetadataResource", + className: "SimplifiedSolutionsResource", modelProperties: { ...ProxyResource.type.modelProperties, - solutions: { - serializedName: "properties.solutions", + solutionId: { + serializedName: "properties.solutionId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SolutionMetadataProperties", - }, - }, + name: "String", + }, + }, + parameters: { + serializedName: "properties.parameters", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + title: { + serializedName: "properties.title", + readOnly: true, + type: { + name: "String", + }, + }, + appendix: { + serializedName: "properties.appendix", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + content: { + serializedName: "properties.content", + readOnly: true, + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", }, }, }, @@ -1763,10 +1794,10 @@ export const SolutionResource: coreClient.CompositeMapper = { }, }; -export const SimplifiedSolutionsResource: coreClient.CompositeMapper = { +export const TroubleshooterResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SimplifiedSolutionsResource", + className: "TroubleshooterResource", modelProperties: { ...ProxyResource.type.modelProperties, solutionId: { @@ -1782,74 +1813,102 @@ export const SimplifiedSolutionsResource: coreClient.CompositeMapper = { value: { type: { name: "String" } }, }, }, - title: { - serializedName: "properties.title", - readOnly: true, - type: { - name: "String", - }, - }, - appendix: { - serializedName: "properties.appendix", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - content: { - serializedName: "properties.content", + provisioningState: { + serializedName: "properties.provisioningState", readOnly: true, type: { name: "String", }, }, - provisioningState: { - serializedName: "properties.provisioningState", + steps: { + serializedName: "properties.steps", readOnly: true, type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Step", + }, + }, }, }, }, }, }; -export const TroubleshooterResource: coreClient.CompositeMapper = { +export const SolutionNlpMetadataResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TroubleshooterResource", + className: "SolutionNlpMetadataResource", modelProperties: { ...ProxyResource.type.modelProperties, - solutionId: { - serializedName: "properties.solutionId", + problemTitle: { + serializedName: "properties.problemTitle", type: { name: "String", }, }, - parameters: { - serializedName: "properties.parameters", + problemDescription: { + serializedName: "properties.problemDescription", type: { - name: "Dictionary", - value: { type: { name: "String" } }, + name: "String", }, }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, + serviceId: { + serializedName: "properties.serviceId", type: { name: "String", }, }, - steps: { - serializedName: "properties.steps", - readOnly: true, + problemClassificationId: { + serializedName: "properties.problemClassificationId", + type: { + name: "String", + }, + }, + solutions: { + serializedName: "properties.solutions", type: { name: "Sequence", element: { type: { name: "Composite", - className: "Step", + className: "SolutionMetadataProperties", + }, + }, + }, + }, + relatedServices: { + serializedName: "properties.relatedServices", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ClassificationService", + }, + }, + }, + }, + }, + }, +}; + +export const SolutionMetadataResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SolutionMetadataResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + solutions: { + serializedName: "properties.solutions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SolutionMetadataProperties", }, }, }, @@ -1909,116 +1968,76 @@ export const SolutionResourceSelfHelp: coreClient.CompositeMapper = { }, }; -export const SolutionNlpMetadataResource: coreClient.CompositeMapper = { +export const DiagnosticsCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SolutionNlpMetadataResource", + className: "DiagnosticsCreateHeaders", modelProperties: { - ...ProxyResource.type.modelProperties, - problemTitle: { - serializedName: "properties.problemTitle", - type: { - name: "String", - }, - }, - problemDescription: { - serializedName: "properties.problemDescription", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { name: "String", }, }, - serviceId: { - serializedName: "properties.serviceId", - type: { - name: "String", - }, - }, - problemClassificationId: { - serializedName: "properties.problemClassificationId", - type: { - name: "String", - }, - }, - solutions: { - serializedName: "properties.solutions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SolutionMetadataProperties", - }, - }, - }, - }, - relatedServices: { - serializedName: "properties.relatedServices", + retryAfter: { + serializedName: "retry-after", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClassificationService", - }, - }, + name: "Number", }, }, }, }, }; -export const SolutionUpdateHeaders: coreClient.CompositeMapper = { +export const SimplifiedSolutionsCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SolutionUpdateHeaders", + className: "SimplifiedSolutionsCreateHeaders", modelProperties: { - location: { - serializedName: "location", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { name: "String", }, }, - }, - }, -}; - -export const TroubleshootersContinueHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TroubleshootersContinueHeaders", - modelProperties: { - location: { - serializedName: "location", + retryAfter: { + serializedName: "retry-after", type: { - name: "String", + name: "Number", }, }, }, }, }; -export const TroubleshootersEndHeaders: coreClient.CompositeMapper = { +export const SolutionCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TroubleshootersEndHeaders", + className: "SolutionCreateHeaders", modelProperties: { - location: { - serializedName: "location", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { name: "String", }, }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, }, }, }; -export const TroubleshootersRestartHeaders: coreClient.CompositeMapper = { +export const SolutionUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TroubleshootersRestartHeaders", + className: "SolutionUpdateHeaders", modelProperties: { - location: { - serializedName: "location", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { name: "String", }, diff --git a/sdk/selfhelp/arm-selfhelp/src/models/parameters.ts b/sdk/selfhelp/arm-selfhelp/src/models/parameters.ts index d11ddd9725f0..7764116e5ae6 100644 --- a/sdk/selfhelp/arm-selfhelp/src/models/parameters.ts +++ b/sdk/selfhelp/arm-selfhelp/src/models/parameters.ts @@ -14,55 +14,48 @@ import { import { CheckNameAvailabilityRequest as CheckNameAvailabilityRequestMapper, DiagnosticResource as DiagnosticResourceMapper, + SimplifiedSolutionsResource as SimplifiedSolutionsResourceMapper, SolutionResource as SolutionResourceMapper, SolutionPatchRequestBody as SolutionPatchRequestBodyMapper, SolutionWarmUpRequestBody as SolutionWarmUpRequestBodyMapper, - SimplifiedSolutionsResource as SimplifiedSolutionsResourceMapper, TroubleshooterResource as TroubleshooterResourceMapper, ContinueRequestBody as ContinueRequestBodyMapper, DiscoveryNlpRequest as DiscoveryNlpRequestMapper, } from "../models/mappers.js"; -export const accept: OperationParameter = { - parameterPath: "accept", +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { defaultValue: "application/json", isConstant: true, - serializedName: "Accept", + serializedName: "Content-Type", type: { name: "String", }, }, }; -export const $host: OperationURLParameter = { - parameterPath: "$host", - mapper: { - serializedName: "$host", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, +export const checkNameAvailabilityRequest: OperationParameter = { + parameterPath: ["options", "checkNameAvailabilityRequest"], + mapper: CheckNameAvailabilityRequestMapper, }; -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", +export const accept: OperationParameter = { + parameterPath: "accept", mapper: { - defaultValue: "2024-03-01-preview", + defaultValue: "application/json", isConstant: true, - serializedName: "api-version", + serializedName: "Accept", type: { name: "String", }, }, }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", +export const $host: OperationURLParameter = { + parameterPath: "$host", mapper: { - serializedName: "nextLink", + serializedName: "$host", required: true, type: { name: "String", @@ -71,23 +64,18 @@ export const nextLink: OperationURLParameter = { skipEncoding: true, }; -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", mapper: { - defaultValue: "application/json", + defaultValue: "2024-03-01-preview", isConstant: true, - serializedName: "Content-Type", + serializedName: "api-version", type: { name: "String", }, }, }; -export const checkNameAvailabilityRequest: OperationParameter = { - parameterPath: ["options", "checkNameAvailabilityRequest"], - mapper: CheckNameAvailabilityRequestMapper, -}; - export const scope: OperationURLParameter = { parameterPath: "scope", mapper: { @@ -100,11 +88,6 @@ export const scope: OperationURLParameter = { skipEncoding: true, }; -export const diagnosticResourceRequest: OperationParameter = { - parameterPath: ["options", "diagnosticResourceRequest"], - mapper: DiagnosticResourceMapper, -}; - export const diagnosticsResourceName: OperationURLParameter = { parameterPath: "diagnosticsResourceName", mapper: { @@ -121,30 +104,30 @@ export const diagnosticsResourceName: OperationURLParameter = { }, }; -export const filter: OperationQueryParameter = { - parameterPath: ["options", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String", - }, - }, - skipEncoding: true, +export const diagnosticResourceRequest: OperationParameter = { + parameterPath: "diagnosticResourceRequest", + mapper: DiagnosticResourceMapper, }; -export const skiptoken: OperationQueryParameter = { - parameterPath: ["options", "skiptoken"], +export const simplifiedSolutionsResourceName: OperationURLParameter = { + parameterPath: "simplifiedSolutionsResourceName", mapper: { - serializedName: "$skiptoken", + constraints: { + Pattern: new RegExp("^[A-Za-z0-9-+@()_]+$"), + MaxLength: 100, + MinLength: 1, + }, + serializedName: "simplifiedSolutionsResourceName", + required: true, type: { name: "String", }, }, }; -export const solutionRequestBody: OperationParameter = { - parameterPath: ["options", "solutionRequestBody"], - mapper: SolutionResourceMapper, +export const simplifiedSolutionsRequestBody: OperationParameter = { + parameterPath: "simplifiedSolutionsRequestBody", + mapper: SimplifiedSolutionsResourceMapper, }; export const solutionResourceName: OperationURLParameter = { @@ -163,8 +146,13 @@ export const solutionResourceName: OperationURLParameter = { }, }; +export const solutionRequestBody: OperationParameter = { + parameterPath: "solutionRequestBody", + mapper: SolutionResourceMapper, +}; + export const solutionPatchRequestBody: OperationParameter = { - parameterPath: ["options", "solutionPatchRequestBody"], + parameterPath: "solutionPatchRequestBody", mapper: SolutionPatchRequestBodyMapper, }; @@ -173,20 +161,15 @@ export const solutionWarmUpRequestBody: OperationParameter = { mapper: SolutionWarmUpRequestBodyMapper, }; -export const simplifiedSolutionsRequestBody: OperationParameter = { - parameterPath: ["options", "simplifiedSolutionsRequestBody"], - mapper: SimplifiedSolutionsResourceMapper, -}; - -export const simplifiedSolutionsResourceName: OperationURLParameter = { - parameterPath: "simplifiedSolutionsResourceName", +export const troubleshooterName: OperationURLParameter = { + parameterPath: "troubleshooterName", mapper: { constraints: { - Pattern: new RegExp("^[A-Za-z0-9-+@()_]+$"), + Pattern: new RegExp("([A-Za-z0-9]+(-[A-Za-z0-9]+)+)"), MaxLength: 100, MinLength: 1, }, - serializedName: "simplifiedSolutionsResourceName", + serializedName: "troubleshooterName", required: true, type: { name: "String", @@ -195,59 +178,74 @@ export const simplifiedSolutionsResourceName: OperationURLParameter = { }; export const createTroubleshooterRequestBody: OperationParameter = { - parameterPath: ["options", "createTroubleshooterRequestBody"], + parameterPath: "createTroubleshooterRequestBody", mapper: TroubleshooterResourceMapper, }; -export const troubleshooterName: OperationURLParameter = { - parameterPath: "troubleshooterName", +export const continueRequestBody: OperationParameter = { + parameterPath: ["options", "continueRequestBody"], + mapper: ContinueRequestBodyMapper, +}; + +export const discoverSolutionRequest: OperationParameter = { + parameterPath: "discoverSolutionRequest", + mapper: DiscoveryNlpRequestMapper, +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", mapper: { - constraints: { - Pattern: new RegExp("([A-Za-z0-9]+(-[A-Za-z0-9]+)+)"), - MaxLength: 100, - MinLength: 1, - }, - serializedName: "troubleshooterName", + serializedName: "subscriptionId", required: true, type: { - name: "String", + name: "Uuid", }, }, }; -export const continueRequestBody: OperationParameter = { - parameterPath: ["options", "continueRequestBody"], - mapper: ContinueRequestBodyMapper, +export const filter: OperationQueryParameter = { + parameterPath: ["options", "filter"], + mapper: { + serializedName: "$filter", + type: { + name: "String", + }, + }, }; -export const solutionId: OperationURLParameter = { - parameterPath: "solutionId", +export const skiptoken: OperationQueryParameter = { + parameterPath: ["options", "skiptoken"], mapper: { - constraints: { - MaxLength: 100, - MinLength: 1, - }, - serializedName: "solutionId", - required: true, + serializedName: "$skiptoken", type: { name: "String", }, }, }; -export const discoverSolutionRequest: OperationParameter = { - parameterPath: ["options", "discoverSolutionRequest"], - mapper: DiscoveryNlpRequestMapper, +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, }; -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", +export const solutionId: OperationURLParameter = { + parameterPath: "solutionId", mapper: { - serializedName: "subscriptionId", + constraints: { + MaxLength: 100, + MinLength: 1, + }, + serializedName: "solutionId", required: true, type: { name: "String", }, }, - skipEncoding: true, }; diff --git a/sdk/selfhelp/arm-selfhelp/src/operations/checkNameAvailability.ts b/sdk/selfhelp/arm-selfhelp/src/operations/checkNameAvailability.ts index 8087f1087c69..e1e2eae6384e 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operations/checkNameAvailability.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operations/checkNameAvailability.ts @@ -31,19 +31,14 @@ export class CheckNameAvailabilityImpl implements CheckNameAvailability { /** * This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or * solutions - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param options The options parameters. */ checkAvailability( scope: string, options?: CheckNameAvailabilityCheckAvailabilityOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { scope, options }, - checkAvailabilityOperationSpec, - ); + return this.client.sendOperationRequest({ scope, options }, checkAvailabilityOperationSpec); } } // Operation Specifications @@ -63,7 +58,7 @@ const checkAvailabilityOperationSpec: coreClient.OperationSpec = { requestBody: Parameters.checkNameAvailabilityRequest, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.scope], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; diff --git a/sdk/selfhelp/arm-selfhelp/src/operations/diagnostics.ts b/sdk/selfhelp/arm-selfhelp/src/operations/diagnostics.ts index 731ab2df55b0..9435876d23fb 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operations/diagnostics.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operations/diagnostics.ts @@ -11,17 +11,14 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { HelpRP } from "../helpRP.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { - DiagnosticsCreateOptionalParams, - DiagnosticsCreateResponse, DiagnosticsGetOptionalParams, DiagnosticsGetResponse, + DiagnosticResource, + DiagnosticsCreateOptionalParams, + DiagnosticsCreateResponse, } from "../models/index.js"; /** Class containing Diagnostics operations. */ @@ -36,25 +33,39 @@ export class DiagnosticsImpl implements Diagnostics { this.client = client; } + /** + * Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param diagnosticsResourceName Unique resource name for insight resources + * @param options The options parameters. + */ + get( + scope: string, + diagnosticsResourceName: string, + options?: DiagnosticsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { scope, diagnosticsResourceName, options }, + getOperationSpec, + ); + } + /** * Creates a diagnostic for the specific resource using solutionId from discovery solutions. *
Diagnostics are powerful solutions that access product resources or other relevant data and * provide the root cause of the issue and the steps to address the issue.

- * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param diagnosticsResourceName Unique resource name for insight resources + * @param diagnosticResourceRequest The required request body for this insightResource invocation. * @param options The options parameters. */ async beginCreate( scope: string, diagnosticsResourceName: string, + diagnosticResourceRequest: DiagnosticResource, options?: DiagnosticsCreateOptionalParams, ): Promise< - SimplePollerLike< - OperationState, - DiagnosticsCreateResponse - > + SimplePollerLike, DiagnosticsCreateResponse> > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -66,8 +77,7 @@ export class DiagnosticsImpl implements Diagnostics { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -96,7 +106,12 @@ export class DiagnosticsImpl implements Diagnostics { const lro = createLroSpec({ sendOperationFn, - args: { scope, diagnosticsResourceName, options }, + args: { + scope, + diagnosticsResourceName, + diagnosticResourceRequest, + options, + }, spec: createOperationSpec, }); const poller = await createHttpPoller< @@ -115,47 +130,45 @@ export class DiagnosticsImpl implements Diagnostics { * Creates a diagnostic for the specific resource using solutionId from discovery solutions. *
Diagnostics are powerful solutions that access product resources or other relevant data and * provide the root cause of the issue and the steps to address the issue.

- * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param diagnosticsResourceName Unique resource name for insight resources + * @param diagnosticResourceRequest The required request body for this insightResource invocation. * @param options The options parameters. */ async beginCreateAndWait( scope: string, diagnosticsResourceName: string, + diagnosticResourceRequest: DiagnosticResource, options?: DiagnosticsCreateOptionalParams, ): Promise { const poller = await this.beginCreate( scope, diagnosticsResourceName, + diagnosticResourceRequest, options, ); return poller.pollUntilDone(); } - - /** - * Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * - * @param diagnosticsResourceName Unique resource name for insight resources - * @param options The options parameters. - */ - get( - scope: string, - diagnosticsResourceName: string, - options?: DiagnosticsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, diagnosticsResourceName, options }, - getOperationSpec, - ); - } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const getOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Help/diagnostics/{diagnosticsResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DiagnosticResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.diagnosticsResourceName], + headerParameters: [Parameters.accept], + serializer, +}; const createOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Help/diagnostics/{diagnosticsResourceName}", httpMethod: "PUT", @@ -178,32 +191,8 @@ const createOperationSpec: coreClient.OperationSpec = { }, requestBody: Parameters.diagnosticResourceRequest, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.diagnosticsResourceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.diagnosticsResourceName], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Help/diagnostics/{diagnosticsResourceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DiagnosticResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.diagnosticsResourceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolution.ts b/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolution.ts index 15ab2d95cdeb..75f331975b4c 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolution.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolution.ts @@ -123,10 +123,7 @@ export class DiscoverySolutionImpl implements DiscoverySolution { nextLink: string, options?: DiscoverySolutionListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications @@ -143,11 +140,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.skiptoken, - ], + queryParameters: [Parameters.apiVersion, Parameters.filter, Parameters.skiptoken], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer, diff --git a/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolutionNLP.ts b/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolutionNLP.ts index c21b21cb0bd4..24b03fedd093 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolutionNLP.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operations/discoverySolutionNLP.ts @@ -12,6 +12,7 @@ import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { HelpRP } from "../helpRP.js"; import { + DiscoveryNlpRequest, DiscoverySolutionNLPDiscoverSolutionsOptionalParams, DiscoverySolutionNLPDiscoverSolutionsResponse, DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams, @@ -33,13 +34,15 @@ export class DiscoverySolutionNLPImpl implements DiscoverySolutionNLP { /** * Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue * summary. + * @param discoverSolutionRequest The request body * @param options The options parameters. */ discoverSolutions( + discoverSolutionRequest: DiscoveryNlpRequest, options?: DiscoverySolutionNLPDiscoverSolutionsOptionalParams, ): Promise { return this.client.sendOperationRequest( - { options }, + { discoverSolutionRequest, options }, discoverSolutionsOperationSpec, ); } @@ -47,15 +50,15 @@ export class DiscoverySolutionNLPImpl implements DiscoverySolutionNLP { /** * Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue * summary and subscription. - * @param subscriptionId The Azure subscription ID. + * @param discoverSolutionRequest The request body * @param options The options parameters. */ discoverSolutionsBySubscription( - subscriptionId: string, + discoverSolutionRequest: DiscoveryNlpRequest, options?: DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( - { subscriptionId, options }, + { discoverSolutionRequest, options }, discoverSolutionsBySubscriptionOperationSpec, ); } @@ -77,7 +80,7 @@ const discoverSolutionsOperationSpec: coreClient.OperationSpec = { requestBody: Parameters.discoverSolutionRequest, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; @@ -95,7 +98,7 @@ const discoverSolutionsBySubscriptionOperationSpec: coreClient.OperationSpec = { requestBody: Parameters.discoverSolutionRequest, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept, Parameters.contentType], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; diff --git a/sdk/selfhelp/arm-selfhelp/src/operations/index.ts b/sdk/selfhelp/arm-selfhelp/src/operations/index.ts index 69cff357a47e..f020bf13f2a7 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operations/index.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operations/index.ts @@ -6,12 +6,12 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./operations.js"; export * from "./checkNameAvailability.js"; export * from "./diagnostics.js"; -export * from "./discoverySolution.js"; -export * from "./solution.js"; export * from "./simplifiedSolutions.js"; +export * from "./solution.js"; export * from "./troubleshooters.js"; -export * from "./solutionSelfHelp.js"; export * from "./discoverySolutionNLP.js"; +export * from "./discoverySolution.js"; +export * from "./operations.js"; +export * from "./solutionSelfHelp.js"; diff --git a/sdk/selfhelp/arm-selfhelp/src/operations/operations.ts b/sdk/selfhelp/arm-selfhelp/src/operations/operations.ts index c75ae4db5915..f0a168a4f464 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operations/operations.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operations/operations.ts @@ -35,12 +35,10 @@ export class OperationsImpl implements Operations { } /** - * Returns list of operations. + * List the operations for the provider * @param options The options parameters. */ - public list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator { + public list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -89,12 +87,10 @@ export class OperationsImpl implements Operations { } /** - * Returns list of operations. + * List the operations for the provider * @param options The options parameters. */ - private _list( - options?: OperationsListOptionalParams, - ): Promise { + private _list(options?: OperationsListOptionalParams): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -107,10 +103,7 @@ export class OperationsImpl implements Operations { nextLink: string, options?: OperationsListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); + return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); } } // Operation Specifications diff --git a/sdk/selfhelp/arm-selfhelp/src/operations/simplifiedSolutions.ts b/sdk/selfhelp/arm-selfhelp/src/operations/simplifiedSolutions.ts index 6c40fbbf3b87..bb3544014205 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operations/simplifiedSolutions.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operations/simplifiedSolutions.ts @@ -11,17 +11,14 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { HelpRP } from "../helpRP.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { - SimplifiedSolutionsCreateOptionalParams, - SimplifiedSolutionsCreateResponse, SimplifiedSolutionsGetOptionalParams, SimplifiedSolutionsGetResponse, + SimplifiedSolutionsResource, + SimplifiedSolutionsCreateOptionalParams, + SimplifiedSolutionsCreateResponse, } from "../models/index.js"; /** Class containing SimplifiedSolutions operations. */ @@ -36,6 +33,24 @@ export class SimplifiedSolutionsImpl implements SimplifiedSolutions { this.client = client; } + /** + * Get the simplified Solutions using the applicable solutionResourceName while creating the simplified + * Solutions. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param simplifiedSolutionsResourceName Simplified Solutions Resource Name. + * @param options The options parameters. + */ + get( + scope: string, + simplifiedSolutionsResourceName: string, + options?: SimplifiedSolutionsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { scope, simplifiedSolutionsResourceName, options }, + getOperationSpec, + ); + } + /** * Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions * as the input.

Simplified Solutions API makes the consumption of solutions APIs easier @@ -43,15 +58,16 @@ export class SimplifiedSolutionsImpl implements SimplifiedSolutions { * Simplified Solutions, users don't have to worry about stitching together the article using * replacement maps and can use the content in the API response to directly render as HTML * content.
- * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param simplifiedSolutionsResourceName Simplified Solutions Resource Name. + * @param simplifiedSolutionsRequestBody The required request body for simplified Solutions resource + * creation. * @param options The options parameters. */ async beginCreate( scope: string, simplifiedSolutionsResourceName: string, + simplifiedSolutionsRequestBody: SimplifiedSolutionsResource, options?: SimplifiedSolutionsCreateOptionalParams, ): Promise< SimplePollerLike< @@ -69,8 +85,7 @@ export class SimplifiedSolutionsImpl implements SimplifiedSolutions { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -99,7 +114,12 @@ export class SimplifiedSolutionsImpl implements SimplifiedSolutions { const lro = createLroSpec({ sendOperationFn, - args: { scope, simplifiedSolutionsResourceName, options }, + args: { + scope, + simplifiedSolutionsResourceName, + simplifiedSolutionsRequestBody, + options, + }, spec: createOperationSpec, }); const poller = await createHttpPoller< @@ -121,48 +141,46 @@ export class SimplifiedSolutionsImpl implements SimplifiedSolutions { * Simplified Solutions, users don't have to worry about stitching together the article using * replacement maps and can use the content in the API response to directly render as HTML * content.
- * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param simplifiedSolutionsResourceName Simplified Solutions Resource Name. + * @param simplifiedSolutionsRequestBody The required request body for simplified Solutions resource + * creation. * @param options The options parameters. */ async beginCreateAndWait( scope: string, simplifiedSolutionsResourceName: string, + simplifiedSolutionsRequestBody: SimplifiedSolutionsResource, options?: SimplifiedSolutionsCreateOptionalParams, ): Promise { const poller = await this.beginCreate( scope, simplifiedSolutionsResourceName, + simplifiedSolutionsRequestBody, options, ); return poller.pollUntilDone(); } - - /** - * Get the simplified Solutions using the applicable solutionResourceName while creating the simplified - * Solutions. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * - * @param simplifiedSolutionsResourceName Simplified Solutions Resource Name. - * @param options The options parameters. - */ - get( - scope: string, - simplifiedSolutionsResourceName: string, - options?: SimplifiedSolutionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, simplifiedSolutionsResourceName, options }, - getOperationSpec, - ); - } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const getOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Help/simplifiedSolutions/{simplifiedSolutionsResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SimplifiedSolutionsResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.simplifiedSolutionsResourceName], + headerParameters: [Parameters.accept], + serializer, +}; const createOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Help/simplifiedSolutions/{simplifiedSolutionsResourceName}", httpMethod: "PUT", @@ -185,32 +203,8 @@ const createOperationSpec: coreClient.OperationSpec = { }, requestBody: Parameters.simplifiedSolutionsRequestBody, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.simplifiedSolutionsResourceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.simplifiedSolutionsResourceName], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Help/simplifiedSolutions/{simplifiedSolutionsResourceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SimplifiedSolutionsResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.simplifiedSolutionsResourceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/selfhelp/arm-selfhelp/src/operations/solution.ts b/sdk/selfhelp/arm-selfhelp/src/operations/solution.ts index d4afa182d4e0..05e9db7307e9 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operations/solution.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operations/solution.ts @@ -11,17 +11,15 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { HelpRP } from "../helpRP.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; +import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl.js"; import { - SolutionCreateOptionalParams, - SolutionCreateResponse, SolutionGetOptionalParams, SolutionGetResponse, + SolutionResource, + SolutionCreateOptionalParams, + SolutionCreateResponse, + SolutionPatchRequestBody, SolutionUpdateOptionalParams, SolutionUpdateResponse, SolutionWarmUpOptionalParams, @@ -39,6 +37,23 @@ export class SolutionImpl implements Solution { this.client = client; } + /** + * Get the solution using the applicable solutionResourceName while creating the solution. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param solutionResourceName Solution resource Name. + * @param options The options parameters. + */ + get( + scope: string, + solutionResourceName: string, + options?: SolutionGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { scope, solutionResourceName, options }, + getOperationSpec, + ); + } + /** * Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and * requiredInputs’ from discovery solutions.
Azure solutions comprise a comprehensive library of @@ -48,22 +63,17 @@ export class SolutionImpl implements Solution { * instructional video tutorials and illustrative diagrams and images.
(3.) Thoughtfully * assembled textual troubleshooting instructions.
All these components are seamlessly converged * into unified solutions tailored to address a specific support problem area. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param solutionResourceName Solution resource Name. + * @param solutionRequestBody The required request body for this solution resource creation. * @param options The options parameters. */ async beginCreate( scope: string, solutionResourceName: string, + solutionRequestBody: SolutionResource, options?: SolutionCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - SolutionCreateResponse - > - > { + ): Promise, SolutionCreateResponse>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, @@ -74,8 +84,7 @@ export class SolutionImpl implements Solution { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -104,7 +113,7 @@ export class SolutionImpl implements Solution { const lro = createLroSpec({ sendOperationFn, - args: { scope, solutionResourceName, options }, + args: { scope, solutionResourceName, solutionRequestBody, options }, spec: createOperationSpec, }); const poller = await createHttpPoller< @@ -128,58 +137,39 @@ export class SolutionImpl implements Solution { * instructional video tutorials and illustrative diagrams and images.
(3.) Thoughtfully * assembled textual troubleshooting instructions.
All these components are seamlessly converged * into unified solutions tailored to address a specific support problem area. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param solutionResourceName Solution resource Name. + * @param solutionRequestBody The required request body for this solution resource creation. * @param options The options parameters. */ async beginCreateAndWait( scope: string, solutionResourceName: string, + solutionRequestBody: SolutionResource, options?: SolutionCreateOptionalParams, ): Promise { - const poller = await this.beginCreate(scope, solutionResourceName, options); - return poller.pollUntilDone(); - } - - /** - * Get the solution using the applicable solutionResourceName while creating the solution. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * - * @param solutionResourceName Solution resource Name. - * @param options The options parameters. - */ - get( - scope: string, - solutionResourceName: string, - options?: SolutionGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, solutionResourceName, options }, - getOperationSpec, + const poller = await this.beginCreate( + scope, + solutionResourceName, + solutionRequestBody, + options, ); + return poller.pollUntilDone(); } /** * Update the requiredInputs or additional information needed to execute the solution - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param solutionResourceName Solution resource Name. + * @param solutionPatchRequestBody The required request body for updating a solution resource. * @param options The options parameters. */ async beginUpdate( scope: string, solutionResourceName: string, + solutionPatchRequestBody: SolutionPatchRequestBody, options?: SolutionUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - SolutionUpdateResponse - > - > { + ): Promise, SolutionUpdateResponse>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, @@ -190,8 +180,7 @@ export class SolutionImpl implements Solution { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -220,7 +209,7 @@ export class SolutionImpl implements Solution { const lro = createLroSpec({ sendOperationFn, - args: { scope, solutionResourceName, options }, + args: { scope, solutionResourceName, solutionPatchRequestBody, options }, spec: updateOperationSpec, }); const poller = await createHttpPoller< @@ -237,26 +226,29 @@ export class SolutionImpl implements Solution { /** * Update the requiredInputs or additional information needed to execute the solution - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param solutionResourceName Solution resource Name. + * @param solutionPatchRequestBody The required request body for updating a solution resource. * @param options The options parameters. */ async beginUpdateAndWait( scope: string, solutionResourceName: string, + solutionPatchRequestBody: SolutionPatchRequestBody, options?: SolutionUpdateOptionalParams, ): Promise { - const poller = await this.beginUpdate(scope, solutionResourceName, options); + const poller = await this.beginUpdate( + scope, + solutionResourceName, + solutionPatchRequestBody, + options, + ); return poller.pollUntilDone(); } /** * Warm up the solution resource by preloading asynchronous diagnostics results into cache - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param solutionResourceName Solution resource Name. * @param options The options parameters. */ @@ -274,6 +266,22 @@ export class SolutionImpl implements Solution { // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const getOperationSpec: coreClient.OperationSpec = { + path: "/{scope}/providers/Microsoft.Help/solutions/{solutionResourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SolutionResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.solutionResourceName], + headerParameters: [Parameters.accept], + serializer, +}; const createOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Help/solutions/{solutionResourceName}", httpMethod: "PUT", @@ -296,54 +304,26 @@ const createOperationSpec: coreClient.OperationSpec = { }, requestBody: Parameters.solutionRequestBody, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.solutionResourceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.solutionResourceName], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; -const getOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Help/solutions/{solutionResourceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SolutionResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.solutionResourceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; const updateOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Help/solutions/{solutionResourceName}", httpMethod: "PATCH", responses: { 200: { bodyMapper: Mappers.SolutionResource, - headersMapper: Mappers.SolutionUpdateHeaders, }, 201: { bodyMapper: Mappers.SolutionResource, - headersMapper: Mappers.SolutionUpdateHeaders, }, 202: { bodyMapper: Mappers.SolutionResource, - headersMapper: Mappers.SolutionUpdateHeaders, }, 204: { bodyMapper: Mappers.SolutionResource, - headersMapper: Mappers.SolutionUpdateHeaders, }, default: { bodyMapper: Mappers.ErrorResponse, @@ -351,12 +331,8 @@ const updateOperationSpec: coreClient.OperationSpec = { }, requestBody: Parameters.solutionPatchRequestBody, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.solutionResourceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.solutionResourceName], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; @@ -371,12 +347,8 @@ const warmUpOperationSpec: coreClient.OperationSpec = { }, requestBody: Parameters.solutionWarmUpRequestBody, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.solutionResourceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.solutionResourceName], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; diff --git a/sdk/selfhelp/arm-selfhelp/src/operations/solutionSelfHelp.ts b/sdk/selfhelp/arm-selfhelp/src/operations/solutionSelfHelp.ts index 5393f147a9d5..3233bcf749fc 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operations/solutionSelfHelp.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operations/solutionSelfHelp.ts @@ -11,10 +11,7 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { HelpRP } from "../helpRP.js"; -import { - SolutionSelfHelpGetOptionalParams, - SolutionSelfHelpGetResponse, -} from "../models/index.js"; +import { SolutionSelfHelpGetOptionalParams, SolutionSelfHelpGetResponse } from "../models/index.js"; /** Class containing SolutionSelfHelp operations. */ export class SolutionSelfHelpImpl implements SolutionSelfHelp { @@ -41,10 +38,7 @@ export class SolutionSelfHelpImpl implements SolutionSelfHelp { solutionId: string, options?: SolutionSelfHelpGetOptionalParams, ): Promise { - return this.client.sendOperationRequest( - { solutionId, options }, - getOperationSpec, - ); + return this.client.sendOperationRequest({ solutionId, options }, getOperationSpec); } } // Operation Specifications diff --git a/sdk/selfhelp/arm-selfhelp/src/operations/troubleshooters.ts b/sdk/selfhelp/arm-selfhelp/src/operations/troubleshooters.ts index 9bd4c3d054fe..c70adfaf60f5 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operations/troubleshooters.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operations/troubleshooters.ts @@ -12,14 +12,13 @@ import * as Mappers from "../models/mappers.js"; import * as Parameters from "../models/parameters.js"; import { HelpRP } from "../helpRP.js"; import { - TroubleshootersCreateOptionalParams, - TroubleshootersCreateResponse, TroubleshootersGetOptionalParams, TroubleshootersGetResponse, + TroubleshooterResource, + TroubleshootersCreateOptionalParams, + TroubleshootersCreateResponse, TroubleshootersContinueOptionalParams, - TroubleshootersContinueResponse, TroubleshootersEndOptionalParams, - TroubleshootersEndResponse, TroubleshootersRestartOptionalParams, TroubleshootersRestartResponse, } from "../models/index.js"; @@ -36,6 +35,26 @@ export class TroubleshootersImpl implements Troubleshooters { this.client = client; } + /** + * Gets troubleshooter instance result which includes the step status/result of the troubleshooter + * resource name that is being executed.
Get API is used to retrieve the result of a + * Troubleshooter instance, which includes the status and result of each step in the Troubleshooter + * workflow. This API requires the Troubleshooter resource name that was created using the Create API. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param troubleshooterName Troubleshooter resource Name. + * @param options The options parameters. + */ + get( + scope: string, + troubleshooterName: string, + options?: TroubleshootersGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { scope, troubleshooterName, options }, + getOperationSpec, + ); + } + /** * Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ * and ‘properties.parameters’ as the trigger.
Azure Troubleshooters help with hard to classify @@ -45,53 +64,30 @@ export class TroubleshootersImpl implements Troubleshooters { * prepared with the help of Subject Matter experts and customer support engineers by carefully * considering previous support requests raised by customers. Troubleshooters terminate at a well * curated solution based off of resource backend signals and customer manual selections. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param troubleshooterName Troubleshooter resource Name. + * @param createTroubleshooterRequestBody The required request body for this Troubleshooter resource + * creation. * @param options The options parameters. */ create( scope: string, troubleshooterName: string, + createTroubleshooterRequestBody: TroubleshooterResource, options?: TroubleshootersCreateOptionalParams, ): Promise { return this.client.sendOperationRequest( - { scope, troubleshooterName, options }, + { scope, troubleshooterName, createTroubleshooterRequestBody, options }, createOperationSpec, ); } - /** - * Gets troubleshooter instance result which includes the step status/result of the troubleshooter - * resource name that is being executed.
Get API is used to retrieve the result of a - * Troubleshooter instance, which includes the status and result of each step in the Troubleshooter - * workflow. This API requires the Troubleshooter resource name that was created using the Create API. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * - * @param troubleshooterName Troubleshooter resource Name. - * @param options The options parameters. - */ - get( - scope: string, - troubleshooterName: string, - options?: TroubleshootersGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { scope, troubleshooterName, options }, - getOperationSpec, - ); - } - /** * Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the * respective troubleshooter resource name.
Continue API is used to provide inputs that are * required for the specific troubleshooter to progress into the next step in the process. This API is * used after the Troubleshooter has been created using the Create API. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param troubleshooterName Troubleshooter resource Name. * @param options The options parameters. */ @@ -99,7 +95,7 @@ export class TroubleshootersImpl implements Troubleshooters { scope: string, troubleshooterName: string, options?: TroubleshootersContinueOptionalParams, - ): Promise { + ): Promise { return this.client.sendOperationRequest( { scope, troubleshooterName, options }, continueOperationSpec, @@ -108,9 +104,7 @@ export class TroubleshootersImpl implements Troubleshooters { /** * Ends the troubleshooter action - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param troubleshooterName Troubleshooter resource Name. * @param options The options parameters. */ @@ -118,7 +112,7 @@ export class TroubleshootersImpl implements Troubleshooters { scope: string, troubleshooterName: string, options?: TroubleshootersEndOptionalParams, - ): Promise { + ): Promise { return this.client.sendOperationRequest( { scope, troubleshooterName, options }, endOperationSpec, @@ -129,9 +123,7 @@ export class TroubleshootersImpl implements Troubleshooters { * Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It * returns new resource name which should be used in subsequent request. The old resource name is * obsolete after this API is invoked. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param troubleshooterName Troubleshooter resource Name. * @param options The options parameters. */ @@ -149,70 +141,56 @@ export class TroubleshootersImpl implements Troubleshooters { // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const createOperationSpec: coreClient.OperationSpec = { +const getOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Help/troubleshooters/{troubleshooterName}", - httpMethod: "PUT", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.TroubleshooterResource, }, - 201: { - bodyMapper: Mappers.TroubleshooterResource, - }, default: { bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.createTroubleshooterRequestBody, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.troubleshooterName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", + urlParameters: [Parameters.$host, Parameters.scope, Parameters.troubleshooterName], + headerParameters: [Parameters.accept], serializer, }; -const getOperationSpec: coreClient.OperationSpec = { +const createOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Help/troubleshooters/{troubleshooterName}", - httpMethod: "GET", + httpMethod: "PUT", responses: { 200: { bodyMapper: Mappers.TroubleshooterResource, }, + 201: { + bodyMapper: Mappers.TroubleshooterResource, + }, default: { bodyMapper: Mappers.ErrorResponse, }, }, + requestBody: Parameters.createTroubleshooterRequestBody, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.troubleshooterName, - ], - headerParameters: [Parameters.accept], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.troubleshooterName], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", serializer, }; const continueOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Help/troubleshooters/{troubleshooterName}/continue", httpMethod: "POST", responses: { - 204: { - headersMapper: Mappers.TroubleshootersContinueHeaders, - }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse, }, }, requestBody: Parameters.continueRequestBody, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.troubleshooterName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.troubleshooterName], + headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; @@ -220,19 +198,13 @@ const endOperationSpec: coreClient.OperationSpec = { path: "/{scope}/providers/Microsoft.Help/troubleshooters/{troubleshooterName}/end", httpMethod: "POST", responses: { - 204: { - headersMapper: Mappers.TroubleshootersEndHeaders, - }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.troubleshooterName, - ], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.troubleshooterName], headerParameters: [Parameters.accept], serializer, }; @@ -242,18 +214,13 @@ const restartOperationSpec: coreClient.OperationSpec = { responses: { 200: { bodyMapper: Mappers.RestartTroubleshooterResponse, - headersMapper: Mappers.TroubleshootersRestartHeaders, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.scope, - Parameters.troubleshooterName, - ], + urlParameters: [Parameters.$host, Parameters.scope, Parameters.troubleshooterName], headerParameters: [Parameters.accept], serializer, }; diff --git a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/checkNameAvailability.ts b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/checkNameAvailability.ts index 76eecf646de2..83a142a29f0b 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/checkNameAvailability.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/checkNameAvailability.ts @@ -16,9 +16,7 @@ export interface CheckNameAvailability { /** * This API is used to check the uniqueness of a resource name used for a diagnostic, troubleshooter or * solutions - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param options The options parameters. */ checkAvailability( diff --git a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/diagnostics.ts b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/diagnostics.ts index b9650156760e..d8da09f0677b 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/diagnostics.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/diagnostics.ts @@ -8,60 +8,56 @@ import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { - DiagnosticsCreateOptionalParams, - DiagnosticsCreateResponse, DiagnosticsGetOptionalParams, DiagnosticsGetResponse, + DiagnosticResource, + DiagnosticsCreateOptionalParams, + DiagnosticsCreateResponse, } from "../models/index.js"; /** Interface representing a Diagnostics. */ export interface Diagnostics { + /** + * Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param diagnosticsResourceName Unique resource name for insight resources + * @param options The options parameters. + */ + get( + scope: string, + diagnosticsResourceName: string, + options?: DiagnosticsGetOptionalParams, + ): Promise; /** * Creates a diagnostic for the specific resource using solutionId from discovery solutions. *
Diagnostics are powerful solutions that access product resources or other relevant data and * provide the root cause of the issue and the steps to address the issue.

- * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param diagnosticsResourceName Unique resource name for insight resources + * @param diagnosticResourceRequest The required request body for this insightResource invocation. * @param options The options parameters. */ beginCreate( scope: string, diagnosticsResourceName: string, + diagnosticResourceRequest: DiagnosticResource, options?: DiagnosticsCreateOptionalParams, ): Promise< - SimplePollerLike< - OperationState, - DiagnosticsCreateResponse - > + SimplePollerLike, DiagnosticsCreateResponse> >; /** * Creates a diagnostic for the specific resource using solutionId from discovery solutions. *
Diagnostics are powerful solutions that access product resources or other relevant data and * provide the root cause of the issue and the steps to address the issue.

- * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param diagnosticsResourceName Unique resource name for insight resources + * @param diagnosticResourceRequest The required request body for this insightResource invocation. * @param options The options parameters. */ beginCreateAndWait( scope: string, diagnosticsResourceName: string, + diagnosticResourceRequest: DiagnosticResource, options?: DiagnosticsCreateOptionalParams, ): Promise; - /** - * Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * - * @param diagnosticsResourceName Unique resource name for insight resources - * @param options The options parameters. - */ - get( - scope: string, - diagnosticsResourceName: string, - options?: DiagnosticsGetOptionalParams, - ): Promise; } diff --git a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolution.ts b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolution.ts index e9983524ab8f..c4d005b31a60 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolution.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolution.ts @@ -7,10 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - SolutionMetadataResource, - DiscoverySolutionListOptionalParams, -} from "../models/index.js"; +import { SolutionMetadataResource, DiscoverySolutionListOptionalParams } from "../models/index.js"; /// /** Interface representing a DiscoverySolution. */ diff --git a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolutionNLP.ts b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolutionNLP.ts index f7884998bd19..8a9249bdc531 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolutionNLP.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/discoverySolutionNLP.ts @@ -7,6 +7,7 @@ */ import { + DiscoveryNlpRequest, DiscoverySolutionNLPDiscoverSolutionsOptionalParams, DiscoverySolutionNLPDiscoverSolutionsResponse, DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams, @@ -18,19 +19,21 @@ export interface DiscoverySolutionNLP { /** * Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue * summary. + * @param discoverSolutionRequest The request body * @param options The options parameters. */ discoverSolutions( + discoverSolutionRequest: DiscoveryNlpRequest, options?: DiscoverySolutionNLPDiscoverSolutionsOptionalParams, ): Promise; /** * Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue * summary and subscription. - * @param subscriptionId The Azure subscription ID. + * @param discoverSolutionRequest The request body * @param options The options parameters. */ discoverSolutionsBySubscription( - subscriptionId: string, + discoverSolutionRequest: DiscoveryNlpRequest, options?: DiscoverySolutionNLPDiscoverSolutionsBySubscriptionOptionalParams, ): Promise; } diff --git a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/index.ts b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/index.ts index 69cff357a47e..f020bf13f2a7 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/index.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/index.ts @@ -6,12 +6,12 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./operations.js"; export * from "./checkNameAvailability.js"; export * from "./diagnostics.js"; -export * from "./discoverySolution.js"; -export * from "./solution.js"; export * from "./simplifiedSolutions.js"; +export * from "./solution.js"; export * from "./troubleshooters.js"; -export * from "./solutionSelfHelp.js"; export * from "./discoverySolutionNLP.js"; +export * from "./discoverySolution.js"; +export * from "./operations.js"; +export * from "./solutionSelfHelp.js"; diff --git a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/operations.ts b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/operations.ts index e46483f09fd0..a3957b6a87d0 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/operations.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/operations.ts @@ -13,10 +13,8 @@ import { Operation, OperationsListOptionalParams } from "../models/index.js"; /** Interface representing a Operations. */ export interface Operations { /** - * Returns list of operations. + * List the operations for the provider * @param options The options parameters. */ - list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator; + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } diff --git a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/simplifiedSolutions.ts b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/simplifiedSolutions.ts index 6ec2246b4e1d..429c2c805978 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/simplifiedSolutions.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/simplifiedSolutions.ts @@ -8,14 +8,27 @@ import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { - SimplifiedSolutionsCreateOptionalParams, - SimplifiedSolutionsCreateResponse, SimplifiedSolutionsGetOptionalParams, SimplifiedSolutionsGetResponse, + SimplifiedSolutionsResource, + SimplifiedSolutionsCreateOptionalParams, + SimplifiedSolutionsCreateResponse, } from "../models/index.js"; /** Interface representing a SimplifiedSolutions. */ export interface SimplifiedSolutions { + /** + * Get the simplified Solutions using the applicable solutionResourceName while creating the simplified + * Solutions. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param simplifiedSolutionsResourceName Simplified Solutions Resource Name. + * @param options The options parameters. + */ + get( + scope: string, + simplifiedSolutionsResourceName: string, + options?: SimplifiedSolutionsGetOptionalParams, + ): Promise; /** * Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions * as the input.

Simplified Solutions API makes the consumption of solutions APIs easier @@ -23,15 +36,16 @@ export interface SimplifiedSolutions { * Simplified Solutions, users don't have to worry about stitching together the article using * replacement maps and can use the content in the API response to directly render as HTML * content.
- * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param simplifiedSolutionsResourceName Simplified Solutions Resource Name. + * @param simplifiedSolutionsRequestBody The required request body for simplified Solutions resource + * creation. * @param options The options parameters. */ beginCreate( scope: string, simplifiedSolutionsResourceName: string, + simplifiedSolutionsRequestBody: SimplifiedSolutionsResource, options?: SimplifiedSolutionsCreateOptionalParams, ): Promise< SimplePollerLike< @@ -46,29 +60,16 @@ export interface SimplifiedSolutions { * Simplified Solutions, users don't have to worry about stitching together the article using * replacement maps and can use the content in the API response to directly render as HTML * content.
- * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param simplifiedSolutionsResourceName Simplified Solutions Resource Name. + * @param simplifiedSolutionsRequestBody The required request body for simplified Solutions resource + * creation. * @param options The options parameters. */ beginCreateAndWait( scope: string, simplifiedSolutionsResourceName: string, + simplifiedSolutionsRequestBody: SimplifiedSolutionsResource, options?: SimplifiedSolutionsCreateOptionalParams, ): Promise; - /** - * Get the simplified Solutions using the applicable solutionResourceName while creating the simplified - * Solutions. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * - * @param simplifiedSolutionsResourceName Simplified Solutions Resource Name. - * @param options The options parameters. - */ - get( - scope: string, - simplifiedSolutionsResourceName: string, - options?: SimplifiedSolutionsGetOptionalParams, - ): Promise; } diff --git a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/solution.ts b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/solution.ts index 986a36f02f64..4378f7ad1141 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/solution.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/solution.ts @@ -8,10 +8,12 @@ import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { - SolutionCreateOptionalParams, - SolutionCreateResponse, SolutionGetOptionalParams, SolutionGetResponse, + SolutionResource, + SolutionCreateOptionalParams, + SolutionCreateResponse, + SolutionPatchRequestBody, SolutionUpdateOptionalParams, SolutionUpdateResponse, SolutionWarmUpOptionalParams, @@ -19,6 +21,17 @@ import { /** Interface representing a Solution. */ export interface Solution { + /** + * Get the solution using the applicable solutionResourceName while creating the solution. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param solutionResourceName Solution resource Name. + * @param options The options parameters. + */ + get( + scope: string, + solutionResourceName: string, + options?: SolutionGetOptionalParams, + ): Promise; /** * Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and * requiredInputs’ from discovery solutions.
Azure solutions comprise a comprehensive library of @@ -28,22 +41,17 @@ export interface Solution { * instructional video tutorials and illustrative diagrams and images.
(3.) Thoughtfully * assembled textual troubleshooting instructions.
All these components are seamlessly converged * into unified solutions tailored to address a specific support problem area. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param solutionResourceName Solution resource Name. + * @param solutionRequestBody The required request body for this solution resource creation. * @param options The options parameters. */ beginCreate( scope: string, solutionResourceName: string, + solutionRequestBody: SolutionResource, options?: SolutionCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - SolutionCreateResponse - > - >; + ): Promise, SolutionCreateResponse>>; /** * Creates a solution for the specific Azure resource or subscription using the inputs ‘solutionId and * requiredInputs’ from discovery solutions.
Azure solutions comprise a comprehensive library of @@ -53,66 +61,46 @@ export interface Solution { * instructional video tutorials and illustrative diagrams and images.
(3.) Thoughtfully * assembled textual troubleshooting instructions.
All these components are seamlessly converged * into unified solutions tailored to address a specific support problem area. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param solutionResourceName Solution resource Name. + * @param solutionRequestBody The required request body for this solution resource creation. * @param options The options parameters. */ beginCreateAndWait( scope: string, solutionResourceName: string, + solutionRequestBody: SolutionResource, options?: SolutionCreateOptionalParams, ): Promise; - /** - * Get the solution using the applicable solutionResourceName while creating the solution. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * - * @param solutionResourceName Solution resource Name. - * @param options The options parameters. - */ - get( - scope: string, - solutionResourceName: string, - options?: SolutionGetOptionalParams, - ): Promise; /** * Update the requiredInputs or additional information needed to execute the solution - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param solutionResourceName Solution resource Name. + * @param solutionPatchRequestBody The required request body for updating a solution resource. * @param options The options parameters. */ beginUpdate( scope: string, solutionResourceName: string, + solutionPatchRequestBody: SolutionPatchRequestBody, options?: SolutionUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - SolutionUpdateResponse - > - >; + ): Promise, SolutionUpdateResponse>>; /** * Update the requiredInputs or additional information needed to execute the solution - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param solutionResourceName Solution resource Name. + * @param solutionPatchRequestBody The required request body for updating a solution resource. * @param options The options parameters. */ beginUpdateAndWait( scope: string, solutionResourceName: string, + solutionPatchRequestBody: SolutionPatchRequestBody, options?: SolutionUpdateOptionalParams, ): Promise; /** * Warm up the solution resource by preloading asynchronous diagnostics results into cache - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param solutionResourceName Solution resource Name. * @param options The options parameters. */ diff --git a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/solutionSelfHelp.ts b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/solutionSelfHelp.ts index dffa80c994da..916c5605f3e3 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/solutionSelfHelp.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/solutionSelfHelp.ts @@ -6,10 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { - SolutionSelfHelpGetOptionalParams, - SolutionSelfHelpGetResponse, -} from "../models/index.js"; +import { SolutionSelfHelpGetOptionalParams, SolutionSelfHelpGetResponse } from "../models/index.js"; /** Interface representing a SolutionSelfHelp. */ export interface SolutionSelfHelp { diff --git a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/troubleshooters.ts b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/troubleshooters.ts index 758a7cf589e1..66aea2ec9277 100644 --- a/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/troubleshooters.ts +++ b/sdk/selfhelp/arm-selfhelp/src/operationsInterfaces/troubleshooters.ts @@ -7,20 +7,33 @@ */ import { - TroubleshootersCreateOptionalParams, - TroubleshootersCreateResponse, TroubleshootersGetOptionalParams, TroubleshootersGetResponse, + TroubleshooterResource, + TroubleshootersCreateOptionalParams, + TroubleshootersCreateResponse, TroubleshootersContinueOptionalParams, - TroubleshootersContinueResponse, TroubleshootersEndOptionalParams, - TroubleshootersEndResponse, TroubleshootersRestartOptionalParams, TroubleshootersRestartResponse, } from "../models/index.js"; /** Interface representing a Troubleshooters. */ export interface Troubleshooters { + /** + * Gets troubleshooter instance result which includes the step status/result of the troubleshooter + * resource name that is being executed.
Get API is used to retrieve the result of a + * Troubleshooter instance, which includes the status and result of each step in the Troubleshooter + * workflow. This API requires the Troubleshooter resource name that was created using the Create API. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param troubleshooterName Troubleshooter resource Name. + * @param options The options parameters. + */ + get( + scope: string, + troubleshooterName: string, + options?: TroubleshootersGetOptionalParams, + ): Promise; /** * Creates the specific troubleshooter action under a resource or subscription using the ‘solutionId’ * and ‘properties.parameters’ as the trigger.
Azure Troubleshooters help with hard to classify @@ -30,41 +43,24 @@ export interface Troubleshooters { * prepared with the help of Subject Matter experts and customer support engineers by carefully * considering previous support requests raised by customers. Troubleshooters terminate at a well * curated solution based off of resource backend signals and customer manual selections. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param troubleshooterName Troubleshooter resource Name. + * @param createTroubleshooterRequestBody The required request body for this Troubleshooter resource + * creation. * @param options The options parameters. */ create( scope: string, troubleshooterName: string, + createTroubleshooterRequestBody: TroubleshooterResource, options?: TroubleshootersCreateOptionalParams, ): Promise; - /** - * Gets troubleshooter instance result which includes the step status/result of the troubleshooter - * resource name that is being executed.
Get API is used to retrieve the result of a - * Troubleshooter instance, which includes the status and result of each step in the Troubleshooter - * workflow. This API requires the Troubleshooter resource name that was created using the Create API. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * - * @param troubleshooterName Troubleshooter resource Name. - * @param options The options parameters. - */ - get( - scope: string, - troubleshooterName: string, - options?: TroubleshootersGetOptionalParams, - ): Promise; /** * Uses ‘stepId’ and ‘responses’ as the trigger to continue the troubleshooting steps for the * respective troubleshooter resource name.
Continue API is used to provide inputs that are * required for the specific troubleshooter to progress into the next step in the process. This API is * used after the Troubleshooter has been created using the Create API. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param troubleshooterName Troubleshooter resource Name. * @param options The options parameters. */ @@ -72,12 +68,10 @@ export interface Troubleshooters { scope: string, troubleshooterName: string, options?: TroubleshootersContinueOptionalParams, - ): Promise; + ): Promise; /** * Ends the troubleshooter action - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param troubleshooterName Troubleshooter resource Name. * @param options The options parameters. */ @@ -85,14 +79,12 @@ export interface Troubleshooters { scope: string, troubleshooterName: string, options?: TroubleshootersEndOptionalParams, - ): Promise; + ): Promise; /** * Restarts the troubleshooter API using applicable troubleshooter resource name as the input.
It * returns new resource name which should be used in subsequent request. The old resource name is * obsolete after this API is invoked. - * @param scope scope = resourceUri of affected resource.
For example: - * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read - * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param troubleshooterName Troubleshooter resource Name. * @param options The options parameters. */ diff --git a/sdk/selfhelp/arm-selfhelp/src/pagingHelper.ts b/sdk/selfhelp/arm-selfhelp/src/pagingHelper.ts index 205cccc26592..e362819bdfc4 100644 --- a/sdk/selfhelp/arm-selfhelp/src/pagingHelper.ts +++ b/sdk/selfhelp/arm-selfhelp/src/pagingHelper.ts @@ -26,10 +26,7 @@ export function getContinuationToken(page: unknown): string | undefined { return pageMap.get(page)?.continuationToken; } -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined, -): void { +export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { if (typeof page !== "object" || page === null || !continuationToken) { return; } diff --git a/sdk/selfhelp/arm-selfhelp/test/sampleTest.spec.ts b/sdk/selfhelp/arm-selfhelp/test/sampleTest.spec.ts new file mode 100644 index 000000000000..90b3c8a868b4 --- /dev/null +++ b/sdk/selfhelp/arm-selfhelp/test/sampleTest.spec.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { Recorder, RecorderStartOptions } from "@azure-tools/test-recorder"; +import { afterEach, beforeEach, describe, it, assert } from "vitest"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async () => { + recorder = new Recorder(); + await recorder.start(recorderOptions); + }); + + afterEach(async () => { + await recorder.stop(); + }); + + it("sample test", async () => { + assert(true); + }); +}); diff --git a/sdk/selfhelp/arm-selfhelp/test/selfhelp_operations_test.spec.ts b/sdk/selfhelp/arm-selfhelp/test/selfhelp_operations_test.spec.ts deleted file mode 100644 index 72db461da768..000000000000 --- a/sdk/selfhelp/arm-selfhelp/test/selfhelp_operations_test.spec.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { env, Recorder, RecorderStartOptions, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { HelpRP } from "../src/helpRP.js"; -import { describe, it, assert, beforeEach, afterEach } from "vitest"; - -const replaceableVariables: Record = { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id", -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables, - removeCentralSanitizers: [ - "AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section - "AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section - ], -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("help test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: HelpRP; - let resourcename: string; - let scope1: string; - - beforeEach(async (ctx) => { - recorder = new Recorder(ctx); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ""; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new HelpRP(credential, recorder.configureClientOptions({})); - resourcename = "resourcetest1"; - scope1 = - "subscriptions/" + - subscriptionId + - "/resourceGroups/myjstest/providers/Microsoft.KeyVault/vaults/testkey20230703"; - }); - - afterEach(async () => { - await recorder.stop(); - }); - - // I think we could skip this case, because service don't give delete api to detele this resource - it.skip("diagnostics create test", async function () { - const options = { - diagnosticResourceRequest: { - insights: [ - { - solutionId: "KeyVaultUnauthorizedNetworkInsight", - }, - ], - }, - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, - }; - const result = await client.diagnostics.beginCreateAndWait(scope1, resourcename, options); - assert.equal(result.name, resourcename); - }); - - it("selfhelp operation test", async () => { - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - assert.notEqual(resArray.length, 0); - }); - - it("discoverySolutionNLPSubscriptionScope post test", async () => { - await client.discoverySolutionNLP.discoverSolutionsBySubscription(subscriptionId, { - discoverSolutionRequest: { issueSummary: "how to retrieve certs from deleted keyvault." }, - }); - }); -}); diff --git a/sdk/selfhelp/arm-selfhelp/test/snippets.spec.ts b/sdk/selfhelp/arm-selfhelp/test/snippets.spec.ts index 55821f40cbc6..e0ae54338dc1 100644 --- a/sdk/selfhelp/arm-selfhelp/test/snippets.spec.ts +++ b/sdk/selfhelp/arm-selfhelp/test/snippets.spec.ts @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ import { HelpRP } from "../src/index.js"; import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; @@ -9,7 +14,7 @@ import { describe, it } from "vitest"; describe("snippets", () => { it("ReadmeSampleCreateClient_Node", async () => { const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new HelpRP(new DefaultAzureCredential()); + const client = new HelpRP(new DefaultAzureCredential(), subscriptionId); }); it("ReadmeSampleCreateClient_Browser", async () => { @@ -18,7 +23,7 @@ describe("snippets", () => { tenantId: "", clientId: "", }); - const client = new HelpRP(credential); + const client = new HelpRP(credential, subscriptionId); }); it("SetLogLevel", async () => { diff --git a/sdk/selfhelp/arm-selfhelp/tsconfig.browser.config.json b/sdk/selfhelp/arm-selfhelp/tsconfig.browser.config.json index 0c8bafa97126..75871518e3a0 100644 --- a/sdk/selfhelp/arm-selfhelp/tsconfig.browser.config.json +++ b/sdk/selfhelp/arm-selfhelp/tsconfig.browser.config.json @@ -1,6 +1,3 @@ { - "extends": [ - "./tsconfig.test.json", - "../../../tsconfig.browser.base.json" - ] + "extends": ["./tsconfig.test.json", "../../../tsconfig.browser.base.json"] } diff --git a/sdk/selfhelp/arm-selfhelp/tsconfig.json b/sdk/selfhelp/arm-selfhelp/tsconfig.json index 19ceb382b521..59ea83c046bf 100644 --- a/sdk/selfhelp/arm-selfhelp/tsconfig.json +++ b/sdk/selfhelp/arm-selfhelp/tsconfig.json @@ -3,11 +3,8 @@ { "path": "./tsconfig.src.json" }, - { - "path": "./tsconfig.samples.json" - }, { "path": "./tsconfig.test.json" } ] -} +} \ No newline at end of file diff --git a/sdk/selfhelp/arm-selfhelp/tsconfig.samples.json b/sdk/selfhelp/arm-selfhelp/tsconfig.samples.json index 78c0695720c5..aac49942795e 100644 --- a/sdk/selfhelp/arm-selfhelp/tsconfig.samples.json +++ b/sdk/selfhelp/arm-selfhelp/tsconfig.samples.json @@ -2,9 +2,7 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-selfhelp": [ - "./dist/esm" - ] + "@azure/arm-selfhelp": ["./dist/esm"] } } } diff --git a/sdk/selfhelp/arm-selfhelp/tsconfig.test.json b/sdk/selfhelp/arm-selfhelp/tsconfig.test.json index 3c2b783a8c1b..290ca214aebc 100644 --- a/sdk/selfhelp/arm-selfhelp/tsconfig.test.json +++ b/sdk/selfhelp/arm-selfhelp/tsconfig.test.json @@ -1,6 +1,3 @@ { - "extends": [ - "./tsconfig.src.json", - "../../../tsconfig.test.base.json" - ] + "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] }