@azure/arm-cognitiveservices 7.7.0-alpha.20250717.1 → 7.7.0-alpha.20250718.2

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 (235) hide show
  1. package/dist/browser/cognitiveServicesManagementClient.js +40 -8
  2. package/dist/browser/cognitiveServicesManagementClient.js.map +1 -1
  3. package/dist/browser/lroImpl.js +7 -3
  4. package/dist/browser/lroImpl.js.map +1 -1
  5. package/dist/browser/models/mappers.js +286 -125
  6. package/dist/browser/models/mappers.js.map +1 -1
  7. package/dist/browser/operations/accountCapabilityHosts.js +23 -12
  8. package/dist/browser/operations/accountCapabilityHosts.js.map +1 -1
  9. package/dist/browser/operations/accountConnection.js +23 -40
  10. package/dist/browser/operations/accountConnection.js.map +1 -1
  11. package/dist/browser/operations/accounts.js +101 -137
  12. package/dist/browser/operations/accounts.js.map +1 -1
  13. package/dist/browser/operations/commitmentPlans.js +155 -193
  14. package/dist/browser/operations/commitmentPlans.js.map +1 -1
  15. package/dist/browser/operations/commitmentTiers.js +23 -40
  16. package/dist/browser/operations/commitmentTiers.js.map +1 -1
  17. package/dist/browser/operations/defenderForAISettings.js +23 -40
  18. package/dist/browser/operations/defenderForAISettings.js.map +1 -1
  19. package/dist/browser/operations/deletedAccounts.js +34 -46
  20. package/dist/browser/operations/deletedAccounts.js.map +1 -1
  21. package/dist/browser/operations/deployments.js +78 -97
  22. package/dist/browser/operations/deployments.js.map +1 -1
  23. package/dist/browser/operations/encryptionScopes.js +34 -46
  24. package/dist/browser/operations/encryptionScopes.js.map +1 -1
  25. package/dist/browser/operations/locationBasedModelCapacities.js +23 -40
  26. package/dist/browser/operations/locationBasedModelCapacities.js.map +1 -1
  27. package/dist/browser/operations/modelCapacities.js +23 -40
  28. package/dist/browser/operations/modelCapacities.js.map +1 -1
  29. package/dist/browser/operations/models.js +23 -40
  30. package/dist/browser/operations/models.js.map +1 -1
  31. package/dist/browser/operations/networkSecurityPerimeterConfigurations.js +34 -46
  32. package/dist/browser/operations/networkSecurityPerimeterConfigurations.js.map +1 -1
  33. package/dist/browser/operations/operations.js +23 -40
  34. package/dist/browser/operations/operations.js.map +1 -1
  35. package/dist/browser/operations/privateEndpointConnections.js +23 -12
  36. package/dist/browser/operations/privateEndpointConnections.js.map +1 -1
  37. package/dist/browser/operations/privateLinkResources.js +1 -0
  38. package/dist/browser/operations/privateLinkResources.js.map +1 -1
  39. package/dist/browser/operations/projectCapabilityHosts.js +23 -12
  40. package/dist/browser/operations/projectCapabilityHosts.js.map +1 -1
  41. package/dist/browser/operations/projectConnection.js +23 -40
  42. package/dist/browser/operations/projectConnection.js.map +1 -1
  43. package/dist/browser/operations/projects.js +56 -58
  44. package/dist/browser/operations/projects.js.map +1 -1
  45. package/dist/browser/operations/raiBlocklistItems.js +34 -46
  46. package/dist/browser/operations/raiBlocklistItems.js.map +1 -1
  47. package/dist/browser/operations/raiBlocklists.js +34 -46
  48. package/dist/browser/operations/raiBlocklists.js.map +1 -1
  49. package/dist/browser/operations/raiContentFilters.js +23 -40
  50. package/dist/browser/operations/raiContentFilters.js.map +1 -1
  51. package/dist/browser/operations/raiPolicies.js +34 -46
  52. package/dist/browser/operations/raiPolicies.js.map +1 -1
  53. package/dist/browser/operations/resourceSkus.js +23 -40
  54. package/dist/browser/operations/resourceSkus.js.map +1 -1
  55. package/dist/browser/operations/usages.js +23 -40
  56. package/dist/browser/operations/usages.js.map +1 -1
  57. package/dist/browser/pagingHelper.js +2 -4
  58. package/dist/browser/pagingHelper.js.map +1 -1
  59. package/dist/commonjs/cognitiveServicesManagementClient.js +40 -8
  60. package/dist/commonjs/cognitiveServicesManagementClient.js.map +1 -1
  61. package/dist/commonjs/lroImpl.js +7 -3
  62. package/dist/commonjs/lroImpl.js.map +1 -1
  63. package/dist/commonjs/models/mappers.js +286 -125
  64. package/dist/commonjs/models/mappers.js.map +1 -1
  65. package/dist/commonjs/operations/accountCapabilityHosts.js +23 -12
  66. package/dist/commonjs/operations/accountCapabilityHosts.js.map +1 -1
  67. package/dist/commonjs/operations/accountConnection.js +23 -39
  68. package/dist/commonjs/operations/accountConnection.js.map +1 -1
  69. package/dist/commonjs/operations/accounts.js +101 -136
  70. package/dist/commonjs/operations/accounts.js.map +1 -1
  71. package/dist/commonjs/operations/commitmentPlans.js +155 -192
  72. package/dist/commonjs/operations/commitmentPlans.js.map +1 -1
  73. package/dist/commonjs/operations/commitmentTiers.js +23 -39
  74. package/dist/commonjs/operations/commitmentTiers.js.map +1 -1
  75. package/dist/commonjs/operations/defenderForAISettings.js +23 -39
  76. package/dist/commonjs/operations/defenderForAISettings.js.map +1 -1
  77. package/dist/commonjs/operations/deletedAccounts.js +34 -45
  78. package/dist/commonjs/operations/deletedAccounts.js.map +1 -1
  79. package/dist/commonjs/operations/deployments.js +78 -96
  80. package/dist/commonjs/operations/deployments.js.map +1 -1
  81. package/dist/commonjs/operations/encryptionScopes.js +34 -45
  82. package/dist/commonjs/operations/encryptionScopes.js.map +1 -1
  83. package/dist/commonjs/operations/locationBasedModelCapacities.js +23 -39
  84. package/dist/commonjs/operations/locationBasedModelCapacities.js.map +1 -1
  85. package/dist/commonjs/operations/modelCapacities.js +23 -39
  86. package/dist/commonjs/operations/modelCapacities.js.map +1 -1
  87. package/dist/commonjs/operations/models.js +23 -39
  88. package/dist/commonjs/operations/models.js.map +1 -1
  89. package/dist/commonjs/operations/networkSecurityPerimeterConfigurations.js +34 -45
  90. package/dist/commonjs/operations/networkSecurityPerimeterConfigurations.js.map +1 -1
  91. package/dist/commonjs/operations/operations.js +23 -39
  92. package/dist/commonjs/operations/operations.js.map +1 -1
  93. package/dist/commonjs/operations/privateEndpointConnections.js +23 -12
  94. package/dist/commonjs/operations/privateEndpointConnections.js.map +1 -1
  95. package/dist/commonjs/operations/privateLinkResources.js +1 -0
  96. package/dist/commonjs/operations/privateLinkResources.js.map +1 -1
  97. package/dist/commonjs/operations/projectCapabilityHosts.js +23 -12
  98. package/dist/commonjs/operations/projectCapabilityHosts.js.map +1 -1
  99. package/dist/commonjs/operations/projectConnection.js +23 -39
  100. package/dist/commonjs/operations/projectConnection.js.map +1 -1
  101. package/dist/commonjs/operations/projects.js +56 -57
  102. package/dist/commonjs/operations/projects.js.map +1 -1
  103. package/dist/commonjs/operations/raiBlocklistItems.js +34 -45
  104. package/dist/commonjs/operations/raiBlocklistItems.js.map +1 -1
  105. package/dist/commonjs/operations/raiBlocklists.js +34 -45
  106. package/dist/commonjs/operations/raiBlocklists.js.map +1 -1
  107. package/dist/commonjs/operations/raiContentFilters.js +23 -39
  108. package/dist/commonjs/operations/raiContentFilters.js.map +1 -1
  109. package/dist/commonjs/operations/raiPolicies.js +34 -45
  110. package/dist/commonjs/operations/raiPolicies.js.map +1 -1
  111. package/dist/commonjs/operations/resourceSkus.js +23 -39
  112. package/dist/commonjs/operations/resourceSkus.js.map +1 -1
  113. package/dist/commonjs/operations/usages.js +23 -39
  114. package/dist/commonjs/operations/usages.js.map +1 -1
  115. package/dist/commonjs/pagingHelper.js +2 -4
  116. package/dist/commonjs/pagingHelper.js.map +1 -1
  117. package/dist/commonjs/tsdoc-metadata.json +11 -11
  118. package/dist/esm/cognitiveServicesManagementClient.js +40 -8
  119. package/dist/esm/cognitiveServicesManagementClient.js.map +1 -1
  120. package/dist/esm/lroImpl.js +7 -3
  121. package/dist/esm/lroImpl.js.map +1 -1
  122. package/dist/esm/models/mappers.js +286 -125
  123. package/dist/esm/models/mappers.js.map +1 -1
  124. package/dist/esm/operations/accountCapabilityHosts.js +23 -12
  125. package/dist/esm/operations/accountCapabilityHosts.js.map +1 -1
  126. package/dist/esm/operations/accountConnection.js +23 -40
  127. package/dist/esm/operations/accountConnection.js.map +1 -1
  128. package/dist/esm/operations/accounts.js +101 -137
  129. package/dist/esm/operations/accounts.js.map +1 -1
  130. package/dist/esm/operations/commitmentPlans.js +155 -193
  131. package/dist/esm/operations/commitmentPlans.js.map +1 -1
  132. package/dist/esm/operations/commitmentTiers.js +23 -40
  133. package/dist/esm/operations/commitmentTiers.js.map +1 -1
  134. package/dist/esm/operations/defenderForAISettings.js +23 -40
  135. package/dist/esm/operations/defenderForAISettings.js.map +1 -1
  136. package/dist/esm/operations/deletedAccounts.js +34 -46
  137. package/dist/esm/operations/deletedAccounts.js.map +1 -1
  138. package/dist/esm/operations/deployments.js +78 -97
  139. package/dist/esm/operations/deployments.js.map +1 -1
  140. package/dist/esm/operations/encryptionScopes.js +34 -46
  141. package/dist/esm/operations/encryptionScopes.js.map +1 -1
  142. package/dist/esm/operations/locationBasedModelCapacities.js +23 -40
  143. package/dist/esm/operations/locationBasedModelCapacities.js.map +1 -1
  144. package/dist/esm/operations/modelCapacities.js +23 -40
  145. package/dist/esm/operations/modelCapacities.js.map +1 -1
  146. package/dist/esm/operations/models.js +23 -40
  147. package/dist/esm/operations/models.js.map +1 -1
  148. package/dist/esm/operations/networkSecurityPerimeterConfigurations.js +34 -46
  149. package/dist/esm/operations/networkSecurityPerimeterConfigurations.js.map +1 -1
  150. package/dist/esm/operations/operations.js +23 -40
  151. package/dist/esm/operations/operations.js.map +1 -1
  152. package/dist/esm/operations/privateEndpointConnections.js +23 -12
  153. package/dist/esm/operations/privateEndpointConnections.js.map +1 -1
  154. package/dist/esm/operations/privateLinkResources.js +1 -0
  155. package/dist/esm/operations/privateLinkResources.js.map +1 -1
  156. package/dist/esm/operations/projectCapabilityHosts.js +23 -12
  157. package/dist/esm/operations/projectCapabilityHosts.js.map +1 -1
  158. package/dist/esm/operations/projectConnection.js +23 -40
  159. package/dist/esm/operations/projectConnection.js.map +1 -1
  160. package/dist/esm/operations/projects.js +56 -58
  161. package/dist/esm/operations/projects.js.map +1 -1
  162. package/dist/esm/operations/raiBlocklistItems.js +34 -46
  163. package/dist/esm/operations/raiBlocklistItems.js.map +1 -1
  164. package/dist/esm/operations/raiBlocklists.js +34 -46
  165. package/dist/esm/operations/raiBlocklists.js.map +1 -1
  166. package/dist/esm/operations/raiContentFilters.js +23 -40
  167. package/dist/esm/operations/raiContentFilters.js.map +1 -1
  168. package/dist/esm/operations/raiPolicies.js +34 -46
  169. package/dist/esm/operations/raiPolicies.js.map +1 -1
  170. package/dist/esm/operations/resourceSkus.js +23 -40
  171. package/dist/esm/operations/resourceSkus.js.map +1 -1
  172. package/dist/esm/operations/usages.js +23 -40
  173. package/dist/esm/operations/usages.js.map +1 -1
  174. package/dist/esm/pagingHelper.js +2 -4
  175. package/dist/esm/pagingHelper.js.map +1 -1
  176. package/dist/react-native/cognitiveServicesManagementClient.js +40 -8
  177. package/dist/react-native/cognitiveServicesManagementClient.js.map +1 -1
  178. package/dist/react-native/lroImpl.js +7 -3
  179. package/dist/react-native/lroImpl.js.map +1 -1
  180. package/dist/react-native/models/mappers.js +286 -125
  181. package/dist/react-native/models/mappers.js.map +1 -1
  182. package/dist/react-native/operations/accountCapabilityHosts.js +23 -12
  183. package/dist/react-native/operations/accountCapabilityHosts.js.map +1 -1
  184. package/dist/react-native/operations/accountConnection.js +23 -40
  185. package/dist/react-native/operations/accountConnection.js.map +1 -1
  186. package/dist/react-native/operations/accounts.js +101 -137
  187. package/dist/react-native/operations/accounts.js.map +1 -1
  188. package/dist/react-native/operations/commitmentPlans.js +155 -193
  189. package/dist/react-native/operations/commitmentPlans.js.map +1 -1
  190. package/dist/react-native/operations/commitmentTiers.js +23 -40
  191. package/dist/react-native/operations/commitmentTiers.js.map +1 -1
  192. package/dist/react-native/operations/defenderForAISettings.js +23 -40
  193. package/dist/react-native/operations/defenderForAISettings.js.map +1 -1
  194. package/dist/react-native/operations/deletedAccounts.js +34 -46
  195. package/dist/react-native/operations/deletedAccounts.js.map +1 -1
  196. package/dist/react-native/operations/deployments.js +78 -97
  197. package/dist/react-native/operations/deployments.js.map +1 -1
  198. package/dist/react-native/operations/encryptionScopes.js +34 -46
  199. package/dist/react-native/operations/encryptionScopes.js.map +1 -1
  200. package/dist/react-native/operations/locationBasedModelCapacities.js +23 -40
  201. package/dist/react-native/operations/locationBasedModelCapacities.js.map +1 -1
  202. package/dist/react-native/operations/modelCapacities.js +23 -40
  203. package/dist/react-native/operations/modelCapacities.js.map +1 -1
  204. package/dist/react-native/operations/models.js +23 -40
  205. package/dist/react-native/operations/models.js.map +1 -1
  206. package/dist/react-native/operations/networkSecurityPerimeterConfigurations.js +34 -46
  207. package/dist/react-native/operations/networkSecurityPerimeterConfigurations.js.map +1 -1
  208. package/dist/react-native/operations/operations.js +23 -40
  209. package/dist/react-native/operations/operations.js.map +1 -1
  210. package/dist/react-native/operations/privateEndpointConnections.js +23 -12
  211. package/dist/react-native/operations/privateEndpointConnections.js.map +1 -1
  212. package/dist/react-native/operations/privateLinkResources.js +1 -0
  213. package/dist/react-native/operations/privateLinkResources.js.map +1 -1
  214. package/dist/react-native/operations/projectCapabilityHosts.js +23 -12
  215. package/dist/react-native/operations/projectCapabilityHosts.js.map +1 -1
  216. package/dist/react-native/operations/projectConnection.js +23 -40
  217. package/dist/react-native/operations/projectConnection.js.map +1 -1
  218. package/dist/react-native/operations/projects.js +56 -58
  219. package/dist/react-native/operations/projects.js.map +1 -1
  220. package/dist/react-native/operations/raiBlocklistItems.js +34 -46
  221. package/dist/react-native/operations/raiBlocklistItems.js.map +1 -1
  222. package/dist/react-native/operations/raiBlocklists.js +34 -46
  223. package/dist/react-native/operations/raiBlocklists.js.map +1 -1
  224. package/dist/react-native/operations/raiContentFilters.js +23 -40
  225. package/dist/react-native/operations/raiContentFilters.js.map +1 -1
  226. package/dist/react-native/operations/raiPolicies.js +34 -46
  227. package/dist/react-native/operations/raiPolicies.js.map +1 -1
  228. package/dist/react-native/operations/resourceSkus.js +23 -40
  229. package/dist/react-native/operations/resourceSkus.js.map +1 -1
  230. package/dist/react-native/operations/usages.js +23 -40
  231. package/dist/react-native/operations/usages.js.map +1 -1
  232. package/dist/react-native/pagingHelper.js +2 -4
  233. package/dist/react-native/pagingHelper.js.map +1 -1
  234. package/package.json +2 -2
  235. package/review/arm-cognitiveservices-node.api.md +3079 -3079
