@azure/arm-devopsinfrastructure 1.0.0-alpha.20250619.1 → 1.0.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 (140) hide show
  1. package/dist/browser/api/devOpsInfrastructureContext.js +11 -8
  2. package/dist/browser/api/devOpsInfrastructureContext.js.map +1 -1
  3. package/dist/browser/api/imageVersions/index.js +1 -1
  4. package/dist/browser/api/imageVersions/index.js.map +1 -1
  5. package/dist/browser/api/operations/index.js +1 -1
  6. package/dist/browser/api/operations/index.js.map +1 -1
  7. package/dist/browser/api/pools/index.js +18 -12
  8. package/dist/browser/api/pools/index.js.map +1 -1
  9. package/dist/browser/api/resourceDetails/index.js +1 -1
  10. package/dist/browser/api/resourceDetails/index.js.map +1 -1
  11. package/dist/browser/api/sku/index.js +1 -1
  12. package/dist/browser/api/sku/index.js.map +1 -1
  13. package/dist/browser/api/subscriptionUsages/index.js +1 -1
  14. package/dist/browser/api/subscriptionUsages/index.js.map +1 -1
  15. package/dist/browser/classic/imageVersions/index.js +3 -1
  16. package/dist/browser/classic/imageVersions/index.js.map +1 -1
  17. package/dist/browser/classic/operations/index.js +3 -1
  18. package/dist/browser/classic/operations/index.js.map +1 -1
  19. package/dist/browser/classic/pools/index.js +3 -1
  20. package/dist/browser/classic/pools/index.js.map +1 -1
  21. package/dist/browser/classic/resourceDetails/index.js +3 -1
  22. package/dist/browser/classic/resourceDetails/index.js.map +1 -1
  23. package/dist/browser/classic/sku/index.js +3 -1
  24. package/dist/browser/classic/sku/index.js.map +1 -1
  25. package/dist/browser/classic/subscriptionUsages/index.js +3 -1
  26. package/dist/browser/classic/subscriptionUsages/index.js.map +1 -1
  27. package/dist/browser/devOpsInfrastructureClient.js +20 -3
  28. package/dist/browser/devOpsInfrastructureClient.js.map +1 -1
  29. package/dist/browser/restorePollerHelpers.js +11 -13
  30. package/dist/browser/restorePollerHelpers.js.map +1 -1
  31. package/dist/browser/static-helpers/pagingHelpers.js +31 -50
  32. package/dist/browser/static-helpers/pagingHelpers.js.map +1 -1
  33. package/dist/browser/static-helpers/pollingHelpers.js +14 -11
  34. package/dist/browser/static-helpers/pollingHelpers.js.map +1 -1
  35. package/dist/commonjs/api/devOpsInfrastructureContext.js +11 -8
  36. package/dist/commonjs/api/devOpsInfrastructureContext.js.map +1 -1
  37. package/dist/commonjs/api/imageVersions/index.js +1 -1
  38. package/dist/commonjs/api/imageVersions/index.js.map +1 -1
  39. package/dist/commonjs/api/operations/index.js +1 -1
  40. package/dist/commonjs/api/operations/index.js.map +1 -1
  41. package/dist/commonjs/api/pools/index.js +18 -12
  42. package/dist/commonjs/api/pools/index.js.map +1 -1
  43. package/dist/commonjs/api/resourceDetails/index.js +1 -1
  44. package/dist/commonjs/api/resourceDetails/index.js.map +1 -1
  45. package/dist/commonjs/api/sku/index.js +1 -1
  46. package/dist/commonjs/api/sku/index.js.map +1 -1
  47. package/dist/commonjs/api/subscriptionUsages/index.js +1 -1
  48. package/dist/commonjs/api/subscriptionUsages/index.js.map +1 -1
  49. package/dist/commonjs/classic/imageVersions/index.js +3 -1
  50. package/dist/commonjs/classic/imageVersions/index.js.map +1 -1
  51. package/dist/commonjs/classic/operations/index.js +3 -1
  52. package/dist/commonjs/classic/operations/index.js.map +1 -1
  53. package/dist/commonjs/classic/pools/index.js +3 -1
  54. package/dist/commonjs/classic/pools/index.js.map +1 -1
  55. package/dist/commonjs/classic/resourceDetails/index.js +3 -1
  56. package/dist/commonjs/classic/resourceDetails/index.js.map +1 -1
  57. package/dist/commonjs/classic/sku/index.js +3 -1
  58. package/dist/commonjs/classic/sku/index.js.map +1 -1
  59. package/dist/commonjs/classic/subscriptionUsages/index.js +3 -1
  60. package/dist/commonjs/classic/subscriptionUsages/index.js.map +1 -1
  61. package/dist/commonjs/devOpsInfrastructureClient.js +20 -3
  62. package/dist/commonjs/devOpsInfrastructureClient.js.map +1 -1
  63. package/dist/commonjs/restorePollerHelpers.js +11 -13
  64. package/dist/commonjs/restorePollerHelpers.js.map +1 -1
  65. package/dist/commonjs/static-helpers/pagingHelpers.js +31 -50
  66. package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -1
  67. package/dist/commonjs/static-helpers/pollingHelpers.js +14 -11
  68. package/dist/commonjs/static-helpers/pollingHelpers.js.map +1 -1
  69. package/dist/commonjs/tsdoc-metadata.json +11 -11
  70. package/dist/esm/api/devOpsInfrastructureContext.js +11 -8
  71. package/dist/esm/api/devOpsInfrastructureContext.js.map +1 -1
  72. package/dist/esm/api/imageVersions/index.js +1 -1
  73. package/dist/esm/api/imageVersions/index.js.map +1 -1
  74. package/dist/esm/api/operations/index.js +1 -1
  75. package/dist/esm/api/operations/index.js.map +1 -1
  76. package/dist/esm/api/pools/index.js +18 -12
  77. package/dist/esm/api/pools/index.js.map +1 -1
  78. package/dist/esm/api/resourceDetails/index.js +1 -1
  79. package/dist/esm/api/resourceDetails/index.js.map +1 -1
  80. package/dist/esm/api/sku/index.js +1 -1
  81. package/dist/esm/api/sku/index.js.map +1 -1
  82. package/dist/esm/api/subscriptionUsages/index.js +1 -1
  83. package/dist/esm/api/subscriptionUsages/index.js.map +1 -1
  84. package/dist/esm/classic/imageVersions/index.js +3 -1
  85. package/dist/esm/classic/imageVersions/index.js.map +1 -1
  86. package/dist/esm/classic/operations/index.js +3 -1
  87. package/dist/esm/classic/operations/index.js.map +1 -1
  88. package/dist/esm/classic/pools/index.js +3 -1
  89. package/dist/esm/classic/pools/index.js.map +1 -1
  90. package/dist/esm/classic/resourceDetails/index.js +3 -1
  91. package/dist/esm/classic/resourceDetails/index.js.map +1 -1
  92. package/dist/esm/classic/sku/index.js +3 -1
  93. package/dist/esm/classic/sku/index.js.map +1 -1
  94. package/dist/esm/classic/subscriptionUsages/index.js +3 -1
  95. package/dist/esm/classic/subscriptionUsages/index.js.map +1 -1
  96. package/dist/esm/devOpsInfrastructureClient.js +20 -3
  97. package/dist/esm/devOpsInfrastructureClient.js.map +1 -1
  98. package/dist/esm/restorePollerHelpers.js +11 -13
  99. package/dist/esm/restorePollerHelpers.js.map +1 -1
  100. package/dist/esm/static-helpers/pagingHelpers.js +31 -50
  101. package/dist/esm/static-helpers/pagingHelpers.js.map +1 -1
  102. package/dist/esm/static-helpers/pollingHelpers.js +14 -11
  103. package/dist/esm/static-helpers/pollingHelpers.js.map +1 -1
  104. package/dist/react-native/api/devOpsInfrastructureContext.js +11 -8
  105. package/dist/react-native/api/devOpsInfrastructureContext.js.map +1 -1
  106. package/dist/react-native/api/imageVersions/index.js +1 -1
  107. package/dist/react-native/api/imageVersions/index.js.map +1 -1
  108. package/dist/react-native/api/operations/index.js +1 -1
  109. package/dist/react-native/api/operations/index.js.map +1 -1
  110. package/dist/react-native/api/pools/index.js +18 -12
  111. package/dist/react-native/api/pools/index.js.map +1 -1
  112. package/dist/react-native/api/resourceDetails/index.js +1 -1
  113. package/dist/react-native/api/resourceDetails/index.js.map +1 -1
  114. package/dist/react-native/api/sku/index.js +1 -1
  115. package/dist/react-native/api/sku/index.js.map +1 -1
  116. package/dist/react-native/api/subscriptionUsages/index.js +1 -1
  117. package/dist/react-native/api/subscriptionUsages/index.js.map +1 -1
  118. package/dist/react-native/classic/imageVersions/index.js +3 -1
  119. package/dist/react-native/classic/imageVersions/index.js.map +1 -1
  120. package/dist/react-native/classic/operations/index.js +3 -1
  121. package/dist/react-native/classic/operations/index.js.map +1 -1
  122. package/dist/react-native/classic/pools/index.js +3 -1
  123. package/dist/react-native/classic/pools/index.js.map +1 -1
  124. package/dist/react-native/classic/resourceDetails/index.js +3 -1
  125. package/dist/react-native/classic/resourceDetails/index.js.map +1 -1
  126. package/dist/react-native/classic/sku/index.js +3 -1
  127. package/dist/react-native/classic/sku/index.js.map +1 -1
  128. package/dist/react-native/classic/subscriptionUsages/index.js +3 -1
  129. package/dist/react-native/classic/subscriptionUsages/index.js.map +1 -1
  130. package/dist/react-native/devOpsInfrastructureClient.js +20 -3
  131. package/dist/react-native/devOpsInfrastructureClient.js.map +1 -1
  132. package/dist/react-native/restorePollerHelpers.js +11 -13
  133. package/dist/react-native/restorePollerHelpers.js.map +1 -1
  134. package/dist/react-native/static-helpers/pagingHelpers.js +31 -50
  135. package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -1
  136. package/dist/react-native/static-helpers/pollingHelpers.js +14 -11
  137. package/dist/react-native/static-helpers/pollingHelpers.js.map +1 -1
  138. package/package.json +2 -2
  139. /package/review/{arm-devopsinfrastructure-models.api.md → arm-devopsinfrastructure-models-node.api.md} +0 -0
  140. /package/review/{arm-devopsinfrastructure.api.md → arm-devopsinfrastructure-node.api.md} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/resourceDetails/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAEL,4CAA4C,GAE7C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,uBAAuB,GACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAGL,eAAe,EACf,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AAEjC,MAAM,UAAU,8BAA8B,CAC5C,OAAe,EACf,cAAsB,EACtB,iBAAyB,EACzB,QAAgB,EAChB,UAAmD,EAAE,cAAc,EAAE,EAAE,EAAE;IAEzE,OAAO,OAAO;SACX,IAAI,CACH,wIAAwI,EACxI,cAAc,EACd,iBAAiB,EACjB,QAAQ,CACT;SACA,GAAG,mBAAM,mCAAmC,CAAC,OAAO,CAAC,EAAG,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qCAAqC,CACzD,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,4CAA4C,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,yBAAyB,CACvC,OAAe,EACf,cAAsB,EACtB,iBAAyB,EACzB,QAAgB,EAChB,UAAmD,EAAE,cAAc,EAAE,EAAE,EAAE;IAEzE,OAAO,uBAAuB,CAC5B,OAAO,EACP,GAAG,EAAE,CACH,8BAA8B,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,CAAC,EAC/F,qCAAqC,EACrC,CAAC,KAAK,CAAC,EACP,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAChD,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DevOpsInfrastructureContext as Client,\n ResourceDetailsListByPoolOptionalParams,\n} from \"../index.js\";\nimport {\n _ResourceDetailsObjectListResult,\n _resourceDetailsObjectListResultDeserializer,\n ResourceDetailsObject,\n} from \"../../models/models.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _resourceDetailsListByPoolSend(\n context: Client,\n subscriptionId: string,\n resourceGroupName: string,\n poolName: string,\n options: ResourceDetailsListByPoolOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n return context\n .path(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}/resources\",\n subscriptionId,\n resourceGroupName,\n poolName,\n )\n .get({ ...operationOptionsToRequestParameters(options) });\n}\n\nexport async function _resourceDetailsListByPoolDeserialize(\n result: PathUncheckedResponse,\n): Promise<_ResourceDetailsObjectListResult> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _resourceDetailsObjectListResultDeserializer(result.body);\n}\n\n/** List ResourceDetailsObject resources by Pool */\nexport function resourceDetailsListByPool(\n context: Client,\n subscriptionId: string,\n resourceGroupName: string,\n poolName: string,\n options: ResourceDetailsListByPoolOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<ResourceDetailsObject> {\n return buildPagedAsyncIterator(\n context,\n () =>\n _resourceDetailsListByPoolSend(context, subscriptionId, resourceGroupName, poolName, options),\n _resourceDetailsListByPoolDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/resourceDetails/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAEL,4CAA4C,GAE7C,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,uBAAuB,GACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAGL,eAAe,EACf,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AAEjC,MAAM,UAAU,8BAA8B,CAC5C,OAAe,EACf,cAAsB,EACtB,iBAAyB,EACzB,QAAgB,EAChB,UAAmD,EAAE,cAAc,EAAE,EAAE,EAAE;IAEzE,OAAO,OAAO;SACX,IAAI,CACH,wIAAwI,EACxI,cAAc,EACd,iBAAiB,EACjB,QAAQ,CACT;SACA,GAAG,CAAC,EAAE,GAAG,mCAAmC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qCAAqC,CACzD,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,4CAA4C,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,yBAAyB,CACvC,OAAe,EACf,cAAsB,EACtB,iBAAyB,EACzB,QAAgB,EAChB,UAAmD,EAAE,cAAc,EAAE,EAAE,EAAE;IAEzE,OAAO,uBAAuB,CAC5B,OAAO,EACP,GAAG,EAAE,CACH,8BAA8B,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,CAAC,EAC/F,qCAAqC,EACrC,CAAC,KAAK,CAAC,EACP,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAChD,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DevOpsInfrastructureContext as Client,\n ResourceDetailsListByPoolOptionalParams,\n} from \"../index.js\";\nimport {\n _ResourceDetailsObjectListResult,\n _resourceDetailsObjectListResultDeserializer,\n ResourceDetailsObject,\n} from \"../../models/models.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _resourceDetailsListByPoolSend(\n context: Client,\n subscriptionId: string,\n resourceGroupName: string,\n poolName: string,\n options: ResourceDetailsListByPoolOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n return context\n .path(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}/resources\",\n subscriptionId,\n resourceGroupName,\n poolName,\n )\n .get({ ...operationOptionsToRequestParameters(options) });\n}\n\nexport async function _resourceDetailsListByPoolDeserialize(\n result: PathUncheckedResponse,\n): Promise<_ResourceDetailsObjectListResult> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _resourceDetailsObjectListResultDeserializer(result.body);\n}\n\n/** List ResourceDetailsObject resources by Pool */\nexport function resourceDetailsListByPool(\n context: Client,\n subscriptionId: string,\n resourceGroupName: string,\n poolName: string,\n options: ResourceDetailsListByPoolOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<ResourceDetailsObject> {\n return buildPagedAsyncIterator(\n context,\n () =>\n _resourceDetailsListByPoolSend(context, subscriptionId, resourceGroupName, poolName, options),\n _resourceDetailsListByPoolDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n"]}
