@azure/arm-selfhelp 2.0.0-beta.2 → 2.0.0-beta.3

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 (167) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/LICENSE +1 -1
  3. package/README.md +3 -2
  4. package/dist/index.js +1589 -861
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/samples-dev/checkNameAvailabilityPostSample.js +7 -7
  9. package/dist-esm/samples-dev/checkNameAvailabilityPostSample.js.map +1 -1
  10. package/dist-esm/samples-dev/diagnosticsCreateSample.js +4 -13
  11. package/dist-esm/samples-dev/diagnosticsCreateSample.js.map +1 -1
  12. package/dist-esm/samples-dev/diagnosticsGetSample.js +1 -1
  13. package/dist-esm/samples-dev/discoverySolutionListSample.js +6 -41
  14. package/dist-esm/samples-dev/discoverySolutionListSample.js.map +1 -1
  15. package/dist-esm/samples-dev/discoverySolutionNlpSubscriptionScopePostSample.d.ts +2 -0
  16. package/dist-esm/samples-dev/discoverySolutionNlpSubscriptionScopePostSample.d.ts.map +1 -0
  17. package/dist-esm/samples-dev/discoverySolutionNlpSubscriptionScopePostSample.js +45 -0
  18. package/dist-esm/samples-dev/discoverySolutionNlpSubscriptionScopePostSample.js.map +1 -0
  19. package/dist-esm/samples-dev/discoverySolutionNlpTenantScopePostSample.d.ts +2 -0
  20. package/dist-esm/samples-dev/discoverySolutionNlpTenantScopePostSample.d.ts.map +1 -0
  21. package/dist-esm/samples-dev/discoverySolutionNlpTenantScopePostSample.js +43 -0
  22. package/dist-esm/samples-dev/discoverySolutionNlpTenantScopePostSample.js.map +1 -0
  23. package/dist-esm/samples-dev/operationsListSample.js +5 -3
  24. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  25. package/dist-esm/samples-dev/simplifiedSolutionsCreateSample.d.ts +2 -0
  26. package/dist-esm/samples-dev/simplifiedSolutionsCreateSample.d.ts.map +1 -0
  27. package/dist-esm/samples-dev/simplifiedSolutionsCreateSample.js +46 -0
  28. package/dist-esm/samples-dev/simplifiedSolutionsCreateSample.js.map +1 -0
  29. package/dist-esm/samples-dev/simplifiedSolutionsGetSample.d.ts +2 -0
  30. package/dist-esm/samples-dev/simplifiedSolutionsGetSample.d.ts.map +1 -0
  31. package/dist-esm/samples-dev/simplifiedSolutionsGetSample.js +37 -0
  32. package/dist-esm/samples-dev/simplifiedSolutionsGetSample.js.map +1 -0
  33. package/dist-esm/samples-dev/solutionCreateSample.js +8 -5
  34. package/dist-esm/samples-dev/solutionCreateSample.js.map +1 -1
  35. package/dist-esm/samples-dev/solutionGetSample.js +1 -1
  36. package/dist-esm/samples-dev/solutionSelfHelpGetSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/solutionSelfHelpGetSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/solutionSelfHelpGetSample.js +36 -0
  39. package/dist-esm/samples-dev/solutionSelfHelpGetSample.js.map +1 -0
  40. package/dist-esm/samples-dev/solutionUpdateSample.js +2 -11
  41. package/dist-esm/samples-dev/solutionUpdateSample.js.map +1 -1
  42. package/dist-esm/samples-dev/solutionWarmUpSample.d.ts +2 -0
  43. package/dist-esm/samples-dev/solutionWarmUpSample.d.ts.map +1 -0
  44. package/dist-esm/samples-dev/solutionWarmUpSample.js +37 -0
  45. package/dist-esm/samples-dev/solutionWarmUpSample.js.map +1 -0
  46. package/dist-esm/samples-dev/troubleshootersContinueSample.js +6 -6
  47. package/dist-esm/samples-dev/troubleshootersContinueSample.js.map +1 -1
  48. package/dist-esm/samples-dev/troubleshootersCreateSample.js +5 -5
  49. package/dist-esm/samples-dev/troubleshootersCreateSample.js.map +1 -1
  50. package/dist-esm/samples-dev/troubleshootersEndSample.js +1 -1
  51. package/dist-esm/samples-dev/troubleshootersGetSample.js +1 -1
  52. package/dist-esm/samples-dev/troubleshootersRestartSample.js +1 -1
  53. package/dist-esm/src/helpRP.d.ts +8 -1
  54. package/dist-esm/src/helpRP.d.ts.map +1 -1
  55. package/dist-esm/src/helpRP.js +25 -15
  56. package/dist-esm/src/helpRP.js.map +1 -1
  57. package/dist-esm/src/lroImpl.js +1 -1
  58. package/dist-esm/src/models/index.d.ts +227 -7
  59. package/dist-esm/src/models/index.d.ts.map +1 -1
  60. package/dist-esm/src/models/index.js +24 -0
  61. package/dist-esm/src/models/index.js.map +1 -1
  62. package/dist-esm/src/models/mappers.d.ts +9 -0
  63. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  64. package/dist-esm/src/models/mappers.js +860 -523
  65. package/dist-esm/src/models/mappers.js.map +1 -1
  66. package/dist-esm/src/models/parameters.d.ts +6 -0
  67. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  68. package/dist-esm/src/models/parameters.js +95 -44
  69. package/dist-esm/src/models/parameters.js.map +1 -1
  70. package/dist-esm/src/operations/checkNameAvailability.js +4 -4
  71. package/dist-esm/src/operations/diagnostics.d.ts +6 -10
  72. package/dist-esm/src/operations/diagnostics.d.ts.map +1 -1
  73. package/dist-esm/src/operations/diagnostics.js +24 -28
  74. package/dist-esm/src/operations/diagnostics.js.map +1 -1
  75. package/dist-esm/src/operations/discoverySolution.d.ts +3 -12
  76. package/dist-esm/src/operations/discoverySolution.d.ts.map +1 -1
  77. package/dist-esm/src/operations/discoverySolution.js +27 -36
  78. package/dist-esm/src/operations/discoverySolution.js.map +1 -1
  79. package/dist-esm/src/operations/discoverySolutionNLPSubscriptionScope.d.ts +19 -0
  80. package/dist-esm/src/operations/discoverySolutionNLPSubscriptionScope.d.ts.map +1 -0
  81. package/dist-esm/src/operations/discoverySolutionNLPSubscriptionScope.js +49 -0
  82. package/dist-esm/src/operations/discoverySolutionNLPSubscriptionScope.js.map +1 -0
  83. package/dist-esm/src/operations/discoverySolutionNLPTenantScope.d.ts +19 -0
  84. package/dist-esm/src/operations/discoverySolutionNLPTenantScope.d.ts.map +1 -0
  85. package/dist-esm/src/operations/discoverySolutionNLPTenantScope.js +49 -0
  86. package/dist-esm/src/operations/discoverySolutionNLPTenantScope.js.map +1 -0
  87. package/dist-esm/src/operations/index.d.ts +4 -0
  88. package/dist-esm/src/operations/index.d.ts.map +1 -1
  89. package/dist-esm/src/operations/index.js +4 -0
  90. package/dist-esm/src/operations/index.js.map +1 -1
  91. package/dist-esm/src/operations/operations.js +9 -9
  92. package/dist-esm/src/operations/operations.js.map +1 -1
  93. package/dist-esm/src/operations/simplifiedSolutions.d.ts +52 -0
  94. package/dist-esm/src/operations/simplifiedSolutions.d.ts.map +1 -0
  95. package/dist-esm/src/operations/simplifiedSolutions.js +159 -0
  96. package/dist-esm/src/operations/simplifiedSolutions.js.map +1 -0
  97. package/dist-esm/src/operations/solution.d.ts +20 -25
  98. package/dist-esm/src/operations/solution.d.ts.map +1 -1
  99. package/dist-esm/src/operations/solution.js +71 -54
  100. package/dist-esm/src/operations/solution.js.map +1 -1
  101. package/dist-esm/src/operations/solutionSelfHelp.d.ts +23 -0
  102. package/dist-esm/src/operations/solutionSelfHelp.d.ts.map +1 -0
  103. package/dist-esm/src/operations/solutionSelfHelp.js +51 -0
  104. package/dist-esm/src/operations/solutionSelfHelp.js.map +1 -0
  105. package/dist-esm/src/operations/troubleshooters.js +26 -26
  106. package/dist-esm/src/operations/troubleshooters.js.map +1 -1
  107. package/dist-esm/src/operationsInterfaces/diagnostics.d.ts +6 -10
  108. package/dist-esm/src/operationsInterfaces/diagnostics.d.ts.map +1 -1
  109. package/dist-esm/src/operationsInterfaces/discoverySolution.d.ts +2 -5
  110. package/dist-esm/src/operationsInterfaces/discoverySolution.d.ts.map +1 -1
  111. package/dist-esm/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.d.ts +11 -0
  112. package/dist-esm/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.d.ts.map +1 -0
  113. package/dist-esm/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.js +9 -0
  114. package/dist-esm/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.js.map +1 -0
  115. package/dist-esm/src/operationsInterfaces/discoverySolutionNLPTenantScope.d.ts +11 -0
  116. package/dist-esm/src/operationsInterfaces/discoverySolutionNLPTenantScope.d.ts.map +1 -0
  117. package/dist-esm/src/operationsInterfaces/discoverySolutionNLPTenantScope.js +9 -0
  118. package/dist-esm/src/operationsInterfaces/discoverySolutionNLPTenantScope.js.map +1 -0
  119. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  120. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  121. package/dist-esm/src/operationsInterfaces/index.js +4 -0
  122. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  123. package/dist-esm/src/operationsInterfaces/simplifiedSolutions.d.ts +44 -0
  124. package/dist-esm/src/operationsInterfaces/simplifiedSolutions.d.ts.map +1 -0
  125. package/dist-esm/src/operationsInterfaces/simplifiedSolutions.js +9 -0
  126. package/dist-esm/src/operationsInterfaces/simplifiedSolutions.js.map +1 -0
  127. package/dist-esm/src/operationsInterfaces/solution.d.ts +20 -25
  128. package/dist-esm/src/operationsInterfaces/solution.d.ts.map +1 -1
  129. package/dist-esm/src/operationsInterfaces/solutionSelfHelp.d.ts +15 -0
  130. package/dist-esm/src/operationsInterfaces/solutionSelfHelp.d.ts.map +1 -0
  131. package/dist-esm/src/operationsInterfaces/solutionSelfHelp.js +9 -0
  132. package/dist-esm/src/operationsInterfaces/solutionSelfHelp.js.map +1 -0
  133. package/dist-esm/src/pagingHelper.js.map +1 -1
  134. package/dist-esm/test/selfhelp_operations_test.spec.js +2 -2
  135. package/dist-esm/test/selfhelp_operations_test.spec.js.map +1 -1
  136. package/package.json +8 -10
  137. package/review/arm-selfhelp.api.md +177 -2
  138. package/src/helpRP.ts +58 -17
  139. package/src/lroImpl.ts +3 -3
  140. package/src/models/index.ts +263 -22
  141. package/src/models/mappers.ts +898 -529
  142. package/src/models/parameters.ts +105 -45
  143. package/src/operations/checkNameAvailability.ts +7 -7
  144. package/src/operations/diagnostics.ts +39 -46
  145. package/src/operations/discoverySolution.ts +29 -46
  146. package/src/operations/discoverySolutionNLPSubscriptionScope.ts +64 -0
  147. package/src/operations/discoverySolutionNLPTenantScope.ts +64 -0
  148. package/src/operations/index.ts +4 -0
  149. package/src/operations/operations.ts +16 -16
  150. package/src/operations/simplifiedSolutions.ts +216 -0
  151. package/src/operations/solution.ts +101 -77
  152. package/src/operations/solutionSelfHelp.ts +68 -0
  153. package/src/operations/troubleshooters.ts +42 -47
  154. package/src/operationsInterfaces/checkNameAvailability.ts +2 -2
  155. package/src/operationsInterfaces/diagnostics.ts +10 -14
  156. package/src/operationsInterfaces/discoverySolution.ts +3 -7
  157. package/src/operationsInterfaces/discoverySolutionNLPSubscriptionScope.ts +24 -0
  158. package/src/operationsInterfaces/discoverySolutionNLPTenantScope.ts +24 -0
  159. package/src/operationsInterfaces/index.ts +4 -0
  160. package/src/operationsInterfaces/operations.ts +1 -1
  161. package/src/operationsInterfaces/simplifiedSolutions.ts +74 -0
  162. package/src/operationsInterfaces/solution.ts +30 -30
  163. package/src/operationsInterfaces/solutionSelfHelp.ts +29 -0
  164. package/src/operationsInterfaces/troubleshooters.ts +6 -6
  165. package/src/pagingHelper.ts +1 -1
  166. package/types/arm-selfhelp.d.ts +359 -46
  167. package/types/tsdoc-metadata.json +1 -1