@@ -5,7 +5,6 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import { setContinuationToken } from "../pagingHelper.js";
10
9
  import * as coreClient from "@azure/core-client";
11
10
  import * as Mappers from "../models/mappers.js";
@@ -13,6 +12,7 @@ import * as Parameters from "../models/parameters.js";
13
12
  /// <reference lib="esnext.asynciterable" />
14
13
  /** Class containing ResourceSkus operations. */
15
14
  export class ResourceSkusImpl {
15
+ client;
16
16
  /**
17
17
  * Initialize a new instance of the class ResourceSkus class.
18
18
  * @param client Reference to the service client
@@ -34,52 +34,35 @@ export class ResourceSkusImpl {
34
34
  return this;
35
35
  },
36
36
  byPage: (settings) => {
37
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
37
+ if (settings?.maxPageSize) {
38
38
  throw new Error("maxPageSize is not supported by this operation.");
39
39
  }
40
40
  return this.listPagingPage(options, settings);
41
41
  },
42
42
  };
43
43
  }
44
- listPagingPage(options, settings) {
45
- return __asyncGenerator(this, arguments, function* listPagingPage_1() {
46
- let result;
47
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
48
- if (!continuationToken) {
49
- result = yield __await(this._list(options));
50
- let page = result.value || [];
51
- continuationToken = result.nextLink;
52
- setContinuationToken(page, continuationToken);
53
- yield yield __await(page);
54
- }
55
- while (continuationToken) {
56
- result = yield __await(this._listNext(continuationToken, options));
57
- continuationToken = result.nextLink;
58
- let page = result.value || [];
59
- setContinuationToken(page, continuationToken);
60
- yield yield __await(page);
61
- }
62
- });
44
+ async *listPagingPage(options, settings) {
45
+ let result;
46
+ let continuationToken = settings?.continuationToken;
47
+ if (!continuationToken) {
48
+ result = await this._list(options);
49
+ let page = result.value || [];
50
+ continuationToken = result.nextLink;
51
+ setContinuationToken(page, continuationToken);
52
+ yield page;
53
+ }
54
+ while (continuationToken) {
55
+ result = await this._listNext(continuationToken, options);
56
+ continuationToken = result.nextLink;
57
+ let page = result.value || [];
58
+ setContinuationToken(page, continuationToken);
59
+ yield page;
60
+ }
63
61
  }
64
- listPagingAll(options) {
65
- return __asyncGenerator(this, arguments, function* listPagingAll_1() {
66
- var _a, e_1, _b, _c;
67
- try {
68
- for (var _d = true, _e = __asyncValues(this.listPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
69
- _c = _f.value;
70
- _d = false;
71
- const page = _c;
72
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
73
- }
74
- }
75
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
76
- finally {
77
- try {
78
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
79
- }
80
- finally { if (e_1) throw e_1.error; }
81
- }
82
- });
62
+ async *listPagingAll(options) {
63
+ for await (const page of this.listPagingPage(options)) {
64
+ yield* page;
65
+ }
83
66
  }
84
67
  /**
85
68
  * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription.
@@ -1 +1 @@
1
- {"version":3,"file":"resourceSkus.js","sourceRoot":"","sources":["../../../src/operations/resourceSkus.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAUtD,4CAA4C;AAC5C,gDAAgD;AAChD,MAAM,OAAO,gBAAgB;IAG3B;;;OAGG;IACH,YAAY,MAAyC;QACnD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,IAAI,CAAC,OAAwC;QAClD,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EA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AO,CAAC,qBAAqB;SAC1C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,QAAQ,CAAC;IACjF,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { ResourceSkus } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { CognitiveServicesManagementClient } from \"../cognitiveServicesManagementClient.js\";\nimport {\n ResourceSku,\n ResourceSkusListNextOptionalParams,\n ResourceSkusListOptionalParams,\n ResourceSkusListResponse,\n ResourceSkusListNextResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing ResourceSkus operations. */\nexport class ResourceSkusImpl implements ResourceSkus {\n private readonly client: CognitiveServicesManagementClient;\n\n /**\n * Initialize a new instance of the class ResourceSkus class.\n * @param client Reference to the service client\n */\n constructor(client: CognitiveServicesManagementClient) {\n this.client = client;\n }\n\n /**\n * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription.\n * @param options The options parameters.\n */\n public list(options?: ResourceSkusListOptionalParams): PagedAsyncIterableIterator<ResourceSku> {\n const iter = this.listPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listPagingPage(options, settings);\n },\n };\n }\n\n private async *listPagingPage(\n options?: ResourceSkusListOptionalParams,\n settings?: PageSettings,\n ): AsyncIterableIterator<ResourceSku[]> {\n let result: ResourceSkusListResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._list(options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._listNext(continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listPagingAll(\n options?: ResourceSkusListOptionalParams,\n ): AsyncIterableIterator<ResourceSku> {\n for await (const page of this.listPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription.\n * @param options The options parameters.\n */\n private _list(options?: ResourceSkusListOptionalParams): Promise<ResourceSkusListResponse> {\n return this.client.sendOperationRequest({ options }, listOperationSpec);\n }\n\n /**\n * ListNext\n * @param nextLink The nextLink from the previous successful call to the List method.\n * @param options The options parameters.\n */\n private _listNext(\n nextLink: string,\n options?: ResourceSkusListNextOptionalParams,\n ): Promise<ResourceSkusListNextResponse> {\n return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ResourceSkuListResult,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ResourceSkuListResult,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
1
+ {"version":3,"file":"resourceSkus.js","sourceRoot":"","sources":["../../../src/operations/resourceSkus.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAUtD,4CAA4C;AAC5C,gDAAgD;AAChD,MAAM,OAAO,gBAAgB;IACV,MAAM,CAAoC;IAE3D;;;OAGG;IACH,YAAY,MAAyC;QACnD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,IAAI,CAAC,OAAwC;QAClD,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,QAAuB,EAAE,EAAE;gBAClC,IAAI,QAAQ,EAAE,WAAW,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;gBACD,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAChD,CAAC;SACF,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,CAAC,cAAc,CAC3B,OAAwC,EACxC,QAAuB;QAEvB,IAAI,MAAgC,CAAC;QACrC,IAAI,iBAAiB,GAAG,QAAQ,EAAE,iBAAiB,CAAC;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AAC,CAAC;AAE3E,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,4EAA4E;IAClF,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,qBAAqB;SAC1C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC;IAC5D,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,qBAAqB;SAC1C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,QAAQ,CAAC;IACjF,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { ResourceSkus } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { CognitiveServicesManagementClient } from \"../cognitiveServicesManagementClient.js\";\nimport {\n ResourceSku,\n ResourceSkusListNextOptionalParams,\n ResourceSkusListOptionalParams,\n ResourceSkusListResponse,\n ResourceSkusListNextResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing ResourceSkus operations. */\nexport class ResourceSkusImpl implements ResourceSkus {\n private readonly client: CognitiveServicesManagementClient;\n\n /**\n * Initialize a new instance of the class ResourceSkus class.\n * @param client Reference to the service client\n */\n constructor(client: CognitiveServicesManagementClient) {\n this.client = client;\n }\n\n /**\n * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription.\n * @param options The options parameters.\n */\n public list(options?: ResourceSkusListOptionalParams): PagedAsyncIterableIterator<ResourceSku> {\n const iter = this.listPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listPagingPage(options, settings);\n },\n };\n }\n\n private async *listPagingPage(\n options?: ResourceSkusListOptionalParams,\n settings?: PageSettings,\n ): AsyncIterableIterator<ResourceSku[]> {\n let result: ResourceSkusListResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._list(options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._listNext(continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listPagingAll(\n options?: ResourceSkusListOptionalParams,\n ): AsyncIterableIterator<ResourceSku> {\n for await (const page of this.listPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription.\n * @param options The options parameters.\n */\n private _list(options?: ResourceSkusListOptionalParams): Promise<ResourceSkusListResponse> {\n return this.client.sendOperationRequest({ options }, listOperationSpec);\n }\n\n /**\n * ListNext\n * @param nextLink The nextLink from the previous successful call to the List method.\n * @param options The options parameters.\n */\n private _listNext(\n nextLink: string,\n options?: ResourceSkusListNextOptionalParams,\n ): Promise<ResourceSkusListNextResponse> {\n return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ResourceSkuListResult,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.ResourceSkuListResult,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
@@ -5,7 +5,6 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import { setContinuationToken } from "../pagingHelper.js";
10
9
  import * as coreClient from "@azure/core-client";
11
10
  import * as Mappers from "../models/mappers.js";
@@ -13,6 +12,7 @@ import * as Parameters from "../models/parameters.js";
13
12
  /// <reference lib="esnext.asynciterable" />
14
13
  /** Class containing Usages operations. */
15
14
  export class UsagesImpl {
15
+ client;
16
16
  /**
17
17
  * Initialize a new instance of the class Usages class.
18
18
  * @param client Reference to the service client
@@ -35,52 +35,35 @@ export class UsagesImpl {
35
35
  return this;
36
36
  },
37
37
  byPage: (settings) => {
38
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
38
+ if (settings?.maxPageSize) {
39
39
  throw new Error("maxPageSize is not supported by this operation.");
40
40
  }
41
41
  return this.listPagingPage(location, options, settings);
42
42
  },
43
43
  };
44
44
  }
45
- listPagingPage(location, options, settings) {
46
- return __asyncGenerator(this, arguments, function* listPagingPage_1() {
47
- let result;
48
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
49
- if (!continuationToken) {
50
- result = yield __await(this._list(location, options));
51
- let page = result.value || [];
52
- continuationToken = result.nextLink;
53
- setContinuationToken(page, continuationToken);
54
- yield yield __await(page);
55
- }
56
- while (continuationToken) {
57
- result = yield __await(this._listNext(location, continuationToken, options));
58
- continuationToken = result.nextLink;
59
- let page = result.value || [];
60
- setContinuationToken(page, continuationToken);
61
- yield yield __await(page);
62
- }
63
- });
45
+ async *listPagingPage(location, options, settings) {
46
+ let result;
47
+ let continuationToken = settings?.continuationToken;
48
+ if (!continuationToken) {
49
+ result = await this._list(location, options);
50
+ let page = result.value || [];
51
+ continuationToken = result.nextLink;
52
+ setContinuationToken(page, continuationToken);
53
+ yield page;
54
+ }
55
+ while (continuationToken) {
56
+ result = await this._listNext(location, continuationToken, options);
57
+ continuationToken = result.nextLink;
58
+ let page = result.value || [];
59
+ setContinuationToken(page, continuationToken);
60
+ yield page;
61
+ }
64
62
  }
65
- listPagingAll(location, options) {
66
- return __asyncGenerator(this, arguments, function* listPagingAll_1() {
67
- var _a, e_1, _b, _c;
68
- try {
69
- for (var _d = true, _e = __asyncValues(this.listPagingPage(location, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
70
- _c = _f.value;
71
- _d = false;
72
- const page = _c;
73
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
74
- }
75
- }
76
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
77
- finally {
78
- try {
79
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
80
- }
81
- finally { if (e_1) throw e_1.error; }
82
- }
83
- });
63
+ async *listPagingAll(location, options) {
64
+ for await (const page of this.listPagingPage(location, options)) {
65
+ yield* page;
66
+ }
84
67
  }
85
68
  /**
86
69
  * Get usages for the requested subscription
@@ -1 +1 @@
1
- {"version":3,"file":"usages.js","sourceRoot":"","sources":["../../../src/operations/usages.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAUtD,4CAA4C;AAC5C,0CAA0C;AAC1C,MAAM,OAAO,UAAU;IAGrB;;;OAGG;IACH,YAAY,MAAyC;QACnD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,IAAI,CACT,QAAgB,EAChB,OAAkC;QAElC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACnD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,QAAuB,EAAE,EAAE;gBAClC,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;gBACD,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YAC1D,CAAC;SACF,CAAC;IACJ,CAAC;IAEc,cAAc,CAC3B,QAAgB,EAChB,OAAkC,EAClC,QAAuB;;YAEvB,IAAI,MAA0B,CAAC;YAC/B,IAAI,iBAAiB,GAAG,QAAQ,aAAR,QAAQ,uB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ated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { Usages } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { CognitiveServicesManagementClient } from \"../cognitiveServicesManagementClient.js\";\nimport {\n Usage,\n UsagesListNextOptionalParams,\n UsagesListOptionalParams,\n UsagesListResponse,\n UsagesListNextResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Usages operations. */\nexport class UsagesImpl implements Usages {\n private readonly client: CognitiveServicesManagementClient;\n\n /**\n * Initialize a new instance of the class Usages class.\n * @param client Reference to the service client\n */\n constructor(client: CognitiveServicesManagementClient) {\n this.client = client;\n }\n\n /**\n * Get usages for the requested subscription\n * @param location Resource location.\n * @param options The options parameters.\n */\n public list(\n location: string,\n options?: UsagesListOptionalParams,\n ): PagedAsyncIterableIterator<Usage> {\n const iter = this.listPagingAll(location, options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listPagingPage(location, options, settings);\n },\n };\n }\n\n private async *listPagingPage(\n location: string,\n options?: UsagesListOptionalParams,\n settings?: PageSettings,\n ): AsyncIterableIterator<Usage[]> {\n let result: UsagesListResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._list(location, options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._listNext(location, continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listPagingAll(\n location: string,\n options?: UsagesListOptionalParams,\n ): AsyncIterableIterator<Usage> {\n for await (const page of this.listPagingPage(location, options)) {\n yield* page;\n }\n }\n\n /**\n * Get usages for the requested subscription\n * @param location Resource location.\n * @param options The options parameters.\n */\n private _list(location: string, options?: UsagesListOptionalParams): Promise<UsagesListResponse> {\n return this.client.sendOperationRequest({ location, options }, listOperationSpec);\n }\n\n /**\n * ListNext\n * @param location Resource location.\n * @param nextLink The nextLink from the previous successful call to the List method.\n * @param options The options parameters.\n */\n private _listNext(\n location: string,\n nextLink: string,\n options?: UsagesListNextOptionalParams,\n ): Promise<UsagesListNextResponse> {\n return this.client.sendOperationRequest({ location, nextLink, options }, listNextOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.UsageListResult,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter],\n urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.UsageListResult,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.nextLink,\n Parameters.location,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
1
+ {"version":3,"file":"usages.js","sourceRoot":"","sources":["../../../src/operations/usages.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oB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SACpC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC;IAC3D,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,QAAQ,CAAC;IACjF,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,eAAe;SACpC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,QAAQ;KACpB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { Usages } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { CognitiveServicesManagementClient } from \"../cognitiveServicesManagementClient.js\";\nimport {\n Usage,\n UsagesListNextOptionalParams,\n UsagesListOptionalParams,\n UsagesListResponse,\n UsagesListNextResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Usages operations. */\nexport class UsagesImpl implements Usages {\n private readonly client: CognitiveServicesManagementClient;\n\n /**\n * Initialize a new instance of the class Usages class.\n * @param client Reference to the service client\n */\n constructor(client: CognitiveServicesManagementClient) {\n this.client = client;\n }\n\n /**\n * Get usages for the requested subscription\n * @param location Resource location.\n * @param options The options parameters.\n */\n public list(\n location: string,\n options?: UsagesListOptionalParams,\n ): PagedAsyncIterableIterator<Usage> {\n const iter = this.listPagingAll(location, options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listPagingPage(location, options, settings);\n },\n };\n }\n\n private async *listPagingPage(\n location: string,\n options?: UsagesListOptionalParams,\n settings?: PageSettings,\n ): AsyncIterableIterator<Usage[]> {\n let result: UsagesListResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._list(location, options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._listNext(location, continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listPagingAll(\n location: string,\n options?: UsagesListOptionalParams,\n ): AsyncIterableIterator<Usage> {\n for await (const page of this.listPagingPage(location, options)) {\n yield* page;\n }\n }\n\n /**\n * Get usages for the requested subscription\n * @param location Resource location.\n * @param options The options parameters.\n */\n private _list(location: string, options?: UsagesListOptionalParams): Promise<UsagesListResponse> {\n return this.client.sendOperationRequest({ location, options }, listOperationSpec);\n }\n\n /**\n * ListNext\n * @param location Resource location.\n * @param nextLink The nextLink from the previous successful call to the List method.\n * @param options The options parameters.\n */\n private _listNext(\n location: string,\n nextLink: string,\n options?: UsagesListNextOptionalParams,\n ): Promise<UsagesListNextResponse> {\n return this.client.sendOperationRequest({ location, nextLink, options }, listNextOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.UsageListResult,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n queryParameters: [Parameters.apiVersion, Parameters.filter],\n urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.UsageListResult,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.nextLink,\n Parameters.location,\n ],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
@@ -14,18 +14,16 @@ const pageMap = new WeakMap();
14
14
  * @returns The continuation token that can be passed into byPage() during future calls.
15
15
  */
16
16
  export function getContinuationToken(page) {
17
- var _a;
18
17
  if (typeof page !== "object" || page === null) {
19
18
  return undefined;
20
19
  }
21
- return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
20
+ return pageMap.get(page)?.continuationToken;
22
21
  }
23
22
  export function setContinuationToken(page, continuationToken) {
24
- var _a;
25
23
  if (typeof page !== "object" || page === null || !continuationToken) {
26
24
  return;
27
25
  }
28
- const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
26
+ const pageInfo = pageMap.get(page) ?? {};
29
27
  pageInfo.continuationToken = continuationToken;
30
28
  pageMap.set(page, pageInfo);
31
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pagingHelper.js","sourceRoot":"","sources":["../../src/pagingHelper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa;;IAChD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,MAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,0CAAE,iBAAiB,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAa,EAAE,iBAAqC;;IACvF,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACpE,OAAO;IACT,CAAC;IACD,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC;IACzC,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport interface PageInfo {\n continuationToken?: string;\n}\n\nconst pageMap = new WeakMap<object, PageInfo>();\n\n/**\n * Given the last `.value` produced by the `byPage` iterator,\n * returns a continuation token that can be used to begin paging from\n * that point later.\n * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.\n * @returns The continuation token that can be passed into byPage() during future calls.\n */\nexport function getContinuationToken(page: unknown): string | undefined {\n if (typeof page !== \"object\" || page === null) {\n return undefined;\n }\n return pageMap.get(page)?.continuationToken;\n}\n\nexport function setContinuationToken(page: unknown, continuationToken: string | undefined): void {\n if (typeof page !== \"object\" || page === null || !continuationToken) {\n return;\n }\n const pageInfo = pageMap.get(page) ?? {};\n pageInfo.continuationToken = continuationToken;\n pageMap.set(page, pageInfo);\n}\n"]}
1
+ {"version":3,"file":"pagingHelper.js","sourceRoot":"","sources":["../../src/pagingHelper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa;IAChD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAa,EAAE,iBAAqC;IACvF,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACpE,OAAO;IACT,CAAC;IACD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACzC,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport interface PageInfo {\n continuationToken?: string;\n}\n\nconst pageMap = new WeakMap<object, PageInfo>();\n\n/**\n * Given the last `.value` produced by the `byPage` iterator,\n * returns a continuation token that can be used to begin paging from\n * that point later.\n * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.\n * @returns The continuation token that can be passed into byPage() during future calls.\n */\nexport function getContinuationToken(page: unknown): string | undefined {\n if (typeof page !== \"object\" || page === null) {\n return undefined;\n }\n return pageMap.get(page)?.continuationToken;\n}\n\nexport function setContinuationToken(page: unknown, continuationToken: string | undefined): void {\n if (typeof page !== \"object\" || page === null || !continuationToken) {\n return;\n }\n const pageInfo = pageMap.get(page) ?? {};\n pageInfo.continuationToken = continuationToken;\n pageMap.set(page, pageInfo);\n}\n"]}
@@ -15,6 +15,9 @@ const index_js_1 = require("./operations/index.js");
15
15
  const Parameters = tslib_1.__importStar(require("./models/parameters.js"));
16
16
  const Mappers = tslib_1.__importStar(require("./models/mappers.js"));
17
17
  class CognitiveServicesManagementClient extends coreClient.ServiceClient {
18
+ $host;
19
+ apiVersion;
20
+ subscriptionId;
18
21
  /**
19
22
  * Initializes a new instance of the CognitiveServicesManagementClient class.
20
23
  * @param credentials Subscription credentials which uniquely identify client subscription.
@@ -22,7 +25,6 @@ class CognitiveServicesManagementClient extends coreClient.ServiceClient {
22
25
  * @param options The parameter options
23
26
  */
24
27
  constructor(credentials, subscriptionId, options) {
25
- var _a, _b, _c;
26
28
  if (credentials === undefined) {
27
29
  throw new Error("'credentials' cannot be null");
28
30
  }
@@ -41,12 +43,17 @@ class CognitiveServicesManagementClient extends coreClient.ServiceClient {
41
43
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
42
44
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
43
45
  : `${packageDetails}`;
44
- const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
46
+ const optionsWithDefaults = {
47
+ ...defaults,
48
+ ...options,
49
+ userAgentOptions: {
45
50
  userAgentPrefix,
46
- }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
51
+ },
52
+ endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com",
53
+ };
47
54
  super(optionsWithDefaults);
48
55
  let bearerTokenAuthenticationPolicyFound = false;
49
- if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
56
+ if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
50
57
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
51
58
  bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName);
52
59
  }
@@ -59,7 +66,7 @@ class CognitiveServicesManagementClient extends coreClient.ServiceClient {
59
66
  });
60
67
  this.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
61
68
  credential: credentials,
62
- scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
69
+ scopes: optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`,
63
70
  challengeCallbacks: {
64
71
  authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,
65
72
  },
@@ -149,6 +156,31 @@ class CognitiveServicesManagementClient extends coreClient.ServiceClient {
149
156
  calculateModelCapacity(options) {
150
157
  return this.sendOperationRequest({ options }, calculateModelCapacityOperationSpec);
151
158
  }
159
+ accounts;
160
+ deletedAccounts;
161
+ resourceSkus;
162
+ usages;
163
+ operations;
164
+ commitmentTiers;
165
+ models;
166
+ locationBasedModelCapacities;
167
+ modelCapacities;
168
+ privateEndpointConnections;
169
+ privateLinkResources;
170
+ deployments;
171
+ commitmentPlans;
172
+ encryptionScopes;
173
+ raiPolicies;
174
+ raiBlocklists;
175
+ raiBlocklistItems;
176
+ raiContentFilters;
177
+ networkSecurityPerimeterConfigurations;
178
+ defenderForAISettings;
179
+ projects;
180
+ accountConnection;
181
+ projectConnection;
182
+ accountCapabilityHosts;
183
+ projectCapabilityHosts;
152
184
  }
153
185
  exports.CognitiveServicesManagementClient = CognitiveServicesManagementClient;
154
186
  // Operation Specifications
@@ -166,7 +198,7 @@ const checkSkuAvailabilityOperationSpec = {
166
198
  },
167
199
  requestBody: {
168
200
  parameterPath: { skus: ["skus"], kind: ["kind"], typeParam: ["typeParam"] },
169
- mapper: Object.assign(Object.assign({}, Mappers.CheckSkuAvailabilityParameter), { required: true }),
201
+ mapper: { ...Mappers.CheckSkuAvailabilityParameter, required: true },
170
202
  },
171
203
  queryParameters: [Parameters.apiVersion],
172
204
  urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location],
@@ -191,7 +223,7 @@ const checkDomainAvailabilityOperationSpec = {
191
223
  typeParam: ["typeParam"],
192
224
  kind: ["options", "kind"],
193
225
  },
194
- mapper: Object.assign(Object.assign({}, Mappers.CheckDomainAvailabilityParameter), { required: true }),
226
+ mapper: { ...Mappers.CheckDomainAvailabilityParameter, required: true },
195
227
  },
196
228
  queryParameters: [Parameters.apiVersion],
197
229
  urlParameters: [Parameters.$host, Parameters.subscriptionId],
@@ -216,7 +248,7 @@ const calculateModelCapacityOperationSpec = {
216
248
  skuName: ["options", "skuName"],
217
249
  workloads: ["options", "workloads"],
218
250
  },
219
- mapper: Object.assign(Object.assign({}, Mappers.CalculateModelCapacityParameter), { required: true }),
251
+ mapper: { ...Mappers.CalculateModelCapacityParameter, required: true },
220
252
  },
221
253
  queryParameters: [Parameters.apiVersion],
222
254
  urlParameters: [Parameters.$host, Parameters.subscriptionId],
@@ -1 +1 @@
1
- {"version":3,"file":"cognitiveServicesManagementClient.js","sourceRoot":"","sources":["../../src/cognitiveServicesManagementClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD;AACjD,oFAA8D;AAG9D,oDA0B+B;AA4B/B,2EAAqD;AACrD,qEAA+C;AAW/C,MAAa,iCAAkC,SAAQ,UAAU,CAAC,aAAa;IAK7E;;;;;OAKG;IACH,YACE,WAAqC,EACrC,cAAsB,EACtB,OAAyD;;QAEzD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAA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,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport { PipelineRequest, PipelineResponse, SendRequest } from \"@azure/core-rest-pipeline\";\nimport * as coreAuth from \"@azure/core-auth\";\nimport {\n AccountsImpl,\n DeletedAccountsImpl,\n ResourceSkusImpl,\n UsagesImpl,\n OperationsImpl,\n CommitmentTiersImpl,\n ModelsImpl,\n LocationBasedModelCapacitiesImpl,\n ModelCapacitiesImpl,\n PrivateEndpointConnectionsImpl,\n PrivateLinkResourcesImpl,\n DeploymentsImpl,\n CommitmentPlansImpl,\n EncryptionScopesImpl,\n RaiPoliciesImpl,\n RaiBlocklistsImpl,\n RaiBlocklistItemsImpl,\n RaiContentFiltersImpl,\n NetworkSecurityPerimeterConfigurationsImpl,\n DefenderForAISettingsImpl,\n ProjectsImpl,\n AccountConnectionImpl,\n ProjectConnectionImpl,\n AccountCapabilityHostsImpl,\n ProjectCapabilityHostsImpl,\n} from \"./operations/index.js\";\nimport {\n Accounts,\n DeletedAccounts,\n ResourceSkus,\n Usages,\n Operations,\n CommitmentTiers,\n Models,\n LocationBasedModelCapacities,\n ModelCapacities,\n PrivateEndpointConnections,\n PrivateLinkResources,\n Deployments,\n CommitmentPlans,\n EncryptionScopes,\n RaiPolicies,\n RaiBlocklists,\n RaiBlocklistItems,\n RaiContentFilters,\n NetworkSecurityPerimeterConfigurations,\n DefenderForAISettings,\n Projects,\n AccountConnection,\n ProjectConnection,\n AccountCapabilityHosts,\n ProjectCapabilityHosts,\n} from \"./operationsInterfaces/index.js\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n CognitiveServicesManagementClientOptionalParams,\n CheckSkuAvailabilityOptionalParams,\n CheckSkuAvailabilityResponse,\n CheckDomainAvailabilityOptionalParams,\n CheckDomainAvailabilityResponse,\n CalculateModelCapacityOptionalParams,\n CalculateModelCapacityResponse,\n} from \"./models/index.js\";\n\nexport class CognitiveServicesManagementClient extends coreClient.ServiceClient {\n $host: string;\n apiVersion: string;\n subscriptionId: string;\n\n /**\n * Initializes a new instance of the CognitiveServicesManagementClient class.\n * @param credentials Subscription credentials which uniquely identify client subscription.\n * @param subscriptionId The ID of the target subscription.\n * @param options The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n subscriptionId: string,\n options?: CognitiveServicesManagementClientOptionalParams,\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (subscriptionId === undefined) {\n throw new Error(\"'subscriptionId' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: CognitiveServicesManagementClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials,\n };\n\n const packageDetails = `azsdk-js-arm-cognitiveservices/7.7.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"https://management.azure.com\",\n };\n super(optionsWithDefaults);\n\n let bearerTokenAuthenticationPolicyFound: boolean = false;\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =\n options.pipeline.getOrderedPolicies();\n bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName,\n );\n }\n if (\n !options ||\n !options.pipeline ||\n options.pipeline.getOrderedPolicies().length == 0 ||\n !bearerTokenAuthenticationPolicyFound\n ) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName,\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n credential: credentials,\n scopes:\n optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,\n },\n }),\n );\n }\n // Parameter assignments\n this.subscriptionId = subscriptionId;\n\n // Assigning values to Constant parameters\n this.$host = options.$host || \"https://management.azure.com\";\n this.apiVersion = options.apiVersion || \"2025-04-01-preview\";\n this.accounts = new AccountsImpl(this);\n this.deletedAccounts = new DeletedAccountsImpl(this);\n this.resourceSkus = new ResourceSkusImpl(this);\n this.usages = new UsagesImpl(this);\n this.operations = new OperationsImpl(this);\n this.commitmentTiers = new CommitmentTiersImpl(this);\n this.models = new ModelsImpl(this);\n this.locationBasedModelCapacities = new LocationBasedModelCapacitiesImpl(this);\n this.modelCapacities = new ModelCapacitiesImpl(this);\n this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);\n this.privateLinkResources = new PrivateLinkResourcesImpl(this);\n this.deployments = new DeploymentsImpl(this);\n this.commitmentPlans = new CommitmentPlansImpl(this);\n this.encryptionScopes = new EncryptionScopesImpl(this);\n this.raiPolicies = new RaiPoliciesImpl(this);\n this.raiBlocklists = new RaiBlocklistsImpl(this);\n this.raiBlocklistItems = new RaiBlocklistItemsImpl(this);\n this.raiContentFilters = new RaiContentFiltersImpl(this);\n this.networkSecurityPerimeterConfigurations = new NetworkSecurityPerimeterConfigurationsImpl(\n this,\n );\n this.defenderForAISettings = new DefenderForAISettingsImpl(this);\n this.projects = new ProjectsImpl(this);\n this.accountConnection = new AccountConnectionImpl(this);\n this.projectConnection = new ProjectConnectionImpl(this);\n this.accountCapabilityHosts = new AccountCapabilityHostsImpl(this);\n this.projectCapabilityHosts = new ProjectCapabilityHostsImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n /**\n * Check available SKUs.\n * @param location Resource location.\n * @param skus The SKU of the resource.\n * @param kind The kind (type) of cognitive service account.\n * @param typeParam The Type of the resource.\n * @param options The options parameters.\n */\n checkSkuAvailability(\n location: string,\n skus: string[],\n kind: string,\n typeParam: string,\n options?: CheckSkuAvailabilityOptionalParams,\n ): Promise<CheckSkuAvailabilityResponse> {\n return this.sendOperationRequest(\n { location, skus, kind, typeParam, options },\n checkSkuAvailabilityOperationSpec,\n );\n }\n\n /**\n * Check whether a domain is available.\n * @param subdomainName The subdomain name to use.\n * @param typeParam The Type of the resource.\n * @param options The options parameters.\n */\n checkDomainAvailability(\n subdomainName: string,\n typeParam: string,\n options?: CheckDomainAvailabilityOptionalParams,\n ): Promise<CheckDomainAvailabilityResponse> {\n return this.sendOperationRequest(\n { subdomainName, typeParam, options },\n checkDomainAvailabilityOperationSpec,\n );\n }\n\n /**\n * Model capacity calculator.\n * @param options The options parameters.\n */\n calculateModelCapacity(\n options?: CalculateModelCapacityOptionalParams,\n ): Promise<CalculateModelCapacityResponse> {\n return this.sendOperationRequest({ options }, calculateModelCapacityOperationSpec);\n }\n\n accounts: Accounts;\n deletedAccounts: DeletedAccounts;\n resourceSkus: ResourceSkus;\n usages: Usages;\n operations: Operations;\n commitmentTiers: CommitmentTiers;\n models: Models;\n locationBasedModelCapacities: LocationBasedModelCapacities;\n modelCapacities: ModelCapacities;\n privateEndpointConnections: PrivateEndpointConnections;\n privateLinkResources: PrivateLinkResources;\n deployments: Deployments;\n commitmentPlans: CommitmentPlans;\n encryptionScopes: EncryptionScopes;\n raiPolicies: RaiPolicies;\n raiBlocklists: RaiBlocklists;\n raiBlocklistItems: RaiBlocklistItems;\n raiContentFilters: RaiContentFilters;\n networkSecurityPerimeterConfigurations: NetworkSecurityPerimeterConfigurations;\n defenderForAISettings: DefenderForAISettings;\n projects: Projects;\n accountConnection: AccountConnection;\n projectConnection: ProjectConnection;\n accountCapabilityHosts: AccountCapabilityHosts;\n projectCapabilityHosts: ProjectCapabilityHosts;\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst checkSkuAvailabilityOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.SkuAvailabilityListResult,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n requestBody: {\n parameterPath: { skus: [\"skus\"], kind: [\"kind\"], typeParam: [\"typeParam\"] },\n mapper: { ...Mappers.CheckSkuAvailabilityParameter, required: true },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst checkDomainAvailabilityOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DomainAvailability,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n requestBody: {\n parameterPath: {\n subdomainName: [\"subdomainName\"],\n typeParam: [\"typeParam\"],\n kind: [\"options\", \"kind\"],\n },\n mapper: { ...Mappers.CheckDomainAvailabilityParameter, required: true },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst calculateModelCapacityOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/calculateModelCapacity\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CalculateModelCapacityResult,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n requestBody: {\n parameterPath: {\n model: [\"options\", \"model\"],\n skuName: [\"options\", \"skuName\"],\n workloads: [\"options\", \"workloads\"],\n },\n mapper: { ...Mappers.CalculateModelCapacityParameter, required: true },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\n"]}
1
+ {"version":3,"file":"cognitiveServicesManagementClient.js","sourceRoot":"","sources":["../../src/cognitiveServicesManagementClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD;AACjD,oFAA8D;AAG9D,oDA0B+B;AA4B/B,2EAAqD;AACrD,qEAA+C;AAW/C,MAAa,iCAAkC,SAAQ,UAAU,CAAC,aAAa;IAC7E,KAAK,CAAS;IACd,UAAU,CAAS;IACnB,cAAc,CAAS;IAEvB;;;;;OAKG;IACH,YACE,WAAqC,EACrC,cAAsB,EACtB,OAAyD;QAEzD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC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AK,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC;YAC3B,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;YAC/B,SAAS,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC;SACpC;QACD,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,+BAA+B,EAAE,QAAQ,EAAE,IAAI,EAAE;KACvE;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC;IAC5D,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport { PipelineRequest, PipelineResponse, SendRequest } from \"@azure/core-rest-pipeline\";\nimport * as coreAuth from \"@azure/core-auth\";\nimport {\n AccountsImpl,\n DeletedAccountsImpl,\n ResourceSkusImpl,\n UsagesImpl,\n OperationsImpl,\n CommitmentTiersImpl,\n ModelsImpl,\n LocationBasedModelCapacitiesImpl,\n ModelCapacitiesImpl,\n PrivateEndpointConnectionsImpl,\n PrivateLinkResourcesImpl,\n DeploymentsImpl,\n CommitmentPlansImpl,\n EncryptionScopesImpl,\n RaiPoliciesImpl,\n RaiBlocklistsImpl,\n RaiBlocklistItemsImpl,\n RaiContentFiltersImpl,\n NetworkSecurityPerimeterConfigurationsImpl,\n DefenderForAISettingsImpl,\n ProjectsImpl,\n AccountConnectionImpl,\n ProjectConnectionImpl,\n AccountCapabilityHostsImpl,\n ProjectCapabilityHostsImpl,\n} from \"./operations/index.js\";\nimport {\n Accounts,\n DeletedAccounts,\n ResourceSkus,\n Usages,\n Operations,\n CommitmentTiers,\n Models,\n LocationBasedModelCapacities,\n ModelCapacities,\n PrivateEndpointConnections,\n PrivateLinkResources,\n Deployments,\n CommitmentPlans,\n EncryptionScopes,\n RaiPolicies,\n RaiBlocklists,\n RaiBlocklistItems,\n RaiContentFilters,\n NetworkSecurityPerimeterConfigurations,\n DefenderForAISettings,\n Projects,\n AccountConnection,\n ProjectConnection,\n AccountCapabilityHosts,\n ProjectCapabilityHosts,\n} from \"./operationsInterfaces/index.js\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n CognitiveServicesManagementClientOptionalParams,\n CheckSkuAvailabilityOptionalParams,\n CheckSkuAvailabilityResponse,\n CheckDomainAvailabilityOptionalParams,\n CheckDomainAvailabilityResponse,\n CalculateModelCapacityOptionalParams,\n CalculateModelCapacityResponse,\n} from \"./models/index.js\";\n\nexport class CognitiveServicesManagementClient extends coreClient.ServiceClient {\n $host: string;\n apiVersion: string;\n subscriptionId: string;\n\n /**\n * Initializes a new instance of the CognitiveServicesManagementClient class.\n * @param credentials Subscription credentials which uniquely identify client subscription.\n * @param subscriptionId The ID of the target subscription.\n * @param options The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n subscriptionId: string,\n options?: CognitiveServicesManagementClientOptionalParams,\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (subscriptionId === undefined) {\n throw new Error(\"'subscriptionId' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: CognitiveServicesManagementClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials,\n };\n\n const packageDetails = `azsdk-js-arm-cognitiveservices/7.7.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"https://management.azure.com\",\n };\n super(optionsWithDefaults);\n\n let bearerTokenAuthenticationPolicyFound: boolean = false;\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =\n options.pipeline.getOrderedPolicies();\n bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName,\n );\n }\n if (\n !options ||\n !options.pipeline ||\n options.pipeline.getOrderedPolicies().length == 0 ||\n !bearerTokenAuthenticationPolicyFound\n ) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName,\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n credential: credentials,\n scopes:\n optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge,\n },\n }),\n );\n }\n // Parameter assignments\n this.subscriptionId = subscriptionId;\n\n // Assigning values to Constant parameters\n this.$host = options.$host || \"https://management.azure.com\";\n this.apiVersion = options.apiVersion || \"2025-04-01-preview\";\n this.accounts = new AccountsImpl(this);\n this.deletedAccounts = new DeletedAccountsImpl(this);\n this.resourceSkus = new ResourceSkusImpl(this);\n this.usages = new UsagesImpl(this);\n this.operations = new OperationsImpl(this);\n this.commitmentTiers = new CommitmentTiersImpl(this);\n this.models = new ModelsImpl(this);\n this.locationBasedModelCapacities = new LocationBasedModelCapacitiesImpl(this);\n this.modelCapacities = new ModelCapacitiesImpl(this);\n this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);\n this.privateLinkResources = new PrivateLinkResourcesImpl(this);\n this.deployments = new DeploymentsImpl(this);\n this.commitmentPlans = new CommitmentPlansImpl(this);\n this.encryptionScopes = new EncryptionScopesImpl(this);\n this.raiPolicies = new RaiPoliciesImpl(this);\n this.raiBlocklists = new RaiBlocklistsImpl(this);\n this.raiBlocklistItems = new RaiBlocklistItemsImpl(this);\n this.raiContentFilters = new RaiContentFiltersImpl(this);\n this.networkSecurityPerimeterConfigurations = new NetworkSecurityPerimeterConfigurationsImpl(\n this,\n );\n this.defenderForAISettings = new DefenderForAISettingsImpl(this);\n this.projects = new ProjectsImpl(this);\n this.accountConnection = new AccountConnectionImpl(this);\n this.projectConnection = new ProjectConnectionImpl(this);\n this.accountCapabilityHosts = new AccountCapabilityHostsImpl(this);\n this.projectCapabilityHosts = new ProjectCapabilityHostsImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n /**\n * Check available SKUs.\n * @param location Resource location.\n * @param skus The SKU of the resource.\n * @param kind The kind (type) of cognitive service account.\n * @param typeParam The Type of the resource.\n * @param options The options parameters.\n */\n checkSkuAvailability(\n location: string,\n skus: string[],\n kind: string,\n typeParam: string,\n options?: CheckSkuAvailabilityOptionalParams,\n ): Promise<CheckSkuAvailabilityResponse> {\n return this.sendOperationRequest(\n { location, skus, kind, typeParam, options },\n checkSkuAvailabilityOperationSpec,\n );\n }\n\n /**\n * Check whether a domain is available.\n * @param subdomainName The subdomain name to use.\n * @param typeParam The Type of the resource.\n * @param options The options parameters.\n */\n checkDomainAvailability(\n subdomainName: string,\n typeParam: string,\n options?: CheckDomainAvailabilityOptionalParams,\n ): Promise<CheckDomainAvailabilityResponse> {\n return this.sendOperationRequest(\n { subdomainName, typeParam, options },\n checkDomainAvailabilityOperationSpec,\n );\n }\n\n /**\n * Model capacity calculator.\n * @param options The options parameters.\n */\n calculateModelCapacity(\n options?: CalculateModelCapacityOptionalParams,\n ): Promise<CalculateModelCapacityResponse> {\n return this.sendOperationRequest({ options }, calculateModelCapacityOperationSpec);\n }\n\n accounts: Accounts;\n deletedAccounts: DeletedAccounts;\n resourceSkus: ResourceSkus;\n usages: Usages;\n operations: Operations;\n commitmentTiers: CommitmentTiers;\n models: Models;\n locationBasedModelCapacities: LocationBasedModelCapacities;\n modelCapacities: ModelCapacities;\n privateEndpointConnections: PrivateEndpointConnections;\n privateLinkResources: PrivateLinkResources;\n deployments: Deployments;\n commitmentPlans: CommitmentPlans;\n encryptionScopes: EncryptionScopes;\n raiPolicies: RaiPolicies;\n raiBlocklists: RaiBlocklists;\n raiBlocklistItems: RaiBlocklistItems;\n raiContentFilters: RaiContentFilters;\n networkSecurityPerimeterConfigurations: NetworkSecurityPerimeterConfigurations;\n defenderForAISettings: DefenderForAISettings;\n projects: Projects;\n accountConnection: AccountConnection;\n projectConnection: ProjectConnection;\n accountCapabilityHosts: AccountCapabilityHosts;\n projectCapabilityHosts: ProjectCapabilityHosts;\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst checkSkuAvailabilityOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.SkuAvailabilityListResult,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n requestBody: {\n parameterPath: { skus: [\"skus\"], kind: [\"kind\"], typeParam: [\"typeParam\"] },\n mapper: { ...Mappers.CheckSkuAvailabilityParameter, required: true },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.location],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst checkDomainAvailabilityOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DomainAvailability,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n requestBody: {\n parameterPath: {\n subdomainName: [\"subdomainName\"],\n typeParam: [\"typeParam\"],\n kind: [\"options\", \"kind\"],\n },\n mapper: { ...Mappers.CheckDomainAvailabilityParameter, required: true },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\nconst calculateModelCapacityOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/calculateModelCapacity\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CalculateModelCapacityResult,\n },\n default: {\n bodyMapper: Mappers.ErrorResponse,\n },\n },\n requestBody: {\n parameterPath: {\n model: [\"options\", \"model\"],\n skuName: [\"options\", \"skuName\"],\n workloads: [\"options\", \"workloads\"],\n },\n mapper: { ...Mappers.CalculateModelCapacityParameter, required: true },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\n"]}
@@ -8,7 +8,6 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.createLroSpec = createLroSpec;
11
- const tslib_1 = require("tslib");
12
11
  function createLroSpec(inputs) {
13
12
  const { args, spec, sendOperationFn } = inputs;
14
13
  return {
@@ -16,8 +15,13 @@ function createLroSpec(inputs) {
16
15
  requestPath: spec.path,
17
16
  sendInitialRequest: () => sendOperationFn(args, spec),
18
17
  sendPollRequest: (path, options) => {
19
- const { requestBody } = spec, restSpec = tslib_1.__rest(spec, ["requestBody"]);
20
- return sendOperationFn(args, Object.assign(Object.assign({}, restSpec), { httpMethod: "GET", path, abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }));
18
+ const { requestBody, ...restSpec } = spec;
19
+ return sendOperationFn(args, {
20
+ ...restSpec,
21
+ httpMethod: "GET",
22
+ path,
23
+ abortSignal: options?.abortSignal,
24
+ });
21
25
  },
22
26
  };
23
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"lroImpl.js","sourceRoot":"","sources":["../../src/lroImpl.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAKH,sCAwBC;;AAxBD,SAAgB,aAAa,CAAI,MAQhC;IACC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IAC/C,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,UAAU;QAC9B,WAAW,EAAE,IAAI,CAAC,IAAK;QACvB,kBAAkB,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC;QACrD,eAAe,EAAE,CAAC,IAAY,EAAE,OAA2C,EAAE,EAAE;YAC7E,MAAM,EAAE,WAAW,KAAkB,IAAI,EAAjB,QAAQ,kBAAK,IAAI,EAAnC,eAA4B,CAAO,CAAC;YAC1C,OAAO,eAAe,CAAC,IAAI,kCACtB,QAAQ,KACX,UAAU,EAAE,KAAK,EACjB,IAAI,EACJ,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,IACjC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { LongRunningOperation, LroResponse } from \"@azure/core-lro\";\n\nexport function createLroSpec<T>(inputs: {\n sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;\n args: Record<string, unknown>;\n spec: {\n readonly requestBody?: unknown;\n readonly path?: string;\n readonly httpMethod: string;\n } & Record<string, any>;\n}): LongRunningOperation<T> {\n const { args, spec, sendOperationFn } = inputs;\n return {\n requestMethod: spec.httpMethod,\n requestPath: spec.path!,\n sendInitialRequest: () => sendOperationFn(args, spec),\n sendPollRequest: (path: string, options?: { abortSignal?: AbortSignalLike }) => {\n const { requestBody, ...restSpec } = spec;\n return sendOperationFn(args, {\n ...restSpec,\n httpMethod: \"GET\",\n path,\n abortSignal: options?.abortSignal,\n });\n },\n };\n}\n"]}
1
+ {"version":3,"file":"lroImpl.js","sourceRoot":"","sources":["../../src/lroImpl.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAKH,sCAwBC;AAxBD,SAAgB,aAAa,CAAI,MAQhC;IACC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IAC/C,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,UAAU;QAC9B,WAAW,EAAE,IAAI,CAAC,IAAK;QACvB,kBAAkB,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC;QACrD,eAAe,EAAE,CAAC,IAAY,EAAE,OAA2C,EAAE,EAAE;YAC7E,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;YAC1C,OAAO,eAAe,CAAC,IAAI,EAAE;gBAC3B,GAAG,QAAQ;gBACX,UAAU,EAAE,KAAK;gBACjB,IAAI;gBACJ,WAAW,EAAE,OAAO,EAAE,WAAW;aAClC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { LongRunningOperation, LroResponse } from \"@azure/core-lro\";\n\nexport function createLroSpec<T>(inputs: {\n sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;\n args: Record<string, unknown>;\n spec: {\n readonly requestBody?: unknown;\n readonly path?: string;\n readonly httpMethod: string;\n } & Record<string, any>;\n}): LongRunningOperation<T> {\n const { args, spec, sendOperationFn } = inputs;\n return {\n requestMethod: spec.httpMethod,\n requestPath: spec.path!,\n sendInitialRequest: () => sendOperationFn(args, spec),\n sendPollRequest: (path: string, options?: { abortSignal?: AbortSignalLike }) => {\n const { requestBody, ...restSpec } = spec;\n return sendOperationFn(args, {\n ...restSpec,\n httpMethod: \"GET\",\n path,\n abortSignal: options?.abortSignal,\n });\n },\n };\n}\n"]}