@@ -6,7 +6,7 @@ import { createRestError, operationOptionsToRequestParameters, } from "@azure-re
6
6
  export function _skuListByLocationSend(context, subscriptionId, locationName, options = { requestOptions: {} }) {
7
7
  return context
8
8
  .path("/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/locations/{locationName}/skus", subscriptionId, locationName)
9
- .get(Object.assign({}, operationOptionsToRequestParameters(options)));
9
+ .get({ ...operationOptionsToRequestParameters(options) });
10
10
  }
11
11
  export async function _skuListByLocationDeserialize(result) {
12
12
  const expectedStatuses = ["200"];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/sku/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAEL,kCAAkC,GAEnC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,uBAAuB,GACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAGL,eAAe,EACf,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AAEjC,MAAM,UAAU,sBAAsB,CACpC,OAAe,EACf,cAAsB,EACtB,YAAoB,EACpB,UAA2C,EAAE,cAAc,EAAE,EAAE,EAAE;IAEjE,OAAO,OAAO;SACX,IAAI,CACH,wGAAwG,EACxG,cAAc,EACd,YAAY,CACb;SACA,GAAG,mBAAM,mCAAmC,CAAC,OAAO,CAAC,EAAG,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACzD,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,iBAAiB,CAC/B,OAAe,EACf,cAAsB,EACtB,YAAoB,EACpB,UAA2C,EAAE,cAAc,EAAE,EAAE,EAAE;IAEjE,OAAO,uBAAuB,CAC5B,OAAO,EACP,GAAG,EAAE,CAAC,sBAAsB,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,EAC5E,6BAA6B,EAC7B,CAAC,KAAK,CAAC,EACP,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAChD,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DevOpsInfrastructureContext as Client,\n SkuListByLocationOptionalParams,\n} from \"../index.js\";\nimport {\n _ResourceSkuListResult,\n _resourceSkuListResultDeserializer,\n ResourceSku,\n} from \"../../models/models.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _skuListByLocationSend(\n context: Client,\n subscriptionId: string,\n locationName: string,\n options: SkuListByLocationOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n return context\n .path(\n \"/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/locations/{locationName}/skus\",\n subscriptionId,\n locationName,\n )\n .get({ ...operationOptionsToRequestParameters(options) });\n}\n\nexport async function _skuListByLocationDeserialize(\n result: PathUncheckedResponse,\n): Promise<_ResourceSkuListResult> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _resourceSkuListResultDeserializer(result.body);\n}\n\n/** List ResourceSku resources by subscription ID */\nexport function skuListByLocation(\n context: Client,\n subscriptionId: string,\n locationName: string,\n options: SkuListByLocationOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<ResourceSku> {\n return buildPagedAsyncIterator(\n context,\n () => _skuListByLocationSend(context, subscriptionId, locationName, options),\n _skuListByLocationDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/sku/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAEL,kCAAkC,GAEnC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,uBAAuB,GACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAGL,eAAe,EACf,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AAEjC,MAAM,UAAU,sBAAsB,CACpC,OAAe,EACf,cAAsB,EACtB,YAAoB,EACpB,UAA2C,EAAE,cAAc,EAAE,EAAE,EAAE;IAEjE,OAAO,OAAO;SACX,IAAI,CACH,wGAAwG,EACxG,cAAc,EACd,YAAY,CACb;SACA,GAAG,CAAC,EAAE,GAAG,mCAAmC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACzD,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,iBAAiB,CAC/B,OAAe,EACf,cAAsB,EACtB,YAAoB,EACpB,UAA2C,EAAE,cAAc,EAAE,EAAE,EAAE;IAEjE,OAAO,uBAAuB,CAC5B,OAAO,EACP,GAAG,EAAE,CAAC,sBAAsB,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,EAC5E,6BAA6B,EAC7B,CAAC,KAAK,CAAC,EACP,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAChD,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DevOpsInfrastructureContext as Client,\n SkuListByLocationOptionalParams,\n} from \"../index.js\";\nimport {\n _ResourceSkuListResult,\n _resourceSkuListResultDeserializer,\n ResourceSku,\n} from \"../../models/models.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _skuListByLocationSend(\n context: Client,\n subscriptionId: string,\n locationName: string,\n options: SkuListByLocationOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n return context\n .path(\n \"/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/locations/{locationName}/skus\",\n subscriptionId,\n locationName,\n )\n .get({ ...operationOptionsToRequestParameters(options) });\n}\n\nexport async function _skuListByLocationDeserialize(\n result: PathUncheckedResponse,\n): Promise<_ResourceSkuListResult> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _resourceSkuListResultDeserializer(result.body);\n}\n\n/** List ResourceSku resources by subscription ID */\nexport function skuListByLocation(\n context: Client,\n subscriptionId: string,\n locationName: string,\n options: SkuListByLocationOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<ResourceSku> {\n return buildPagedAsyncIterator(\n context,\n () => _skuListByLocationSend(context, subscriptionId, locationName, options),\n _skuListByLocationDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n"]}
@@ -6,7 +6,7 @@ import { createRestError, operationOptionsToRequestParameters, } from "@azure-re
6
6
  export function _subscriptionUsagesUsagesSend(context, subscriptionId, location, options = { requestOptions: {} }) {
7
7
  return context
8
8
  .path("/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/locations/{location}/usages", subscriptionId, location)
9
- .get(Object.assign({}, operationOptionsToRequestParameters(options)));
9
+ .get({ ...operationOptionsToRequestParameters(options) });
10
10
  }