@@ -18,7 +18,7 @@ import {
18
18
  DiscoverySolutionListNextOptionalParams,
19
19
  DiscoverySolutionListOptionalParams,
20
20
  DiscoverySolutionListResponse,
21
- DiscoverySolutionListNextResponse
21
+ DiscoverySolutionListNextResponse,
22
22
  } from "../models";
23
23
 
24
24
  /// <reference lib="esnext.asynciterable" />
@@ -35,7 +35,7 @@ export class DiscoverySolutionImpl implements DiscoverySolution {
35
35
  }
36
36
 
37
37
  /**
38
- * Lists the relevant Azure diagnostics and solutions using [problemClassification
38
+ * Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification
39
39
  * API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND
40
40
  * resourceUri or resourceType.<br/> Discovery Solutions is the initial entry point within Help API,
41
41
  * which identifies relevant Azure diagnostics and solutions. <br/><br/> Required Input :
@@ -44,16 +44,12 @@ export class DiscoverySolutionImpl implements DiscoverySolution {
44
44
  * <br/>Optional input: resourceUri OR resource Type <br/><br/> <b>Note: </b> ‘requiredInputs’ from
45
45
  * Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics
46
46
  * and Solutions API.
47
- * @param scope scope = resourceUri of affected resource.<br/> For example:
48
- * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read
49
- *
50
47
  * @param options The options parameters.
51
48
  */
