@azure/arm-selfhelp 1.0.0-alpha.20230428.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +108 -0
  4. package/dist/index.js +1434 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/samples-dev/diagnosticsCheckNameAvailabilitySample.d.ts +2 -0
  9. package/dist-esm/samples-dev/diagnosticsCheckNameAvailabilitySample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/diagnosticsCheckNameAvailabilitySample.js +66 -0
  11. package/dist-esm/samples-dev/diagnosticsCheckNameAvailabilitySample.js.map +1 -0
  12. package/dist-esm/samples-dev/diagnosticsCreateSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/diagnosticsCreateSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/diagnosticsCreateSample.js +37 -0
  15. package/dist-esm/samples-dev/diagnosticsCreateSample.js.map +1 -0
  16. package/dist-esm/samples-dev/diagnosticsGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/diagnosticsGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/diagnosticsGetSample.js +37 -0
  19. package/dist-esm/samples-dev/diagnosticsGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/discoverySolutionListSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/discoverySolutionListSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/discoverySolutionListSample.js +57 -0
  23. package/dist-esm/samples-dev/discoverySolutionListSample.js.map +1 -0
  24. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/operationsListSample.js +56 -0
  27. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  28. package/dist-esm/src/helpRP.d.ts +20 -0
  29. package/dist-esm/src/helpRP.d.ts.map +1 -0
  30. package/dist-esm/src/helpRP.js +96 -0
  31. package/dist-esm/src/helpRP.js.map +1 -0
  32. package/dist-esm/src/index.d.ts +6 -0
  33. package/dist-esm/src/index.d.ts.map +1 -0
  34. package/dist-esm/src/index.js +13 -0
  35. package/dist-esm/src/index.js.map +1 -0
  36. package/dist-esm/src/lroImpl.d.ts +11 -0
  37. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  38. package/dist-esm/src/lroImpl.js +21 -0
  39. package/dist-esm/src/lroImpl.js.map +1 -0
  40. package/dist-esm/src/models/index.d.ts +435 -0
  41. package/dist-esm/src/models/index.d.ts.map +1 -0
  42. package/dist-esm/src/models/index.js +72 -0
  43. package/dist-esm/src/models/index.js.map +1 -0
  44. package/dist-esm/src/models/mappers.d.ts +20 -0
  45. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  46. package/dist-esm/src/models/mappers.js +585 -0
  47. package/dist-esm/src/models/mappers.js.map +1 -0
  48. package/dist-esm/src/models/parameters.d.ts +13 -0
  49. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  50. package/dist-esm/src/models/parameters.js +117 -0
  51. package/dist-esm/src/models/parameters.js.map +1 -0
  52. package/dist-esm/src/operations/diagnostics.d.ts +53 -0
  53. package/dist-esm/src/operations/diagnostics.d.ts.map +1 -0
  54. package/dist-esm/src/operations/diagnostics.js +180 -0
  55. package/dist-esm/src/operations/diagnostics.js.map +1 -0
  56. package/dist-esm/src/operations/discoverySolution.d.ts +50 -0
  57. package/dist-esm/src/operations/discoverySolution.d.ts.map +1 -0
  58. package/dist-esm/src/operations/discoverySolution.js +160 -0
  59. package/dist-esm/src/operations/discoverySolution.js.map +1 -0
  60. package/dist-esm/src/operations/index.d.ts +4 -0
  61. package/dist-esm/src/operations/index.d.ts.map +1 -0
  62. package/dist-esm/src/operations/index.js +11 -0
  63. package/dist-esm/src/operations/index.js.map +1 -0
  64. package/dist-esm/src/operations/operations.d.ts +32 -0
  65. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  66. package/dist-esm/src/operations/operations.js +138 -0
  67. package/dist-esm/src/operations/operations.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/diagnostics.d.ts +45 -0
  69. package/dist-esm/src/operationsInterfaces/diagnostics.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/diagnostics.js +9 -0
  71. package/dist-esm/src/operationsInterfaces/diagnostics.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/discoverySolution.d.ts +19 -0
  73. package/dist-esm/src/operationsInterfaces/discoverySolution.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/discoverySolution.js +9 -0
  75. package/dist-esm/src/operationsInterfaces/discoverySolution.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  77. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  79. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  81. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  83. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  84. package/dist-esm/src/pagingHelper.d.ts +13 -0
  85. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  86. package/dist-esm/src/pagingHelper.js +32 -0
  87. package/dist-esm/src/pagingHelper.js.map +1 -0
  88. package/dist-esm/test/selfhelp_operations_test.spec.d.ts +4 -0
  89. package/dist-esm/test/selfhelp_operations_test.spec.d.ts.map +1 -0
  90. package/dist-esm/test/selfhelp_operations_test.spec.js +62 -0
  91. package/dist-esm/test/selfhelp_operations_test.spec.js.map +1 -0
  92. package/package.json +123 -0
  93. package/review/arm-selfhelp.api.md +310 -0
  94. package/rollup.config.js +122 -0
  95. package/src/helpRP.ts +144 -0
  96. package/src/index.ts +13 -0
  97. package/src/lroImpl.ts +42 -0
  98. package/src/models/index.ts +485 -0
  99. package/src/models/mappers.ts +619 -0
  100. package/src/models/parameters.ts +136 -0
  101. package/src/operations/diagnostics.ts +249 -0
  102. package/src/operations/discoverySolution.ts +179 -0
  103. package/src/operations/index.ts +11 -0
  104. package/src/operations/operations.ts +149 -0
  105. package/src/operationsInterfaces/diagnostics.ts +80 -0
  106. package/src/operationsInterfaces/discoverySolution.ts +34 -0
  107. package/src/operationsInterfaces/index.ts +11 -0
  108. package/src/operationsInterfaces/operations.ts +22 -0
  109. package/src/pagingHelper.ts +39 -0
  110. package/tsconfig.json +33 -0
  111. package/types/arm-selfhelp.d.ts +579 -0
  112. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,136 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import {
10
+ OperationParameter,
11
+ OperationURLParameter,
12
+ OperationQueryParameter
13
+ } from "@azure/core-client";
14
+ import {
15
+ CheckNameAvailabilityRequest as CheckNameAvailabilityRequestMapper,
16
+ DiagnosticResource as DiagnosticResourceMapper
17
+ } from "../models/mappers";
18
+
19
+ export const accept: OperationParameter = {
20
+ parameterPath: "accept",
21
+ mapper: {
22
+ defaultValue: "application/json",
23
+ isConstant: true,
24
+ serializedName: "Accept",
25
+ type: {
26
+ name: "String"
27
+ }
28
+ }
29
+ };
30
+
31
+ export const $host: OperationURLParameter = {
32
+ parameterPath: "$host",
33
+ mapper: {
34
+ serializedName: "$host",
35
+ required: true,
36
+ type: {
37
+ name: "String"
38
+ }
39
+ },
40
+ skipEncoding: true
41
+ };
42
+
43
+ export const apiVersion: OperationQueryParameter = {
44
+ parameterPath: "apiVersion",
45
+ mapper: {
46
+ defaultValue: "2023-01-01-preview",
47
+ isConstant: true,
48
+ serializedName: "api-version",
49
+ type: {
50
+ name: "String"
51
+ }
52
+ }
53
+ };
54
+
55
+ export const nextLink: OperationURLParameter = {
56
+ parameterPath: "nextLink",
57
+ mapper: {
58
+ serializedName: "nextLink",
59
+ required: true,
60
+ type: {
61
+ name: "String"
62
+ }
63
+ },
64
+ skipEncoding: true
65
+ };
66
+
67
+ export const contentType: OperationParameter = {
68
+ parameterPath: ["options", "contentType"],
69
+ mapper: {
70
+ defaultValue: "application/json",
71
+ isConstant: true,
72
+ serializedName: "Content-Type",
73
+ type: {
74
+ name: "String"
75
+ }
76
+ }
77
+ };
78
+
79
+ export const checkNameAvailabilityRequest: OperationParameter = {
80
+ parameterPath: ["options", "checkNameAvailabilityRequest"],
81
+ mapper: CheckNameAvailabilityRequestMapper
82
+ };
83
+
84
+ export const scope: OperationURLParameter = {
85
+ parameterPath: "scope",
86
+ mapper: {
87
+ serializedName: "scope",
88
+ required: true,
89
+ type: {
90
+ name: "String"
91
+ }
92
+ },
93
+ skipEncoding: true
94
+ };
95
+
96
+ export const diagnosticResourceRequest: OperationParameter = {
97
+ parameterPath: ["options", "diagnosticResourceRequest"],
98
+ mapper: DiagnosticResourceMapper
99
+ };
100
+
101
+ export const diagnosticsResourceName: OperationURLParameter = {
102
+ parameterPath: "diagnosticsResourceName",
103
+ mapper: {
104
+ constraints: {
105
+ Pattern: new RegExp("^[A-Za-z0-9-+@()_]+$"),
106
+ MaxLength: 100,
107
+ MinLength: 1
108
+ },
109
+ serializedName: "diagnosticsResourceName",
110
+ required: true,
111
+ type: {
112
+ name: "String"
113
+ }
114
+ }
115
+ };
116
+
117
+ export const filter: OperationQueryParameter = {
118
+ parameterPath: ["options", "filter"],
119
+ mapper: {
120
+ serializedName: "$filter",
121
+ type: {
122
+ name: "String"
123
+ }
124
+ },
125
+ skipEncoding: true
126
+ };
127
+
128
+ export const skiptoken: OperationQueryParameter = {
129
+ parameterPath: ["options", "skiptoken"],
130
+ mapper: {
131
+ serializedName: "$skiptoken",
132
+ type: {
133
+ name: "String"
134
+ }
135
+ }
136
+ };
@@ -0,0 +1,249 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { Diagnostics } from "../operationsInterfaces";
10
+ import * as coreClient from "@azure/core-client";
11
+ import * as Mappers from "../models/mappers";
12
+ import * as Parameters from "../models/parameters";
13
+ import { HelpRP } from "../helpRP";
14
+ import {
15
+ SimplePollerLike,
16
+ OperationState,
17
+ createHttpPoller
18
+ } from "@azure/core-lro";
19
+ import { createLroSpec } from "../lroImpl";
20
+ import {
21
+ DiagnosticsCheckNameAvailabilityOptionalParams,
22
+ DiagnosticsCheckNameAvailabilityResponse,
23
+ DiagnosticsCreateOptionalParams,
24
+ DiagnosticsCreateResponse,
25
+ DiagnosticsGetOptionalParams,
26
+ DiagnosticsGetResponse
27
+ } from "../models";
28
+
29
+ /** Class containing Diagnostics operations. */
30
+ export class DiagnosticsImpl implements Diagnostics {
31
+ private readonly client: HelpRP;
32
+
33
+ /**
34
+ * Initialize a new instance of the class Diagnostics class.
35
+ * @param client Reference to the service client
36
+ */
37
+ constructor(client: HelpRP) {
38
+ this.client = client;
39
+ }
40
+
41
+ /**
42
+ * This API is used to check the uniqueness of a resource name used for a diagnostic check.
43
+ * @param scope This is an extension resource provider and only resource level extension is supported
44
+ * at the moment.
45
+ * @param options The options parameters.
46
+ */
47
+ checkNameAvailability(
48
+ scope: string,
49
+ options?: DiagnosticsCheckNameAvailabilityOptionalParams
50
+ ): Promise<DiagnosticsCheckNameAvailabilityResponse> {
51
+ return this.client.sendOperationRequest(
52
+ { scope, options },
53
+ checkNameAvailabilityOperationSpec
54
+ );
55
+ }
56
+
57
+ /**
58
+ * Diagnostics tells you precisely the root cause of the issue and how to address it. You can get
59
+ * diagnostics once you discover and identify the relevant solution for your Azure issue.<br/><br/> You
60
+ * can create diagnostics using the ‘solutionId’ from Solution Discovery API response and
61
+ * ‘additionalParameters’ <br/><br/> <b>Note: </b>‘requiredParameterSets’ from Solutions Discovery API
62
+ * response must be passed via ‘additionalParameters’ as an input to Diagnostics API
63
+ * @param scope This is an extension resource provider and only resource level extension is supported
64
+ * at the moment.
65
+ * @param diagnosticsResourceName Unique resource name for insight resources
66
+ * @param options The options parameters.
67
+ */
68
+ async beginCreate(
69
+ scope: string,
70
+ diagnosticsResourceName: string,
71
+ options?: DiagnosticsCreateOptionalParams
72
+ ): Promise<
73
+ SimplePollerLike<
74
+ OperationState<DiagnosticsCreateResponse>,
75
+ DiagnosticsCreateResponse
76
+ >
77
+ > {
78
+ const directSendOperation = async (
79
+ args: coreClient.OperationArguments,
80
+ spec: coreClient.OperationSpec
81
+ ): Promise<DiagnosticsCreateResponse> => {
82
+ return this.client.sendOperationRequest(args, spec);
83
+ };
84
+ const sendOperationFn = async (
85
+ args: coreClient.OperationArguments,
86
+ spec: coreClient.OperationSpec
87
+ ) => {
88
+ let currentRawResponse:
89
+ | coreClient.FullOperationResponse
90
+ | undefined = undefined;
91
+ const providedCallback = args.options?.onResponse;
92
+ const callback: coreClient.RawResponseCallback = (
93
+ rawResponse: coreClient.FullOperationResponse,
94
+ flatResponse: unknown
95
+ ) => {
96
+ currentRawResponse = rawResponse;
97
+ providedCallback?.(rawResponse, flatResponse);
98
+ };
99
+ const updatedArgs = {
100
+ ...args,
101
+ options: {
102
+ ...args.options,
103
+ onResponse: callback
104
+ }
105
+ };
106
+ const flatResponse = await directSendOperation(updatedArgs, spec);
107
+ return {
108
+ flatResponse,
109
+ rawResponse: {
110
+ statusCode: currentRawResponse!.status,
111
+ body: currentRawResponse!.parsedBody,
112
+ headers: currentRawResponse!.headers.toJSON()
113
+ }
114
+ };
115
+ };
116
+
117
+ const lro = createLroSpec({
118
+ sendOperationFn,
119
+ args: { scope, diagnosticsResourceName, options },
120
+ spec: createOperationSpec
121
+ });
122
+ const poller = await createHttpPoller<
123
+ DiagnosticsCreateResponse,
124
+ OperationState<DiagnosticsCreateResponse>
125
+ >(lro, {
126
+ restoreFrom: options?.resumeFrom,
127
+ intervalInMs: options?.updateIntervalInMs,
128
+ resourceLocationConfig: "azure-async-operation"
129
+ });
130
+ await poller.poll();
131
+ return poller;
132
+ }
133
+
134
+ /**
135
+ * Diagnostics tells you precisely the root cause of the issue and how to address it. You can get
136
+ * diagnostics once you discover and identify the relevant solution for your Azure issue.<br/><br/> You
137
+ * can create diagnostics using the ‘solutionId’ from Solution Discovery API response and
138
+ * ‘additionalParameters’ <br/><br/> <b>Note: </b>‘requiredParameterSets’ from Solutions Discovery API
139
+ * response must be passed via ‘additionalParameters’ as an input to Diagnostics API
140
+ * @param scope This is an extension resource provider and only resource level extension is supported
141
+ * at the moment.
142
+ * @param diagnosticsResourceName Unique resource name for insight resources
143
+ * @param options The options parameters.
144
+ */
145
+ async beginCreateAndWait(
146
+ scope: string,
147
+ diagnosticsResourceName: string,
148
+ options?: DiagnosticsCreateOptionalParams
149
+ ): Promise<DiagnosticsCreateResponse> {
150
+ const poller = await this.beginCreate(
151
+ scope,
152
+ diagnosticsResourceName,
153
+ options
154
+ );
155
+ return poller.pollUntilDone();
156
+ }
157
+
158
+ /**
159
+ * Get the diagnostics using the 'diagnosticsResourceName' you chose while creating the diagnostic.
160
+ * @param scope This is an extension resource provider and only resource level extension is supported
161
+ * at the moment.
162
+ * @param diagnosticsResourceName Unique resource name for insight resources
163
+ * @param options The options parameters.
164
+ */
165
+ get(
166
+ scope: string,
167
+ diagnosticsResourceName: string,
168
+ options?: DiagnosticsGetOptionalParams
169
+ ): Promise<DiagnosticsGetResponse> {
170
+ return this.client.sendOperationRequest(
171
+ { scope, diagnosticsResourceName, options },
172
+ getOperationSpec
173
+ );
174
+ }
175
+ }
176
+ // Operation Specifications
177
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
178
+
179
+ const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = {
180
+ path: "/{scope}/providers/Microsoft.Help/checkNameAvailability",
181
+ httpMethod: "POST",
182
+ responses: {
183
+ 200: {
184
+ bodyMapper: Mappers.CheckNameAvailabilityResponse
185
+ },
186
+ default: {
187
+ bodyMapper: Mappers.ErrorResponse
188
+ }
189
+ },
190
+ requestBody: Parameters.checkNameAvailabilityRequest,
191
+ queryParameters: [Parameters.apiVersion],
192
+ urlParameters: [Parameters.$host, Parameters.scope],
193
+ headerParameters: [Parameters.accept, Parameters.contentType],
194
+ mediaType: "json",
195
+ serializer
196
+ };
197
+ const createOperationSpec: coreClient.OperationSpec = {
198
+ path:
199
+ "/{scope}/providers/Microsoft.Help/diagnostics/{diagnosticsResourceName}",
200
+ httpMethod: "PUT",
201
+ responses: {
202
+ 200: {
203
+ bodyMapper: Mappers.DiagnosticResource
204
+ },
205
+ 201: {
206
+ bodyMapper: Mappers.DiagnosticResource
207
+ },
208
+ 202: {
209
+ bodyMapper: Mappers.DiagnosticResource
210
+ },
211
+ 204: {
212
+ bodyMapper: Mappers.DiagnosticResource
213
+ },
214
+ default: {
215
+ bodyMapper: Mappers.ErrorResponse
216
+ }
217
+ },
218
+ requestBody: Parameters.diagnosticResourceRequest,
219
+ queryParameters: [Parameters.apiVersion],
220
+ urlParameters: [
221
+ Parameters.$host,
222
+ Parameters.scope,
223
+ Parameters.diagnosticsResourceName
224
+ ],
225
+ headerParameters: [Parameters.accept, Parameters.contentType],
226
+ mediaType: "json",
227
+ serializer
228
+ };
229
+ const getOperationSpec: coreClient.OperationSpec = {
230
+ path:
231
+ "/{scope}/providers/Microsoft.Help/diagnostics/{diagnosticsResourceName}",
232
+ httpMethod: "GET",
233
+ responses: {
234
+ 200: {
235
+ bodyMapper: Mappers.DiagnosticResource
236
+ },
237
+ default: {
238
+ bodyMapper: Mappers.ErrorResponse
239
+ }
240
+ },
241
+ queryParameters: [Parameters.apiVersion],
242
+ urlParameters: [
243
+ Parameters.$host,
244
+ Parameters.scope,
245
+ Parameters.diagnosticsResourceName
246
+ ],
247
+ headerParameters: [Parameters.accept],
248
+ serializer
249
+ };
@@ -0,0 +1,179 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
11
+ import { DiscoverySolution } from "../operationsInterfaces";
12
+ import * as coreClient from "@azure/core-client";
13
+ import * as Mappers from "../models/mappers";
14
+ import * as Parameters from "../models/parameters";
15
+ import { HelpRP } from "../helpRP";
16
+ import {
17
+ SolutionMetadataResource,
18
+ DiscoverySolutionListNextOptionalParams,
19
+ DiscoverySolutionListOptionalParams,
20
+ DiscoverySolutionListResponse,
21
+ DiscoverySolutionListNextResponse
22
+ } from "../models";
23
+
24
+ /// <reference lib="esnext.asynciterable" />
25
+ /** Class containing DiscoverySolution operations. */
26
+ export class DiscoverySolutionImpl implements DiscoverySolution {
27
+ private readonly client: HelpRP;
28
+
29
+ /**
30
+ * Initialize a new instance of the class DiscoverySolution class.
31
+ * @param client Reference to the service client
32
+ */
33
+ constructor(client: HelpRP) {
34
+ this.client = client;
35
+ }
36
+
37
+ /**
38
+ * Solutions Discovery is the initial point of entry within Help API, which helps you identify the
39
+ * relevant solutions for your Azure issue.<br/><br/> You can discover solutions using resourceUri OR
40
+ * resourceUri + problemClassificationId.<br/><br/>We will do our best in returning relevant
41
+ * diagnostics for your Azure issue.<br/><br/> Get the problemClassificationId(s) using this
42
+ * [reference](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP).<br/><br/>
43
+ * <b>Note: </b> ‘requiredParameterSets’ from Solutions Discovery API response must be passed via
44
+ * ‘additionalParameters’ as an input to Diagnostics API.
45
+ * @param scope This is an extension resource provider and only resource level extension is supported
46
+ * at the moment.
47
+ * @param options The options parameters.
48
+ */
49
+ public list(
50
+ scope: string,
51
+ options?: DiscoverySolutionListOptionalParams
52
+ ): PagedAsyncIterableIterator<SolutionMetadataResource> {
53
+ const iter = this.listPagingAll(scope, options);
54
+ return {
55
+ next() {
56
+ return iter.next();
57
+ },
58
+ [Symbol.asyncIterator]() {
59
+ return this;
60
+ },
61
+ byPage: (settings?: PageSettings) => {
62
+ if (settings?.maxPageSize) {
63
+ throw new Error("maxPageSize is not supported by this operation.");
64
+ }
65
+ return this.listPagingPage(scope, options, settings);
66
+ }
67
+ };
68
+ }
69
+
70
+ private async *listPagingPage(
71
+ scope: string,
72
+ options?: DiscoverySolutionListOptionalParams,
73
+ settings?: PageSettings
74
+ ): AsyncIterableIterator<SolutionMetadataResource[]> {
75
+ let result: DiscoverySolutionListResponse;
76
+ let continuationToken = settings?.continuationToken;
77
+ if (!continuationToken) {
78
+ result = await this._list(scope, options);
79
+ let page = result.value || [];
80
+ continuationToken = result.nextLink;
81
+ setContinuationToken(page, continuationToken);
82
+ yield page;
83
+ }
84
+ while (continuationToken) {
85
+ result = await this._listNext(scope, continuationToken, options);
86
+ continuationToken = result.nextLink;
87
+ let page = result.value || [];
88
+ setContinuationToken(page, continuationToken);
89
+ yield page;
90
+ }
91
+ }
92
+
93
+ private async *listPagingAll(
94
+ scope: string,
95
+ options?: DiscoverySolutionListOptionalParams
96
+ ): AsyncIterableIterator<SolutionMetadataResource> {
97
+ for await (const page of this.listPagingPage(scope, options)) {
98
+ yield* page;
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Solutions Discovery is the initial point of entry within Help API, which helps you identify the
104
+ * relevant solutions for your Azure issue.<br/><br/> You can discover solutions using resourceUri OR
105
+ * resourceUri + problemClassificationId.<br/><br/>We will do our best in returning relevant
106
+ * diagnostics for your Azure issue.<br/><br/> Get the problemClassificationId(s) using this
107
+ * [reference](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP).<br/><br/>
108
+ * <b>Note: </b> ‘requiredParameterSets’ from Solutions Discovery API response must be passed via
109
+ * ‘additionalParameters’ as an input to Diagnostics API.
110
+ * @param scope This is an extension resource provider and only resource level extension is supported
111
+ * at the moment.
112
+ * @param options The options parameters.
113
+ */
114
+ private _list(
115
+ scope: string,
116
+ options?: DiscoverySolutionListOptionalParams
117
+ ): Promise<DiscoverySolutionListResponse> {
118
+ return this.client.sendOperationRequest(
119
+ { scope, options },
120
+ listOperationSpec
121
+ );
122
+ }
123
+
124
+ /**
125
+ * ListNext
126
+ * @param scope This is an extension resource provider and only resource level extension is supported
127
+ * at the moment.
128
+ * @param nextLink The nextLink from the previous successful call to the List method.
129
+ * @param options The options parameters.
130
+ */
131
+ private _listNext(
132
+ scope: string,
133
+ nextLink: string,
134
+ options?: DiscoverySolutionListNextOptionalParams
135
+ ): Promise<DiscoverySolutionListNextResponse> {
136
+ return this.client.sendOperationRequest(
137
+ { scope, nextLink, options },
138
+ listNextOperationSpec
139
+ );
140
+ }
141
+ }
142
+ // Operation Specifications
143
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
144
+
145
+ const listOperationSpec: coreClient.OperationSpec = {
146
+ path: "/{scope}/providers/Microsoft.Help/discoverySolutions",
147
+ httpMethod: "GET",
148
+ responses: {
149
+ 200: {
150
+ bodyMapper: Mappers.DiscoveryResponse
151
+ },
152
+ default: {
153
+ bodyMapper: Mappers.ErrorResponse
154
+ }
155
+ },
156
+ queryParameters: [
157
+ Parameters.apiVersion,
158
+ Parameters.filter,
159
+ Parameters.skiptoken
160
+ ],
161
+ urlParameters: [Parameters.$host, Parameters.scope],
162
+ headerParameters: [Parameters.accept],
163
+ serializer
164
+ };
165
+ const listNextOperationSpec: coreClient.OperationSpec = {
166
+ path: "{nextLink}",
167
+ httpMethod: "GET",
168
+ responses: {
169
+ 200: {
170
+ bodyMapper: Mappers.DiscoveryResponse
171
+ },
172
+ default: {
173
+ bodyMapper: Mappers.ErrorResponse
174
+ }
175
+ },
176
+ urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope],
177
+ headerParameters: [Parameters.accept],
178
+ serializer
179
+ };
@@ -0,0 +1,11 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ export * from "./operations";
10
+ export * from "./diagnostics";
11
+ export * from "./discoverySolution";