11
11
  export async function _subscriptionUsagesUsagesDeserialize(result) {
12
12
  const expectedStatuses = ["200"];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/subscriptionUsages/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAe,uBAAuB,EAAS,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAEL,uBAAuB,GACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAGL,eAAe,EACf,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AAEjC,MAAM,UAAU,6BAA6B,CAC3C,OAAe,EACf,cAAsB,EACtB,QAAgB,EAChB,UAAkD,EAAE,cAAc,EAAE,EAAE,EAAE;IAExE,OAAO,OAAO;SACX,IAAI,CACH,sGAAsG,EACtG,cAAc,EACd,QAAQ,CACT;SACA,GAAG,mBAAM,mCAAmC,CAAC,OAAO,CAAC,EAAG,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oCAAoC,CACxD,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,wBAAwB,CACtC,OAAe,EACf,cAAsB,EACtB,QAAgB,EAChB,UAAkD,EAAE,cAAc,EAAE,EAAE,EAAE;IAExE,OAAO,uBAAuB,CAC5B,OAAO,EACP,GAAG,EAAE,CAAC,6BAA6B,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,CAAC,EAC/E,oCAAoC,EACpC,CAAC,KAAK,CAAC,EACP,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAChD,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DevOpsInfrastructureContext as Client,\n SubscriptionUsagesUsagesOptionalParams,\n} from \"../index.js\";\nimport { _PagedQuota, _pagedQuotaDeserializer, Quota } from \"../../models/models.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _subscriptionUsagesUsagesSend(\n context: Client,\n subscriptionId: string,\n location: string,\n options: SubscriptionUsagesUsagesOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n return context\n .path(\n \"/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/locations/{location}/usages\",\n subscriptionId,\n location,\n )\n .get({ ...operationOptionsToRequestParameters(options) });\n}\n\nexport async function _subscriptionUsagesUsagesDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedQuota> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedQuotaDeserializer(result.body);\n}\n\n/** List Quota resources by subscription ID */\nexport function subscriptionUsagesUsages(\n context: Client,\n subscriptionId: string,\n location: string,\n options: SubscriptionUsagesUsagesOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<Quota> {\n return buildPagedAsyncIterator(\n context,\n () => _subscriptionUsagesUsagesSend(context, subscriptionId, location, options),\n _subscriptionUsagesUsagesDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/subscriptionUsages/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAe,uBAAuB,EAAS,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAEL,uBAAuB,GACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAGL,eAAe,EACf,mCAAmC,GACpC,MAAM,yBAAyB,CAAC;AAEjC,MAAM,UAAU,6BAA6B,CAC3C,OAAe,EACf,cAAsB,EACtB,QAAgB,EAChB,UAAkD,EAAE,cAAc,EAAE,EAAE,EAAE;IAExE,OAAO,OAAO;SACX,IAAI,CACH,sGAAsG,EACtG,cAAc,EACd,QAAQ,CACT;SACA,GAAG,CAAC,EAAE,GAAG,mCAAmC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oCAAoC,CACxD,MAA6B;IAE7B,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,wBAAwB,CACtC,OAAe,EACf,cAAsB,EACtB,QAAgB,EAChB,UAAkD,EAAE,cAAc,EAAE,EAAE,EAAE;IAExE,OAAO,uBAAuB,CAC5B,OAAO,EACP,GAAG,EAAE,CAAC,6BAA6B,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,CAAC,EAC/E,oCAAoC,EACpC,CAAC,KAAK,CAAC,EACP,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAChD,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DevOpsInfrastructureContext as Client,\n SubscriptionUsagesUsagesOptionalParams,\n} from \"../index.js\";\nimport { _PagedQuota, _pagedQuotaDeserializer, Quota } from \"../../models/models.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _subscriptionUsagesUsagesSend(\n context: Client,\n subscriptionId: string,\n location: string,\n options: SubscriptionUsagesUsagesOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n return context\n .path(\n \"/subscriptions/{subscriptionId}/providers/Microsoft.DevOpsInfrastructure/locations/{location}/usages\",\n subscriptionId,\n location,\n )\n .get({ ...operationOptionsToRequestParameters(options) });\n}\n\nexport async function _subscriptionUsagesUsagesDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedQuota> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedQuotaDeserializer(result.body);\n}\n\n/** List Quota resources by subscription ID */\nexport function subscriptionUsagesUsages(\n context: Client,\n subscriptionId: string,\n location: string,\n options: SubscriptionUsagesUsagesOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<Quota> {\n return buildPagedAsyncIterator(\n context,\n () => _subscriptionUsagesUsagesSend(context, subscriptionId, location, options),\n _subscriptionUsagesUsagesDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n"]}
@@ -7,6 +7,8 @@ export function getImageVersions(context, subscriptionId) {
7
7
  };
8
8
  }
9
9
  export function getImageVersionsOperations(context, subscriptionId) {
10
- return Object.assign({}, getImageVersions(context, subscriptionId));
10
+ return {
11
+ ...getImageVersions(context, subscriptionId),
12
+ };
11
13
  }
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/imageVersions/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAe5E,MAAM,UAAU,gBAAgB,CAAC,OAAoC,EAAE,cAAsB;IAC3F,OAAO;QACL,WAAW,EAAE,CACX,iBAAyB,EACzB,SAAiB,EACjB,OAAgD,EAChD,EAAE,CAAC,wBAAwB,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,CAAC;KAC9F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,OAAoC,EACpC,cAAsB;IAEtB,yBACK,gBAAgB,CAAC,OAAO,EAAE,cAAc,CAAC,EAC5C;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureContext } from \"../../api/devOpsInfrastructureContext.js\";\nimport { imageVersionsListByImage } from \"../../api/imageVersions/index.js\";\nimport { ImageVersionsListByImageOptionalParams } from \"../../api/options.js\";\nimport { ImageVersion } from \"../../models/models.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a ImageVersions operations. */\nexport interface ImageVersionsOperations {\n /** List ImageVersion resources by Image */\n listByImage: (\n resourceGroupName: string,\n imageName: string,\n options?: ImageVersionsListByImageOptionalParams,\n ) => PagedAsyncIterableIterator<ImageVersion>;\n}\n\nexport function getImageVersions(context: DevOpsInfrastructureContext, subscriptionId: string) {\n return {\n listByImage: (\n resourceGroupName: string,\n imageName: string,\n options?: ImageVersionsListByImageOptionalParams,\n ) => imageVersionsListByImage(context, subscriptionId, resourceGroupName, imageName, options),\n };\n}\n\nexport function getImageVersionsOperations(\n context: DevOpsInfrastructureContext,\n subscriptionId: string,\n): ImageVersionsOperations {\n return {\n ...getImageVersions(context, subscriptionId),\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/imageVersions/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAe5E,MAAM,UAAU,gBAAgB,CAAC,OAAoC,EAAE,cAAsB;IAC3F,OAAO;QACL,WAAW,EAAE,CACX,iBAAyB,EACzB,SAAiB,EACjB,OAAgD,EAChD,EAAE,CAAC,wBAAwB,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,CAAC;KAC9F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,OAAoC,EACpC,cAAsB;IAEtB,OAAO;QACL,GAAG,gBAAgB,CAAC,OAAO,EAAE,cAAc,CAAC;KAC7C,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureContext } from \"../../api/devOpsInfrastructureContext.js\";\nimport { imageVersionsListByImage } from \"../../api/imageVersions/index.js\";\nimport { ImageVersionsListByImageOptionalParams } from \"../../api/options.js\";\nimport { ImageVersion } from \"../../models/models.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a ImageVersions operations. */\nexport interface ImageVersionsOperations {\n /** List ImageVersion resources by Image */\n listByImage: (\n resourceGroupName: string,\n imageName: string,\n options?: ImageVersionsListByImageOptionalParams,\n ) => PagedAsyncIterableIterator<ImageVersion>;\n}\n\nexport function getImageVersions(context: DevOpsInfrastructureContext, subscriptionId: string) {\n return {\n listByImage: (\n resourceGroupName: string,\n imageName: string,\n options?: ImageVersionsListByImageOptionalParams,\n ) => imageVersionsListByImage(context, subscriptionId, resourceGroupName, imageName, options),\n };\n}\n\nexport function getImageVersionsOperations(\n context: DevOpsInfrastructureContext,\n subscriptionId: string,\n): ImageVersionsOperations {\n return {\n ...getImageVersions(context, subscriptionId),\n };\n}\n"]}
@@ -7,6 +7,8 @@ export function getOperations(context) {
7
7
  };
8
8
  }
9
9
  export function getOperationsOperations(context) {
10
- return Object.assign({}, getOperations(context));
10
+ return {
11
+ ...getOperations(context),
12
+ };
11
13
  }
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/operations/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAW/D,MAAM,UAAU,aAAa,CAAC,OAAoC;IAChE,OAAO;QACL,IAAI,EAAE,CAAC,OAAsC,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC;KACnF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,OAAoC;IAEpC,yBACK,aAAa,CAAC,OAAO,CAAC,EACzB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureContext } from \"../../api/devOpsInfrastructureContext.js\";\nimport { operationsList } from \"../../api/operations/index.js\";\nimport { OperationsListOptionalParams } from \"../../api/options.js\";\nimport { Operation } from \"../../models/models.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a Operations operations. */\nexport interface OperationsOperations {\n /** List the operations for the provider */\n list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator<Operation>;\n}\n\nexport function getOperations(context: DevOpsInfrastructureContext) {\n return {\n list: (options?: OperationsListOptionalParams) => operationsList(context, options),\n };\n}\n\nexport function getOperationsOperations(\n context: DevOpsInfrastructureContext,\n): OperationsOperations {\n return {\n ...getOperations(context),\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/operations/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAW/D,MAAM,UAAU,aAAa,CAAC,OAAoC;IAChE,OAAO;QACL,IAAI,EAAE,CAAC,OAAsC,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC;KACnF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,OAAoC;IAEpC,OAAO;QACL,GAAG,aAAa,CAAC,OAAO,CAAC;KAC1B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureContext } from \"../../api/devOpsInfrastructureContext.js\";\nimport { operationsList } from \"../../api/operations/index.js\";\nimport { OperationsListOptionalParams } from \"../../api/options.js\";\nimport { Operation } from \"../../models/models.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a Operations operations. */\nexport interface OperationsOperations {\n /** List the operations for the provider */\n list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator<Operation>;\n}\n\nexport function getOperations(context: DevOpsInfrastructureContext) {\n return {\n list: (options?: OperationsListOptionalParams) => operationsList(context, options),\n };\n}\n\nexport function getOperationsOperations(\n context: DevOpsInfrastructureContext,\n): OperationsOperations {\n return {\n ...getOperations(context),\n };\n}\n"]}
@@ -12,6 +12,8 @@ export function getPools(context, subscriptionId) {
12
12
  };