52
49
  public list(
53
- scope: string,
54
- options?: DiscoverySolutionListOptionalParams
50
+ options?: DiscoverySolutionListOptionalParams,
55
51
  ): PagedAsyncIterableIterator<SolutionMetadataResource> {
56
- const iter = this.listPagingAll(scope, options);
52
+ const iter = this.listPagingAll(options);
57
53
  return {
58
54
  next() {
59
55
  return iter.next();
@@ -65,27 +61,26 @@ export class DiscoverySolutionImpl implements DiscoverySolution {
65
61
  if (settings?.maxPageSize) {
66
62
  throw new Error("maxPageSize is not supported by this operation.");
67
63
  }
68
- return this.listPagingPage(scope, options, settings);
69
- }
64
+ return this.listPagingPage(options, settings);
65
+ },
70
66
  };
71
67
  }
72
68
 
73
69
  private async *listPagingPage(
74
- scope: string,
75
70
  options?: DiscoverySolutionListOptionalParams,
76
- settings?: PageSettings
71
+ settings?: PageSettings,
77
72
  ): AsyncIterableIterator<SolutionMetadataResource[]> {
78
73
  let result: DiscoverySolutionListResponse;
79
74
  let continuationToken = settings?.continuationToken;
80
75
  if (!continuationToken) {
81
- result = await this._list(scope, options);
76
+ result = await this._list(options);
82
77
  let page = result.value || [];
83
78
  continuationToken = result.nextLink;
84
79
  setContinuationToken(page, continuationToken);
85
80
  yield page;
86
81
  }
87
82
  while (continuationToken) {
88
- result = await this._listNext(scope, continuationToken, options);
83
+ result = await this._listNext(continuationToken, options);
89
84
  continuationToken = result.nextLink;
90
85
  let page = result.value || [];
91
86
  setContinuationToken(page, continuationToken);
@@ -94,16 +89,15 @@ export class DiscoverySolutionImpl implements DiscoverySolution {
94
89
  }
95
90
 
96
91
  private async *listPagingAll(
97
- scope: string,
98
- options?: DiscoverySolutionListOptionalParams
92
+ options?: DiscoverySolutionListOptionalParams,
99
93
  ): AsyncIterableIterator<SolutionMetadataResource> {
100
- for await (const page of this.listPagingPage(scope, options)) {
94
+ for await (const page of this.listPagingPage(options)) {
101
95
  yield* page;
102
96
  }
103
97
  }
104
98
 
105
99
  /**
106
- * Lists the relevant Azure diagnostics and solutions using [problemClassification
100
+ * Lists the relevant Azure Diagnostics, Solutions and Troubleshooters using [problemClassification
107
101
  * API](https://learn.microsoft.com/rest/api/support/problem-classifications/list?tabs=HTTP)) AND
108
102
  * resourceUri or resourceType.<br/> Discovery Solutions is the initial entry point within Help API,
109
103
  * which identifies relevant Azure diagnostics and solutions. <br/><br/> Required Input :
@@ -112,37 +106,26 @@ export class DiscoverySolutionImpl implements DiscoverySolution {
112
106
  * <br/>Optional input: resourceUri OR resource Type <br/><br/> <b>Note: </b> ‘requiredInputs’ from
113
107
  * Discovery solutions response must be passed via ‘additionalParameters’ as an input to Diagnostics
114
108
  * and Solutions API.
115
- * @param scope scope = resourceUri of affected resource.<br/> For example:
116
- * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read
117
- *
118
109
  * @param options The options parameters.
119
110
  */
120
111
  private _list(
121
- scope: string,
122
- options?: DiscoverySolutionListOptionalParams
112
+ options?: DiscoverySolutionListOptionalParams,
123
113
  ): Promise<DiscoverySolutionListResponse> {
124
- return this.client.sendOperationRequest(
125
- { scope, options },
126
- listOperationSpec
127
- );
114
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
128
115
  }
129
116
 
130
117
  /**
131
118
  * ListNext
132
- * @param scope scope = resourceUri of affected resource.<br/> For example:
133
- * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read
134
- *
135
119
  * @param nextLink The nextLink from the previous successful call to the List method.
136
120
  * @param options The options parameters.
137
121
  */
138
122
  private _listNext(
139
- scope: string,
140
123
  nextLink: string,
141
- options?: DiscoverySolutionListNextOptionalParams
124
+ options?: DiscoverySolutionListNextOptionalParams,
142
125
  ): Promise<DiscoverySolutionListNextResponse> {
143
126
  return this.client.sendOperationRequest(
144
- { scope, nextLink, options },
145
- listNextOperationSpec
127
+ { nextLink, options },
128
+ listNextOperationSpec,
146
129
  );
147
130
  }
148
131
  }
@@ -150,37 +133,37 @@ export class DiscoverySolutionImpl implements DiscoverySolution {
150
133
  const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
151
134
 
152
135
  const listOperationSpec: coreClient.OperationSpec = {
153
- path: "/{scope}/providers/Microsoft.Help/discoverySolutions",
136
+ path: "/providers/Microsoft.Help/discoverySolutions",
154
137
  httpMethod: "GET",
155
138
  responses: {
156
139
  200: {
157
- bodyMapper: Mappers.DiscoveryResponse
140
+ bodyMapper: Mappers.DiscoveryResponse,
158
141
  },
159
142
  default: {
160
- bodyMapper: Mappers.ErrorResponse
161
- }
143
+ bodyMapper: Mappers.ErrorResponse,
144
+ },
162
145
  },
163
146
  queryParameters: [
164
147
  Parameters.apiVersion,
165
148
  Parameters.filter,
166
- Parameters.skiptoken
149
+ Parameters.skiptoken,
167
150
  ],
168
- urlParameters: [Parameters.$host, Parameters.scope],
151
+ urlParameters: [Parameters.$host],
169
152
  headerParameters: [Parameters.accept],
170
- serializer
153
+ serializer,
171
154
  };
172
155
  const listNextOperationSpec: coreClient.OperationSpec = {
173
156
  path: "{nextLink}",
174
157
  httpMethod: "GET",
175
158
  responses: {
176
159
  200: {
177
- bodyMapper: Mappers.DiscoveryResponse
160
+ bodyMapper: Mappers.DiscoveryResponse,
178
161
  },
179
162
  default: {
180
- bodyMapper: Mappers.ErrorResponse
181
- }
163
+ bodyMapper: Mappers.ErrorResponse,
164
+ },
182
165
  },
183
- urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope],
166
+ urlParameters: [Parameters.$host, Parameters.nextLink],
184
167
  headerParameters: [Parameters.accept],
185
- serializer
168
+ serializer,
186
169
  };
