@azure/arm-sqlvirtualmachine 5.0.0-beta.9 → 5.0.0
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.
- package/LICENSE +1 -1
- package/README.md +13 -16
- package/dist/browser/api/availabilityGroupListeners/index.d.ts +3 -0
- package/dist/browser/api/availabilityGroupListeners/index.js +4 -0
- package/dist/browser/api/availabilityGroupListeners/index.js.map +1 -0
- package/dist/browser/api/availabilityGroupListeners/operations.d.ts +23 -0
- package/dist/browser/api/availabilityGroupListeners/operations.js +140 -0
- package/dist/browser/api/availabilityGroupListeners/operations.js.map +1 -0
- package/dist/browser/api/availabilityGroupListeners/options.d.ts +20 -0
- package/dist/browser/api/availabilityGroupListeners/options.js +4 -0
- package/dist/browser/api/availabilityGroupListeners/options.js.map +1 -0
- package/dist/browser/api/index.d.ts +3 -0
- package/dist/browser/api/index.js +4 -0
- package/dist/browser/api/index.js.map +1 -0
- package/dist/browser/api/operations/index.d.ts +3 -0
- package/dist/browser/api/operations/index.js +4 -0
- package/dist/browser/api/operations/index.js.map +1 -0
- package/dist/browser/api/operations/operations.d.ts +10 -0
- package/dist/browser/api/operations/operations.js +33 -0
- package/dist/browser/api/operations/operations.js.map +1 -0
- package/dist/browser/api/operations/options.d.ts +5 -0
- package/dist/browser/api/operations/options.js +4 -0
- package/dist/browser/api/operations/options.js.map +1 -0
- package/dist/browser/api/sqlVirtualMachineGroups/index.d.ts +3 -0
- package/dist/browser/api/sqlVirtualMachineGroups/index.js +4 -0
- package/dist/browser/api/sqlVirtualMachineGroups/index.js.map +1 -0
- package/dist/browser/api/sqlVirtualMachineGroups/operations.d.ts +31 -0
- package/dist/browser/api/sqlVirtualMachineGroups/operations.js +199 -0
- package/dist/browser/api/sqlVirtualMachineGroups/operations.js.map +1 -0
- package/dist/browser/api/sqlVirtualMachineGroups/options.d.ts +26 -0
- package/dist/browser/api/sqlVirtualMachineGroups/options.js +4 -0
- package/dist/browser/api/sqlVirtualMachineGroups/options.js.map +1 -0
- package/dist/browser/api/sqlVirtualMachineManagementContext.d.ts +22 -0
- package/dist/browser/api/sqlVirtualMachineManagementContext.js +26 -0
- package/dist/browser/api/sqlVirtualMachineManagementContext.js.map +1 -0
- package/dist/browser/api/sqlVirtualMachineTroubleshoot/index.d.ts +3 -0
- package/dist/browser/api/sqlVirtualMachineTroubleshoot/index.js +4 -0
- package/dist/browser/api/sqlVirtualMachineTroubleshoot/index.js.map +1 -0
- package/dist/browser/api/sqlVirtualMachineTroubleshoot/operations.d.ts +10 -0
- package/dist/browser/api/sqlVirtualMachineTroubleshoot/operations.js +44 -0
- package/dist/browser/api/sqlVirtualMachineTroubleshoot/operations.js.map +1 -0
- package/dist/browser/api/sqlVirtualMachineTroubleshoot/options.d.ts +7 -0
- package/dist/browser/api/sqlVirtualMachineTroubleshoot/options.js +4 -0
- package/dist/browser/api/sqlVirtualMachineTroubleshoot/options.js.map +1 -0
- package/dist/browser/api/sqlVirtualMachines/index.d.ts +3 -0
- package/dist/browser/api/sqlVirtualMachines/index.js +4 -0
- package/dist/browser/api/sqlVirtualMachines/index.js.map +1 -0
- package/dist/browser/api/sqlVirtualMachines/operations.d.ts +47 -0
- package/dist/browser/api/sqlVirtualMachines/operations.js +329 -0
- package/dist/browser/api/sqlVirtualMachines/operations.js.map +1 -0
- package/dist/browser/api/sqlVirtualMachines/options.d.ts +46 -0
- package/dist/browser/api/sqlVirtualMachines/options.js +4 -0
- package/dist/browser/api/sqlVirtualMachines/options.js.map +1 -0
- package/dist/browser/classic/availabilityGroupListeners/index.d.ts +27 -0
- package/dist/browser/classic/availabilityGroupListeners/index.js +34 -0
- package/dist/browser/classic/availabilityGroupListeners/index.js.map +1 -0
- package/dist/browser/classic/index.d.ts +6 -0
- package/dist/browser/classic/index.js +4 -0
- package/dist/browser/classic/index.js.map +1 -0
- package/dist/browser/classic/operations/index.d.ts +11 -0
- package/dist/browser/classic/operations/index.js +14 -0
- package/dist/browser/classic/operations/index.js.map +1 -0
- package/dist/browser/classic/sqlVirtualMachineGroups/index.d.ts +35 -0
- package/dist/browser/classic/sqlVirtualMachineGroups/index.js +44 -0
- package/dist/browser/classic/sqlVirtualMachineGroups/index.js.map +1 -0
- package/dist/browser/classic/sqlVirtualMachineTroubleshoot/index.d.ts +16 -0
- package/dist/browser/classic/sqlVirtualMachineTroubleshoot/index.js +23 -0
- package/dist/browser/classic/sqlVirtualMachineTroubleshoot/index.js.map +1 -0
- package/dist/browser/classic/sqlVirtualMachines/index.d.ts +55 -0
- package/dist/browser/classic/sqlVirtualMachines/index.js +72 -0
- package/dist/browser/classic/sqlVirtualMachines/index.js.map +1 -0
- package/dist/browser/index.d.ts +19 -3
- package/dist/browser/index.js +7 -11
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/models/index.d.ts +2 -1291
- package/dist/browser/models/index.js +3 -225
- package/dist/browser/models/index.js.map +1 -1
- package/dist/{react-native/models/index.d.ts → browser/models/models.d.ts} +881 -924
- package/dist/browser/models/models.js +1363 -0
- package/dist/browser/models/models.js.map +1 -0
- package/dist/browser/restorePollerHelpers.d.ts +21 -0
- package/dist/browser/restorePollerHelpers.js +120 -0
- package/dist/browser/restorePollerHelpers.js.map +1 -0
- package/dist/browser/sqlVirtualMachineManagementClient.d.ts +25 -22
- package/dist/browser/sqlVirtualMachineManagementClient.js +41 -106
- package/dist/browser/sqlVirtualMachineManagementClient.js.map +1 -1
- package/dist/browser/static-helpers/cloudSettingHelpers.d.ts +22 -0
- package/dist/browser/static-helpers/cloudSettingHelpers.js +38 -0
- package/dist/browser/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/pagingHelpers.d.ts +74 -0
- package/dist/browser/static-helpers/pagingHelpers.js +143 -0
- package/dist/browser/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/pollingHelpers.d.ts +34 -0
- package/dist/browser/static-helpers/pollingHelpers.js +95 -0
- package/dist/browser/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/serialization/check-prop-undefined.d.ts +8 -0
- package/dist/browser/static-helpers/serialization/check-prop-undefined.js +17 -0
- package/dist/browser/static-helpers/serialization/check-prop-undefined.js.map +1 -0
- package/dist/browser/static-helpers/simplePollerHelpers.d.ts +73 -0
- package/dist/browser/static-helpers/simplePollerHelpers.js +44 -0
- package/dist/browser/static-helpers/simplePollerHelpers.js.map +1 -0
- package/dist/browser/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/browser/static-helpers/urlTemplate.js +200 -0
- package/dist/browser/static-helpers/urlTemplate.js.map +1 -0
- package/dist/commonjs/api/availabilityGroupListeners/index.d.ts +3 -0
- package/dist/commonjs/api/availabilityGroupListeners/index.js +34 -0
- package/dist/commonjs/api/availabilityGroupListeners/index.js.map +7 -0
- package/dist/commonjs/api/availabilityGroupListeners/operations.d.ts +23 -0
- package/dist/commonjs/api/availabilityGroupListeners/operations.js +223 -0
- package/dist/commonjs/api/availabilityGroupListeners/operations.js.map +7 -0
- package/dist/commonjs/api/availabilityGroupListeners/options.d.ts +20 -0
- package/dist/commonjs/api/availabilityGroupListeners/options.js +16 -0
- package/dist/commonjs/api/availabilityGroupListeners/options.js.map +7 -0
- package/dist/commonjs/api/index.d.ts +3 -0
- package/dist/commonjs/api/index.js +28 -0
- package/dist/commonjs/api/index.js.map +7 -0
- package/dist/commonjs/api/operations/index.d.ts +3 -0
- package/dist/commonjs/api/operations/index.js +28 -0
- package/dist/commonjs/api/operations/index.js.map +7 -0
- package/dist/commonjs/api/operations/operations.d.ts +10 -0
- package/dist/commonjs/api/operations/operations.js +70 -0
- package/dist/commonjs/api/operations/operations.js.map +7 -0
- package/dist/commonjs/api/operations/options.d.ts +5 -0
- package/dist/commonjs/api/operations/options.js +16 -0
- package/dist/commonjs/api/operations/options.js.map +7 -0
- package/dist/commonjs/api/sqlVirtualMachineGroups/index.d.ts +3 -0
- package/dist/commonjs/api/sqlVirtualMachineGroups/index.js +38 -0
- package/dist/commonjs/api/sqlVirtualMachineGroups/index.js.map +7 -0
- package/dist/commonjs/api/sqlVirtualMachineGroups/operations.d.ts +31 -0
- package/dist/commonjs/api/sqlVirtualMachineGroups/operations.js +293 -0
- package/dist/commonjs/api/sqlVirtualMachineGroups/operations.js.map +7 -0
- package/dist/commonjs/api/sqlVirtualMachineGroups/options.d.ts +26 -0
- package/dist/commonjs/api/sqlVirtualMachineGroups/options.js +16 -0
- package/dist/commonjs/api/sqlVirtualMachineGroups/options.js.map +7 -0
- package/dist/commonjs/api/sqlVirtualMachineManagementContext.d.ts +22 -0
- package/dist/commonjs/api/sqlVirtualMachineManagementContext.js +47 -0
- package/dist/commonjs/api/sqlVirtualMachineManagementContext.js.map +7 -0
- package/dist/commonjs/api/sqlVirtualMachineTroubleshoot/index.d.ts +3 -0
- package/dist/commonjs/api/sqlVirtualMachineTroubleshoot/index.js +28 -0
- package/dist/commonjs/api/sqlVirtualMachineTroubleshoot/index.js.map +7 -0
- package/dist/commonjs/api/sqlVirtualMachineTroubleshoot/operations.d.ts +10 -0
- package/dist/commonjs/api/sqlVirtualMachineTroubleshoot/operations.js +75 -0
- package/dist/commonjs/api/sqlVirtualMachineTroubleshoot/operations.js.map +7 -0
- package/dist/commonjs/api/sqlVirtualMachineTroubleshoot/options.d.ts +7 -0
- package/dist/commonjs/api/sqlVirtualMachineTroubleshoot/options.js +16 -0
- package/dist/commonjs/api/sqlVirtualMachineTroubleshoot/options.js.map +7 -0
- package/dist/commonjs/api/sqlVirtualMachines/index.d.ts +3 -0
- package/dist/commonjs/api/sqlVirtualMachines/index.js +46 -0
- package/dist/commonjs/api/sqlVirtualMachines/index.js.map +7 -0
- package/dist/commonjs/api/sqlVirtualMachines/operations.d.ts +47 -0
- package/dist/commonjs/api/sqlVirtualMachines/operations.js +465 -0
- package/dist/commonjs/api/sqlVirtualMachines/operations.js.map +7 -0
- package/dist/commonjs/api/sqlVirtualMachines/options.d.ts +46 -0
- package/dist/commonjs/api/sqlVirtualMachines/options.js +16 -0
- package/dist/commonjs/api/sqlVirtualMachines/options.js.map +7 -0
- package/dist/commonjs/classic/availabilityGroupListeners/index.d.ts +27 -0
- package/dist/commonjs/classic/availabilityGroupListeners/index.js +103 -0
- package/dist/commonjs/classic/availabilityGroupListeners/index.js.map +7 -0
- package/dist/commonjs/classic/index.d.ts +6 -0
- package/dist/commonjs/classic/index.js +16 -0
- package/dist/commonjs/classic/index.js.map +7 -0
- package/dist/commonjs/classic/operations/index.d.ts +11 -0
- package/dist/commonjs/classic/operations/index.js +38 -0
- package/dist/commonjs/classic/operations/index.js.map +7 -0
- package/dist/commonjs/classic/sqlVirtualMachineGroups/index.d.ts +35 -0
- package/dist/commonjs/classic/sqlVirtualMachineGroups/index.js +92 -0
- package/dist/commonjs/classic/sqlVirtualMachineGroups/index.js.map +7 -0
- package/dist/commonjs/classic/sqlVirtualMachineTroubleshoot/index.d.ts +16 -0
- package/dist/commonjs/classic/sqlVirtualMachineTroubleshoot/index.js +59 -0
- package/dist/commonjs/classic/sqlVirtualMachineTroubleshoot/index.js.map +7 -0
- package/dist/commonjs/classic/sqlVirtualMachines/index.d.ts +55 -0
- package/dist/commonjs/classic/sqlVirtualMachines/index.js +120 -0
- package/dist/commonjs/classic/sqlVirtualMachines/index.js.map +7 -0
- package/dist/commonjs/index.d.ts +19 -3
- package/dist/commonjs/index.js +96 -19
- package/dist/commonjs/index.js.map +7 -1
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.js +29 -0
- package/dist/commonjs/logger.js.map +7 -0
- package/dist/commonjs/models/index.d.ts +2 -1291
- package/dist/commonjs/models/index.js +82 -229
- package/dist/commonjs/models/index.js.map +7 -1
- package/dist/commonjs/models/models.d.ts +1249 -0
- package/dist/commonjs/models/models.js +1367 -0
- package/dist/commonjs/models/models.js.map +7 -0
- package/dist/commonjs/restorePollerHelpers.d.ts +21 -0
- package/dist/commonjs/restorePollerHelpers.js +133 -0
- package/dist/commonjs/restorePollerHelpers.js.map +7 -0
- package/dist/commonjs/sqlVirtualMachineManagementClient.d.ts +25 -22
- package/dist/commonjs/sqlVirtualMachineManagementClient.js +68 -117
- package/dist/commonjs/sqlVirtualMachineManagementClient.js.map +7 -1
- package/dist/commonjs/static-helpers/cloudSettingHelpers.d.ts +22 -0
- package/dist/commonjs/static-helpers/cloudSettingHelpers.js +52 -0
- package/dist/commonjs/static-helpers/cloudSettingHelpers.js.map +7 -0
- package/dist/commonjs/static-helpers/pagingHelpers.d.ts +74 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js +143 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js.map +7 -0
- package/dist/commonjs/static-helpers/pollingHelpers.d.ts +34 -0
- package/dist/commonjs/static-helpers/pollingHelpers.js +101 -0
- package/dist/commonjs/static-helpers/pollingHelpers.js.map +7 -0
- package/dist/commonjs/static-helpers/serialization/check-prop-undefined.d.ts +8 -0
- package/dist/commonjs/static-helpers/serialization/check-prop-undefined.js +35 -0
- package/dist/commonjs/static-helpers/serialization/check-prop-undefined.js.map +7 -0
- package/dist/commonjs/static-helpers/simplePollerHelpers.d.ts +73 -0
- package/dist/commonjs/static-helpers/simplePollerHelpers.js +67 -0
- package/dist/commonjs/static-helpers/simplePollerHelpers.js.map +7 -0
- package/dist/commonjs/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/commonjs/static-helpers/urlTemplate.js +197 -0
- package/dist/commonjs/static-helpers/urlTemplate.js.map +7 -0
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/api/availabilityGroupListeners/index.d.ts +3 -0
- package/dist/esm/api/availabilityGroupListeners/index.js +4 -0
- package/dist/esm/api/availabilityGroupListeners/index.js.map +1 -0
- package/dist/esm/api/availabilityGroupListeners/operations.d.ts +23 -0
- package/dist/esm/api/availabilityGroupListeners/operations.js +140 -0
- package/dist/esm/api/availabilityGroupListeners/operations.js.map +1 -0
- package/dist/esm/api/availabilityGroupListeners/options.d.ts +20 -0
- package/dist/esm/api/availabilityGroupListeners/options.js +4 -0
- package/dist/esm/api/availabilityGroupListeners/options.js.map +1 -0
- package/dist/esm/api/index.d.ts +3 -0
- package/dist/esm/api/index.js +4 -0
- package/dist/esm/api/index.js.map +1 -0
- package/dist/esm/api/operations/index.d.ts +3 -0
- package/dist/esm/api/operations/index.js +4 -0
- package/dist/esm/api/operations/index.js.map +1 -0
- package/dist/esm/api/operations/operations.d.ts +10 -0
- package/dist/esm/api/operations/operations.js +33 -0
- package/dist/esm/api/operations/operations.js.map +1 -0
- package/dist/esm/api/operations/options.d.ts +5 -0
- package/dist/esm/api/operations/options.js +4 -0
- package/dist/esm/api/operations/options.js.map +1 -0
- package/dist/esm/api/sqlVirtualMachineGroups/index.d.ts +3 -0
- package/dist/esm/api/sqlVirtualMachineGroups/index.js +4 -0
- package/dist/esm/api/sqlVirtualMachineGroups/index.js.map +1 -0
- package/dist/esm/api/sqlVirtualMachineGroups/operations.d.ts +31 -0
- package/dist/esm/api/sqlVirtualMachineGroups/operations.js +199 -0
- package/dist/esm/api/sqlVirtualMachineGroups/operations.js.map +1 -0
- package/dist/esm/api/sqlVirtualMachineGroups/options.d.ts +26 -0
- package/dist/esm/api/sqlVirtualMachineGroups/options.js +4 -0
- package/dist/esm/api/sqlVirtualMachineGroups/options.js.map +1 -0
- package/dist/esm/api/sqlVirtualMachineManagementContext.d.ts +22 -0
- package/dist/esm/api/sqlVirtualMachineManagementContext.js +26 -0
- package/dist/esm/api/sqlVirtualMachineManagementContext.js.map +1 -0
- package/dist/esm/api/sqlVirtualMachineTroubleshoot/index.d.ts +3 -0
- package/dist/esm/api/sqlVirtualMachineTroubleshoot/index.js +4 -0
- package/dist/esm/api/sqlVirtualMachineTroubleshoot/index.js.map +1 -0
- package/dist/esm/api/sqlVirtualMachineTroubleshoot/operations.d.ts +10 -0
- package/dist/esm/api/sqlVirtualMachineTroubleshoot/operations.js +44 -0
- package/dist/esm/api/sqlVirtualMachineTroubleshoot/operations.js.map +1 -0
- package/dist/esm/api/sqlVirtualMachineTroubleshoot/options.d.ts +7 -0
- package/dist/esm/api/sqlVirtualMachineTroubleshoot/options.js +4 -0
- package/dist/esm/api/sqlVirtualMachineTroubleshoot/options.js.map +1 -0
- package/dist/esm/api/sqlVirtualMachines/index.d.ts +3 -0
- package/dist/esm/api/sqlVirtualMachines/index.js +4 -0
- package/dist/esm/api/sqlVirtualMachines/index.js.map +1 -0
- package/dist/esm/api/sqlVirtualMachines/operations.d.ts +47 -0
- package/dist/esm/api/sqlVirtualMachines/operations.js +329 -0
- package/dist/esm/api/sqlVirtualMachines/operations.js.map +1 -0
- package/dist/esm/api/sqlVirtualMachines/options.d.ts +46 -0
- package/dist/esm/api/sqlVirtualMachines/options.js +4 -0
- package/dist/esm/api/sqlVirtualMachines/options.js.map +1 -0
- package/dist/esm/classic/availabilityGroupListeners/index.d.ts +27 -0
- package/dist/esm/classic/availabilityGroupListeners/index.js +34 -0
- package/dist/esm/classic/availabilityGroupListeners/index.js.map +1 -0
- package/dist/esm/classic/index.d.ts +6 -0
- package/dist/esm/classic/index.js +4 -0
- package/dist/esm/classic/index.js.map +1 -0
- package/dist/esm/classic/operations/index.d.ts +11 -0
- package/dist/esm/classic/operations/index.js +14 -0
- package/dist/esm/classic/operations/index.js.map +1 -0
- package/dist/esm/classic/sqlVirtualMachineGroups/index.d.ts +35 -0
- package/dist/esm/classic/sqlVirtualMachineGroups/index.js +44 -0
- package/dist/esm/classic/sqlVirtualMachineGroups/index.js.map +1 -0
- package/dist/esm/classic/sqlVirtualMachineTroubleshoot/index.d.ts +16 -0
- package/dist/esm/classic/sqlVirtualMachineTroubleshoot/index.js +23 -0
- package/dist/esm/classic/sqlVirtualMachineTroubleshoot/index.js.map +1 -0
- package/dist/esm/classic/sqlVirtualMachines/index.d.ts +55 -0
- package/dist/esm/classic/sqlVirtualMachines/index.js +72 -0
- package/dist/esm/classic/sqlVirtualMachines/index.js.map +1 -0
- package/dist/esm/index.d.ts +19 -3
- package/dist/esm/index.js +7 -11
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models/index.d.ts +2 -1291
- package/dist/esm/models/index.js +3 -225
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/models.d.ts +1249 -0
- package/dist/esm/models/models.js +1363 -0
- package/dist/esm/models/models.js.map +1 -0
- package/dist/esm/restorePollerHelpers.d.ts +21 -0
- package/dist/esm/restorePollerHelpers.js +120 -0
- package/dist/esm/restorePollerHelpers.js.map +1 -0
- package/dist/esm/sqlVirtualMachineManagementClient.d.ts +25 -22
- package/dist/esm/sqlVirtualMachineManagementClient.js +41 -106
- package/dist/esm/sqlVirtualMachineManagementClient.js.map +1 -1
- package/dist/esm/static-helpers/cloudSettingHelpers.d.ts +22 -0
- package/dist/esm/static-helpers/cloudSettingHelpers.js +38 -0
- package/dist/esm/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/pagingHelpers.d.ts +74 -0
- package/dist/esm/static-helpers/pagingHelpers.js +143 -0
- package/dist/esm/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/pollingHelpers.d.ts +34 -0
- package/dist/esm/static-helpers/pollingHelpers.js +95 -0
- package/dist/esm/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/serialization/check-prop-undefined.d.ts +8 -0
- package/dist/esm/static-helpers/serialization/check-prop-undefined.js +17 -0
- package/dist/esm/static-helpers/serialization/check-prop-undefined.js.map +1 -0
- package/dist/esm/static-helpers/simplePollerHelpers.d.ts +73 -0
- package/dist/esm/static-helpers/simplePollerHelpers.js +44 -0
- package/dist/esm/static-helpers/simplePollerHelpers.js.map +1 -0
- package/dist/esm/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/esm/static-helpers/urlTemplate.js +200 -0
- package/dist/esm/static-helpers/urlTemplate.js.map +1 -0
- package/package.json +188 -97
- package/CHANGELOG.md +0 -21
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/lroImpl.d.ts +0 -11
- package/dist/browser/lroImpl.d.ts.map +0 -1
- package/dist/browser/lroImpl.js +0 -18
- package/dist/browser/lroImpl.js.map +0 -1
- package/dist/browser/models/index.d.ts.map +0 -1
- package/dist/browser/models/mappers.d.ts +0 -53
- package/dist/browser/models/mappers.d.ts.map +0 -1
- package/dist/browser/models/mappers.js +0 -1753
- package/dist/browser/models/mappers.js.map +0 -1
- package/dist/browser/models/parameters.d.ts +0 -19
- package/dist/browser/models/parameters.d.ts.map +0 -1
- package/dist/browser/models/parameters.js +0 -152
- package/dist/browser/models/parameters.js.map +0 -1
- package/dist/browser/operations/availabilityGroupListeners.d.ts +0 -89
- package/dist/browser/operations/availabilityGroupListeners.d.ts.map +0 -1
- package/dist/browser/operations/availabilityGroupListeners.js +0 -367
- package/dist/browser/operations/availabilityGroupListeners.js.map +0 -1
- package/dist/browser/operations/index.d.ts +0 -6
- package/dist/browser/operations/index.d.ts.map +0 -1
- package/dist/browser/operations/index.js +0 -13
- package/dist/browser/operations/index.js.map +0 -1
- package/dist/browser/operations/operations.d.ts +0 -32
- package/dist/browser/operations/operations.d.ts.map +0 -1
- package/dist/browser/operations/operations.js +0 -116
- package/dist/browser/operations/operations.js.map +0 -1
- package/dist/browser/operations/sqlVirtualMachineGroups.d.ts +0 -117
- package/dist/browser/operations/sqlVirtualMachineGroups.d.ts.map +0 -1
- package/dist/browser/operations/sqlVirtualMachineGroups.js +0 -535
- package/dist/browser/operations/sqlVirtualMachineGroups.js.map +0 -1
- package/dist/browser/operations/sqlVirtualMachineTroubleshoot.d.ts +0 -32
- package/dist/browser/operations/sqlVirtualMachineTroubleshoot.d.ts.map +0 -1
- package/dist/browser/operations/sqlVirtualMachineTroubleshoot.js +0 -119
- package/dist/browser/operations/sqlVirtualMachineTroubleshoot.js.map +0 -1
- package/dist/browser/operations/sqlVirtualMachines.d.ts +0 -176
- package/dist/browser/operations/sqlVirtualMachines.d.ts.map +0 -1
- package/dist/browser/operations/sqlVirtualMachines.js +0 -797
- package/dist/browser/operations/sqlVirtualMachines.js.map +0 -1
- package/dist/browser/operationsInterfaces/availabilityGroupListeners.d.ts +0 -62
- package/dist/browser/operationsInterfaces/availabilityGroupListeners.d.ts.map +0 -1
- package/dist/browser/operationsInterfaces/availabilityGroupListeners.js +0 -9
- package/dist/browser/operationsInterfaces/availabilityGroupListeners.js.map +0 -1
- package/dist/browser/operationsInterfaces/index.d.ts +0 -6
- package/dist/browser/operationsInterfaces/index.d.ts.map +0 -1
- package/dist/browser/operationsInterfaces/index.js +0 -13
- package/dist/browser/operationsInterfaces/index.js.map +0 -1
- package/dist/browser/operationsInterfaces/operations.d.ts +0 -11
- package/dist/browser/operationsInterfaces/operations.d.ts.map +0 -1
- package/dist/browser/operationsInterfaces/operations.js +0 -9
- package/dist/browser/operationsInterfaces/operations.js.map +0 -1
- package/dist/browser/operationsInterfaces/sqlVirtualMachineGroups.d.ts +0 -79
- package/dist/browser/operationsInterfaces/sqlVirtualMachineGroups.d.ts.map +0 -1
- package/dist/browser/operationsInterfaces/sqlVirtualMachineGroups.js +0 -9
- package/dist/browser/operationsInterfaces/sqlVirtualMachineGroups.js.map +0 -1
- package/dist/browser/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts +0 -24
- package/dist/browser/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts.map +0 -1
- package/dist/browser/operationsInterfaces/sqlVirtualMachineTroubleshoot.js +0 -9
- package/dist/browser/operationsInterfaces/sqlVirtualMachineTroubleshoot.js.map +0 -1
- package/dist/browser/operationsInterfaces/sqlVirtualMachines.d.ts +0 -119
- package/dist/browser/operationsInterfaces/sqlVirtualMachines.d.ts.map +0 -1
- package/dist/browser/operationsInterfaces/sqlVirtualMachines.js +0 -9
- package/dist/browser/operationsInterfaces/sqlVirtualMachines.js.map +0 -1
- package/dist/browser/pagingHelper.d.ts +0 -13
- package/dist/browser/pagingHelper.d.ts.map +0 -1
- package/dist/browser/pagingHelper.js +0 -30
- package/dist/browser/pagingHelper.js.map +0 -1
- package/dist/browser/sqlVirtualMachineManagementClient.d.ts.map +0 -1
- package/dist/commonjs/index.d.ts.map +0 -1
- package/dist/commonjs/lroImpl.d.ts +0 -11
- package/dist/commonjs/lroImpl.d.ts.map +0 -1
- package/dist/commonjs/lroImpl.js +0 -21
- package/dist/commonjs/lroImpl.js.map +0 -1
- package/dist/commonjs/models/index.d.ts.map +0 -1
- package/dist/commonjs/models/mappers.d.ts +0 -53
- package/dist/commonjs/models/mappers.d.ts.map +0 -1
- package/dist/commonjs/models/mappers.js +0 -1757
- package/dist/commonjs/models/mappers.js.map +0 -1
- package/dist/commonjs/models/parameters.d.ts +0 -19
- package/dist/commonjs/models/parameters.d.ts.map +0 -1
- package/dist/commonjs/models/parameters.js +0 -155
- package/dist/commonjs/models/parameters.js.map +0 -1
- package/dist/commonjs/operations/availabilityGroupListeners.d.ts +0 -89
- package/dist/commonjs/operations/availabilityGroupListeners.d.ts.map +0 -1
- package/dist/commonjs/operations/availabilityGroupListeners.js +0 -372
- package/dist/commonjs/operations/availabilityGroupListeners.js.map +0 -1
- package/dist/commonjs/operations/index.d.ts +0 -6
- package/dist/commonjs/operations/index.d.ts.map +0 -1
- package/dist/commonjs/operations/index.js +0 -16
- package/dist/commonjs/operations/index.js.map +0 -1
- package/dist/commonjs/operations/operations.d.ts +0 -32
- package/dist/commonjs/operations/operations.d.ts.map +0 -1
- package/dist/commonjs/operations/operations.js +0 -121
- package/dist/commonjs/operations/operations.js.map +0 -1
- package/dist/commonjs/operations/sqlVirtualMachineGroups.d.ts +0 -117
- package/dist/commonjs/operations/sqlVirtualMachineGroups.d.ts.map +0 -1
- package/dist/commonjs/operations/sqlVirtualMachineGroups.js +0 -540
- package/dist/commonjs/operations/sqlVirtualMachineGroups.js.map +0 -1
- package/dist/commonjs/operations/sqlVirtualMachineTroubleshoot.d.ts +0 -32
- package/dist/commonjs/operations/sqlVirtualMachineTroubleshoot.d.ts.map +0 -1
- package/dist/commonjs/operations/sqlVirtualMachineTroubleshoot.js +0 -124
- package/dist/commonjs/operations/sqlVirtualMachineTroubleshoot.js.map +0 -1
- package/dist/commonjs/operations/sqlVirtualMachines.d.ts +0 -176
- package/dist/commonjs/operations/sqlVirtualMachines.d.ts.map +0 -1
- package/dist/commonjs/operations/sqlVirtualMachines.js +0 -802
- package/dist/commonjs/operations/sqlVirtualMachines.js.map +0 -1
- package/dist/commonjs/operationsInterfaces/availabilityGroupListeners.d.ts +0 -62
- package/dist/commonjs/operationsInterfaces/availabilityGroupListeners.d.ts.map +0 -1
- package/dist/commonjs/operationsInterfaces/availabilityGroupListeners.js +0 -10
- package/dist/commonjs/operationsInterfaces/availabilityGroupListeners.js.map +0 -1
- package/dist/commonjs/operationsInterfaces/index.d.ts +0 -6
- package/dist/commonjs/operationsInterfaces/index.d.ts.map +0 -1
- package/dist/commonjs/operationsInterfaces/index.js +0 -16
- package/dist/commonjs/operationsInterfaces/index.js.map +0 -1
- package/dist/commonjs/operationsInterfaces/operations.d.ts +0 -11
- package/dist/commonjs/operationsInterfaces/operations.d.ts.map +0 -1
- package/dist/commonjs/operationsInterfaces/operations.js +0 -10
- package/dist/commonjs/operationsInterfaces/operations.js.map +0 -1
- package/dist/commonjs/operationsInterfaces/sqlVirtualMachineGroups.d.ts +0 -79
- package/dist/commonjs/operationsInterfaces/sqlVirtualMachineGroups.d.ts.map +0 -1
- package/dist/commonjs/operationsInterfaces/sqlVirtualMachineGroups.js +0 -10
- package/dist/commonjs/operationsInterfaces/sqlVirtualMachineGroups.js.map +0 -1
- package/dist/commonjs/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts +0 -24
- package/dist/commonjs/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts.map +0 -1
- package/dist/commonjs/operationsInterfaces/sqlVirtualMachineTroubleshoot.js +0 -10
- package/dist/commonjs/operationsInterfaces/sqlVirtualMachineTroubleshoot.js.map +0 -1
- package/dist/commonjs/operationsInterfaces/sqlVirtualMachines.d.ts +0 -119
- package/dist/commonjs/operationsInterfaces/sqlVirtualMachines.d.ts.map +0 -1
- package/dist/commonjs/operationsInterfaces/sqlVirtualMachines.js +0 -10
- package/dist/commonjs/operationsInterfaces/sqlVirtualMachines.js.map +0 -1
- package/dist/commonjs/pagingHelper.d.ts +0 -13
- package/dist/commonjs/pagingHelper.d.ts.map +0 -1
- package/dist/commonjs/pagingHelper.js +0 -34
- package/dist/commonjs/pagingHelper.js.map +0 -1
- package/dist/commonjs/sqlVirtualMachineManagementClient.d.ts.map +0 -1
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/lroImpl.d.ts +0 -11
- package/dist/esm/lroImpl.d.ts.map +0 -1
- package/dist/esm/lroImpl.js +0 -18
- package/dist/esm/lroImpl.js.map +0 -1
- package/dist/esm/models/index.d.ts.map +0 -1
- package/dist/esm/models/mappers.d.ts +0 -53
- package/dist/esm/models/mappers.d.ts.map +0 -1
- package/dist/esm/models/mappers.js +0 -1753
- package/dist/esm/models/mappers.js.map +0 -1
- package/dist/esm/models/parameters.d.ts +0 -19
- package/dist/esm/models/parameters.d.ts.map +0 -1
- package/dist/esm/models/parameters.js +0 -152
- package/dist/esm/models/parameters.js.map +0 -1
- package/dist/esm/operations/availabilityGroupListeners.d.ts +0 -89
- package/dist/esm/operations/availabilityGroupListeners.d.ts.map +0 -1
- package/dist/esm/operations/availabilityGroupListeners.js +0 -367
- package/dist/esm/operations/availabilityGroupListeners.js.map +0 -1
- package/dist/esm/operations/index.d.ts +0 -6
- package/dist/esm/operations/index.d.ts.map +0 -1
- package/dist/esm/operations/index.js +0 -13
- package/dist/esm/operations/index.js.map +0 -1
- package/dist/esm/operations/operations.d.ts +0 -32
- package/dist/esm/operations/operations.d.ts.map +0 -1
- package/dist/esm/operations/operations.js +0 -116
- package/dist/esm/operations/operations.js.map +0 -1
- package/dist/esm/operations/sqlVirtualMachineGroups.d.ts +0 -117
- package/dist/esm/operations/sqlVirtualMachineGroups.d.ts.map +0 -1
- package/dist/esm/operations/sqlVirtualMachineGroups.js +0 -535
- package/dist/esm/operations/sqlVirtualMachineGroups.js.map +0 -1
- package/dist/esm/operations/sqlVirtualMachineTroubleshoot.d.ts +0 -32
- package/dist/esm/operations/sqlVirtualMachineTroubleshoot.d.ts.map +0 -1
- package/dist/esm/operations/sqlVirtualMachineTroubleshoot.js +0 -119
- package/dist/esm/operations/sqlVirtualMachineTroubleshoot.js.map +0 -1
- package/dist/esm/operations/sqlVirtualMachines.d.ts +0 -176
- package/dist/esm/operations/sqlVirtualMachines.d.ts.map +0 -1
- package/dist/esm/operations/sqlVirtualMachines.js +0 -797
- package/dist/esm/operations/sqlVirtualMachines.js.map +0 -1
- package/dist/esm/operationsInterfaces/availabilityGroupListeners.d.ts +0 -62
- package/dist/esm/operationsInterfaces/availabilityGroupListeners.d.ts.map +0 -1
- package/dist/esm/operationsInterfaces/availabilityGroupListeners.js +0 -9
- package/dist/esm/operationsInterfaces/availabilityGroupListeners.js.map +0 -1
- package/dist/esm/operationsInterfaces/index.d.ts +0 -6
- package/dist/esm/operationsInterfaces/index.d.ts.map +0 -1
- package/dist/esm/operationsInterfaces/index.js +0 -13
- package/dist/esm/operationsInterfaces/index.js.map +0 -1
- package/dist/esm/operationsInterfaces/operations.d.ts +0 -11
- package/dist/esm/operationsInterfaces/operations.d.ts.map +0 -1
- package/dist/esm/operationsInterfaces/operations.js +0 -9
- package/dist/esm/operationsInterfaces/operations.js.map +0 -1
- package/dist/esm/operationsInterfaces/sqlVirtualMachineGroups.d.ts +0 -79
- package/dist/esm/operationsInterfaces/sqlVirtualMachineGroups.d.ts.map +0 -1
- package/dist/esm/operationsInterfaces/sqlVirtualMachineGroups.js +0 -9
- package/dist/esm/operationsInterfaces/sqlVirtualMachineGroups.js.map +0 -1
- package/dist/esm/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts +0 -24
- package/dist/esm/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts.map +0 -1
- package/dist/esm/operationsInterfaces/sqlVirtualMachineTroubleshoot.js +0 -9
- package/dist/esm/operationsInterfaces/sqlVirtualMachineTroubleshoot.js.map +0 -1
- package/dist/esm/operationsInterfaces/sqlVirtualMachines.d.ts +0 -119
- package/dist/esm/operationsInterfaces/sqlVirtualMachines.d.ts.map +0 -1
- package/dist/esm/operationsInterfaces/sqlVirtualMachines.js +0 -9
- package/dist/esm/operationsInterfaces/sqlVirtualMachines.js.map +0 -1
- package/dist/esm/pagingHelper.d.ts +0 -13
- package/dist/esm/pagingHelper.d.ts.map +0 -1
- package/dist/esm/pagingHelper.js +0 -30
- package/dist/esm/pagingHelper.js.map +0 -1
- package/dist/esm/sqlVirtualMachineManagementClient.d.ts.map +0 -1
- package/dist/react-native/index.d.ts +0 -5
- package/dist/react-native/index.d.ts.map +0 -1
- package/dist/react-native/index.js +0 -13
- package/dist/react-native/index.js.map +0 -1
- package/dist/react-native/lroImpl.d.ts +0 -11
- package/dist/react-native/lroImpl.d.ts.map +0 -1
- package/dist/react-native/lroImpl.js +0 -18
- package/dist/react-native/lroImpl.js.map +0 -1
- package/dist/react-native/models/index.d.ts.map +0 -1
- package/dist/react-native/models/index.js +0 -226
- package/dist/react-native/models/index.js.map +0 -1
- package/dist/react-native/models/mappers.d.ts +0 -53
- package/dist/react-native/models/mappers.d.ts.map +0 -1
- package/dist/react-native/models/mappers.js +0 -1753
- package/dist/react-native/models/mappers.js.map +0 -1
- package/dist/react-native/models/parameters.d.ts +0 -19
- package/dist/react-native/models/parameters.d.ts.map +0 -1
- package/dist/react-native/models/parameters.js +0 -152
- package/dist/react-native/models/parameters.js.map +0 -1
- package/dist/react-native/operations/availabilityGroupListeners.d.ts +0 -89
- package/dist/react-native/operations/availabilityGroupListeners.d.ts.map +0 -1
- package/dist/react-native/operations/availabilityGroupListeners.js +0 -367
- package/dist/react-native/operations/availabilityGroupListeners.js.map +0 -1
- package/dist/react-native/operations/index.d.ts +0 -6
- package/dist/react-native/operations/index.d.ts.map +0 -1
- package/dist/react-native/operations/index.js +0 -13
- package/dist/react-native/operations/index.js.map +0 -1
- package/dist/react-native/operations/operations.d.ts +0 -32
- package/dist/react-native/operations/operations.d.ts.map +0 -1
- package/dist/react-native/operations/operations.js +0 -116
- package/dist/react-native/operations/operations.js.map +0 -1
- package/dist/react-native/operations/sqlVirtualMachineGroups.d.ts +0 -117
- package/dist/react-native/operations/sqlVirtualMachineGroups.d.ts.map +0 -1
- package/dist/react-native/operations/sqlVirtualMachineGroups.js +0 -535
- package/dist/react-native/operations/sqlVirtualMachineGroups.js.map +0 -1
- package/dist/react-native/operations/sqlVirtualMachineTroubleshoot.d.ts +0 -32
- package/dist/react-native/operations/sqlVirtualMachineTroubleshoot.d.ts.map +0 -1
- package/dist/react-native/operations/sqlVirtualMachineTroubleshoot.js +0 -119
- package/dist/react-native/operations/sqlVirtualMachineTroubleshoot.js.map +0 -1
- package/dist/react-native/operations/sqlVirtualMachines.d.ts +0 -176
- package/dist/react-native/operations/sqlVirtualMachines.d.ts.map +0 -1
- package/dist/react-native/operations/sqlVirtualMachines.js +0 -797
- package/dist/react-native/operations/sqlVirtualMachines.js.map +0 -1
- package/dist/react-native/operationsInterfaces/availabilityGroupListeners.d.ts +0 -62
- package/dist/react-native/operationsInterfaces/availabilityGroupListeners.d.ts.map +0 -1
- package/dist/react-native/operationsInterfaces/availabilityGroupListeners.js +0 -9
- package/dist/react-native/operationsInterfaces/availabilityGroupListeners.js.map +0 -1
- package/dist/react-native/operationsInterfaces/index.d.ts +0 -6
- package/dist/react-native/operationsInterfaces/index.d.ts.map +0 -1
- package/dist/react-native/operationsInterfaces/index.js +0 -13
- package/dist/react-native/operationsInterfaces/index.js.map +0 -1
- package/dist/react-native/operationsInterfaces/operations.d.ts +0 -11
- package/dist/react-native/operationsInterfaces/operations.d.ts.map +0 -1
- package/dist/react-native/operationsInterfaces/operations.js +0 -9
- package/dist/react-native/operationsInterfaces/operations.js.map +0 -1
- package/dist/react-native/operationsInterfaces/sqlVirtualMachineGroups.d.ts +0 -79
- package/dist/react-native/operationsInterfaces/sqlVirtualMachineGroups.d.ts.map +0 -1
- package/dist/react-native/operationsInterfaces/sqlVirtualMachineGroups.js +0 -9
- package/dist/react-native/operationsInterfaces/sqlVirtualMachineGroups.js.map +0 -1
- package/dist/react-native/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts +0 -24
- package/dist/react-native/operationsInterfaces/sqlVirtualMachineTroubleshoot.d.ts.map +0 -1
- package/dist/react-native/operationsInterfaces/sqlVirtualMachineTroubleshoot.js +0 -9
- package/dist/react-native/operationsInterfaces/sqlVirtualMachineTroubleshoot.js.map +0 -1
- package/dist/react-native/operationsInterfaces/sqlVirtualMachines.d.ts +0 -119
- package/dist/react-native/operationsInterfaces/sqlVirtualMachines.d.ts.map +0 -1
- package/dist/react-native/operationsInterfaces/sqlVirtualMachines.js +0 -9
- package/dist/react-native/operationsInterfaces/sqlVirtualMachines.js.map +0 -1
- package/dist/react-native/package.json +0 -3
- package/dist/react-native/pagingHelper.d.ts +0 -13
- package/dist/react-native/pagingHelper.d.ts.map +0 -1
- package/dist/react-native/pagingHelper.js +0 -30
- package/dist/react-native/pagingHelper.js.map +0 -1
- package/dist/react-native/sqlVirtualMachineManagementClient.d.ts +0 -24
- package/dist/react-native/sqlVirtualMachineManagementClient.d.ts.map +0 -1
- package/dist/react-native/sqlVirtualMachineManagementClient.js +0 -114
- package/dist/react-native/sqlVirtualMachineManagementClient.js.map +0 -1
- package/review/arm-sqlvirtualmachine-node.api.md +0 -949
|
@@ -1,114 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* @param subscriptionId Subscription ID that identifies an Azure subscription.
|
|
19
|
-
* @param options The parameter options
|
|
20
|
-
*/
|
|
21
|
-
constructor(credentials, subscriptionId, options) {
|
|
22
|
-
if (credentials === undefined) {
|
|
23
|
-
throw new Error("'credentials' cannot be null");
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { createSqlVirtualMachineManagement } from "./api/index.js";
|
|
4
|
+
import { _getAvailabilityGroupListenersOperations } from "./classic/availabilityGroupListeners/index.js";
|
|
5
|
+
import { _getOperationsOperations } from "./classic/operations/index.js";
|
|
6
|
+
import { _getSqlVirtualMachineGroupsOperations } from "./classic/sqlVirtualMachineGroups/index.js";
|
|
7
|
+
import { _getSqlVirtualMachineTroubleshootOperations } from "./classic/sqlVirtualMachineTroubleshoot/index.js";
|
|
8
|
+
import { _getSqlVirtualMachinesOperations } from "./classic/sqlVirtualMachines/index.js";
|
|
9
|
+
export class SqlVirtualMachineManagementClient {
|
|
10
|
+
_client;
|
|
11
|
+
/** The pipeline used by this client to make requests */
|
|
12
|
+
pipeline;
|
|
13
|
+
/** The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network & Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. */
|
|
14
|
+
constructor(credential, subscriptionIdOrOptions, options) {
|
|
15
|
+
let subscriptionId;
|
|
16
|
+
if (typeof subscriptionIdOrOptions === "string") {
|
|
17
|
+
subscriptionId = subscriptionIdOrOptions;
|
|
24
18
|
}
|
|
25
|
-
if (
|
|
26
|
-
|
|
19
|
+
else if (typeof subscriptionIdOrOptions === "object") {
|
|
20
|
+
options = subscriptionIdOrOptions;
|
|
27
21
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
credential: credentials
|
|
35
|
-
};
|
|
36
|
-
const packageDetails = `azsdk-js-arm-sqlvirtualmachine/5.0.0-beta.9`;
|
|
37
|
-
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
38
|
-
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
39
|
-
: `${packageDetails}`;
|
|
40
|
-
const optionsWithDefaults = {
|
|
41
|
-
...defaults,
|
|
22
|
+
options = options ?? {};
|
|
23
|
+
const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
|
|
24
|
+
const userAgentPrefix = prefixFromOptions
|
|
25
|
+
? `${prefixFromOptions} azsdk-js-client`
|
|
26
|
+
: `azsdk-js-client`;
|
|
27
|
+
this._client = createSqlVirtualMachineManagement(credential, subscriptionId ?? "", {
|
|
42
28
|
...options,
|
|
43
|
-
userAgentOptions: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
52
|
-
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
53
|
-
coreRestPipeline.bearerTokenAuthenticationPolicyName);
|
|
54
|
-
}
|
|
55
|
-
if (!options ||
|
|
56
|
-
!options.pipeline ||
|
|
57
|
-
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
58
|
-
!bearerTokenAuthenticationPolicyFound) {
|
|
59
|
-
this.pipeline.removePolicy({
|
|
60
|
-
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
61
|
-
});
|
|
62
|
-
this.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
63
|
-
credential: credentials,
|
|
64
|
-
scopes: optionsWithDefaults.credentialScopes ??
|
|
65
|
-
`${optionsWithDefaults.endpoint}/.default`,
|
|
66
|
-
challengeCallbacks: {
|
|
67
|
-
authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge
|
|
68
|
-
}
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
// Parameter assignments
|
|
72
|
-
this.subscriptionId = subscriptionId;
|
|
73
|
-
// Assigning values to Constant parameters
|
|
74
|
-
this.$host = options.$host || "https://management.azure.com";
|
|
75
|
-
this.apiVersion = options.apiVersion || "2022-08-01-preview";
|
|
76
|
-
this.availabilityGroupListeners = new AvailabilityGroupListenersImpl(this);
|
|
77
|
-
this.operations = new OperationsImpl(this);
|
|
78
|
-
this.sqlVirtualMachineGroups = new SqlVirtualMachineGroupsImpl(this);
|
|
79
|
-
this.sqlVirtualMachines = new SqlVirtualMachinesImpl(this);
|
|
80
|
-
this.sqlVirtualMachineTroubleshoot = new SqlVirtualMachineTroubleshootImpl(this);
|
|
81
|
-
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
29
|
+
userAgentOptions: { userAgentPrefix },
|
|
30
|
+
});
|
|
31
|
+
this.pipeline = this._client.pipeline;
|
|
32
|
+
this.sqlVirtualMachineTroubleshoot = _getSqlVirtualMachineTroubleshootOperations(this._client);
|
|
33
|
+
this.sqlVirtualMachineGroups = _getSqlVirtualMachineGroupsOperations(this._client);
|
|
34
|
+
this.sqlVirtualMachines = _getSqlVirtualMachinesOperations(this._client);
|
|
35
|
+
this.availabilityGroupListeners = _getAvailabilityGroupListenersOperations(this._client);
|
|
36
|
+
this.operations = _getOperationsOperations(this._client);
|
|
82
37
|
}
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
const apiVersionPolicy = {
|
|
89
|
-
name: "CustomApiVersionPolicy",
|
|
90
|
-
async sendRequest(request, next) {
|
|
91
|
-
const param = request.url.split("?");
|
|
92
|
-
if (param.length > 1) {
|
|
93
|
-
const newParams = param[1].split("&").map((item) => {
|
|
94
|
-
if (item.indexOf("api-version") > -1) {
|
|
95
|
-
return "api-version=" + apiVersion;
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
return item;
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
request.url = param[0] + "?" + newParams.join("&");
|
|
102
|
-
}
|
|
103
|
-
return next(request);
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
this.pipeline.addPolicy(apiVersionPolicy);
|
|
107
|
-
}
|
|
108
|
-
availabilityGroupListeners;
|
|
109
|
-
operations;
|
|
38
|
+
/** The operation groups for sqlVirtualMachineTroubleshoot */
|
|
39
|
+
sqlVirtualMachineTroubleshoot;
|
|
40
|
+
/** The operation groups for sqlVirtualMachineGroups */
|
|
110
41
|
sqlVirtualMachineGroups;
|
|
42
|
+
/** The operation groups for sqlVirtualMachines */
|
|
111
43
|
sqlVirtualMachines;
|
|
112
|
-
|
|
44
|
+
/** The operation groups for availabilityGroupListeners */
|
|
45
|
+
availabilityGroupListeners;
|
|
46
|
+
/** The operation groups for operations */
|
|
47
|
+
operations;
|
|
113
48
|
}
|
|
114
49
|
//# sourceMappingURL=sqlVirtualMachineManagementClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlVirtualMachineManagementClient.js","sourceRoot":"","sources":["../../src/sqlVirtualMachineManagementClient.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sqlVirtualMachineManagementClient.js","sourceRoot":"","sources":["../../src/sqlVirtualMachineManagementClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,wCAAwC,EAAE,MAAM,+CAA+C,CAAC;AAEzG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,qCAAqC,EAAE,MAAM,4CAA4C,CAAC;AAEnG,OAAO,EAAE,2CAA2C,EAAE,MAAM,kDAAkD,CAAC;AAE/G,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAMzF,MAAM,OAAO,iCAAiC;IACpC,OAAO,CAAqC;IACpD,wDAAwD;IACxC,QAAQ,CAAW;IAWnC,8TAA8T;IAC9T,YACE,UAA2B,EAC3B,uBAAkF,EAClF,OAAyD;QAEzD,IAAI,cAAkC,CAAC;QAEvC,IAAI,OAAO,uBAAuB,KAAK,QAAQ,EAAE,CAAC;YAChD,cAAc,GAAG,uBAAuB,CAAC;QAC3C,CAAC;aAAM,IAAI,OAAO,uBAAuB,KAAK,QAAQ,EAAE,CAAC;YACvD,OAAO,GAAG,uBAAuB,CAAC;QACpC,CAAC;QAED,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;QACxB,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,iCAAiC,CAAC,UAAU,EAAE,cAAc,IAAI,EAAE,EAAE;YACjF,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,6BAA6B,GAAG,2CAA2C,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/F,IAAI,CAAC,uBAAuB,GAAG,qCAAqC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnF,IAAI,CAAC,kBAAkB,GAAG,gCAAgC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzE,IAAI,CAAC,0BAA0B,GAAG,wCAAwC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzF,IAAI,CAAC,UAAU,GAAG,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,6DAA6D;IAC7C,6BAA6B,CAA0C;IACvF,uDAAuD;IACvC,uBAAuB,CAAoC;IAC3E,kDAAkD;IAClC,kBAAkB,CAA+B;IACjE,0DAA0D;IAC1C,0BAA0B,CAAuC;IACjF,0CAA0C;IAC1B,UAAU,CAAuB;CAClD","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n SqlVirtualMachineManagementContext,\n SqlVirtualMachineManagementClientOptionalParams,\n} from \"./api/index.js\";\nimport { createSqlVirtualMachineManagement } from \"./api/index.js\";\nimport type { AvailabilityGroupListenersOperations } from \"./classic/availabilityGroupListeners/index.js\";\nimport { _getAvailabilityGroupListenersOperations } from \"./classic/availabilityGroupListeners/index.js\";\nimport type { OperationsOperations } from \"./classic/operations/index.js\";\nimport { _getOperationsOperations } from \"./classic/operations/index.js\";\nimport type { SqlVirtualMachineGroupsOperations } from \"./classic/sqlVirtualMachineGroups/index.js\";\nimport { _getSqlVirtualMachineGroupsOperations } from \"./classic/sqlVirtualMachineGroups/index.js\";\nimport type { SqlVirtualMachineTroubleshootOperations } from \"./classic/sqlVirtualMachineTroubleshoot/index.js\";\nimport { _getSqlVirtualMachineTroubleshootOperations } from \"./classic/sqlVirtualMachineTroubleshoot/index.js\";\nimport type { SqlVirtualMachinesOperations } from \"./classic/sqlVirtualMachines/index.js\";\nimport { _getSqlVirtualMachinesOperations } from \"./classic/sqlVirtualMachines/index.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\n\nexport type { SqlVirtualMachineManagementClientOptionalParams } from \"./api/sqlVirtualMachineManagementContext.js\";\n\nexport class SqlVirtualMachineManagementClient {\n private _client: SqlVirtualMachineManagementContext;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n constructor(\n credential: TokenCredential,\n options?: SqlVirtualMachineManagementClientOptionalParams,\n );\n constructor(\n credential: TokenCredential,\n subscriptionId: string,\n options?: SqlVirtualMachineManagementClientOptionalParams,\n );\n /** The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network & Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. */\n constructor(\n credential: TokenCredential,\n subscriptionIdOrOptions?: string | SqlVirtualMachineManagementClientOptionalParams,\n options?: SqlVirtualMachineManagementClientOptionalParams,\n ) {\n let subscriptionId: string | undefined;\n\n if (typeof subscriptionIdOrOptions === \"string\") {\n subscriptionId = subscriptionIdOrOptions;\n } else if (typeof subscriptionIdOrOptions === \"object\") {\n options = subscriptionIdOrOptions;\n }\n\n options = options ?? {};\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._client = createSqlVirtualMachineManagement(credential, subscriptionId ?? \"\", {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n this.pipeline = this._client.pipeline;\n this.sqlVirtualMachineTroubleshoot = _getSqlVirtualMachineTroubleshootOperations(this._client);\n this.sqlVirtualMachineGroups = _getSqlVirtualMachineGroupsOperations(this._client);\n this.sqlVirtualMachines = _getSqlVirtualMachinesOperations(this._client);\n this.availabilityGroupListeners = _getAvailabilityGroupListenersOperations(this._client);\n this.operations = _getOperationsOperations(this._client);\n }\n\n /** The operation groups for sqlVirtualMachineTroubleshoot */\n public readonly sqlVirtualMachineTroubleshoot: SqlVirtualMachineTroubleshootOperations;\n /** The operation groups for sqlVirtualMachineGroups */\n public readonly sqlVirtualMachineGroups: SqlVirtualMachineGroupsOperations;\n /** The operation groups for sqlVirtualMachines */\n public readonly sqlVirtualMachines: SqlVirtualMachinesOperations;\n /** The operation groups for availabilityGroupListeners */\n public readonly availabilityGroupListeners: AvailabilityGroupListenersOperations;\n /** The operation groups for operations */\n public readonly operations: OperationsOperations;\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An enum to describe Azure Cloud environments.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
5
|
+
export declare enum AzureClouds {
|
|
6
|
+
/** Azure public cloud, which is the default cloud for Azure SDKs. */
|
|
7
|
+
AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD",
|
|
8
|
+
/** Azure China cloud */
|
|
9
|
+
AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD",
|
|
10
|
+
/** Azure US government cloud */
|
|
11
|
+
AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT"
|
|
12
|
+
}
|
|
13
|
+
/** The supported values for cloud setting as a string literal type */
|
|
14
|
+
export type AzureSupportedClouds = `${AzureClouds}`;
|
|
15
|
+
/**
|
|
16
|
+
* Gets the Azure Resource Manager endpoint URL for the specified cloud setting.
|
|
17
|
+
* @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.
|
|
18
|
+
* @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.
|
|
19
|
+
* @throws {Error} Throws an error if an unknown cloud setting is provided.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined;
|
|
22
|
+
//# sourceMappingURL=cloudSettingHelpers.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* An enum to describe Azure Cloud environments.
|
|
5
|
+
* @enum {string}
|
|
6
|
+
*/
|
|
7
|
+
export var AzureClouds;
|
|
8
|
+
(function (AzureClouds) {
|
|
9
|
+
/** Azure public cloud, which is the default cloud for Azure SDKs. */
|
|
10
|
+
AzureClouds["AZURE_PUBLIC_CLOUD"] = "AZURE_PUBLIC_CLOUD";
|
|
11
|
+
/** Azure China cloud */
|
|
12
|
+
AzureClouds["AZURE_CHINA_CLOUD"] = "AZURE_CHINA_CLOUD";
|
|
13
|
+
/** Azure US government cloud */
|
|
14
|
+
AzureClouds["AZURE_US_GOVERNMENT"] = "AZURE_US_GOVERNMENT";
|
|
15
|
+
})(AzureClouds || (AzureClouds = {}));
|
|
16
|
+
/**
|
|
17
|
+
* Gets the Azure Resource Manager endpoint URL for the specified cloud setting.
|
|
18
|
+
* @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.
|
|
19
|
+
* @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.
|
|
20
|
+
* @throws {Error} Throws an error if an unknown cloud setting is provided.
|
|
21
|
+
*/
|
|
22
|
+
export function getArmEndpoint(cloudSetting) {
|
|
23
|
+
if (cloudSetting === undefined) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const cloudEndpoints = {
|
|
27
|
+
AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/",
|
|
28
|
+
AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/",
|
|
29
|
+
AZURE_PUBLIC_CLOUD: "https://management.azure.com/",
|
|
30
|
+
};
|
|
31
|
+
if (cloudSetting in cloudEndpoints) {
|
|
32
|
+
return cloudEndpoints[cloudSetting];
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
throw new Error(`Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=cloudSettingHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudSettingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/cloudSettingHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AACH,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,qEAAqE;IACrE,wDAAyC,CAAA;IACzC,wBAAwB;IACxB,sDAAuC,CAAA;IACvC,gCAAgC;IAChC,0DAA2C,CAAA;AAC7C,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AAKD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,YAAmC;IAChE,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,cAAc,GAA6C;QAC/D,iBAAiB,EAAE,sCAAsC;QACzD,mBAAmB,EAAE,uCAAuC;QAC5D,kBAAkB,EAAE,+BAA+B;KACpD,CAAC;IACF,IAAI,YAAY,IAAI,cAAc,EAAE,CAAC;QACnC,OAAO,cAAc,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CACb,0BAA0B,YAAY,6DAA6D,CACpG,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * An enum to describe Azure Cloud environments.\n * @enum {string}\n */\nexport enum AzureClouds {\n /** Azure public cloud, which is the default cloud for Azure SDKs. */\n AZURE_PUBLIC_CLOUD = \"AZURE_PUBLIC_CLOUD\",\n /** Azure China cloud */\n AZURE_CHINA_CLOUD = \"AZURE_CHINA_CLOUD\",\n /** Azure US government cloud */\n AZURE_US_GOVERNMENT = \"AZURE_US_GOVERNMENT\",\n}\n\n/** The supported values for cloud setting as a string literal type */\nexport type AzureSupportedClouds = `${AzureClouds}`;\n\n/**\n * Gets the Azure Resource Manager endpoint URL for the specified cloud setting.\n * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.\n * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.\n * @throws {Error} Throws an error if an unknown cloud setting is provided.\n */\nexport function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined {\n if (cloudSetting === undefined) {\n return undefined;\n }\n const cloudEndpoints: Record<keyof typeof AzureClouds, string> = {\n AZURE_CHINA_CLOUD: \"https://management.chinacloudapi.cn/\",\n AZURE_US_GOVERNMENT: \"https://management.usgovcloudapi.net/\",\n AZURE_PUBLIC_CLOUD: \"https://management.azure.com/\",\n };\n if (cloudSetting in cloudEndpoints) {\n return cloudEndpoints[cloudSetting];\n } else {\n throw new Error(\n `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`,\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the byPage method
|
|
4
|
+
*/
|
|
5
|
+
export interface PageSettings {
|
|
6
|
+
/**
|
|
7
|
+
* A reference to a specific page to start iterating from.
|
|
8
|
+
*/
|
|
9
|
+
continuationToken?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An interface that describes a page of results.
|
|
13
|
+
*/
|
|
14
|
+
export type ContinuablePage<TElement, TPage = TElement[]> = TPage & {
|
|
15
|
+
/**
|
|
16
|
+
* The token that keeps track of where to continue the iterator
|
|
17
|
+
*/
|
|
18
|
+
continuationToken?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* An interface that allows async iterable iteration both to completion and by page.
|
|
22
|
+
*/
|
|
23
|
+
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
|
|
24
|
+
/**
|
|
25
|
+
* The next method, part of the iteration protocol
|
|
26
|
+
*/
|
|
27
|
+
next(): Promise<IteratorResult<TElement>>;
|
|
28
|
+
/**
|
|
29
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
30
|
+
*/
|
|
31
|
+
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
32
|
+
/**
|
|
33
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
34
|
+
*/
|
|
35
|
+
byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* An interface that describes how to communicate with the service.
|
|
39
|
+
*/
|
|
40
|
+
export interface PagedResult<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
|
|
41
|
+
/**
|
|
42
|
+
* Link to the first page of results.
|
|
43
|
+
*/
|
|
44
|
+
firstPageLink?: string;
|
|
45
|
+
/**
|
|
46
|
+
* A method that returns a page of results.
|
|
47
|
+
*/
|
|
48
|
+
getPage: (pageLink?: string) => Promise<{
|
|
49
|
+
page: TPage;
|
|
50
|
+
nextPageLink?: string;
|
|
51
|
+
} | undefined>;
|
|
52
|
+
/**
|
|
53
|
+
* a function to implement the `byPage` method on the paged async iterator.
|
|
54
|
+
*/
|
|
55
|
+
byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
56
|
+
/**
|
|
57
|
+
* A function to extract elements from a page.
|
|
58
|
+
*/
|
|
59
|
+
toElements?: (page: TPage) => TElement[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Options for the paging helper
|
|
63
|
+
*/
|
|
64
|
+
export interface BuildPagedAsyncIteratorOptions {
|
|
65
|
+
itemName?: string;
|
|
66
|
+
nextLinkName?: string;
|
|
67
|
+
nextLinkMethod?: "GET" | "POST";
|
|
68
|
+
apiVersion?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
|
|
72
|
+
*/
|
|
73
|
+
export declare function buildPagedAsyncIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings, TResponse extends PathUncheckedResponse = PathUncheckedResponse>(client: Client, getInitialResponse: () => PromiseLike<TResponse>, processResponseBody: (result: TResponse) => PromiseLike<unknown>, expectedStatuses: string[], options?: BuildPagedAsyncIteratorOptions): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
74
|
+
//# sourceMappingURL=pagingHelpers.d.ts.map
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { createRestError } from "@azure-rest/core-client";
|
|
4
|
+
import { RestError } from "@azure/core-rest-pipeline";
|
|
5
|
+
/**
|
|
6
|
+
* Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
|
|
7
|
+
*/
|
|
8
|
+
export function buildPagedAsyncIterator(client, getInitialResponse, processResponseBody, expectedStatuses, options = {}) {
|
|
9
|
+
const itemName = options.itemName ?? "value";
|
|
10
|
+
const nextLinkName = options.nextLinkName ?? "nextLink";
|
|
11
|
+
const nextLinkMethod = options.nextLinkMethod ?? "GET";
|
|
12
|
+
const apiVersion = options.apiVersion;
|
|
13
|
+
const pagedResult = {
|
|
14
|
+
getPage: async (pageLink) => {
|
|
15
|
+
let result;
|
|
16
|
+
if (pageLink === undefined) {
|
|
17
|
+
result = await getInitialResponse();
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink;
|
|
21
|
+
result =
|
|
22
|
+
nextLinkMethod === "POST"
|
|
23
|
+
? await client.pathUnchecked(resolvedPageLink).post()
|
|
24
|
+
: await client.pathUnchecked(resolvedPageLink).get();
|
|
25
|
+
}
|
|
26
|
+
checkPagingRequest(result, expectedStatuses);
|
|
27
|
+
const results = await processResponseBody(result);
|
|
28
|
+
const nextLink = getNextLink(results, nextLinkName);
|
|
29
|
+
const values = getElements(results, itemName);
|
|
30
|
+
return {
|
|
31
|
+
page: values,
|
|
32
|
+
nextPageLink: nextLink,
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
byPage: (settings) => {
|
|
36
|
+
const { continuationToken } = settings ?? {};
|
|
37
|
+
return getPageAsyncIterator(pagedResult, {
|
|
38
|
+
pageLink: continuationToken,
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
return getPagedAsyncIterator(pagedResult);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* returns an async iterator that iterates over results. It also has a `byPage`
|
|
46
|
+
* method that returns pages of items at once.
|
|
47
|
+
*
|
|
48
|
+
* @param pagedResult - an object that specifies how to get pages.
|
|
49
|
+
* @returns a paged async iterator that iterates over results.
|
|
50
|
+
*/
|
|
51
|
+
function getPagedAsyncIterator(pagedResult) {
|
|
52
|
+
const iter = getItemAsyncIterator(pagedResult);
|
|
53
|
+
return {
|
|
54
|
+
next() {
|
|
55
|
+
return iter.next();
|
|
56
|
+
},
|
|
57
|
+
[Symbol.asyncIterator]() {
|
|
58
|
+
return this;
|
|
59
|
+
},
|
|
60
|
+
byPage: pagedResult?.byPage ??
|
|
61
|
+
((settings) => {
|
|
62
|
+
const { continuationToken } = settings ?? {};
|
|
63
|
+
return getPageAsyncIterator(pagedResult, {
|
|
64
|
+
pageLink: continuationToken,
|
|
65
|
+
});
|
|
66
|
+
}),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async function* getItemAsyncIterator(pagedResult) {
|
|
70
|
+
const pages = getPageAsyncIterator(pagedResult);
|
|
71
|
+
for await (const page of pages) {
|
|
72
|
+
yield* page;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async function* getPageAsyncIterator(pagedResult, options = {}) {
|
|
76
|
+
const { pageLink } = options;
|
|
77
|
+
let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);
|
|
78
|
+
if (!response) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
let result = response.page;
|
|
82
|
+
result.continuationToken = response.nextPageLink;
|
|
83
|
+
yield result;
|
|
84
|
+
while (response.nextPageLink) {
|
|
85
|
+
response = await pagedResult.getPage(response.nextPageLink);
|
|
86
|
+
if (!response) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
result = response.page;
|
|
90
|
+
result.continuationToken = response.nextPageLink;
|
|
91
|
+
yield result;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Gets for the value of nextLink in the body
|
|
96
|
+
*/
|
|
97
|
+
function getNextLink(body, nextLinkName) {
|
|
98
|
+
if (!nextLinkName) {
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
const nextLink = body[nextLinkName];
|
|
102
|
+
if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) {
|
|
103
|
+
throw new RestError(`Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`);
|
|
104
|
+
}
|
|
105
|
+
if (nextLink === null) {
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
return nextLink;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Gets the elements of the current request in the body.
|
|
112
|
+
*/
|
|
113
|
+
function getElements(body, itemName) {
|
|
114
|
+
const value = body[itemName];
|
|
115
|
+
if (!Array.isArray(value)) {
|
|
116
|
+
throw new RestError(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
|
|
117
|
+
}
|
|
118
|
+
return value ?? [];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Checks if a request failed
|
|
122
|
+
*/
|
|
123
|
+
function checkPagingRequest(response, expectedStatuses) {
|
|
124
|
+
if (!expectedStatuses.includes(response.status)) {
|
|
125
|
+
throw createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Adds the api-version query parameter on a URL if it's not present.
|
|
130
|
+
* @param url - the URL to modify
|
|
131
|
+
* @param apiVersion - the API version to set
|
|
132
|
+
* @returns - the URL with the api-version query parameter set
|
|
133
|
+
*/
|
|
134
|
+
function addApiVersionToUrl(url, apiVersion) {
|
|
135
|
+
// The base URL is only used for parsing and won't appear in the returned URL
|
|
136
|
+
const urlObj = new URL(url, "https://microsoft.com");
|
|
137
|
+
if (!urlObj.searchParams.get("api-version")) {
|
|
138
|
+
// Append one if there is no apiVersion
|
|
139
|
+
return `${url}${urlObj.search ? "&" : "?"}api-version=${apiVersion}`;
|
|
140
|
+
}
|
|
141
|
+
return url;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=pagingHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pagingHelpers.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError } 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 nextLinkMethod?: \"GET\" | \"POST\";\n apiVersion?: 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 nextLinkMethod = options.nextLinkMethod ?? \"GET\";\n const apiVersion = options.apiVersion;\n const pagedResult: PagedResult<TElement, TPage, TPageSettings> = {\n getPage: async (pageLink?: string) => {\n let result;\n if (pageLink === undefined) {\n result = await getInitialResponse();\n } else {\n const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink;\n result =\n nextLinkMethod === \"POST\"\n ? await client.pathUnchecked(resolvedPageLink).post()\n : await client.pathUnchecked(resolvedPageLink).get();\n }\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\n/**\n * Adds the api-version query parameter on a URL if it's not present.\n * @param url - the URL to modify\n * @param apiVersion - the API version to set\n * @returns - the URL with the api-version query parameter set\n */\nfunction addApiVersionToUrl(url: string, apiVersion: string): string {\n // The base URL is only used for parsing and won't appear in the returned URL\n const urlObj = new URL(url, \"https://microsoft.com\");\n if (!urlObj.searchParams.get(\"api-version\")) {\n // Append one if there is no apiVersion\n return `${url}${urlObj.search ? \"&\" : \"?\"}api-version=${apiVersion}`;\n }\n return url;\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { OperationState, PollerLike, ResourceLocationConfig } from "@azure/core-lro";
|
|
2
|
+
import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
3
|
+
import type { AbortSignalLike } from "@azure/abort-controller";
|
|
4
|
+
export interface GetLongRunningPollerOptions<TResponse> {
|
|
5
|
+
/** Delay to wait until next poll, in milliseconds. */
|
|
6
|
+
updateIntervalInMs?: number;
|
|
7
|
+
/**
|
|
8
|
+
* The signal which can be used to abort requests.
|
|
9
|
+
*/
|
|
10
|
+
abortSignal?: AbortSignalLike;
|
|
11
|
+
/**
|
|
12
|
+
* The potential location of the result of the LRO if specified by the LRO extension in the swagger.
|
|
13
|
+
*/
|
|
14
|
+
resourceLocationConfig?: ResourceLocationConfig;
|
|
15
|
+
/**
|
|
16
|
+
* The original url of the LRO
|
|
17
|
+
* Should not be null when restoreFrom is set
|
|
18
|
+
*/
|
|
19
|
+
initialRequestUrl?: string;
|
|
20
|
+
/**
|
|
21
|
+
* A serialized poller which can be used to resume an existing paused Long-Running-Operation.
|
|
22
|
+
*/
|
|
23
|
+
restoreFrom?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The function to get the initial response
|
|
26
|
+
*/
|
|
27
|
+
getInitialResponse?: () => PromiseLike<TResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* The api-version of the LRO
|
|
30
|
+
*/
|
|
31
|
+
apiVersion?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function getLongRunningPoller<TResponse extends PathUncheckedResponse, TResult = void>(client: Client, processResponseBody: (result: TResponse) => Promise<TResult>, expectedStatuses: string[], options: GetLongRunningPollerOptions<TResponse>): PollerLike<OperationState<TResult>, TResult>;
|
|
34
|
+
//# sourceMappingURL=pollingHelpers.d.ts.map
|