13
13
  }
14
14
  export function getPoolsOperations(context, subscriptionId) {
15
- return Object.assign({}, getPools(context, subscriptionId));
15
+ return {
16
+ ...getPools(context, subscriptionId),
17
+ };
16
18
  }
17
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/pools/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAWlC,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AA4ClC,MAAM,UAAU,QAAQ,CAAC,OAAoC,EAAE,cAAsB;IACnF,OAAO;QACL,GAAG,EAAE,CAAC,iBAAyB,EAAE,QAAgB,EAAE,OAAgC,EAAE,EAAE,CACrF,QAAQ,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,CAAC;QACzE,cAAc,EAAE,CACd,iBAAyB,EACzB,QAAgB,EAChB,QAAc,EACd,OAA2C,EAC3C,EAAE,CACF,mBAAmB,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC;QAC9F,MAAM,EAAE,CACN,iBAAyB,EACzB,QAAgB,EAChB,UAAsB,EACtB,OAAmC,EACnC,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC;QAC3F,MAAM,EAAE,CAAC,iBAAyB,EAAE,QAAgB,EAAE,OAAmC,EAAE,EAAE,CAC3F,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,CAAC;QAC5E,mBAAmB,EAAE,CACnB,iBAAyB,EACzB,OAAgD,EAChD,EAAE,CAAC,wBAAwB,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,OAAO,CAAC;QAClF,kBAAkB,EAAE,CAAC,OAA+C,EAAE,EAAE,CACtE,uBAAuB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC;KAC5D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,OAAoC,EACpC,cAAsB;IAEtB,yBACK,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,EACpC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureContext } from \"../../api/devOpsInfrastructureContext.js\";\nimport {\n PoolsGetOptionalParams,\n PoolsCreateOrUpdateOptionalParams,\n PoolsUpdateOptionalParams,\n PoolsDeleteOptionalParams,\n PoolsListByResourceGroupOptionalParams,\n PoolsListBySubscriptionOptionalParams,\n} from \"../../api/options.js\";\nimport {\n poolsGet,\n poolsCreateOrUpdate,\n poolsUpdate,\n poolsDelete,\n poolsListByResourceGroup,\n poolsListBySubscription,\n} from \"../../api/pools/index.js\";\nimport { Pool, PoolUpdate } from \"../../models/models.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\nimport { PollerLike, OperationState } from \"@azure/core-lro\";\n\n/** Interface representing a Pools operations. */\nexport interface PoolsOperations {\n /** Get a Pool */\n get: (\n resourceGroupName: string,\n poolName: string,\n options?: PoolsGetOptionalParams,\n ) => Promise<Pool>;\n /** Create a Pool */\n createOrUpdate: (\n resourceGroupName: string,\n poolName: string,\n resource: Pool,\n options?: PoolsCreateOrUpdateOptionalParams,\n ) => PollerLike<OperationState<Pool>, Pool>;\n /** Update a Pool */\n update: (\n resourceGroupName: string,\n poolName: string,\n properties: PoolUpdate,\n options?: PoolsUpdateOptionalParams,\n ) => PollerLike<OperationState<Pool>, Pool>;\n /** Delete a Pool */\n delete: (\n resourceGroupName: string,\n poolName: string,\n options?: PoolsDeleteOptionalParams,\n ) => PollerLike<OperationState<void>, void>;\n /** List Pool resources by resource group */\n listByResourceGroup: (\n resourceGroupName: string,\n options?: PoolsListByResourceGroupOptionalParams,\n ) => PagedAsyncIterableIterator<Pool>;\n /** List Pool resources by subscription ID */\n listBySubscription: (\n options?: PoolsListBySubscriptionOptionalParams,\n ) => PagedAsyncIterableIterator<Pool>;\n}\n\nexport function getPools(context: DevOpsInfrastructureContext, subscriptionId: string) {\n return {\n get: (resourceGroupName: string, poolName: string, options?: PoolsGetOptionalParams) =>\n poolsGet(context, subscriptionId, resourceGroupName, poolName, options),\n createOrUpdate: (\n resourceGroupName: string,\n poolName: string,\n resource: Pool,\n options?: PoolsCreateOrUpdateOptionalParams,\n ) =>\n poolsCreateOrUpdate(context, subscriptionId, resourceGroupName, poolName, resource, options),\n update: (\n resourceGroupName: string,\n poolName: string,\n properties: PoolUpdate,\n options?: PoolsUpdateOptionalParams,\n ) => poolsUpdate(context, subscriptionId, resourceGroupName, poolName, properties, options),\n delete: (resourceGroupName: string, poolName: string, options?: PoolsDeleteOptionalParams) =>\n poolsDelete(context, subscriptionId, resourceGroupName, poolName, options),\n listByResourceGroup: (\n resourceGroupName: string,\n options?: PoolsListByResourceGroupOptionalParams,\n ) => poolsListByResourceGroup(context, subscriptionId, resourceGroupName, options),\n listBySubscription: (options?: PoolsListBySubscriptionOptionalParams) =>\n poolsListBySubscription(context, subscriptionId, options),\n };\n}\n\nexport function getPoolsOperations(\n context: DevOpsInfrastructureContext,\n subscriptionId: string,\n): PoolsOperations {\n return {\n ...getPools(context, subscriptionId),\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/pools/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAWlC,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AA4ClC,MAAM,UAAU,QAAQ,CAAC,OAAoC,EAAE,cAAsB;IACnF,OAAO;QACL,GAAG,EAAE,CAAC,iBAAyB,EAAE,QAAgB,EAAE,OAAgC,EAAE,EAAE,CACrF,QAAQ,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,CAAC;QACzE,cAAc,EAAE,CACd,iBAAyB,EACzB,QAAgB,EAChB,QAAc,EACd,OAA2C,EAC3C,EAAE,CACF,mBAAmB,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC;QAC9F,MAAM,EAAE,CACN,iBAAyB,EACzB,QAAgB,EAChB,UAAsB,EACtB,OAAmC,EACnC,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC;QAC3F,MAAM,EAAE,CAAC,iBAAyB,EAAE,QAAgB,EAAE,OAAmC,EAAE,EAAE,CAC3F,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,CAAC;QAC5E,mBAAmB,EAAE,CACnB,iBAAyB,EACzB,OAAgD,EAChD,EAAE,CAAC,wBAAwB,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,OAAO,CAAC;QAClF,kBAAkB,EAAE,CAAC,OAA+C,EAAE,EAAE,CACtE,uBAAuB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC;KAC5D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,OAAoC,EACpC,cAAsB;IAEtB,OAAO;QACL,GAAG,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;KACrC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureContext } from \"../../api/devOpsInfrastructureContext.js\";\nimport {\n PoolsGetOptionalParams,\n PoolsCreateOrUpdateOptionalParams,\n PoolsUpdateOptionalParams,\n PoolsDeleteOptionalParams,\n PoolsListByResourceGroupOptionalParams,\n PoolsListBySubscriptionOptionalParams,\n} from \"../../api/options.js\";\nimport {\n poolsGet,\n poolsCreateOrUpdate,\n poolsUpdate,\n poolsDelete,\n poolsListByResourceGroup,\n poolsListBySubscription,\n} from \"../../api/pools/index.js\";\nimport { Pool, PoolUpdate } from \"../../models/models.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\nimport { PollerLike, OperationState } from \"@azure/core-lro\";\n\n/** Interface representing a Pools operations. */\nexport interface PoolsOperations {\n /** Get a Pool */\n get: (\n resourceGroupName: string,\n poolName: string,\n options?: PoolsGetOptionalParams,\n ) => Promise<Pool>;\n /** Create a Pool */\n createOrUpdate: (\n resourceGroupName: string,\n poolName: string,\n resource: Pool,\n options?: PoolsCreateOrUpdateOptionalParams,\n ) => PollerLike<OperationState<Pool>, Pool>;\n /** Update a Pool */\n update: (\n resourceGroupName: string,\n poolName: string,\n properties: PoolUpdate,\n options?: PoolsUpdateOptionalParams,\n ) => PollerLike<OperationState<Pool>, Pool>;\n /** Delete a Pool */\n delete: (\n resourceGroupName: string,\n poolName: string,\n options?: PoolsDeleteOptionalParams,\n ) => PollerLike<OperationState<void>, void>;\n /** List Pool resources by resource group */\n listByResourceGroup: (\n resourceGroupName: string,\n options?: PoolsListByResourceGroupOptionalParams,\n ) => PagedAsyncIterableIterator<Pool>;\n /** List Pool resources by subscription ID */\n listBySubscription: (\n options?: PoolsListBySubscriptionOptionalParams,\n ) => PagedAsyncIterableIterator<Pool>;\n}\n\nexport function getPools(context: DevOpsInfrastructureContext, subscriptionId: string) {\n return {\n get: (resourceGroupName: string, poolName: string, options?: PoolsGetOptionalParams) =>\n poolsGet(context, subscriptionId, resourceGroupName, poolName, options),\n createOrUpdate: (\n resourceGroupName: string,\n poolName: string,\n resource: Pool,\n options?: PoolsCreateOrUpdateOptionalParams,\n ) =>\n poolsCreateOrUpdate(context, subscriptionId, resourceGroupName, poolName, resource, options),\n update: (\n resourceGroupName: string,\n poolName: string,\n properties: PoolUpdate,\n options?: PoolsUpdateOptionalParams,\n ) => poolsUpdate(context, subscriptionId, resourceGroupName, poolName, properties, options),\n delete: (resourceGroupName: string, poolName: string, options?: PoolsDeleteOptionalParams) =>\n poolsDelete(context, subscriptionId, resourceGroupName, poolName, options),\n listByResourceGroup: (\n resourceGroupName: string,\n options?: PoolsListByResourceGroupOptionalParams,\n ) => poolsListByResourceGroup(context, subscriptionId, resourceGroupName, options),\n listBySubscription: (options?: PoolsListBySubscriptionOptionalParams) =>\n poolsListBySubscription(context, subscriptionId, options),\n };\n}\n\nexport function getPoolsOperations(\n context: DevOpsInfrastructureContext,\n subscriptionId: string,\n): PoolsOperations {\n return {\n ...getPools(context, subscriptionId),\n };\n}\n"]}
@@ -7,6 +7,8 @@ export function getResourceDetails(context, subscriptionId) {
7
7
  };