@@ -0,0 +1,64 @@
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 { DiscoverySolutionNLPSubscriptionScope } 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
+ DiscoverySolutionNLPSubscriptionScopePostOptionalParams,
16
+ DiscoverySolutionNLPSubscriptionScopePostResponse,
17
+ } from "../models";
18
+
19
+ /** Class containing DiscoverySolutionNLPSubscriptionScope operations. */
20
+ export class DiscoverySolutionNLPSubscriptionScopeImpl
21
+ implements DiscoverySolutionNLPSubscriptionScope
22
+ {
23
+ private readonly client: HelpRP;
24
+
25
+ /**
26
+ * Initialize a new instance of the class DiscoverySolutionNLPSubscriptionScope class.
27
+ * @param client Reference to the service client
28
+ */
29
+ constructor(client: HelpRP) {
30
+ this.client = client;
31
+ }
32
+
33
+ /**
34
+ * Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue
35
+ * summary and subscription.
36
+ * @param options The options parameters.
37
+ */
38
+ post(
39
+ options?: DiscoverySolutionNLPSubscriptionScopePostOptionalParams,
40
+ ): Promise<DiscoverySolutionNLPSubscriptionScopePostResponse> {
41
+ return this.client.sendOperationRequest({ options }, postOperationSpec);
42
+ }
43
+ }
44
+ // Operation Specifications
45
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
46
+
47
+ const postOperationSpec: coreClient.OperationSpec = {
48
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.Help/discoverSolutions",
49
+ httpMethod: "POST",
50
+ responses: {
51
+ 200: {
52
+ bodyMapper: Mappers.DiscoveryNlpResponse,
53
+ },
54
+ default: {
55
+ bodyMapper: Mappers.ErrorResponse,
56
+ },
57
+ },
58
+ requestBody: Parameters.discoverSolutionRequest,
59
+ queryParameters: [Parameters.apiVersion],
60
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
61
+ headerParameters: [Parameters.accept, Parameters.contentType],
62
+ mediaType: "json",
63
+ serializer,
64
+ };
@@ -0,0 +1,64 @@
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 { DiscoverySolutionNLPTenantScope } 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
+ DiscoverySolutionNLPTenantScopePostOptionalParams,
16
+ DiscoverySolutionNLPTenantScopePostResponse,
17
+ } from "../models";
18
+
19
+ /** Class containing DiscoverySolutionNLPTenantScope operations. */
20
+ export class DiscoverySolutionNLPTenantScopeImpl
21
+ implements DiscoverySolutionNLPTenantScope
22
+ {
23
+ private readonly client: HelpRP;
24
+
25
+ /**
26
+ * Initialize a new instance of the class DiscoverySolutionNLPTenantScope class.
27
+ * @param client Reference to the service client
28
+ */
29
+ constructor(client: HelpRP) {
30
+ this.client = client;
31
+ }
32
+
33
+ /**
34
+ * Search for relevant Azure Diagnostics, Solutions and Troubleshooters using a natural language issue
35
+ * summary.
36
+ * @param options The options parameters.
37
+ */
38
+ post(
39
+ options?: DiscoverySolutionNLPTenantScopePostOptionalParams,
40
+ ): Promise<DiscoverySolutionNLPTenantScopePostResponse> {
41
+ return this.client.sendOperationRequest({ options }, postOperationSpec);
42
+ }
43
+ }
44
+ // Operation Specifications
45
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
46
+
47
+ const postOperationSpec: coreClient.OperationSpec = {
48
+ path: "/providers/Microsoft.Help/discoverSolutions",
49
+ httpMethod: "POST",
50
+ responses: {
51
+ 200: {
52
+ bodyMapper: Mappers.DiscoveryNlpResponse,
53
+ },
54
+ default: {
55
+ bodyMapper: Mappers.ErrorResponse,
56
+ },
57
+ },
58
+ requestBody: Parameters.discoverSolutionRequest,
59
+ queryParameters: [Parameters.apiVersion],
60
+ urlParameters: [Parameters.$host],
61
+ headerParameters: [Parameters.accept, Parameters.contentType],
62
+ mediaType: "json",
63
+ serializer,
64
+ };
@@ -11,4 +11,8 @@ export * from "./checkNameAvailability";
11
11
  export * from "./diagnostics";
12
12
  export * from "./discoverySolution";
13
13
  export * from "./solution";
14
+ export * from "./simplifiedSolutions";
14
15
  export * from "./troubleshooters";
16
+ export * from "./solutionSelfHelp";
17
+ export * from "./discoverySolutionNLPTenantScope";
18
+ export * from "./discoverySolutionNLPSubscriptionScope";
@@ -18,7 +18,7 @@ import {
18
18
  OperationsListNextOptionalParams,
19
19
  OperationsListOptionalParams,
20
20
  OperationsListResponse,
21
- OperationsListNextResponse
21
+ OperationsListNextResponse,
22
22
  } from "../models";
23
23
 
24
24
  /// <reference lib="esnext.asynciterable" />
@@ -39,7 +39,7 @@ export class OperationsImpl implements Operations {
39
39
  * @param options The options parameters.
40
40
  */
41
41
  public list(
42
- options?: OperationsListOptionalParams
42
+ options?: OperationsListOptionalParams,
43
43
  ): PagedAsyncIterableIterator<Operation> {
44
44
  const iter = this.listPagingAll(options);
45
45
  return {
@@ -54,13 +54,13 @@ export class OperationsImpl implements Operations {
54
54
  throw new Error("maxPageSize is not supported by this operation.");
55
55
  }
56
56
  return this.listPagingPage(options, settings);
57
- }
57
+ },
58
58
  };