8
8
  }
9
9
  export function getResourceDetailsOperations(context, subscriptionId) {
10
- return Object.assign({}, getResourceDetails(context, subscriptionId));
10
+ return {
11
+ ...getResourceDetails(context, subscriptionId),
12
+ };
11
13
  }
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/resourceDetails/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAc/E,MAAM,UAAU,kBAAkB,CAAC,OAAoC,EAAE,cAAsB;IAC7F,OAAO;QACL,UAAU,EAAE,CACV,iBAAyB,EACzB,QAAgB,EAChB,OAAiD,EACjD,EAAE,CAAC,yBAAyB,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,CAAC;KAC9F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,OAAoC,EACpC,cAAsB;IAEtB,yBACK,kBAAkB,CAAC,OAAO,EAAE,cAAc,CAAC,EAC9C;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureContext } from \"../../api/devOpsInfrastructureContext.js\";\nimport { ResourceDetailsListByPoolOptionalParams } from \"../../api/options.js\";\nimport { resourceDetailsListByPool } from \"../../api/resourceDetails/index.js\";\nimport { ResourceDetailsObject } from \"../../models/models.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a ResourceDetails operations. */\nexport interface ResourceDetailsOperations {\n /** List ResourceDetailsObject resources by Pool */\n listByPool: (\n resourceGroupName: string,\n poolName: string,\n options?: ResourceDetailsListByPoolOptionalParams,\n ) => PagedAsyncIterableIterator<ResourceDetailsObject>;\n}\n\nexport function getResourceDetails(context: DevOpsInfrastructureContext, subscriptionId: string) {\n return {\n listByPool: (\n resourceGroupName: string,\n poolName: string,\n options?: ResourceDetailsListByPoolOptionalParams,\n ) => resourceDetailsListByPool(context, subscriptionId, resourceGroupName, poolName, options),\n };\n}\n\nexport function getResourceDetailsOperations(\n context: DevOpsInfrastructureContext,\n subscriptionId: string,\n): ResourceDetailsOperations {\n return {\n ...getResourceDetails(context, subscriptionId),\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/resourceDetails/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAc/E,MAAM,UAAU,kBAAkB,CAAC,OAAoC,EAAE,cAAsB;IAC7F,OAAO;QACL,UAAU,EAAE,CACV,iBAAyB,EACzB,QAAgB,EAChB,OAAiD,EACjD,EAAE,CAAC,yBAAyB,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,CAAC;KAC9F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,OAAoC,EACpC,cAAsB;IAEtB,OAAO;QACL,GAAG,kBAAkB,CAAC,OAAO,EAAE,cAAc,CAAC;KAC/C,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureContext } from \"../../api/devOpsInfrastructureContext.js\";\nimport { ResourceDetailsListByPoolOptionalParams } from \"../../api/options.js\";\nimport { resourceDetailsListByPool } from \"../../api/resourceDetails/index.js\";\nimport { ResourceDetailsObject } from \"../../models/models.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a ResourceDetails operations. */\nexport interface ResourceDetailsOperations {\n /** List ResourceDetailsObject resources by Pool */\n listByPool: (\n resourceGroupName: string,\n poolName: string,\n options?: ResourceDetailsListByPoolOptionalParams,\n ) => PagedAsyncIterableIterator<ResourceDetailsObject>;\n}\n\nexport function getResourceDetails(context: DevOpsInfrastructureContext, subscriptionId: string) {\n return {\n listByPool: (\n resourceGroupName: string,\n poolName: string,\n options?: ResourceDetailsListByPoolOptionalParams,\n ) => resourceDetailsListByPool(context, subscriptionId, resourceGroupName, poolName, options),\n };\n}\n\nexport function getResourceDetailsOperations(\n context: DevOpsInfrastructureContext,\n subscriptionId: string,\n): ResourceDetailsOperations {\n return {\n ...getResourceDetails(context, subscriptionId),\n };\n}\n"]}
@@ -7,6 +7,8 @@ export function getSku(context, subscriptionId) {
7
7
  };
8
8
  }
9
9
  export function getSkuOperations(context, subscriptionId) {
10
- return Object.assign({}, getSku(context, subscriptionId));
10
+ return {
11
+ ...getSku(context, subscriptionId),
12
+ };
11
13
  }
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/sku/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAa3D,MAAM,UAAU,MAAM,CAAC,OAAoC,EAAE,cAAsB;IACjF,OAAO;QACL,cAAc,EAAE,CAAC,YAAoB,EAAE,OAAyC,EAAE,EAAE,CAClF,iBAAiB,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC;KACpE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,OAAoC,EACpC,cAAsB;IAEtB,yBACK,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,EAClC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureContext } from \"../../api/devOpsInfrastructureContext.js\";\nimport { SkuListByLocationOptionalParams } from \"../../api/options.js\";\nimport { skuListByLocation } from \"../../api/sku/index.js\";\nimport { ResourceSku } from \"../../models/models.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a Sku operations. */\nexport interface SkuOperations {\n /** List ResourceSku resources by subscription ID */\n listByLocation: (\n locationName: string,\n options?: SkuListByLocationOptionalParams,\n ) => PagedAsyncIterableIterator<ResourceSku>;\n}\n\nexport function getSku(context: DevOpsInfrastructureContext, subscriptionId: string) {\n return {\n listByLocation: (locationName: string, options?: SkuListByLocationOptionalParams) =>\n skuListByLocation(context, subscriptionId, locationName, options),\n };\n}\n\nexport function getSkuOperations(\n context: DevOpsInfrastructureContext,\n subscriptionId: string,\n): SkuOperations {\n return {\n ...getSku(context, subscriptionId),\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/sku/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAa3D,MAAM,UAAU,MAAM,CAAC,OAAoC,EAAE,cAAsB;IACjF,OAAO;QACL,cAAc,EAAE,CAAC,YAAoB,EAAE,OAAyC,EAAE,EAAE,CAClF,iBAAiB,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC;KACpE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,OAAoC,EACpC,cAAsB;IAEtB,OAAO;QACL,GAAG,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC;KACnC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureContext } from \"../../api/devOpsInfrastructureContext.js\";\nimport { SkuListByLocationOptionalParams } from \"../../api/options.js\";\nimport { skuListByLocation } from \"../../api/sku/index.js\";\nimport { ResourceSku } from \"../../models/models.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a Sku operations. */\nexport interface SkuOperations {\n /** List ResourceSku resources by subscription ID */\n listByLocation: (\n locationName: string,\n options?: SkuListByLocationOptionalParams,\n ) => PagedAsyncIterableIterator<ResourceSku>;\n}\n\nexport function getSku(context: DevOpsInfrastructureContext, subscriptionId: string) {\n return {\n listByLocation: (locationName: string, options?: SkuListByLocationOptionalParams) =>\n skuListByLocation(context, subscriptionId, locationName, options),\n };\n}\n\nexport function getSkuOperations(\n context: DevOpsInfrastructureContext,\n subscriptionId: string,\n): SkuOperations {\n return {\n ...getSku(context, subscriptionId),\n };\n}\n"]}
@@ -7,6 +7,8 @@ export function getSubscriptionUsages(context, subscriptionId) {
7
7
  };
8
8
  }
9
9
  export function getSubscriptionUsagesOperations(context, subscriptionId) {
10
- return Object.assign({}, getSubscriptionUsages(context, subscriptionId));
10
+ return {
11
+ ...getSubscriptionUsages(context, subscriptionId),
12
+ };
11
13
  }
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/subscriptionUsages/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAajF,MAAM,UAAU,qBAAqB,CACnC,OAAoC,EACpC,cAAsB;IAEtB,OAAO;QACL,MAAM,EAAE,CAAC,QAAgB,EAAE,OAAgD,EAAE,EAAE,CAC7E,wBAAwB,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,CAAC;KACvE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC7C,OAAoC,EACpC,cAAsB;IAEtB,yBACK,qBAAqB,CAAC,OAAO,EAAE,cAAc,CAAC,EACjD;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureContext } from \"../../api/devOpsInfrastructureContext.js\";\nimport { SubscriptionUsagesUsagesOptionalParams } from \"../../api/options.js\";\nimport { subscriptionUsagesUsages } from \"../../api/subscriptionUsages/index.js\";\nimport { Quota } from \"../../models/models.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a SubscriptionUsages operations. */\nexport interface SubscriptionUsagesOperations {\n /** List Quota resources by subscription ID */\n usages: (\n location: string,\n options?: SubscriptionUsagesUsagesOptionalParams,\n ) => PagedAsyncIterableIterator<Quota>;\n}\n\nexport function getSubscriptionUsages(\n context: DevOpsInfrastructureContext,\n subscriptionId: string,\n) {\n return {\n usages: (location: string, options?: SubscriptionUsagesUsagesOptionalParams) =>\n subscriptionUsagesUsages(context, subscriptionId, location, options),\n };\n}\n\nexport function getSubscriptionUsagesOperations(\n context: DevOpsInfrastructureContext,\n subscriptionId: string,\n): SubscriptionUsagesOperations {\n return {\n ...getSubscriptionUsages(context, subscriptionId),\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/subscriptionUsages/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAajF,MAAM,UAAU,qBAAqB,CACnC,OAAoC,EACpC,cAAsB;IAEtB,OAAO;QACL,MAAM,EAAE,CAAC,QAAgB,EAAE,OAAgD,EAAE,EAAE,CAC7E,wBAAwB,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,CAAC;KACvE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC7C,OAAoC,EACpC,cAAsB;IAEtB,OAAO;QACL,GAAG,qBAAqB,CAAC,OAAO,EAAE,cAAc,CAAC;KAClD,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureContext } from \"../../api/devOpsInfrastructureContext.js\";\nimport { SubscriptionUsagesUsagesOptionalParams } from \"../../api/options.js\";\nimport { subscriptionUsagesUsages } from \"../../api/subscriptionUsages/index.js\";\nimport { Quota } from \"../../models/models.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a SubscriptionUsages operations. */\nexport interface SubscriptionUsagesOperations {\n /** List Quota resources by subscription ID */\n usages: (\n location: string,\n options?: SubscriptionUsagesUsagesOptionalParams,\n ) => PagedAsyncIterableIterator<Quota>;\n}\n\nexport function getSubscriptionUsages(\n context: DevOpsInfrastructureContext,\n subscriptionId: string,\n) {\n return {\n usages: (location: string, options?: SubscriptionUsagesUsagesOptionalParams) =>\n subscriptionUsagesUsages(context, subscriptionId, location, options),\n };\n}\n\nexport function getSubscriptionUsagesOperations(\n context: DevOpsInfrastructureContext,\n subscriptionId: string,\n): SubscriptionUsagesOperations {\n return {\n ...getSubscriptionUsages(context, subscriptionId),\n };\n}\n"]}
@@ -8,13 +8,18 @@ import { getSubscriptionUsagesOperations, } from "./classic/subscriptionUsages/i
8
8
  import { getImageVersionsOperations, } from "./classic/imageVersions/index.js";