59
59
  }
60
60
 
61
61
  private async *listPagingPage(
62
62
  options?: OperationsListOptionalParams,
63
- settings?: PageSettings
63
+ settings?: PageSettings,
64
64
  ): AsyncIterableIterator<Operation[]> {
65
65
  let result: OperationsListResponse;
66
66
  let continuationToken = settings?.continuationToken;
@@ -81,7 +81,7 @@ export class OperationsImpl implements Operations {
81
81
  }
82
82
 
83
83
  private async *listPagingAll(
84
- options?: OperationsListOptionalParams
84
+ options?: OperationsListOptionalParams,
85
85
  ): AsyncIterableIterator<Operation> {
86
86
  for await (const page of this.listPagingPage(options)) {
87
87
  yield* page;
@@ -93,7 +93,7 @@ export class OperationsImpl implements Operations {
93
93
  * @param options The options parameters.
94
94
  */
95
95
  private _list(
96
- options?: OperationsListOptionalParams
96
+ options?: OperationsListOptionalParams,
97
97
  ): Promise<OperationsListResponse> {
98
98
  return this.client.sendOperationRequest({ options }, listOperationSpec);
99
99
  }
@@ -105,11 +105,11 @@ export class OperationsImpl implements Operations {
105
105
  */
106
106
  private _listNext(
107
107
  nextLink: string,
108
- options?: OperationsListNextOptionalParams
108
+ options?: OperationsListNextOptionalParams,
109
109
  ): Promise<OperationsListNextResponse> {
110
110
  return this.client.sendOperationRequest(
111
111
  { nextLink, options },
112
- listNextOperationSpec
112
+ listNextOperationSpec,
113
113
  );
114
114
  }
115
115
  }
@@ -121,29 +121,29 @@ const listOperationSpec: coreClient.OperationSpec = {
121
121
  httpMethod: "GET",
122
122
  responses: {
123
123
  200: {
124
- bodyMapper: Mappers.OperationListResult
124
+ bodyMapper: Mappers.OperationListResult,
125
125
  },
126
126
  default: {
127
- bodyMapper: Mappers.ErrorResponse
128
- }
127
+ bodyMapper: Mappers.ErrorResponse,
128
+ },
129
129
  },
130
130
  queryParameters: [Parameters.apiVersion],
131
131
  urlParameters: [Parameters.$host],
132
132
  headerParameters: [Parameters.accept],
133
- serializer
133
+ serializer,
134
134
  };
135
135
  const listNextOperationSpec: coreClient.OperationSpec = {
136
136
  path: "{nextLink}",
137
137
  httpMethod: "GET",
138
138
  responses: {
139
139
  200: {
140
- bodyMapper: Mappers.OperationListResult
140
+ bodyMapper: Mappers.OperationListResult,
141
141
  },
142
142
  default: {
143
- bodyMapper: Mappers.ErrorResponse
144
- }
143
+ bodyMapper: Mappers.ErrorResponse,
144
+ },
145
145
  },
146
146
  urlParameters: [Parameters.$host, Parameters.nextLink],
147
147
  headerParameters: [Parameters.accept],
148
- serializer
148
+ serializer,
149
149
  };
@@ -0,0 +1,216 @@
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 { SimplifiedSolutions } 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
+ SimplifiedSolutionsCreateOptionalParams,
22
+ SimplifiedSolutionsCreateResponse,
23
+ SimplifiedSolutionsGetOptionalParams,
24
+ SimplifiedSolutionsGetResponse,
25
+ } from "../models";
26
+
27
+ /** Class containing SimplifiedSolutions operations. */
28
+ export class SimplifiedSolutionsImpl implements SimplifiedSolutions {
29
+ private readonly client: HelpRP;
30
+
31
+ /**
32
+ * Initialize a new instance of the class SimplifiedSolutions class.
33
+ * @param client Reference to the service client
34
+ */
35
+ constructor(client: HelpRP) {
36
+ this.client = client;
37
+ }
38
+
39
+ /**
40
+ * Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions
41
+ * as the input. <br/><br/> Simplified Solutions API makes the consumption of solutions APIs easier
42
+ * while still providing access to the same powerful solutions rendered in Solutions API. With
43
+ * Simplified Solutions, users don't have to worry about stitching together the article using
44
+ * replacement maps and can use the content in the API response to directly render as HTML
45
+ * content.<br/>
46
+ * @param scope scope = resourceUri of affected resource.<br/> For example:
47
+ * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read
48
+ *
49
+ * @param simplifiedSolutionsResourceName Simplified Solutions Resource Name.
50
+ * @param options The options parameters.
51
+ */
52
+ async beginCreate(
53
+ scope: string,
54
+ simplifiedSolutionsResourceName: string,
55
+ options?: SimplifiedSolutionsCreateOptionalParams,
56
+ ): Promise<
57
+ SimplePollerLike<
58
+ OperationState<SimplifiedSolutionsCreateResponse>,
59
+ SimplifiedSolutionsCreateResponse
60
+ >
61
+ > {
62
+ const directSendOperation = async (
63
+ args: coreClient.OperationArguments,
64
+ spec: coreClient.OperationSpec,
65
+ ): Promise<SimplifiedSolutionsCreateResponse> => {
66
+ return this.client.sendOperationRequest(args, spec);
67
+ };
68
+ const sendOperationFn = async (
69
+ args: coreClient.OperationArguments,
70
+ spec: coreClient.OperationSpec,
71
+ ) => {
72
+ let currentRawResponse: coreClient.FullOperationResponse | undefined =
73
+ undefined;
74
+ const providedCallback = args.options?.onResponse;
75
+ const callback: coreClient.RawResponseCallback = (
76
+ rawResponse: coreClient.FullOperationResponse,
77
+ flatResponse: unknown,
78
+ ) => {
79
+ currentRawResponse = rawResponse;
80
+ providedCallback?.(rawResponse, flatResponse);
81
+ };
82
+ const updatedArgs = {
83
+ ...args,
84
+ options: {
85
+ ...args.options,
86
+ onResponse: callback,
87
+ },
88
+ };
89
+ const flatResponse = await directSendOperation(updatedArgs, spec);
90
+ return {
91
+ flatResponse,
92
+ rawResponse: {
93
+ statusCode: currentRawResponse!.status,
94
+ body: currentRawResponse!.parsedBody,
95
+ headers: currentRawResponse!.headers.toJSON(),
96
+ },
97
+ };
98
+ };
99
+
100
+ const lro = createLroSpec({
101
+ sendOperationFn,
102
+ args: { scope, simplifiedSolutionsResourceName, options },
103
+ spec: createOperationSpec,
104
+ });
105
+ const poller = await createHttpPoller<
106
+ SimplifiedSolutionsCreateResponse,
107
+ OperationState<SimplifiedSolutionsCreateResponse>
108
+ >(lro, {
109
+ restoreFrom: options?.resumeFrom,
110
+ intervalInMs: options?.updateIntervalInMs,
111
+ resourceLocationConfig: "azure-async-operation",
112
+ });
113
+ await poller.poll();
114
+ return poller;
115
+ }
116
+
117
+ /**
118
+ * Creates Simplified Solutions for an Azure subscription using 'solutionId' from Discovery Solutions
119
+ * as the input. <br/><br/> Simplified Solutions API makes the consumption of solutions APIs easier
120
+ * while still providing access to the same powerful solutions rendered in Solutions API. With
121
+ * Simplified Solutions, users don't have to worry about stitching together the article using
122
+ * replacement maps and can use the content in the API response to directly render as HTML
123
+ * content.<br/>
124
+ * @param scope scope = resourceUri of affected resource.<br/> For example:
125
+ * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read
126
+ *
127
+ * @param simplifiedSolutionsResourceName Simplified Solutions Resource Name.
128
+ * @param options The options parameters.
129
+ */
130
+ async beginCreateAndWait(
131
+ scope: string,
132
+ simplifiedSolutionsResourceName: string,
133
+ options?: SimplifiedSolutionsCreateOptionalParams,
134
+ ): Promise<SimplifiedSolutionsCreateResponse> {
135
+ const poller = await this.beginCreate(
136
+ scope,
137
+ simplifiedSolutionsResourceName,
138
+ options,
139
+ );
140
+ return poller.pollUntilDone();
141
+ }
142
+
143
+ /**
144
+ * Get the simplified Solutions using the applicable solutionResourceName while creating the simplified
145
+ * Solutions.
146
+ * @param scope scope = resourceUri of affected resource.<br/> For example:
147
+ * /subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read
148
+ *
149
+ * @param simplifiedSolutionsResourceName Simplified Solutions Resource Name.
150
+ * @param options The options parameters.
151
+ */
152
+ get(
153
+ scope: string,
154
+ simplifiedSolutionsResourceName: string,
155
+ options?: SimplifiedSolutionsGetOptionalParams,
156
+ ): Promise<SimplifiedSolutionsGetResponse> {
157
+ return this.client.sendOperationRequest(
158
+ { scope, simplifiedSolutionsResourceName, options },
159
+ getOperationSpec,
160
+ );
161
+ }
162
+ }
163
+ // Operation Specifications
164
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
165
+
166
+ const createOperationSpec: coreClient.OperationSpec = {
167
+ path: "/{scope}/providers/Microsoft.Help/simplifiedSolutions/{simplifiedSolutionsResourceName}",
168
+ httpMethod: "PUT",
169
+ responses: {
170
+ 200: {
171
+ bodyMapper: Mappers.SimplifiedSolutionsResource,
172
+ },
173
+ 201: {
174
+ bodyMapper: Mappers.SimplifiedSolutionsResource,
175
+ },
176
+ 202: {
177
+ bodyMapper: Mappers.SimplifiedSolutionsResource,
178
+ },
179
+ 204: {
180
+ bodyMapper: Mappers.SimplifiedSolutionsResource,
181
+ },
182
+ default: {
183
+ bodyMapper: Mappers.ErrorResponse,
184
+ },
185
+ },
186
+ requestBody: Parameters.simplifiedSolutionsRequestBody,
187
+ queryParameters: [Parameters.apiVersion],
188
+ urlParameters: [
189
+ Parameters.$host,
190
+ Parameters.scope,
191
+ Parameters.simplifiedSolutionsResourceName,
192
+ ],
193
+ headerParameters: [Parameters.accept, Parameters.contentType],
194
+ mediaType: "json",
195
+ serializer,
196
+ };
197
+ const getOperationSpec: coreClient.OperationSpec = {
198
+ path: "/{scope}/providers/Microsoft.Help/simplifiedSolutions/{simplifiedSolutionsResourceName}",
199
+ httpMethod: "GET",
200
+ responses: {
201
+ 200: {
202
+ bodyMapper: Mappers.SimplifiedSolutionsResource,
203
+ },
204
+ default: {
205
+ bodyMapper: Mappers.ErrorResponse,
206
+ },
207
+ },
208
+ queryParameters: [Parameters.apiVersion],
209
+ urlParameters: [
210
+ Parameters.$host,
211
+ Parameters.scope,
212
+ Parameters.simplifiedSolutionsResourceName,
213
+ ],
214
+ headerParameters: [Parameters.accept],
215
+ serializer,
216
+ };