9
9
  import { createDevOpsInfrastructure, } from "./api/index.js";
10
10
  export class DevOpsInfrastructureClient {
11
+ _client;
12
+ /** The pipeline used by this client to make requests */
13
+ pipeline;
11
14
  constructor(credential, subscriptionId, options = {}) {
12
- var _a;
13
- const prefixFromOptions = (_a = options === null || options === void 0 ? void 0 : options.userAgentOptions) === null || _a === void 0 ? void 0 : _a.userAgentPrefix;
15
+ const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
14
16
  const userAgentPrefix = prefixFromOptions
15
17
  ? `${prefixFromOptions} azsdk-js-client`
16
18
  : `azsdk-js-client`;
17
- this._client = createDevOpsInfrastructure(credential, Object.assign(Object.assign({}, options), { userAgentOptions: { userAgentPrefix } }));
19
+ this._client = createDevOpsInfrastructure(credential, {
20
+ ...options,
21
+ userAgentOptions: { userAgentPrefix },
22
+ });
18
23
  this.pipeline = this._client.pipeline;
19
24
  this.operations = getOperationsOperations(this._client);
20
25
  this.pools = getPoolsOperations(this._client, subscriptionId);
@@ -23,5 +28,17 @@ export class DevOpsInfrastructureClient {
23
28
  this.subscriptionUsages = getSubscriptionUsagesOperations(this._client, subscriptionId);
24
29
  this.imageVersions = getImageVersionsOperations(this._client, subscriptionId);
25
30
  }
31
+ /** The operation groups for Operations */
32
+ operations;
33
+ /** The operation groups for Pools */
34
+ pools;
35
+ /** The operation groups for ResourceDetails */
36
+ resourceDetails;
37
+ /** The operation groups for Sku */
38
+ sku;
39
+ /** The operation groups for SubscriptionUsages */
40
+ subscriptionUsages;
41
+ /** The operation groups for ImageVersions */
42
+ imageVersions;
26
43
  }
27
44
  //# sourceMappingURL=devOpsInfrastructureClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"devOpsInfrastructureClient.js","sourceRoot":"","sources":["../../src/devOpsInfrastructureClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,uBAAuB,EAAwB,MAAM,+BAA+B,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAmB,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EACL,4BAA4B,GAE7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAiB,MA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port { getOperationsOperations, OperationsOperations } from \"./classic/operations/index.js\";\nimport { getPoolsOperations, PoolsOperations } from \"./classic/pools/index.js\";\nimport {\n getResourceDetailsOperations,\n ResourceDetailsOperations,\n} from \"./classic/resourceDetails/index.js\";\nimport { getSkuOperations, SkuOperations } from \"./classic/sku/index.js\";\nimport {\n getSubscriptionUsagesOperations,\n SubscriptionUsagesOperations,\n} from \"./classic/subscriptionUsages/index.js\";\nimport {\n getImageVersionsOperations,\n ImageVersionsOperations,\n} from \"./classic/imageVersions/index.js\";\nimport {\n createDevOpsInfrastructure,\n DevOpsInfrastructureContext,\n DevOpsInfrastructureClientOptionalParams,\n} from \"./api/index.js\";\nimport { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport { DevOpsInfrastructureClientOptionalParams } from \"./api/devOpsInfrastructureContext.js\";\n\nexport class DevOpsInfrastructureClient {\n private _client: DevOpsInfrastructureContext;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n constructor(\n credential: TokenCredential,\n subscriptionId: string,\n options: DevOpsInfrastructureClientOptionalParams = {},\n ) {\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._client = createDevOpsInfrastructure(credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n this.pipeline = this._client.pipeline;\n this.operations = getOperationsOperations(this._client);\n this.pools = getPoolsOperations(this._client, subscriptionId);\n this.resourceDetails = getResourceDetailsOperations(this._client, subscriptionId);\n this.sku = getSkuOperations(this._client, subscriptionId);\n this.subscriptionUsages = getSubscriptionUsagesOperations(this._client, subscriptionId);\n this.imageVersions = getImageVersionsOperations(this._client, subscriptionId);\n }\n\n /** The operation groups for Operations */\n public readonly operations: OperationsOperations;\n /** The operation groups for Pools */\n public readonly pools: PoolsOperations;\n /** The operation groups for ResourceDetails */\n public readonly resourceDetails: ResourceDetailsOperations;\n /** The operation groups for Sku */\n public readonly sku: SkuOperations;\n /** The operation groups for SubscriptionUsages */\n public readonly subscriptionUsages: SubscriptionUsagesOperations;\n /** The operation groups for ImageVersions */\n public readonly imageVersions: ImageVersionsOperations;\n}\n"]}
1
+ {"version":3,"file":"devOpsInfrastructureClient.js","sourceRoot":"","sources":["../../src/devOpsInfrastructureClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,uBAAuB,EAAwB,MAAM,+BAA+B,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAmB,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EACL,4BAA4B,GAE7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAiB,MAAM,wBAAwB,CAAC;AACzE,OAAO,EACL,+BAA+B,GAEhC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,0BAA0B,GAE3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,0BAA0B,GAG3B,MAAM,gBAAgB,CAAC;AAMxB,MAAM,OAAO,0BAA0B;IAC7B,OAAO,CAA8B;IAC7C,wDAAwD;IACxC,QAAQ,CAAW;IAEnC,YACE,UAA2B,EAC3B,cAAsB,EACtB,UAAoD,EAAE;QAEtD,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;QACrE,MAAM,eAAe,GAAG,iBAAiB;YACvC,CAAC,CAAC,GAAG,iBAAiB,kBAAkB;YACxC,CAAC,CAAC,iBAAiB,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,0BAA0B,CAAC,UAAU,EAAE;YACpD,GAAG,OAAO;YACV,gBAAgB,EAAE,EAAE,eAAe,EAAE;SACtC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;QACtC,IAAI,CAAC,UAAU,GAAG,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC9D,IAAI,CAAC,eAAe,GAAG,4BAA4B,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAClF,IAAI,CAAC,GAAG,GAAG,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC1D,IAAI,CAAC,kBAAkB,GAAG,+BAA+B,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QACxF,IAAI,CAAC,aAAa,GAAG,0BAA0B,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAChF,CAAC;IAED,0CAA0C;IAC1B,UAAU,CAAuB;IACjD,qCAAqC;IACrB,KAAK,CAAkB;IACvC,+CAA+C;IAC/B,eAAe,CAA4B;IAC3D,mCAAmC;IACnB,GAAG,CAAgB;IACnC,kDAAkD;IAClC,kBAAkB,CAA+B;IACjE,6CAA6C;IAC7B,aAAa,CAA0B;CACxD","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getOperationsOperations, OperationsOperations } from \"./classic/operations/index.js\";\nimport { getPoolsOperations, PoolsOperations } from \"./classic/pools/index.js\";\nimport {\n getResourceDetailsOperations,\n ResourceDetailsOperations,\n} from \"./classic/resourceDetails/index.js\";\nimport { getSkuOperations, SkuOperations } from \"./classic/sku/index.js\";\nimport {\n getSubscriptionUsagesOperations,\n SubscriptionUsagesOperations,\n} from \"./classic/subscriptionUsages/index.js\";\nimport {\n getImageVersionsOperations,\n ImageVersionsOperations,\n} from \"./classic/imageVersions/index.js\";\nimport {\n createDevOpsInfrastructure,\n DevOpsInfrastructureContext,\n DevOpsInfrastructureClientOptionalParams,\n} from \"./api/index.js\";\nimport { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport { DevOpsInfrastructureClientOptionalParams } from \"./api/devOpsInfrastructureContext.js\";\n\nexport class DevOpsInfrastructureClient {\n private _client: DevOpsInfrastructureContext;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n constructor(\n credential: TokenCredential,\n subscriptionId: string,\n options: DevOpsInfrastructureClientOptionalParams = {},\n ) {\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._client = createDevOpsInfrastructure(credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n this.pipeline = this._client.pipeline;\n this.operations = getOperationsOperations(this._client);\n this.pools = getPoolsOperations(this._client, subscriptionId);\n this.resourceDetails = getResourceDetailsOperations(this._client, subscriptionId);\n this.sku = getSkuOperations(this._client, subscriptionId);\n this.subscriptionUsages = getSubscriptionUsagesOperations(this._client, subscriptionId);\n this.imageVersions = getImageVersionsOperations(this._client, subscriptionId);\n }\n\n /** The operation groups for Operations */\n public readonly operations: OperationsOperations;\n /** The operation groups for Pools */\n public readonly pools: PoolsOperations;\n /** The operation groups for ResourceDetails */\n public readonly resourceDetails: ResourceDetailsOperations;\n /** The operation groups for Sku */\n public readonly sku: SkuOperations;\n /** The operation groups for SubscriptionUsages */\n public readonly subscriptionUsages: SubscriptionUsagesOperations;\n /** The operation groups for ImageVersions */\n public readonly imageVersions: ImageVersionsOperations;\n}\n"]}
@@ -9,21 +9,20 @@ import { deserializeState, } from "@azure/core-lro";
9
9
  * needs to be constructed after the original one is not in scope.
10
10
  */
11
11
  export function restorePoller(client, serializedState, sourceOperation, options) {
12
- var _a, _b, _c;
13
12
  const pollerConfig = deserializeState(serializedState).config;
14
13
  const { initialRequestUrl, requestMethod, metadata } = pollerConfig;
15
14
  if (!initialRequestUrl || !requestMethod) {
16
- throw new Error(`Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation === null || sourceOperation === void 0 ? void 0 : sourceOperation.name}`);
15
+ throw new Error(`Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`);
17
16
  }
18
- const resourceLocationConfig = metadata === null || metadata === void 0 ? void 0 : metadata["resourceLocationConfig"];
19
- const { deserializer, expectedStatuses = [] } = (_a = getDeserializationHelper(initialRequestUrl, requestMethod)) !== null && _a !== void 0 ? _a : {};
20
- const deserializeHelper = (_b = options === null || options === void 0 ? void 0 : options.processResponseBody) !== null && _b !== void 0 ? _b : deserializer;
17
+ const resourceLocationConfig = metadata?.["resourceLocationConfig"];
18
+ const { deserializer, expectedStatuses = [] } = getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};
19
+ const deserializeHelper = options?.processResponseBody ?? deserializer;
21
20
  if (!deserializeHelper) {
22
- throw new Error(`Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation === null || sourceOperation === void 0 ? void 0 : sourceOperation.name}.`);
21
+ throw new Error(`Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`);
23
22
  }
24
- return getLongRunningPoller((_c = client["_client"]) !== null && _c !== void 0 ? _c : client, deserializeHelper, expectedStatuses, {
25
- updateIntervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
26
- abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal,
23
+ return getLongRunningPoller(client["_client"] ?? client, deserializeHelper, expectedStatuses, {
24
+ updateIntervalInMs: options?.updateIntervalInMs,
25
+ abortSignal: options?.abortSignal,
27
26
  resourceLocationConfig,
28
27
  restoreFrom: serializedState,
29
28
  initialRequestUrl,
@@ -41,7 +40,6 @@ const deserializeMap = {
41
40
  },
42
41
  };
43
42
  function getDeserializationHelper(urlStr, method) {
44
- var _a, _b, _c, _d;
45
43
  const path = new URL(urlStr).pathname;
46
44
  const pathParts = path.split("/");
47
45
  // Traverse list to match the longest candidate
@@ -61,13 +59,13 @@ function getDeserializationHelper(urlStr, method) {
61
59
  // track if we have found a match to return the values found.
62
60
  let found = true;
63
61
  for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
64
- if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
65
- const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
62
+ if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) {
63
+ const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
66
64
  // If the current part of the candidate is a "template" part
67
65
  // Try to use the suffix of pattern to match the path
68
66
  // {guid} ==> $
69
67
  // {guid}:export ==> :export$
70
- const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
68
+ const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
71
69
  if (!isMatched) {
72
70
  found = false;
73
71
  break;
@@ -1 +1 @@
1
- {"version":3,"file":"restorePollerHelpers.js","sourceRoot":"","sources":["../../src/restorePollerHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EACL,+BAA+B,EAC/B,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAG1E,OAAO,EAGL,gBAAgB,GAEjB,MAAM,iBAAiB,CAAC;AAgBzB;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAkC,EAClC,eAAuB,EACvB,eAAiF,EACjF,OAAuC;;IAEvC,MAAM,YAAY,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC;IAC9D,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAC;IACpE,IAAI,CAAC,iBAAiB,IAAI,CAAC,aAAa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AG,CAAC,EAC/C,GAAG,GAAG,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,MAAM,CAAC;gBAClC,4DAA4D;gBAC5D,qDAAqD;gBACrD,eAAe;gBACf,6BAA6B;gBAC7B,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,GAAG,MAAA,cAAc,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAC1E,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CACnB,CAAC;gBAEF,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureClient } from \"./devOpsInfrastructureClient.js\";\nimport {\n _poolsCreateOrUpdateDeserialize,\n _poolsUpdateDeserialize,\n _poolsDeleteDeserialize,\n} from \"./api/pools/index.js\";\nimport { getLongRunningPoller } from \"./static-helpers/pollingHelpers.js\";\nimport { OperationOptions, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n PollerLike,\n OperationState,\n deserializeState,\n ResourceLocationConfig,\n} from \"@azure/core-lro\";\n\nexport interface RestorePollerOptions<\n TResult,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n> extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /** Deserialization function for raw response body */\n processResponseBody?: (result: TResponse) => Promise<TResult>;\n}\n\n/**\n * Creates a poller from the serialized state of another poller. This can be\n * useful when you want to create pollers on a different host or a poller\n * needs to be constructed after the original one is not in scope.\n */\nexport function restorePoller<TResponse extends PathUncheckedResponse, TResult>(\n client: DevOpsInfrastructureClient,\n serializedState: string,\n sourceOperation: (...args: any[]) => PollerLike<OperationState<TResult>, TResult>,\n options?: RestorePollerOptions<TResult>,\n): PollerLike<OperationState<TResult>, TResult> {\n const pollerConfig = deserializeState(serializedState).config;\n const { initialRequestUrl, requestMethod, metadata } = pollerConfig;\n if (!initialRequestUrl || !requestMethod) {\n throw new Error(\n `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`,\n );\n }\n const resourceLocationConfig = metadata?.[\"resourceLocationConfig\"] as\n | ResourceLocationConfig\n | undefined;\n const { deserializer, expectedStatuses = [] } =\n getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};\n const deserializeHelper = options?.processResponseBody ?? deserializer;\n if (!deserializeHelper) {\n throw new Error(\n `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`,\n );\n }\n return getLongRunningPoller(\n (client as any)[\"_client\"] ?? client,\n deserializeHelper as (result: TResponse) => Promise<TResult>,\n expectedStatuses,\n {\n updateIntervalInMs: options?.updateIntervalInMs,\n abortSignal: options?.abortSignal,\n resourceLocationConfig,\n restoreFrom: serializedState,\n initialRequestUrl,\n },\n );\n}\n\ninterface DeserializationHelper {\n deserializer: Function;\n expectedStatuses: string[];\n}\n\nconst deserializeMap: Record<string, DeserializationHelper> = {\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}\":\n {\n deserializer: _poolsCreateOrUpdateDeserialize,\n expectedStatuses: [\"200\", \"201\"],\n },\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}\":\n { deserializer: _poolsUpdateDeserialize, expectedStatuses: [\"200\", \"202\"] },\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}\":\n {\n deserializer: _poolsDeleteDeserialize,\n expectedStatuses: [\"202\", \"204\", \"200\"],\n },\n};\n\nfunction getDeserializationHelper(\n urlStr: string,\n method: string,\n): DeserializationHelper | undefined {\n const path = new URL(urlStr).pathname;\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: DeserializationHelper | undefined;\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(deserializeMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
1
+ {"version":3,"file":"restorePollerHelpers.js","sourceRoot":"","sources":["../../src/restorePollerHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EACL,+BAA+B,EAC/B,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAG1E,OAAO,EAGL,gBAAgB,GAEjB,MAAM,iBAAiB,CAAC;AAgBzB;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAkC,EAClC,eAAuB,EACvB,eAAiF,EACjF,OAAuC;IAEvC,MAAM,YAAY,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC;IAC9D,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAC;IACpE,IAAI,CAAC,iBAAiB,IAAI,CAAC,aAAa,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CACb,6BAA6B,eAAe,wBAAwB,eAAe,EAAE,IAAI,EAAE,CAC5F,CAAC;IACJ,CAAC;IACD,MAAM,sBAAsB,GAAG,QAAQ,EAAE,CAAC,wBAAwB,CAErD,CAAC;IACd,MAAM,EAAE,YAAY,EAAE,gBAAgB,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AAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DevOpsInfrastructureClient } from \"./devOpsInfrastructureClient.js\";\nimport {\n _poolsCreateOrUpdateDeserialize,\n _poolsUpdateDeserialize,\n _poolsDeleteDeserialize,\n} from \"./api/pools/index.js\";\nimport { getLongRunningPoller } from \"./static-helpers/pollingHelpers.js\";\nimport { OperationOptions, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n PollerLike,\n OperationState,\n deserializeState,\n ResourceLocationConfig,\n} from \"@azure/core-lro\";\n\nexport interface RestorePollerOptions<\n TResult,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n> extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /** Deserialization function for raw response body */\n processResponseBody?: (result: TResponse) => Promise<TResult>;\n}\n\n/**\n * Creates a poller from the serialized state of another poller. This can be\n * useful when you want to create pollers on a different host or a poller\n * needs to be constructed after the original one is not in scope.\n */\nexport function restorePoller<TResponse extends PathUncheckedResponse, TResult>(\n client: DevOpsInfrastructureClient,\n serializedState: string,\n sourceOperation: (...args: any[]) => PollerLike<OperationState<TResult>, TResult>,\n options?: RestorePollerOptions<TResult>,\n): PollerLike<OperationState<TResult>, TResult> {\n const pollerConfig = deserializeState(serializedState).config;\n const { initialRequestUrl, requestMethod, metadata } = pollerConfig;\n if (!initialRequestUrl || !requestMethod) {\n throw new Error(\n `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`,\n );\n }\n const resourceLocationConfig = metadata?.[\"resourceLocationConfig\"] as\n | ResourceLocationConfig\n | undefined;\n const { deserializer, expectedStatuses = [] } =\n getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};\n const deserializeHelper = options?.processResponseBody ?? deserializer;\n if (!deserializeHelper) {\n throw new Error(\n `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`,\n );\n }\n return getLongRunningPoller(\n (client as any)[\"_client\"] ?? client,\n deserializeHelper as (result: TResponse) => Promise<TResult>,\n expectedStatuses,\n {\n updateIntervalInMs: options?.updateIntervalInMs,\n abortSignal: options?.abortSignal,\n resourceLocationConfig,\n restoreFrom: serializedState,\n initialRequestUrl,\n },\n );\n}\n\ninterface DeserializationHelper {\n deserializer: Function;\n expectedStatuses: string[];\n}\n\nconst deserializeMap: Record<string, DeserializationHelper> = {\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}\":\n {\n deserializer: _poolsCreateOrUpdateDeserialize,\n expectedStatuses: [\"200\", \"201\"],\n },\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}\":\n { deserializer: _poolsUpdateDeserialize, expectedStatuses: [\"200\", \"202\"] },\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevOpsInfrastructure/pools/{poolName}\":\n {\n deserializer: _poolsDeleteDeserialize,\n expectedStatuses: [\"202\", \"204\", \"200\"],\n },\n};\n\nfunction getDeserializationHelper(\n urlStr: string,\n method: string,\n): DeserializationHelper | undefined {\n const path = new URL(urlStr).pathname;\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: DeserializationHelper | undefined;\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(deserializeMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -1,15 +1,13 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
4
3
  import { createRestError } from "@azure-rest/core-client";
5
4
  import { RestError } from "@azure/core-rest-pipeline";
6
5
  /**
7
6
  * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
8
7
  */
9
8
  export function buildPagedAsyncIterator(client, getInitialResponse, processResponseBody, expectedStatuses, options = {}) {
10
- var _a, _b;
11
- const itemName = (_a = options.itemName) !== null && _a !== void 0 ? _a : "value";
12
- const nextLinkName = (_b = options.nextLinkName) !== null && _b !== void 0 ? _b : "nextLink";
9
+ const itemName = options.itemName ?? "value";
10
+ const nextLinkName = options.nextLinkName ?? "nextLink";
13
11
  const pagedResult = {
14
12
  getPage: async (pageLink) => {
15
13
  const result = pageLink === undefined
@@ -25,7 +23,7 @@ export function buildPagedAsyncIterator(client, getInitialResponse, processRespo
25
23
  };
26
24
  },
27
25
  byPage: (settings) => {
28
- const { continuationToken } = settings !== null && settings !== void 0 ? settings : {};
26
+ const { continuationToken } = settings ?? {};
29
27
  return getPageAsyncIterator(pagedResult, {
30
28
  pageLink: continuationToken,
31
29
  });
@@ -41,7 +39,6 @@ export function buildPagedAsyncIterator(client, getInitialResponse, processRespo
41
39
  * @returns a paged async iterator that iterates over results.
42
40
  */
43
41
  function getPagedAsyncIterator(pagedResult) {
44
- var _a;
45
42
  const iter = getItemAsyncIterator(pagedResult);
46
43
  return {
47
44
  next() {
@@ -50,55 +47,39 @@ function getPagedAsyncIterator(pagedResult) {
50
47
  [Symbol.asyncIterator]() {
51
48
  return this;
52
49
  },
53
- byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => {
54
- const { continuationToken } = settings !== null && settings !== void 0 ? settings : {};
55
- return getPageAsyncIterator(pagedResult, {
56
- pageLink: continuationToken,
57
- });
58
- }),
50
+ byPage: pagedResult?.byPage ??
51
+ ((settings) => {
52
+ const { continuationToken } = settings ?? {};
53
+ return getPageAsyncIterator(pagedResult, {
54
+ pageLink: continuationToken,
55
+ });
56
+ }),
59
57
  };
60
58
  }
61
- function getItemAsyncIterator(pagedResult) {
62
- return __asyncGenerator(this, arguments, function* getItemAsyncIterator_1() {
63
- var _a, e_1, _b, _c;
64
- const pages = getPageAsyncIterator(pagedResult);
65
- try {
66
- for (var _d = true, pages_1 = __asyncValues(pages), pages_1_1; pages_1_1 = yield __await(pages_1.next()), _a = pages_1_1.done, !_a; _d = true) {
67
- _c = pages_1_1.value;
68
- _d = false;
69
- const page = _c;
70
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
71
- }
72
- }
73
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
74
- finally {
75
- try {
76
- if (!_d && !_a && (_b = pages_1.return)) yield __await(_b.call(pages_1));
77
- }
78
- finally { if (e_1) throw e_1.error; }
79
- }
80
- });
59
+ async function* getItemAsyncIterator(pagedResult) {
60
+ const pages = getPageAsyncIterator(pagedResult);
61
+ for await (const page of pages) {
62
+ yield* page;
63
+ }
81
64
  }
82
- function getPageAsyncIterator(pagedResult_1) {
83
- return __asyncGenerator(this, arguments, function* getPageAsyncIterator_1(pagedResult, options = {}) {
84
- const { pageLink } = options;
85
- let response = yield __await(pagedResult.getPage(pageLink !== null && pageLink !== void 0 ? pageLink : pagedResult.firstPageLink));
65
+ async function* getPageAsyncIterator(pagedResult, options = {}) {
66
+ const { pageLink } = options;
67
+ let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);
68
+ if (!response) {
69
+ return;
70
+ }
71
+ let result = response.page;
72
+ result.continuationToken = response.nextPageLink;
73
+ yield result;
74
+ while (response.nextPageLink) {
75
+ response = await pagedResult.getPage(response.nextPageLink);
86
76
  if (!response) {
87
- return yield __await(void 0);
77
+ return;
88
78
  }
89
- let result = response.page;
79
+ result = response.page;
90
80
  result.continuationToken = response.nextPageLink;
91
- yield yield __await(result);
92
- while (response.nextPageLink) {
93
- response = yield __await(pagedResult.getPage(response.nextPageLink));
94
- if (!response) {
95
- return yield __await(void 0);
96
- }
97
- result = response.page;
98
- result.continuationToken = response.nextPageLink;
99
- yield yield __await(result);
100
- }
101
- });
81
+ yield result;
82
+ }
102
83
  }
103
84
  /**
104
85
  * Gets for the value of nextLink in the body
@@ -124,7 +105,7 @@ function getElements(body, itemName) {
124
105
  if (!Array.isArray(value)) {
125
106
  throw new RestError(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
126
107
  }
127
- return value !== null && value !== void 0 ? value : [];
108
+ return value ?? [];
128
109
  }
129
110
  /**
130
111
  * Checks if a request failed
@@ -1 +1 @@
1
- {"version":3,"file":"pagingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pagingHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAU,eAAe,EAAyB,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AA+EtD;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAMrC,MAAc,EACd,kBAAgD,EAChD,mBAAgE,EAChE,gBAA0B,EAC1B,UAA0C,EAAE;;IAE5C,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC;IAC7C,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,YAAY,mCAAI,UAAU,CAAC;IACxD,MAAM,WAAW,GAAgD;QAC/D,OAAO,EAAE,KAAK,EAAE,QAAiB,EAAE,EAAE;YACnC,MAAM,MAAM,GACV,QAAQ,KAAK,SAAS;gBACpB,CAAC,CAAC,MAAM,kBAAkB,EAAE;gBAC5B,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;YACjD,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;YAC7C,MAAM,OAAO,GAA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QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACzF,MAAM,IAAI,SAAS,CACjB,iBAAiB,YAAY,oDAAoD,OAAO,QAAQ,EAAE,CACnG,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IACjE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,SAAS,CACjB,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B,EAAE,gBAA0B;IACrF,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options for the byPage method\n */\nexport interface PageSettings {\n /**\n * A reference to a specific page to start iterating from.\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that describes a page of results.\n */\nexport type ContinuablePage<TElement, TPage = TElement[]> = TPage & {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n};\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\nexport interface PagedResult<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * Link to the first page of results.\n */\n firstPageLink?: string;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => TElement[];\n}\n\n/**\n * Options for the paging helper\n */\nexport interface BuildPagedAsyncIteratorOptions {\n itemName?: string;\n nextLinkName?: string;\n}\n\n/**\n * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator\n */\nexport function buildPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n>(\n client: Client,\n getInitialResponse: () => PromiseLike<TResponse>,\n processResponseBody: (result: TResponse) => PromiseLike<unknown>,\n expectedStatuses: string[],\n options: BuildPagedAsyncIteratorOptions = {},\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const itemName = options.itemName ?? \"value\";\n const nextLinkName = options.nextLinkName ?? \"nextLink\";\n const pagedResult: PagedResult<TElement, TPage, TPageSettings> = {\n getPage: async (pageLink?: string) => {\n const result =\n pageLink === undefined\n ? await getInitialResponse()\n : await client.pathUnchecked(pageLink).get();\n checkPagingRequest(result, expectedStatuses);\n const results = await processResponseBody(result as TResponse);\n const nextLink = getNextLink(results, nextLinkName);\n const values = getElements<TElement>(results, itemName) as TPage;\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n byPage: (settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n },\n };\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\n\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n ((settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n }),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n for await (const page of pages) {\n yield* page as unknown as TElement[];\n }\n}\n\nasync function* getPageAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n options: {\n pageLink?: string;\n } = {},\n): AsyncIterableIterator<ContinuablePage<TElement, TPage>> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n let result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n }\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\" && nextLink !== null) {\n throw new RestError(\n `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`,\n );\n }\n\n if (nextLink === null) {\n return undefined;\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n if (!Array.isArray(value)) {\n throw new RestError(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void {\n if (!expectedStatuses.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pagingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pagingHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAU,eAAe,EAAyB,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AA+EtD;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAMrC,MAAc,EACd,kBAAgD,EAChD,mBAAgE,EAChE,gBAA0B,EAC1B,UAA0C,EAAE;IAE5C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC;IA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;IACvD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,QAAQ,GAAI,IAAgC,CAAC,YAAY,CAAC,CAAC;IAEjE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACzF,MAAM,IAAI,SAAS,CACjB,iBAAiB,YAAY,oDAAoD,OAAO,QAAQ,EAAE,CACnG,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IACjE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,SAAS,CACjB,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,IAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B,EAAE,gBAA0B;IACrF,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options for the byPage method\n */\nexport interface PageSettings {\n /**\n * A reference to a specific page to start iterating from.\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that describes a page of results.\n */\nexport type ContinuablePage<TElement, TPage = TElement[]> = TPage & {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n};\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\nexport interface PagedResult<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * Link to the first page of results.\n */\n firstPageLink?: string;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => TElement[];\n}\n\n/**\n * Options for the paging helper\n */\nexport interface BuildPagedAsyncIteratorOptions {\n itemName?: string;\n nextLinkName?: string;\n}\n\n/**\n * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator\n */\nexport function buildPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n>(\n client: Client,\n getInitialResponse: () => PromiseLike<TResponse>,\n processResponseBody: (result: TResponse) => PromiseLike<unknown>,\n expectedStatuses: string[],\n options: BuildPagedAsyncIteratorOptions = {},\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const itemName = options.itemName ?? \"value\";\n const nextLinkName = options.nextLinkName ?? \"nextLink\";\n const pagedResult: PagedResult<TElement, TPage, TPageSettings> = {\n getPage: async (pageLink?: string) => {\n const result =\n pageLink === undefined\n ? await getInitialResponse()\n : await client.pathUnchecked(pageLink).get();\n checkPagingRequest(result, expectedStatuses);\n const results = await processResponseBody(result as TResponse);\n const nextLink = getNextLink(results, nextLinkName);\n const values = getElements<TElement>(results, itemName) as TPage;\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n byPage: (settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n },\n };\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\n\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n ((settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n }),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n for await (const page of pages) {\n yield* page as unknown as TElement[];\n }\n}\n\nasync function* getPageAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n options: {\n pageLink?: string;\n } = {},\n): AsyncIterableIterator<ContinuablePage<TElement, TPage>> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n let result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n }\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\" && nextLink !== null) {\n throw new RestError(\n `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`,\n );\n }\n\n if (nextLink === null) {\n return undefined;\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n if (!Array.isArray(value)) {\n throw new RestError(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void {\n if (!expectedStatuses.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}